oracle 中禁用所有外键关联

禁用外键

select 'alter table '|| t.table_name||' disable constraint '||t.constraint_name||';'   
from user_constraints t where t.constraint_type = 'R'  
order by t.table_name   

启用外键

select 'alter table '|| t.table_name ||' enable constraint '||t.constraint_name||';'  
from user_constraints t where t.constraint_type = 'R'  
order by t.table_name   

猜你喜欢

转载自blog.csdn.net/u014481405/article/details/78232878