表分区维护的sql(3)
来源:未知 责任编辑:责任编辑 发表时间:2015-10-08 14:16 点击:次
--创建备份表
begin
pro_createbaktable(v_table_name, v_baktable);
exception
when others then
Pro_Record_Log('an error happed when creating ' || v_table_name ||
'''s backup table:' || v_baktable || '.',
'ErrCode:' || SQLCODE || SUBSTR(SQLERRM, 1, 1500));
return - 1;
end;
--创建备份表上的索引,只允许建立分区索引
begin
Pro_Create_Backup_Part_Indx(v_baktable,
v_partitionflag,
v_table_name,
v_sysdate);
exception www.2cto.com
when others then
Pro_Record_Log('an error happend when creating ' || v_baktable ||
'''s index.',
'ErrCode:' || SQLCODE || SUBSTR(SQLERRM, 1, 1500));
return - 2;
end;
--预处理
begin
if (v_preprocessflag = 1) then
v_sql := upper(v_preprocesssql);
v_sql := replace(v_sql, 'V_ORG_TABLENAME', v_table_name);
v_sql := replace(v_sql, 'V_DEST_TABLENAME', v_baktable);
execute immediate v_sql;
commit;
end if;
exception
when others then
Pro_Record_Log('an error happend when preprocessing ' ||
v_baktable || '.', www.2cto.com
'ErrCode:' || SQLCODE || SUBSTR(SQLERRM, 1, 1500) ||
'.sql:' || v_preprocesssql);
相关新闻>>
最新推荐更多>>>
- 发表评论
-
- 最新评论 更多>>