Thursday, December 18, 2014

How to change subnet mask in Oracle Clusterware (grid infrastructure)

Change subnet mask on RAC databases:

Task: Changing  Subnet Mask from 255.255.255.0 to 255.255.254.0 on 10gR2 2-node RAC database running on HP-UX 11.31 boxes.

We followed Note: Doc ID 276434.1. However Case III was not clear for our case.
Case III says :

"If the change involves different subnet(netmask) or interface, delete the existing interface information from OCR and add it back with the correct information is required. In the example here, the subnet is changed from 10.2.156.0  to 10.2.166.0 via two separate commands - first a 'delif'  followed by a 'setif':
% $CRS_HOME/bin/oifcfg/oifcfg delif -global <if_name>[/<subnet>] % $CRS_HOME/bin/oifcfg/oifcfg setif -global <if_name>/<subnet>:public
For example: % $CRS_HOME/bin/oifcfg delif -global eth0/10.2.156.0  % $CRS_HOME/bin/oifcfg setif -global eth0/10.2.166.0:public"

However, changing subnet mask from 255.255.255.0 to 255.255.254.0 is not changing public network. So, we raise an SR and we suggested to skip Case III and apply Case IV.


Here is the steps that we use:


1.     First gather the existing setup:

racdb1> srvctl config nodeapps -n racdb1 -a
VIP exists.: /racdb1-vip/10.255.0.167/255.255.255.0/lan900

racdb1> srvctl config nodeapps -n racdb2 -a
VIP exists.: /racdb2-vip/10.255.0.168/255.255.255.0/lan900

racdb1> crs_stat -t                       
Name           Type           Target    State     Host       
------------------------------------------------------------
ora....E1.inst application    ONLINE    ONLINE    racdb1     
ora....E2.inst application    ONLINE    ONLINE    racdb2     
ora.prod.db    application    ONLINE    ONLINE    racdb2     
ora....SM1.asm application    ONLINE    ONLINE    racdb1      
ora....B1.lsnr application    ONLINE    ONLINE    racdb1     
ora.racdb1.gsd application    ONLINE    ONLINE    racdb1     
ora.racdb1.ons application    ONLINE    ONLINE    racdb1     
ora.racdb1.vip application    ONLINE    ONLINE    racdb1      
ora....SM2.asm application    ONLINE    ONLINE    racdb2     
ora....B2.lsnr application    ONLINE    ONLINE    racdb2     
ora.racdb2.gsd application    ONLINE    ONLINE    racdb2     
ora.racdb2.ons application    ONLINE    ONLINE    racdb2     
ora.racdb2.vip application    ONLINE    ONLINE    racdb2 
   
racdb1> netstat -in
Name      Mtu  Network         Address         Ipkts              Ierrs Opkts              Oerrs Coll
lo0      32808 127.0.0.0       127.0.0.1       1973468007         0     1973470399         0     0  
lan900:8  1500 10.255.0.0      10.255.0.167    25546968404        0     59117886           0     0  
Warning: The above name 'lan900:801' is truncated, use -w to show the output in wide format
lan901    1500 192.168.56.0    192.168.56.160  95623379768        82    42023362181        0     0  
lan900    1500 10.255.0.0      10.255.0.160    42141072728        0     95058720682        0     0  
racdb1> ./crs_stat -p ora.racdb1.vip
NAME=ora.racdb1.vip
TYPE=application
ACTION_SCRIPT=/u01/oraprod/prod/proddb/crshome/bin/racgwrap
ACTIVE_PLACEMENT=1
AUTO_START=1
CHECK_INTERVAL=30
DESCRIPTION=CRS application for VIP on a node
FAILOVER_DELAY=0
FAILURE_INTERVAL=0
FAILURE_THRESHOLD=0
HOSTING_MEMBERS=racdb1
OPTIONAL_RESOURCES=
PLACEMENT=favored
REQUIRED_RESOURCES=
RESTART_ATTEMPTS=0
SCRIPT_TIMEOUT=60
START_TIMEOUT=0
STOP_TIMEOUT=0
UPTIME_THRESHOLD=7d
USR_ORA_ALERT_NAME=
USR_ORA_CHECK_TIMEOUT=0
USR_ORA_CONNECT_STR=/ as sysdba
USR_ORA_DEBUG=0
USR_ORA_DISCONNECT=false
USR_ORA_FLAGS=
USR_ORA_IF=lan900
USR_ORA_INST_NOT_SHUTDOWN=
USR_ORA_LANG=
USR_ORA_NETMASK=255.255.255.0
USR_ORA_OPEN_MODE=
USR_ORA_OPI=false
USR_ORA_PFILE=
USR_ORA_PRECONNECT=none
USR_ORA_SRV=
USR_ORA_START_TIMEOUT=0
USR_ORA_STOP_MODE=immediate
USR_ORA_STOP_TIMEOUT=0
USR_ORA_VIP=10.255.0.167

            2.   Stop the resources:

racdb1> srvctl stop instance -d prod -i prod1
racdb1> ps -ef|grep pmon
 oraprod  5136     1  0  Dec  8  ?        161:51 asm_pmon_+ASM1
 oraprod  5277 27140  1 22:07:17 pts/2     0:00 grep pmon
