Node1:- Instance Name : RUP001 Hostname : testserver1 Database : RUP DB_UNIQUE_NAME: RUP_TEST Node2:- Instance Name : RUP002 Hostname : testserver2 Database : RUP DB_UNIQUE_NAME: RUP_TEST Note : Node to be deleted is the 2nd node RUP002 |
Step 1: Backup the source database including control file, spfile, and archive logs. (Validate if all archive logs have been backed-up and also verify backup has completed successfully without any error). Check number of CPU cores on server and the allocate channels accordingly. vi rman_backup.rcv run { allocate channel ch1 device type disk; allocate channel ch2 device type disk; allocate channel ch3 device type disk; allocate channel ch4 device type disk; allocate channel ch5 device type disk; allocate channel ch6 device type disk; allocate channel ch7 device type disk; allocate channel ch8 device type disk; allocate channel ch9 device type disk; allocate channel ch10 device type disk; allocate channel ch11 device type disk; allocate channel ch12 device type disk; allocate channel ch13 device type disk; allocate channel ch14 device type disk; allocate channel ch15 device type disk; allocate channel ch16 device type disk; allocate channel ch17 device type disk; allocate channel ch18 device type disk; allocate channel ch19 device type disk; allocate channel ch20 device type disk; backup as compressed backupset database format='/opt/rpc/scripts/backup/RMAN_RUP/FULL_DB_RUP_24042017_%U' plus archivelog format='/opt/rpc/scripts/backup/RMAN_RUP/Arch_RUP_24042017_%U'; backup current controlfile format='/opt/rpc/scripts/backup/RMAN_RUP/Con_RUP_24042017_%F'; release channel ch1; release channel ch2; release channel ch3; release channel ch4; release channel ch5; release channel ch6; release channel ch7; release channel ch8; release channel ch9; release channel ch10; release channel ch11; release channel ch12; release channel ch13; release channel ch14; release channel ch15; release channel ch16; release channel ch17; release channel ch18; release channel ch19; release channel ch20; } $nohup rman target / cmdfile=rman_backup.rcv log=rman_backup.log & |
Step 2: Stop the database. (Note : RUP_TEST is the db_unique_name for the database RUP). $srvctl status database -d RUP_TEST $srvctl config database -d RUP_TEST $srvctl stop database -d RUP_TEST $srvctl status database -d RUP_TEST |
Step 3: Considering we are deleting 2nd node. Login to 1st node and remove 2nd node from cluster. $srvctl remove instance -d RUP_TEST -i RUP002 $srvctl status database -d RUP_TEST |
Step 4: Now start the database using srvctl command and check the status. $srvctl start database -d RUP_TEST $srvctl status database -d RUP_TEST SQL> set lines 300 pages 5000 SQL> select INST_ID,name,open_mode,log_mode,controlfile_type, database_role,db_unique_name from gv$database order by 1; |
Step 5: Now disable thread of 2nd node and drop the associated redolog files. SQL> alter database disable thread 2; SQL> select INST_ID,GROUP#,STATUS,MEMBER from gv$logfile; INST_ID GROUP# STATUS MEMBER ------- ------ ------ ------------------------------------------------- 2 2 +DATAC1/RUP_TEST/onlinelog/group_2.927.934140781 2 2 +RECOC1/RUP_TEST/onlinelog/group_2.6234.934140781 2 1 +DATAC1/RUP_TEST/onlinelog/group_1.928.934140781 2 1 +RECOC1/RUP_TEST/onlinelog/group_1.6427.934140781 2 3 +DATAC1/RUP_TEST/onlinelog/group_3.1361.934140887 2 3 +RECOC1/RUP_TEST/onlinelog/group_3.5647.934140887 2 4 +DATAC1/RUP_TEST/onlinelog/group_4.1362.934140887 2 4 +RECOC1/RUP_TEST/onlinelog/group_4.5646.934140887 SQL> select group# from v$log where THREAD#=2; GROUP# ---------- 3 4 SQL> alter database drop logfile group 3; SQL> alter database drop logfile group 4; Verify once again. SQL> select * from gv$log order by THREAD#,GROUP#; SQL> select * from gv$standby_log order by THREAD#,GROUP#; SQL> col member for a60 SQL> select * from gv$logfile order by 1; SQL> select THREAD#,GROUP# from gv$standby_log order by THREAD#,GROUP#; |
Step 6: Drop the undo tablespaces created for 2nd node. SQL> select tablespace_name from dba_tablespaces where contents='UNDO'; TABLESPACE_NAME --------------------------------- UNDOTBS1 UNDOTBS2 SQL> drop tablespace UNDOTBS2 including contents and datafiles; SQL> select tablespace_name from dba_tablespaces where contents='UNDO'; |
Step 7: Change the below RAC parameters to Single instance parameters. SQL> alter system set cluster_database_instances=1 scope=spfile; SQL> alter system set cluster_database=FALSE scope=spfile; SQL> shut immediate; SQL> startup; SQL> show parameter cluster |
Step 8: Change the parameters in PFile and start the instance by taking backup of the existing one. Modify the backed-up pfile and remove any cluster parameters and also make it for single instance. Creating spfile will overwrite the existing spfile in ASM. SQL> show parameter spfile NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ spfile string +DATAC1/RUP_TEST/spfilerup.ora SQL> create pfile='/oracle/RUP/121/dbs/initRUP001_bkp.ora' from spfile; SQL> shut immediate; SQL> startup pfile='/oracle/RUP/121/dbs/initRUP001_Single.ora'; SQL> create spfile='+DATAC1/RUP_TEST/spfilerup.ora' from pfile='/oracle/RUP/121/dbs/initRUP001_Single.ora'; SQL> shut immediate; SQL> startup; Note: If value of cluster_database_instances is not 1 then set it again and bounce the instance.. SQL> show parameter spfile; SQL> show parameter cluster; SQL> alter system set cluster_database_instances=1 scope=spfile; SQL> shut immediate; SQL> startup; |
Step 9: Restart the database using srvctl utility once. $srvctl status database -d RUP_TEST $srvctl stop database -d RUP_TEST $srvctl status database -d RUP_TEST $srvctl start database -d RUP_TEST $srvctl status database -d RUP_TEST |
Thanks for reading this post ! Please comment if you like this post ! Click on FOLLOW to get future blog updates !
Thank you for your comment !