How to drop an Oracle RAC database using RMAN

(1) create a pfile

SQL> create pfile=’/tmp/p_h1c.txt’ from spfile;

(2) stop db
oracle@testsrv01:/opt/oracle [testdb1] $ srvctl stop database -d testdb

(3) edit pfile

edit pfile make sure: cluster_database=false

(4) startup mount with the pfile in restricted mode

oracle@testsrv01:/opt/oracle [testdb1] $ sqlplus / as sysdba

SQL*Plus: Release 12.2.0.1.0 Production on Tue Mar 26 13:10:03 2019

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

Connected to an idle instance.

SQL> startup mount restrict pfile='/tmp/p_h1c.txt';
ORACLE instance started.

Total System Global Area 2.1475E+10 bytes
Fixed Size 22769264 bytes
Variable Size 4831842704 bytes
Database Buffers 1.6173E+10 bytes
Redo Buffers 446988288 bytes

Database mounted.
SQL> SQL> select logins,parallel from v$instance;

LOGINS PAR
---------- ---
RESTRICTED NO

(5) Run rman drop database command

oracle@testsrv01:/opt/oracle [testdb1] $ rman target /

Recovery Manager: Release 12.2.0.1.0 - Production on Tue Mar 26 13:15:47 2019

Copyright (c) 1982, 2017, Oracle and/or its affiliates. All rights reserved.

connected to target database: TESTDB (DBID=3299770666, not open)

RMAN> drop database including backups;

database name is "TESTDB" and DBID is 3299770666

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_DISK_1
channel ORA_DISK_1: SID=610 device type=DISK
specification does not match any backup in the repository

released channel: ORA_DISK_1
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=610 device type=DISK
specification does not match any datafile copy in the repository
specification does not match any control file copy in the repository
specification does not match any control file copy in the repository
specification does not match any archived log in the repository

database name is "TESTDB" and DBID is 3299770666
database dropped

 

(6) Removes the database from Oracle Clusterware management.

oracle@testsrv01:/opt/oracle [testdb1] $ srvctl remove database -d testdb
Remove the database testdb? (y/[n]) y
oracle@testsrv01:/opt/oracle [testdb1] $
oracle@testsrv01:/opt/oracle [testdb1] $
oracle@testsrv01:/opt/oracle [testdb1] $