HI
recently i have truncate some table. during the truncate process i have face below problem and solve as below way,
SQL> TRUNCATE TABLE USER_STATE;
TRUNCATE TABLE USER_STATE
*
ERROR at line 1:
ORA-02266: unique/primary keys in table referenced by enabled foreign keys
Then i have find the related CONSTRAINT on the table as per
434169
SQL> ALTER TABLE USER_STATE_PARAMETER disable CONSTRAINT FK1_USR_SES_ST_PAR;
Table altered.
SQL> ALTER TABLE USER_STATE disable CONSTRAINT SYS_C0030849;
Table altered.
Then successfully truncate the table as below
SQL> TRUNCATE TABLE USER_STATE;
Table truncated.
then i have enable the CONSTRAINT
SQL> ALTER TABLE USER_STATE enable CONSTRAINT SYS_C0030849;
Table altered.
SQL> ALTER TABLE USER_STATE_PARAMETER enable CONSTRAINT FK1_USR_SES_ST_PAR;
Table altered.
---My Question is, after disable the CONSTRAINT, I did the truncate operation then I enable the CONSTRAINT. Is there anything I need to do which will make me confident to not face any problem during database DML OPERATION? i also found there is no disable CONSTRAINT in my database.