禁用外键
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
本文提供了一种在Oracle数据库中禁用和重新启用外键约束的方法。通过使用SQL语句,可以有效地管理数据库中的外键,这对于进行大规模数据操作或维护数据库结构时非常有用。
964

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



