Wednesday, December 23, 2015

Dropping a RAC database


Stop database from cluster utility

C:\Users\farhat>set oracle_home=D:\app\11.2.0\grid

C:\Users\farhat>srvctl stop database -d FINOLD -o IMMEDIATE

Connect Any of Cluster Instance and change cluster database parameter to FALSE

C:\Users\farhat>SET ORACLE_SID=FINOLD1

C:\Users\farhat>sqlplus / as sysdba

SQL*Plus: Release 11.2.0.3.0 Production on Wed Dec 23 11:53:42 2015

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

Connected to an idle instance.

SQL> startup mount;
ORACLE instance started.

Total System Global Area 5144301568 bytes
Fixed Size                  2264128 bytes
Variable Size            1006633920 bytes
Database Buffers         4127195136 bytes
Redo Buffers                8208384 bytes
Database mounted.
SQL> alter system set cluster_database=FALSE scope=spfile sid='*';

System altered.

SQL> shutdown abort;
ORACLE instance shut down.

---------------------------------------
Mount database in exclusive mode

SQL> startup mount exclusive restrict;
ORACLE instance started.

Total System Global Area 5144301568 bytes
Fixed Size                  2264128 bytes
Variable Size            1006633920 bytes
Database Buffers         4127195136 bytes
Redo Buffers                8208384 bytes
Database mounted.
SQL>   select logins,parallel from v$instance;

LOGINS     PAR
---------- ---
RESTRICTED NO
--------------------------------------------------------
Drop Database

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.
---------------------------------------------------
Drop database including backups

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

RMAN> DROP DATABASE INCLUDING BACKUPS NOPROMPT;

---------------------------------------------------
Remove database entry from cluster

C:\Users\farhat>srvctl stop instance -i FINOLD1 -d FINOLD

C:\Users\farhat>srvctl stop instance -i FINOLD2 -d FINOLD
PRCC-1017 : FINOLD was already stopped on OR-12

C:\Users\farhat>srvctl remove instance -i FINOLD1 -d FINOLD
Remove instance from the database FINOLD? (y/[n]) y

C:\Users\farhat>srvctl remove instance -i FINOLD2 -d FINOLD
Remove instance from the database FINOLD? (y/[n]) y

C:\Users\farhat>srvctl remove database -d FINOLD

No comments:

Post a Comment