oracle 刪除外鍵約束 禁用約束 啟用約束
執行以下sql生成的語句即可
刪除所有外鍵約束
Sql代碼
select 'alter table '||table_name||' drop constraint '||constraint_name||';' from user_constraints where constraint_type='R'
禁用所有外鍵約束
Sql代碼
select 'alter table '||table_name||' disable constraint '||constraint_name||';' from user_constraints where constraint_type='R'
啟用所有外鍵約束
Sql代碼
select 'alter table '||table_name||' enable constraint '||constraint_name||';' from user_constraints where constraint_type='R'