执行以下sql生成的语句即可
删除所有外键约束
select 'alter table '||table_name||' drop 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'
启用所有外键约束
select 'alter table '||table_name||' enable constraint '||constraint_name||';' from user_constraints where constraint_type='R'
本文提供了一种通过SQL语句批量管理数据库中外键约束的方法,包括删除、禁用及启用等操作,适用于需要进行批量数据库维护的场景。
1056

被折叠的 条评论
为什么被折叠?



