Friday, February 10, 2012

drop database in 11gR2 with RAC



I am planning to remove my cluster database which is running on 11gR2

Stop the entire cluster environment  
bhuora01[BHU_1]>srvctl stop database -d BHU_a

Start only one instance to edit the cluster_database parameter to FALSE

bhuora01[BHU_1]>sqlplus / as sysdba

SQL*Plus: Release 11.2.0.3.0 Production on Fri Feb 10 16:03:03 2012

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

Connected to an idle instance.

SQL> startup mount
ORACLE instance started.

Total System Global Area 2.6924E+10 bytes
Fixed Size                  2241104 bytes
Variable Size            1.3086E+10 bytes
Database Buffers         1.3824E+10 bytes
Redo Buffers               11227136 bytes
Database mounted.


SQL> alter system set cluster_database=FALSE scope=spfile sid='*';

System altered.


SQL> shutdown abort;
ORACLE instance shut down.

Now starting only one instance after editing below parameter CLUSTER_DATABASE parameters to FALSE

SQL> startup mount exclusive restrict
ORACLE instance started.

Total System Global Area 2.6924E+10 bytes
Fixed Size                  2241104 bytes
Variable Size            1.3086E+10 bytes
Database Buffers         1.3824E+10 bytes
Redo Buffers               11227136 bytes
Database mounted.

Make sure whether you have started in the restricted mode

SQL>  select logins,parallel from v$instance;

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

When you issue this command, this will drop the database including datafiles, control files, redo log files & archive log files

SQL> drop database;

Database dropped.

To drop the database including the backup, we can go for the below option

RMAN> DROP DATABASE INCLUDING BACKUPS NOPROMPT;

2 comments:

  1. This is owsome!! IT worked for me smoothly

    ReplyDelete
  2. Please note that this doesnot remove the entry from cluster registry...You will have to do below

    srvctl remove database -d dbname

    ReplyDelete