In this post, we will discuss how to drop the oracle database. The below procedure drops the spfile also but it does not touch Oracle Home. You may want to backup the spfile before dropping the database
sqlplus / as sysdba
startup mount (If database not started)
create pfile='/tmp/pfile.ora' from spfile;
How to drop the database
Now follow the below procedure to drop the database
- Source the environment
$. oraenv
[ORACLE_SID]? TEST
or
export ORACLE_SID=TEST
export ORACLE_HOME=<ORACLE_HOME PATH>
2- Connect as sysdba
$ sqlplus / as sysdba
SQL*Plus: Release 12.2.0.1.0 Production on Mon Dec 1 17:38:02 2014
Copyright (c) 1982, 2009, Oracle. All rights reserved.
Connected to an idle instance.
3- Start The database
SQL> startup ORACLE instance started. Total System Global Area 134045184 bytes Fixed Size 2217952 bytes Variable Size 142871862 bytes Database Buffers 129317222 bytes Redo Buffers 16343040 bytes Database mounted. Database opened.
4- Shutdown the database
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
5- Start in Exclusive mode
SQL> startup mount exclusive restrict ORACLE instance started. Total System Global Area 134045184 bytes Fixed Size 2217952 bytes Variable Size 142871862 bytes Database Buffers 129317222 bytes Redo Buffers 16343040 bytes Database mounted.
6- Drop the database
SQL> drop database;
Database dropped.
Disconnected from Oracle Database 11g Enterprise Edition Release 12.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL>
This completes dropping the database.
How to Drop the RAC database
If the Database is Oracle RAC, then the below steps need to be executed in mount state
alter system set cluster_database=FALSE scope=spfile
Then stop and mount in exclusive mode and drop it
Related Articles
Flashback PDB in Oracle Database 12c Release 2
PDB Relocate in Oracle database 12c Release 2
How to remotely clone a PDB or non-CDB in Oracle Database 12.1
Hot PDB cloning in Oracle database 12.2
Refreshable PDB in Oracle Database 12.2
https://docs.oracle.com/database/121/ADMIN/cdb_mon.htm#ADMIN13720
Leave a Reply