表分区维护的sql(9)
来源:未知 责任编辑:责任编辑 发表时间:2015-10-08 14:16 点击:次
end if;
Pro_Record_Log(v_comments, v_comments);
end loop;
close cur_partitiontable;
exception
when others then
if cur_partitiontable%isopen then
close cur_partitiontable;
end if;
raise;
end;
function fun_getTableName(tablename varchar2,
partitionflag varchar2,
v_sysdate varchar2) return varchar2 as
v_return_tabname varchar2(30); www.2cto.com
v_tablename varchar2(60);
v_tabprefix varchar2(30);
begin
v_tabprefix := partitionflag;
v_tablename := v_tabprefix ||
substr(tablename, 1, INSTR(tablename, '_')) ||
replace(substr(tablename, INSTR(tablename, '_')),
'_',
'');
v_return_tabname := substr(v_tablename, 0, 30 - length(v_sysdate)) ||
v_sysdate;
return v_return_tabname;
EXCEPTION
WHEN OTHERS THEN
raise;
end;
procedure pro_createbaktable(v_table_name in varchar2,
v_baktable in varchar2) as
v_sql varchar2(32767);
begin
v_sql := 'create table ' || v_baktable || ' tablespace TAB_CC ' ||
' as select a.* from ' || v_table_name || ' a where 1<>1 ';
EXECUTE IMMEDIATE v_sql;
www.2cto.com
insert into partition_baktable
(table_name, create_date, update_date, state)
相关新闻>>
最新推荐更多>>>
- 发表评论
-
- 最新评论 更多>>