启用失效 外键

--disable fk
SELECT 'ALTER TABLE '|| table_name || ' DISABLE CONSTRAINTS ' || t.constraint_name ||';'
FROM user_constraints t
WHERE t.constraint_type = 'R';

--enable fk
SELECT 'ALTER TABLE '|| table_name || ' ENABLE CONSTRAINTS ' || t.constraint_name ||';'
FROM user_constraints t
WHERE t.constraint_type = 'R';

原文地址:https://www.cnblogs.com/Nina-piaoye/p/9457693.html