oracle enable / disable all constraint

begin
for i in (select constraint_name, table_name from user_constraints where table_name='') LOOP
execute immediate 'alter table '||i.table_name||' enable constraint '||i.constraint_name||'';
end loop;
end;
/
COMMIT;

--

begin
for i in (select constraint_name, table_name from user_constraints where table_name='') LOOP
execute immediate 'alter table '||i.table_name||' disable constraint '||i.constraint_name||'';
end loop;
end;
/
COMMIT;

原文地址:https://www.cnblogs.com/kakaisgood/p/8759935.html