1. 程式人生 > 資料庫 >Oracle--ORA-02449:unique/primary keys in table referenced by foreign keys(由於唯一/主鍵被其他外來鍵引用)

Oracle--ORA-02449:unique/primary keys in table referenced by foreign keys(由於唯一/主鍵被其他外來鍵引用)

1.禁用該約束

select * from user_constraints c where c.table_name='TABLE_NAME';
alter table TABLE_NAME disable constraint CONSTRAINT_NAME CASCADE;

2.刪除表的時候,級聯刪除約束

drop table TABLE_NAME cascade constraints;