表分区维护的sql(4)
来源:未知 责任编辑:责任编辑 发表时间:2015-10-08 14:16 点击:次
return - 4;
end;
--开始执行分区交换
begin
v_sql := 'alter table ' || v_table_name || ' exchange partition ' ||
v_partition_name || ' with table ' || v_baktable ||
' INCLUDING INDEXES update global indexes';
execute immediate v_sql;
exception
when others then
Pro_Record_Log('an error happed when exchanging the partition..',
v_sql || '. ErrCode:' || SQLCODE ||
SUBSTR(SQLERRM, 1, 1500));
return - 3;
end;
--善后处理
begin
if (v_postprocessflag = 1) then
v_sql := upper(v_postprocesssql);
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; www.2cto.com
commit;
end if;
exception
when others then
Pro_Record_Log('exchange partition has sucessful.but an error happend when postprocessing ' ||
v_baktable || '.',
'ErrCode:' || SQLCODE || SUBSTR(SQLERRM, 1, 1500) ||
'.sql:' || v_preprocesssql);
return - 5;
end;
return 0;
EXCEPTION
WHEN OTHERS THEN
www.2cto.com
raise;
end;
PROCEDURE Pro_Record_Log(v_operation in VARCHAR2, v_comments in VARCHAR2) AS
BEGIN
INSERT INTO partition_log
(log_id, Oper_date, operator, COMMENTS)
values
(partition_log_id_seq.Nextval,
相关新闻>>
最新推荐更多>>>
- 发表评论
-
- 最新评论 更多>>