oracle 对外键约束的操作

禁用所有外键约束

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

select 'alter table '||table_name||' enable 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'

猜你喜欢

转载自fuqiangjava.iteye.com/blog/1783608