Oracle Error ORA-02266: unique/primary keys in table referenced by enabled foreign keys

Oracle Error Message

ORA-02266: unique/primary keys in table referenced by enabled foreign keys

Reason for the Error

An attempt was made to truncate a table with unique or primary keys referenced by foreign keys enabled in another table. Other operations not allowed are dropping/truncating a partition of a partitioned table or an ALTER TABLE EXCHANGE PARTITION.

Solution

Before performing the above operations the table, disable the foreign key constraints in other tables. You can see what constraints are referencing a table by issuing the following command: SELECT * FROM USER_CONSTRAINTS WHERE TABLE_NAME = “tabnam”;

Share:

Leave A Reply

Your email address will not be published. Required fields are marked *

You May Also Like

Oracle Error Message ORA-24328: illegal attribute value Reason for the Error The attribute value passed in is illegal. Solution Consult...
Oracle Error Message ORA-01346: LogMiner processed redo beyond specified reset log scn Reason for the Error LogMiner has detected a...
Oracle Error Message ORA-13241: specified dimensionality does not match that of the data Reason for the Error An error occurred...