Friday 9 December 2011

Removing a node from Oracle RAC Cluster


Removing a node from an Oracle 11gr2 cluster.

In this document, we have a 3 node cluster, and we will remove node 2 from the configuration.

First backup the ocr configuration, in case of problems.

root_node1#> export ORACLE_HOME=/home/grid/app/11.2.0/grid
root_node1#> export PATH=$PATH:$ORACLE_HOME/bin
root_node1#> ocrconfig -manualbackup

Run DBCA on a node not being removed, to remove the instance:

oracle_node1$> export ORACLE_HOME=/home/oracle/app/oracle/product/11.2.0/dbhome_1
oracle_node1$> export PATH=$PATH:$ORACLE_HOME/bin
oracle_node1$> dbca &

select Oracle RAC database
click Next
select Instance Management
click Next
select Delete an Instance
click Next
Make sure TESTDB is selected
enter sys for the username and the sys password
click on Next
select the Node you wish to remove, I.e racnode2
click on Next
click on Finish
click OK to the popup
click OK to proceed

Make sure the redo log thread has been removed:

oracle_node1$> export ORACLE_HOME=/home/oracle/app/oracle/product/11.2.0/dbhome_1
oracle_node1$> export PATH=$PATH:$ORACLE_HOME/bin
oracle_node1$> sqlplus system/manager1@rac-scan.laptop.com:1521/TESTDB.laptop.com
sqlplus> select * from v$log;

Make sure the instance is removed from the cluster:

oracle_node1$> export ORACLE_HOME=/home/grid/app/11.2.0/grid
oracle_node1$> export PATH=$PATH:$ORACLE_HOME/bin
oracle_node1$> srvctl config database -d testdb

You should see that the node has been removed from the instances listed against the Database Instances parameter.

Check where the listerner is running, it should only be in grid home:

oracle_node1$> srvctl config listener -a

It should show that the only listener home, is that under grid

On the node to be deleted, remove the oracle inventory:

oracle_node2$> export ORACLE_HOME=/home/oracle/app/oracle/product/11.2.0/dbhome_1
oracle_node2$> export PATH=$PATH:$ORACLE_HOME/bin
oracle_node2$> cd $ORACLE_HOME/oui/bin
oracle_node2$> ./runInstaller -updateNodeList ORACLE_HOME=$ORACLE_HOME “CLUSTER_NODES={racnode2}” -local -silent

This should return as successful.

We can now de-install the Oracle Home on the node we are deleting:

oracle_node2$> /home/oracle/app/oracle/product/11.2.0/dbhome_1/deinstall/deinstall -local

We now need to update the other nodes to reflect the change in nodes:

oracle_node1$> export ORACLE_HOME=/home/oracle/app/oracle/product/11.2.0/dbhome_1
oracle_node1$> /home/oracle/app/oracle/product/11.2.0/dbhome_1/oui/bin/runInstaller -updateNodeList ORACLE_HOME=$ORACLE_HOME “CLUSTER_NODES={racnode1,racnode3}”

oracle_node3$> export ORACLE_HOME=/home/oracle/app/oracle/product/11.2.0/dbhome_1
oracle_node3$> /home/oracle/app/oracle/product/11.2.0/dbhome_1/oui/bin/runInstaller -updateNodeList ORACLE_HOME=$ORACLE_HOME “CLUSTER_NODES={racnode1,racnode3}”

Make sure the node is unpinned:

oracle_node1$> export ORACLE_HOME=/home/grid/app/11.2.0/grid
oracle_node1$> export PATH=$PATH:$PORACLE_HOME/bin
oracle_node1$> olsnodes -s -t

We can now remove the grid home:

root_node2#> /home/grid/app/11.2.0/grid/crs/install/rootcrs.pl -deconfig -force

This should return a successful message.

We now need to remove the node using CRS on an node not being deleted:

root_node1#> export ORACLE_HOME=/home/grid/app/11.2.0/grid
root_node1#> export PATH=$PATH:$PORACLE_HOME/bin
root_node1#> crsctl delete node -n racnode2

Update the node list on the node that is being deleted to contain just the node being deleted:

oracle_node2$> export ORACLE_HOME=/home/grid/app/11.2.0/grid
oracle_node2$> /home/grid/app/11.2.0/grid/oui/bin/runInstaller -updateNodeList ORACLE_HOME=$ORACLE_HOME “CLUSTER_NODES={racnode2}” -silent -local CRS=TRUE

Now deinstall the grid home:

oracle_node2$> /home/grid/app/11.2.0/grid/deinstall/deinstall -local

When prompted run the following command in another window as root:

root_node2$> /tmp/deinstall<date time>/perl/bin/perl -I/tmp/deinstall<date time>/perl/lib -I/tmp/deinstall<date time>/crs/install /tmp/deinstall<date time>/crs/install/rootcrs.pl -force -deconfig -paramfile “/tmp/deinstall<date time>/response/deinstall_Ora11g_gridinfrahome1.rsp”

When this has run, click on Enter in the original window

Now update the node list on the other nodes:

oracle_node1$> export CRS_HOME=/home/grid/app/11.2.0/grid
oracle_node1$> export PATH=$PATH:$CRS_HOME/bin
oracle_node1$> /home/grid/app/11.2.0/grid/oui/bin/runInstaller -updateNodeList ORACLE_HOME=$CRS_HOME “CLUSTER_NODES={racnode1,racnode3}” CRS=TRUE

oracle_node3$> export CRS_HOME=/home/grid/app/11.2.0/grid
oracle_node3$> export PATH=$PATH:$CRS_HOME/bin
oracle_node3$> /home/grid/app/11.2.0/grid/oui/bin/runInstaller -updateNodeList ORACLE_HOME=$CRS_HOME “CLUSTER_NODES={racnode1,racnode3}” CRS=TRUE

Now run the cluster verification tool, to check the node has been removed:

oracle_node1$> /tmp/oracle/grid/runcluvfy.sh stage -post nodedel -n racnode2

3 comments:

  1. Hi,
    Thank you for submitting such wonderful content and very informative and useful for Oracle Rac learners.

    ReplyDelete
  2. Hello,
    Your blog has a lot of valuable information . Thanks for your time on putting these all together.. Really helpful blog..I just wanted to share information about
    devops online training

    ReplyDelete