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  

 

posted @ 2019-11-04 09:33  xtjatswc  阅读(498)  评论(0)    收藏  举报