Backing up OCR:
Oracle performs physical backup of OCR devices every 4 hours under the default backup directory $ORA_CRS_HOME/cdata/<CLUSTER_NAME> and then it rolls that forward to Daily, weekly and monthly backup. You can get the backup information by executing below command.
ocrconfig -showbackup
[root@node1-ser ~]# ocrconfig -showbackup
node2-ser 2013/12/05 19:46:47 /u01/app/crs/cdata/test-crs/backup00.ocr
node2-ser 2013/12/05 15:46:45 /u01/app/crs/cdata/test-crs/backup01.ocr
node2-ser 2013/12/05 10:46:44 /u01/app/crs/cdata/test-crs/backup02.ocr
node2-ser 2013/12/05 07:46:39 /u01/app/crs/cdata/test-crs/day.ocr
node2-ser 2013/12/05 03:46:39 /u01/app/crs/cdata/test-crs/week.ocr
[root@node1-ser ~]#
Manually backing up the OCR
ocrconfig -manualbackup <<–Physical Backup of OCR
The above command backs up OCR under the default Backup directory. You can export the contents of the OCR using below command (Logical backup).
ocrconfig -export /tmp/ocr_exp.dat -s online <<– Logical Backup of OCR
Restoring OCR:
The below command is used to restore the OCR from the physical backup. Shutdown CRS on all nodes.
ocrconfig -restore <file name>
Locate the available Backups
[root@node1-ser ~]# ocrconfig -showbackup
node2-ser 2013/12/05 19:46:47 /u01/app/crs/cdata/test-crs/backup00.ocr
node2-ser 2013/12/05 15:46:45 /u01/app/crs/cdata/test-crs/backup01.ocr
node2-ser 2013/12/05 10:46:44 /u01/app/crs/cdata/test-crs/backup02.ocr
node2-ser 2013/12/05 07:46:39 /u01/app/crs/cdata/test-crs/day.ocr
node2-ser 2013/12/05 03:46:39 /u01/app/crs/cdata/test-crs/week.ocr
node1-ser 2013/12/07 13:50:41 /u01/app/crs/cdata/test-crs/backup_20131207_135041.ocr
Perform Restore from previous Backup
[root@node2-ser ~]# ocrconfig -restore /u01/app/crs/cdata/test-crs/week.ocr
The logical backup of OCR (taken using export option) can be imported using the below command.
ocrconfig -import /tmp/ocr_exp.dat
Restoring Votedisks:
- Shutdown CRS on all the nodes in Cluster.
- Locate the current location of the Votedisks
- Restore each of the votedisks using “dd” command from the previous good backup of Votedisk taken using the same “dd” command.
- Start CRS on all the nodes.
crsctl stop crs
crsctl query css votedisk
dd if=<backup of Votedisk> of=<Votedisk file> <<– do this for all the votedisks
crsctl start crs
Changing Public and Virtual IP Address:
Current Config Changed to
Node 1:
Public IP: 216.162.33.135 192.168.10.11
VIP: 216.162.33.134 192.168.10.111
subnet: 216.162.33.139 192.168.10.0
Netmask: 255.255.255.248 255.255.255.0
Interface used: eth0 eth0
Hostname: node1-ser.terse.net node1-ser.terse.net
Node 2:
Public IP: 216.160.37.156 192.168.10.22
VIP: 216.160.37.157 192.168.10.222
subnet: 216.160.37.159 192.168.10.0
Netmask: 255.255.255.248 255.255.255.0
Interface used: eth0 eth0
Hostname: node1-ser.terse.net node2-ser.terse.net
(A) Take the Services, Database, ASM Instances and nodeapps down on both the Nodes in Cluster. Also disable the nodeapps, asm and database instances to prevent them from restarting in case if this node gets rebooted during this process.
srvctl stop service -d test
srvctl stop database -d test
srvctl stop asm -n node1-ser
srvctl stop asm -n node2-ser
srvctl stop nodeapps -n node1-ser,node1-ser2
srvctl disable instance -d test -i test1,test2
srvctl disable asm -n node1-ser
srvctl disable asm -n node2-ser
srvctl disable nodeapps -n node1-ser
srvctl disable nodeapps -n node2-ser
(B) Modify the /etc/hosts and/or DNS, ifcfg-eth0 (local node) with the new IP values on All the Nodes
(C) Restart the specific network interface in order to use the new IP.
ifconfig eth0 down
ifconfig eth0 up
Or, you can restart the network. CAUTION: on NAS, restarting entire network may cause the node to be rebooted.
(D) Update the OCR with the New Public IP information.
In case of public IP, you have to delete the interface first and then add it back with the new IP address. As oracle user, Issue the below command:
oifcfg delif -global eth0
oifcfg setif -global eth0/192.168.10.0:public
(E) Update the OCR with the New Virtual IP.
Virtual IP is part of the nodeapps and so you can modify the nodeapps to update the Virtual IP information. As privileged user (root), Issue the below commands:
srvctl modify nodeapps -n node1-ser-A 192.168.10.111/255.255.255.0/eth0 <– for Node 1
srvctl modify nodeapps -n node1-ser-A 192.168.10.222/255.255.255.0/eth0 <– for Node 2
(F) Enable the nodeapps, ASM, database Instances for all the Nodes.
srvctl enable instance -d test -i test1,test2
srvctl enable asm -n node1-ser
srvctl enable asm -n node2-ser
srvctl enable nodeapps -n node1-ser
srvctl enable nodeapps -n node2-ser
(G) Update the listener.ora file on each nodes with the correct IP addresses in case if it uses the IP address instead of the hostname.
(H) Restart the Nodeapps, ASM and Database instance
srvctl start nodeapps -n node1-ser
srvctl start nodeapps -n node2-ser
srvctl start asm -n node1-ser
srvctl start asm -n node2-ser
srvctl start database -d test