While truncating a table in database, might face the error ORA-02266 unique key error.

 

PROBLEM:

SQL> truncate table DBACLASS.AAF_USER;
truncate table DBACLASS.AAF_USER
*
ERROR at line 1:
ORA-02266: unique/primary keys in table referenced by enabled foreign keys

 

SOLUTION:

The primary key in the table( which we are truncating) , seems to be referring to a another child table with foreign key.

Run below script to get the parent table , child table relation

So either disable or drop this foreign constraint and try to truncate.