How to Drop RAC Database

It is good practice to drop a database with “including contents and datafiles”.

A. Startup database in mount status.

SQL> startup mount;
ORACLE instance started.

Total System Global Area 1.7180E+10 bytes
Fixed Size 7663544 bytes
Variable Size 3120562248 bytes
Database Buffers 1.4026E+10 bytes
Redo Buffers 25890816 bytes
Database mounted.

B. Failed to drop the database.

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

C. Make the database as a non-cluster database, and then mount the database in RESTRICT mode.

SQL> alter system set cluster_database=FALSE scope=spfile;
System altered.


SQL> shutdown immediate;
ORA-01109: database not open
Database dismounted.
ORACLE instance shut down.


SQL> startup mount restrict;
ORACLE instance started.
Total System Global Area 1.7180E+10 bytes
Fixed Size 7663544 bytes
Variable Size 3120562248 bytes
Database Buffers 1.4026E+10 bytes
Redo Buffers 25890816 bytes
Database mounted.

D. Drop the database successfully.

SQL> drop database including contents and datafiles; 
Database dropped.

E. Remove the database from cluster.

$ srvctl status database -d RACTEST
Instance RACTEST1 is not running on node racnode1
Instance RACTEST2 is not running on node racnode2
Instance RACTEST3 is not running on node racnode3
Instance RACTEST4 is not running on node racnode4

$ srvctl remove database -d RACTEST
Remove the database RACTEST? (y/[n]) y

$ srvctl status database -d RACTEST
PRCD-1120 : The resource for database RACTEST could not be found.
PRCR-1001 : Resource ora.RACTEST.db does not exist