Sunday, July 8, 2012

OCR and Voting Disk Backup and restore



To add a redundant copy for OCR on a shared storage location, run the
following command:
./$ORA_GRID_HOME/bin/ocrconfig –add /dev/sdf1 --new_location_path

-------------------------------------------------------------------------------------------------
To place a redundant copy for OCR on an ASM diskgroup, use the following
command. Ensure the diskgroup is created with the COMPATIBLE.ASM attribute and
that the value is set to 11.2 and mounted on all ASM instances of the cluster.
./ocrconfig –add +OCRVOTE
To add a redundant copy of a Voting disk file on a shared storage location, use the
following command as root user. However, you cannot add a redundant copy of a
Voting disk when it is placed on the ASM storage.
./$ORA_GRID_HOME/bin/crsctl add css votedisk /dev/sdg1 --
new_location_path
-----------------------------------------------------------------------------------------------------
The Oracle Clusterware (on the master node of a cluster) is responsible for
performing automatic OCR backups at these predefined scheduled intervals: every
four hours, end of the day, and end of the week. These backup copies are kept under
the $ORA_GRID_HOME/cdata/CLUSTERNAME location on the local node.
------------------------------------------------------------------------------------------------------------
In the event of a master node reboot, the other node that subsequently takes over as
the master node will be responsible for performing the automatic OCR backups on
its local file system. At a given time, Oracle Clusterware retains three backup copies
of the OCR file. As a DBA, you have no control over the frequency and number of
backup copies that the Oracle Clusterware retains.
Run the following command as Oracle user on a node to list the details for
automatically-generated OCR backups:
./$ORA_GRID_HOME/bin/ocrconfig -showbackup
------------------------------------------------------------------------------------------------------
To view the OCR backup default path details and verify the OCR integrity, the
following commands can be used:
./ocrcheck
./cluvfy comp ocr -n all -verbose

-------------------------------------------------------------------------------------------------------
You can also navigate to the ocr.loc file to determine the path defined for the OCR
and its mirror location. Use the following command:
more /etc/oracle/ocr.loc
ocrconfig_loc=+DATA
ocrmirrorconfig_loc=+VOTEOCR
The path for the default automatic and manual OCR backups can be customized
using the ocrconfig command. The following example demonstrates how to modify
the default path. However, you need to be the root user to successfully run the
command:
./$ORA_GRID_HOME/bin/ocrconfig –backuploc
After changing the default path, all the subsequent OCR automatic and manual
backups will be generated in the new location.
------------------------------------------------------------------------------------------------------
The on-demand OCR binary backup option is available with 11g R1; therefore, you
are allowed to perform a manual on-demand binary backup of the OCR file using the
ocrconfig utility with the –manual option.
Run the following command as root user to perform the on-demand OCR
binary backup:
./ocrconfig –manualbackup
When the directory name is not specified with the command, the backup copy will
be created in the default OCR backup location on the local node.
-------------------------------------------------------------------------------------------------
To back up the Voting disk, you need to use the operating system-specific
copy command: dd for UNIX and ocopy for Windows. The following example
demonstrates how to back up the Voting disk file on the UNIX operating system
using the dd command:
dd if=voting_disk_name of=backup_file_name
Fortunately, in 11g R2 the Voting disk contents are now backed up automatically in
OCR; therefore, you are no longer required to back up the Voting disk manually.
---------------------------------------------------------------------------------------------------------
The following steps demonstrate the procedure to restore the OCR using the latest
binary backup copy on a shared storage device, applicable for 11g R1 and 11g R2.
1. Firstly, you will need to locate the latest binary backup copy of the OCR. As
root user on any node of a cluster, execute the following command to find
out the latest backup copy details:
./ocrconfig –showbackup
2. After identifying and determining the backup file to be restored, ensure you
are logged in as root user and stop the cluster stack across the nodes of the
cluster by using the following command:
./crsctl stop crs (repeat the command on all nodes in 11g R1)

In 11g R2:
./crsctl stop cluster –all (just from the first node)
./crsctl stop crs (repeat the command on all nodes in 11g R2)
4. After the cluster stack is successfully stopped on all the nodes, proceed to
restore the backup file identified previously using the following command:
./ocrconfig –restore
5. Once you have successfully restored the backup file, bring up the cluster
stack on all the nodes of a cluster using the following command:
./crsctl start crs
6. Perform the OCR integrity checks using the following commands to ensure
the restoration is successful:
./ocrcheck
./cluvfy comp ocr –n all -verbose

In 11g R2:
./crsctl stop cluster –all (just from the first node)
./crsctl stop crs (repeat the command on all nodes in 11g R2)
4. After the cluster stack is successfully stopped on all the nodes, proceed to
restore the backup file identified previously using the following command:
./ocrconfig –restore
5. Once you have successfully restored the backup file, bring up the cluster
stack on all the nodes of a cluster using the following command:
./crsctl start crs
6. Perform the OCR integrity checks using the following commands to ensure
the restoration is successful:
./ocrcheck
./cluvfy comp ocr –n all -verbose

stopping the cluster stack)
3. Start up the cluster stack in exclusive mode on a node that holds the latest
binary backup file for OCR. Run the following command as root user:
./crsctl start crs -excl


--------------------------------------------------

stopping the cluster stack)
3. Start up the cluster stack in exclusive mode on a node that holds the latest
binary backup file for OCR. Run the following command as root user:
./crsctl start crs -excl

Perform the OCR integrity checks after starting up the cluster stack
successfully on all the nodes, using the following command:
./ocrcheck
./cluvfy comp ocr –n all -verbose




No comments:

Post a Comment