How to Drop Database in Oracle 19c

Hi,

Sometimes you may need to drop Oracle database especially in test or development databases.

 

Mostly test or development databases are expired when testing or development is done. And When these databases are not used, we should drop this database with following steps.

 

You cannot drop Oracle database when it is open. You will get following error if you try this.

[oracle@MehmetSalih ~]$ sqlplus / as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Tue Mar 26 07:13:04 2019
Version 19.2.0.0.0

Copyright (c) 1982, 2018, Oracle. All rights reserved.


Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.2.0.0.0

SQL> drop database;
drop database
*
ERROR at line 1:
ORA-01586: database must be mounted EXCLUSIVE and not open for this operation

 

You should shutdown database and open it mount exclusive mode.

SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL>
SQL>
SQL> startup mount restrict
ORACLE instance started.

Total System Global Area 1140849896 bytes
Fixed Size 8895720 bytes
Variable Size 838860800 bytes
Database Buffers 285212672 bytes
Redo Buffers 7880704 bytes
Database mounted.
SQL>

 

Then you can drop database like following.

 

SQL> drop database;

Database dropped.

Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.2.0.0.0
SQL>
SQL> exit
[oracle@MehmetSalih ~]$

 

You can see that Oracle database 19c is dropped.

[oracle@MehmetSalih ~]$ sqlplus / as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Tue Mar 26 07:19:54 2019
Version 19.2.0.0.0

Copyright (c) 1982, 2018, Oracle. All rights reserved.

Connected to an idle instance.

SQL> 



  

Mehmet Salih Deveci

I am Founder of 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 mehmetsalih.deveci@outlook.com.-                                                                                                                                                                                                                                                 -Oracle DBA, SQL Server DBA, APPS DBA,  Exadata, Goldengate, EBS ve linux Danışmanlık ve Eğitim için  mehmetsalih.deveci@outlook.com a mail atabilirsiniz.

One thought on “How to Drop Database in Oracle 19c

  • May 20, 2019 at 3:37 pm
    Permalink

    Oh my goodness! an amazing article dude. Thank you Nonetheless I am experiencing situation with ur rss . Don’t know why Unable to subscribe to it. Is there anyone getting equivalent rss problem? Anyone who is aware of kindly respond. Thnkx

    Reply

Leave a Reply

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