racdb1> srvctl stop instance -d prod -i prod2

racdb1> srvctl stop asm -n racdb1
racdb1> ps -ef|grep pmon
 oraprod  7266 27140  0 22:10:50 pts/2     0:00 grep pmon
racdb1>  srvctl stop asm -n racdb2
racdb1> srvctl stop nodeapps -n racdb1
racdb1> ./crs_stat -t                
Name           Type           Target    State     Host       
------------------------------------------------------------
ora....E1.inst application    OFFLINE   OFFLINE              
ora....E2.inst application    OFFLINE   OFFLINE              
ora.prod.db    application    OFFLINE   OFFLINE              
ora....SM1.asm application    OFFLINE   OFFLINE              
ora....B1.lsnr application    OFFLINE   OFFLINE              
ora.racdb1.gsd application    OFFLINE   OFFLINE              
ora.racdb1.ons application    OFFLINE   OFFLINE              
ora.racdb1.vip application    OFFLINE   OFFLINE              
ora....SM2.asm application    OFFLINE   OFFLINE              
ora....B2.lsnr application    OFFLINE   OFFLINE              
ora.racdb2.gsd application    OFFLINE   OFFLINE              
ora.racdb2.ons application    OFFLINE   OFFLINE              
ora.racdb2.vip application    OFFLINE   OFFLINE 

         3.       Modify VIP

Run as root:

#./srvctl modify nodeapps -n racdb1 -A racdb1-vip/255.255.254.0/lan900
#./srvctl modify nodeapps -n racdb2 -A racdb2-vip/255.255.254.0/lan900

Verify:

racdb1:/u01/oraprod/prod/proddb/crshome/bin#./crs_stat -p ora.racdb2.vip
NAME=ora.racdb2.vip
TYPE=application
ACTION_SCRIPT=/u01/oraprod/prod/proddb/crshome/bin/racgwrap
ACTIVE_PLACEMENT=1
AUTO_START=1
CHECK_INTERVAL=30
DESCRIPTION=CRS application for VIP on a node
FAILOVER_DELAY=0
FAILURE_INTERVAL=0
FAILURE_THRESHOLD=0
HOSTING_MEMBERS=racdb2
OPTIONAL_RESOURCES=
PLACEMENT=favored
REQUIRED_RESOURCES=
RESTART_ATTEMPTS=0
SCRIPT_TIMEOUT=60
START_TIMEOUT=0
STOP_TIMEOUT=0
UPTIME_THRESHOLD=7d
USR_ORA_ALERT_NAME=
USR_ORA_CHECK_TIMEOUT=0
USR_ORA_CONNECT_STR=/ as sysdba
USR_ORA_DEBUG=0
USR_ORA_DISCONNECT=false
USR_ORA_FLAGS=
USR_ORA_IF=lan900
USR_ORA_INST_NOT_SHUTDOWN=
USR_ORA_LANG=
USR_ORA_NETMASK=255.255.254.0
USR_ORA_OPEN_MODE=
USR_ORA_OPI=false
USR_ORA_PFILE=
USR_ORA_PRECONNECT=none
USR_ORA_SRV=
USR_ORA_START_TIMEOUT=0
USR_ORA_STOP_MODE=immediate
USR_ORA_STOP_TIMEOUT=0
USR_ORA_VIP=10.255.0.168


racdb1:/u01/oraprod/prod/proddb/crshome/bin#./srvctl config nodeapps -n racdb1 -a
VIP exists.: /racdb1-vip/10.255.0.167/255.255.254.0/lan900

racdb1:/u01/oraprod/prod/proddb/crshome/bin#./srvctl config nodeapps -n racdb2 -a
VIP exists.: /racdb2-vip/10.255.0.168/255.255.254.0/lan900

           4.       Start resources:

racdb1> srvctl start nodeapps -n racdb1
racdb1> srvctl start nodeapps -n racdb2
racdb1> srvctl start asm -n racdb1
racdb1> srvctl start asm -n racdb2
racdb1> srvctl start instance -d prod -i prod1
racdb1> srvctl start instance -d prod -i prod2
racdb1> ./crs_stat -t                        
Name           Type           Target    State     Host       
------------------------------------------------------------
ora....E1.inst application    ONLINE    ONLINE    racdb1     
ora....E2.inst application    ONLINE    ONLINE    racdb2     
ora.prod.db    application    ONLINE    ONLINE    racdb2     
ora....SM1.asm application    ONLINE    ONLINE    racdb1     
ora....B1.lsnr application    ONLINE    ONLINE    racdb1     
ora.racdb1.gsd application    ONLINE    ONLINE    racdb1     
ora.racdb1.ons application    ONLINE    ONLINE    racdb1     
ora.racdb1.vip application    ONLINE    ONLINE    racdb1     
ora....SM2.asm application    ONLINE    ONLINE    racdb2     
ora....B2.lsnr application    ONLINE    ONLINE    racdb2     
ora.racdb2.gsd application    ONLINE    ONLINE    racdb2     
ora.racdb2.ons application    ONLINE    ONLINE    racdb2     
ora.racdb2.vip application    ONLINE    ONLINE    racdb2