启用失效 外键

--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';

猜你喜欢

转载自www.cnblogs.com/Nina-piaoye/p/9457693.html