How to drop a two-node Oracle RAC database database manually.
In this article, we wrote an Clear steps for dropping a two node oracle database with Pre-requisite steps.
Server: sewnpossqa01/02
Database : npossqa1
DB Unique name: sewnpossqa1
Step 1:
Take consistent export of NPOSSQA1 database before dropping the database.
1 |
nohup expdp "'/ as sysdba'" directory=DBA_EXPORT dumpfile=expdp_NPOSSQA1_bfr_DB_DROP_date '+%m%d%y_%H%M%S'`_%U.dmp logfile=expdp_NPOSSQA1_bfr_DB_DROP_date '+%m%d%y_%H%M%S'`_%U.log EXCLUDE=STATISTICS flashback_time=systimestamp cluster=n metrics=Y parallel=4 & |
Step 2:
Take pfile backup
1 |
create pfile='/u01/app/oracle/datapump/npossqa1_pfile_bfr_db_drop_04JUL2021.ora' from spfile; |
Step 3:
Run the Prechecks scripts
1 2 3 4 5 6 7 8 9 |
. oraenv npossqa1 sqlplus / as sysdba spool /u01/app/oracle/datapump/npossqa1/npossqa1_db_files_details.txt select name from v$datafile; select name from v$controlfile; select member from v$logfile; spool off |
Step 4:
To avoid the alerts to email we need to disable the cronjobs in both the nodes related to database which we are going to drop.
Step 5:
Connect to database and set cluster_database=false
1 2 3 4 5 6 |
sqlplus / as sysdba select name from v$database; --> make sure it is the correct database to drop NAME ------ NPOSSQA1 alter system set cluster_database=FALSE scope=spfile sid='*'; |
Step 6:
Check the status, configuration of of database and shutdown the database
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
[oracle@sewnpossqa ~]$srvctl status database -d sewnpossqa1 Instance seprpst11 is running on node tewupdtrps01 Instance seprpst12 is running on node tewupdtrps02 [oracle@sewnpossqa ~]$ srvctl config database -d sewnpossqa1 Database unique name: npossqa1 Database name: sewnpossqa1 Oracle home: /u01/app/oracle/product/12102 Oracle user: oracle Spfile: +DATA01/npossqa1/PARAMETERFILE/spfile.445.1029255429 Password file: Domain: Start options: open Stop options: immediate Database role: PRIMARY Management policy: AUTOMATIC Server pools: Disk Groups: DATA01,REDO01,REDO02 Mount point paths: Services: Type: SINGLE OSDBA group: oinstall OSOPER group: oinstall Database instance: npossqa1 Configured nodes: sewnpossqa01 Database is administrator managed |
Shutdown the database :
1 2 3 4 5 |
[oracle@sewnpossqa ~]$ srvctl stop database -d sewnpossqa1 Check the status [oracle@sewnpossqa ~]$ srvctl status database -d sewnpossqa1 |
Step 7:
Connect to sqlplus and start the database in exclusive restrict mount state.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
[oracle@sewnpossqa ~]$ sqlplus / as sysdba SQL> startup mount exclusive restrict; Total System Global Area 1.0737E+11 bytes Fixed Size 6085288 bytes Variable Size 1.9864E+10 bytes Database Buffers 8.7242E+10 bytes Redo Buffers 262348800 bytes Database mounted. SQL> select logins,parallel from gv$instance; LOGINS PAR ---------- --- RESTRICTED NO |
Step 8:
1 2 |
SQL> drop database; Database dropped. |
Step 7:
Remove the database entry from cluster:
1 2 3 |
srvctl config database -d sewnpossqa1 srvctl remove database -d sewnpossqa1 srvctl config database -d sewnpossqa1 |
Post Steps:
1 2 3 4 5 |
1) Cross verify if all the associated datafiles, comntrolfile and online redologs are removed 2) Remove the directories if not required like archivelog directories etc. 3) Remove the entry of the database from /etc/oratab 4) Modify/drop any of the scripts used for this database in crontab 5) crosscheck and cleanup all the old dumps or any log files |
Note : Please perform all the above steps in your own servers.
Thank you for giving your valuable time to read the above information. Please click here to subscribe for further updates
KTEXPERTS is always active on below social media platforms.
Facebook : https://www.facebook.com/ktexperts/
LinkedIn : https://www.linkedin.com/company/ktexperts/
Twitter : https://twitter.com/ktexpertsadmin
YouTube : https://www.youtube.com/c/ktexperts