ORA-02449: unique/primary keys in table referenced by foreign keys During Drop Tablespace

I got “ORA-02449: unique/primary keys in table referenced by foreign keys During Drop Tablespace ” error in Oracle database.

 

ORA-02449: unique/primary keys in table referenced by foreign keys During Drop Tablespace

Details of error are as follows.

SQL> DROP TABLESPACE TBS_USERS INCLUDING CONTENTS AND DATAFILES
DROP TABLESPACE TBS_USERS INCLUDING CONTENTS AND DATAFILES
*
ERROR at line 1:
ORA-02449: unique/primary keys in table referenced by foreign keys

SQL>

 

 

 

The tablespace still contain dependencies objects (constraints , indexes ) in the different tablespaces.

 

To check the dependencies objectsi run the following query.

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_NAME');

 

Then run the following command.



 SQl>ALTER TABLE table_name DISABLE CONSTRAINT constraint_name;

And then you can drop the tablespace as follows.



SQL>Drop tablespace <tablespace_name> including contents and datafiles cascade constraints;

 

Please note that if this Tablespace contain empty table it will not be viewed in dba_segments because of the new feature deffered segment creation and you can you can user alter table move to move the table to a new TS

 

 

Do you want to learn Oracle Database for Beginners, then read the following articles.

Oracle Tutorial | Oracle Database Tutorials for Beginners ( Junior Oracle DBA )

About Mehmet Salih Deveci

I am Founder of SysDBASoft IT and IT Tutorial and Certified Expert about Oracle & SQL Server database, Goldengate, Exadata Machine, Oracle Database Appliance administrator with 10+years experience.I have OCA, OCP, OCE RAC Expert Certificates I have worked 100+ Banking, Insurance, Finance, Telco and etc. clients as a Consultant, Insource or Outsource.I have done 200+ Operations in this clients such as Exadata Installation & PoC & Migration & Upgrade, Oracle & SQL Server Database Upgrade, Oracle RAC Installation, SQL Server AlwaysOn Installation, Database Migration, Disaster Recovery, Backup Restore, Performance Tuning, Periodic Healthchecks.I have done 2000+ Table replication with Goldengate or SQL Server Replication tool for DWH Databases in many clients.If you need Oracle DBA, SQL Server DBA, APPS DBA,  Exadata, Goldengate, EBS Consultancy and Training you can send my email adress [email protected].-                                                                                                                                                                                                                                                 -Oracle DBA, SQL Server DBA, APPS DBA,  Exadata, Goldengate, EBS ve linux Danışmanlık ve Eğitim için  [email protected] a mail atabilirsiniz.

Leave a Reply

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