ORACLE 外键禁用

删除所有外键约束

Sql代码 
1.select 'alter table '||table_name||' drop constraint '||constraint_name||';' from user_constraints where constraint_type='R' 
select 'alter table '||table_name||' drop constraint '||constraint_name||';' from user_constraints where constraint_type='R' 禁用所有外键约束

Sql代码 
1.select 'alter table '||table_name||' disable constraint '||constraint_name||';' from user_constraints where constraint_type='R' 
select 'alter table '||table_name||' disable constraint '||constraint_name||';' from user_constraints where constraint_type='R'启用所有外键约束

Sql代码 
1.select 'alter table '||table_name||' enable constraint '||constraint_name||';' from user_constraints where constraint_type='R' 

猜你喜欢

转载自wujt.iteye.com/blog/1495582