One way to drop a RAC database without using DBCA.
This happened to be a smaller non-production database and I had the luxury of taking an export before I dropped the database. All the users had already moved to the new database.
Create a data pump directory (if you do not already have one).
CREATE or replace DIRECTORY dean_data_pump AS '/backup/UATDB/DATAPUMP';
Perform an export with the command:
cd /backup/UATDB/DATAPUMP nohup expdp \'/ as sysdba \' directory=DEAN_DATA_PUMP dumpfile=UATDB_full_2017_09_18.dmp logfile=UATDB_full_2017_09_18.log full=yes &
Monitor the nohup.out file for errors.
Check the current status of the database. This is a 2 node RAC and is currently running on both nodes
[uatsrvr2-UATDB] srvctl status database -d UATDB Instance UATDB1 is running on node uatsrvr1 Instance UATDB2 is running on node uatsrvr2
Stop all nodes of the RAC
srvctl stop database -d UATDB
Repeat the status check
[uatsrvr2-UATDB] srvctl status database -d UATDB Instance UATDB1 is not running on node uatsrvr1 Instance UATDB2 is not running on node uatsrvr2
Start SQL*Plus to change the cluster_database parameter
[uatsrvr2-UATDB2] sqlplus / as sysdba SQL*Plus: Release 11.2.0.4.0 Production on Mon Sep 18 10:35:26 2017 Copyright (c) 1982, 2013, Oracle. All rights reserved. Connected to an idle instance. SQL> startup mount; ORACLE instance started. Total System Global Area 4810256384 bytes Fixed Size 226136 bytes Variable Size 13421810 bytes Database Buffers 3456106 bytes Redo Buffers 97070 bytes Database mounted. SQL> alter system set cluster_database=FALSE scope=spfile sid='*'; System altered. SQL> shutdown immediate; ORA-01109: database not open Database dismounted. ORACLE instance shut down.
Bring up the database in exclusive mode with restricted session
SQL> startup mount exclusive restrict; ORACLE instance started. Total System Global Area 4810256384 bytes Fixed Size 2261368 bytes Variable Size 1342181000 bytes Database Buffers 3456106496 bytes Redo Buffers 9707520 bytes Database mounted.
Check if the database is in restricted session and cluster is off and then exit from SQL*Plus
SQL> select logins,parallel from v$instance; LOGINS PAR ---------- --- RESTRICTED NO SQL> exit
Connect to the database via RMAN
[uatsrvr2-UATDB2] rman target / Recovery Manager: Release 11.2.0.4.0 - Production on Mon Sep 18 10:43:07 2017 Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved. connected to target database: UATDB2 (DBID=407684853, not open)
Drop the database, including all the backups
RMAN> DROP DATABASE INCLUDING BACKUPS; database name is "UATDB" and DBID is 407684853 Do you really want to drop all backups and the database (enter YES or NO)? yes using target database control file instead of recovery catalog allocated channel: ORA_1 channel ORA_DISK_1: SID=2 device type=DISK List of Backup Pieces BP Key BS Key Pc# Cp# Status Device Type Piece Name ------- ------- --- --- ----------- ----------- ---------- 3535 3535 1 1 AVAILABLE DISK /backup01/UATDB/backups/UATDB_db_20170911_eise5da4_1_1.bus . . Many more lines of output . . database name is "UATDB" and DBID is 407684853 database dropped RMAN>
Remove the configuration from SRVCTL
[uatsrvr2-UATDB] srvctl remove database -d UATDB Remove the database UATDB? (y/[n]) y [uatsrvr2-UATDB]
The following steps will have to be performed on all nodes of the RAC. Edit the /etc/oratab and remove the entry for the database.
If auditing is turned on, delete the audit files from the audit destination.
Delete any CRON entries, trace files, password files, etc.