Sunday, 25 December 2011

How to Change Interconnect/Public Network (Interface or Subnet) in Oracle Clusterware 10gr2 and 11gr2

The purpose of this article is to describe how to change or update the cluster_interconnect and/or public interface information that is stored in OCR. It may be necessary to change or update interface names, or subnet associated with an interface if there is a network change affecting the servers, or if the original information that was input during the installation was incorrect.   It may also be the case that for some reason, the Oracle Interface Configuration Assistant  ('oifcfg')  did not succeed during the installation.
Network information(interface, subnet and role of each interface) for Oracle Clusterware is managed by 'oifcfg', but actual IP address for each interfaces are not - 'oifcfg' can not update IP address information. 'oifcfg getif' can be used to find out currently configured interfaces in OCR:
# $ORA_CRS_HOME/bin/oifcfg getif
eth0 10.2.156.0 global public
eth1 192.168.0.0 global cluster_interconnect
Above example is from a Linux system, but the syntax is the same for any platform.  On Unix/Linux systems, the interface names are generally assigned by the OS, and standard names vary by platform. For Windows systems, see additional notes below. Above example shows currently interface eth0 is used for public with subnet 10.2.156.0, and eth1 for cluster_interconnect/private with subnet  192.168.0.0.
If the subnet for either the 'public' or 'cluster_interconnect' interface is incorrect and needs to be changed, you should make the changes using oifcfg as the same user who did the original CRS installation, because the 'setif' option updates the OCR and sets permissions in the OCR for the interface based on who is running the command.  This is true on all platforms, including Windows.
1. Public Network Change
If the change is only public IP address and the new ones are still in the same subnet, nothing needs to be done on clusterware level (all changes needs to be done on OS level to reflect the change). If the change involves different subnet or interface, as there is not a 'modify' option - you will need to delete the interface and add it back with the correct information.  So, in the example here, the subnet is being changed from 10.2.156.0  to 10.2.166.0 via two separate commands - first a 'delif'  followed by a 'setif':
# $ORA_CRS_HOME/bin/oifcfg delif -global eth0
# $ORA_CRS_HOME/bin/oifcfg setif -global eth0/10.2.166.0:public
syntax: oifcfg setif <interface-name>/<subnet>:<cluster_interconnect|public>
2. Private Network Change
2a.For pre-11gR2, if you wish to change the cluster_interconnect information and/or private IP address, hosts file needs to be modified on each node to reflect the change while the Oracle Clusterware Stack is down on all nodes. After the stack has restarted, to change the cluster_interconnect used by RDBMS and ASM instances, run oifcfg. In this example:
# $ORA_CRS_HOME/bin/oifcfg delif -global eth1
# $ORA_CRS_HOME/bin/oifcfg setif -global eth1/192.168.1.0:cluster_interconnect
2b.For 11gR2 and higher do the following procedure:
2b1. Ensure CRS is running on ALL cluster nodes in the cluster.
    As grid user, add new interface:
    Find the interface which needs to be removed. For example:
    $ oifcfg getif
    eth1 100.17.10.0 global public
    eth0 192.168.0.0 global cluster_interconnect
    Here the eth0 interface will be replaced by bond0 interface.
    Add new interface bond0:
    # oifcfg setif -global <interface>/<subnet>:cluster_interconnect
    # oifcfg setif -global bond0/192.168.0.0:cluster_interconnect
    This can be done with -global option even if the interface is not available yet, but this     can not be done with -node option if the interface is not available, it will lead to node     eviction.
2b2. Verify the change:
    # oifcfg getif
2b3. Shutdown CRS on all nodes and disable the CRS  as root user:
    # crsctl stop crs
    # crsctl disable crs
2b4. Make the network configuration change at OS level as required, ensure the new interface is available on all nodes after the change.
    # ifconfig -a
    # ping <private hostname>
2b5. Enable CRS and restart CRS on all nodes as root user:
    # crsctl enable crs
    # crsctl start crs
2b6. Remove the old interface:
    # oifcfg delif -global eth0
2b7. Verify the correct interface subnet is in use by re-running oifcfg with the 'getif' option:
    # $ORA_CRS_HOME/bin/oifcfg getif
    eth0 10.2.166.0 global public
    eth1 192.168.1.0 global cluster_interconnect
Notes for Windows Systems
The syntax for changing the interfaces on Windows/RAC clusters is the same as on Unix or Linux, but the interface names will be slightly different.   On Windows systems, the default names assigned to the interfaces are generally names such as:
Local Area Connection
Local Area Connection 1
Local Area Connection 2
If you are using an interface name that has spaces in it, such as the examples above, you must enclose the name in quotes.   Also, be aware that it is case sensitive.