執行以下sql可以生成禁止、啟用、删除限制腳本,然後執行即可:
禁用所有外鍵限制
[sql] view plain copy
- select 'alter table '||table_name||' disable constraint '||constraint_name||';' from user_constraints where constraint_type='R';
啟用所有外鍵限制 [sql] view plain copy
- select 'alter table '||table_name||' enable constraint '||constraint_name||';' from user_constraints where constraint_type='R';
删除所有外鍵限制 [sql] view plain copy
- select 'alter table '||table_name||' drop constraint '||constraint_name||';' from user_constraints where constraint_type='R';