ORA-02449: unique/primary keys in table referenced by foreign keys
OracleWhat does it mean?
The primary or unique key of the table you want to drop is referenced by foreign keys in other tables. Oracle does not let you drop the table without removing these dependencies first.
Why does it happen?
You ran DROP TABLE without CASCADE CONSTRAINTS while other tables reference this table through FKs. Enforcing referential integrity, Oracle prevents orphaned foreign keys.
How to fix it
To drop it together with the dependent foreign keys: DROP TABLE table_name CASCADE CONSTRAINTS; This also removes the related FK constraints in the other tables (it does not delete the data in those tables). To see which constraints depend on it: SELECT table_name, constraint_name FROM all_constraints WHERE r_constraint_name IN (SELECT constraint_name FROM user_constraints WHERE table_name = 'TABLE_NAME');
More from this engine
- direct path readWait: session reading blocks directly into PGA bypassing buffer cache
- latch: cache buffers chainsWait: contention on cache buffers chains latch
- ORA-00955name is already used by an existing object
- ORA-01950no privileges on tablespace 'name'
- ORA-01110data file N: 'path'
- ORA-16038log N sequence# M cannot be archived
- ORA-19809limit exceeded for recovery files