declare
v_cnt number(1);
begin
select count(1) into v_cnt from user_tables where lower(table_name)='t_batch_job_sub_bak';
if v_cnt > 0 then
execute immediate 'drop table t_batch_job_sub_bak';
end if;
execute immediate 'create table t_batch_job_sub_bak as select * from t_batch_job_sub';
execute immediate 'alter table t_batch_job_sub disable constraint FK_BATCH_JOB_SUB__PIECE_ID';
execute immediate 'truncate table t_batch_job_sub';
execute immediate 'alter table t_batch_job_sub enable constraint FK_BATCH_JOB_SUB__PIECE_ID';
end;
/
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/27500440/viewspace-1824875/
,如需转载,请注明出处,否则将追究法律责任。