ORA-02449: unique/primary keys in table referenced by foreign keys when drop tablespace
Error:
SQL> DROP TABLESPACE <TABLESPACE_NAME> INCLUDING CONTENTS AND DATAFILES;
CAUSE :
The tablespace still contain dependencies objects (constraints, indexes)
APPLIES TO:
Oracle Database - Enterprise Edition - Version 10.2.0.1 and later
SOLUTION:
Check the dependencies objects:
SQL> select owner, constraint_name,table_name,index_owner,index_name from dba_constraints where (index_owner,index_name) in (select owner,index_name from dba_indexes where tablespace_name='YOUR_TABLESPACE IN UPPER CASE');
Then follow anyone of the below sql statement:
SQL> ALTER TABLE <table_name> DISABLE CONSTRAINT < constraint_name>;
OR
SQL> Drop tablespace <tablespace_name> including contents and datafiles cascade constraints;
REFERENCE:
ORA-02449: unique/primary keys in table referenced by foreign keys when drop tablespace (Doc ID 1920371.1)