Oracle RAC – Backup and Recover for OCR and VOTING Disk

Oracle Cluster Registry Utility

Use the ocrconfig command to manage OCR.

Using this utility you can import, export, add, delete, restore, overwrite, backup, repair, replace, move, upgrade, or downgrade OCR.

Operational Notes

Usage Information

  • The OCRCONFIG executable is located in the Grid_home/bin directory
  • The ocrconfig command syntax is as follows:
    ocrconfig -option

Using Utility Help

To display the help output for the OCRCONFIG utility:

ocrconfig -help

Privileges and Security

To use the OCRCONFIG utility you must be logged into the operating system as a user with administrative privileges.

Log Files

The OCRCONFIG utility creates a log file in Grid_home/log/host_name/client.

To change the amount of logging, edit the path in the Grid_home/srvm/admin/ocrlog.ini file.

 

OCRCONFIG Command Reference

This section lists the following OCRCONFIG commands:

-bash-3.2$ ocrconfig
Name:
ocrconfig - Configuration tool for Oracle Cluster/Local Registry.

Synopsis:
ocrconfig [option]
option:
[-local] -export <filename>
- Export OCR/OLR contents to a file
[-local] -import <filename>         - Import OCR/OLR contents from a file
[-local] -upgrade [<user> [<group>]]
- Upgrade OCR from previous version
-downgrade [-version <version string>]
- Downgrade OCR to the specified version
[-local] -backuploc <dirname>       - Configure OCR/OLR backup location
[-local] -showbackup [auto|manual]  - Show OCR/OLR backup information
[-local] -manualbackup              - Perform OCR/OLR backup
[-local] -restore <filename>        - Restore OCR/OLR from physical backup
-replace <current filename> -replacement <new filename>
- Replace a OCR device/file <filename1> with <filename2>
-add <filename>                     - Add a new OCR device/file
-delete <filename>                  - Remove a OCR device/file
-overwrite                          - Overwrite OCR configuration on disk
-repair -add <filename> | -delete <filename> | -replace <current filename> -replacement <new filename>
- Repair OCR configuration on the local node
-help                               - Print out this help information

Note:
* A log file will be created in
$ORACLE_HOME/log/<hostname>/client/ocrconfig_<pid>.log. Please ensure
you have file creation privileges in the above directory before
running this tool.
* Only -local -showbackup [manual] is supported.
* Use option '-local' to indicate that the operation is to be performed on the Oracle Local Registry.

/ocrconfig -showbackup

prod-wifi-mdo2 2013/10/14 13:37:50 /u02/app/11.2.0/grid/cdata/prod-wi-cluster/backup00.ocr

prod-wifi-mdo2 2013/10/14 09:37:48 /u02/app/11.2.0/grid/cdata/prod-wi-cluster/backup01.ocr

prod-wifi-mdo2 2013/10/14 05:37:45 /u02/app/11.2.0/grid/cdata/prod-wi-cluster/backup02.ocr

prod-wifi-mdo2 2013/10/12 21:37:18 /u02/app/11.2.0/grid/cdata/prod-wi-cluster/day.ocr

prod-wifi-mdo2 2013/10/01 09:33:32 /u02/app/11.2.0/grid/cdata/prod-wi-cluster/week.ocr
PROT-25: Manual backups for the Oracle Cluster Registry are not available

./ocrconfig -local -export /u02/app/11.2.0/grid/cdata/prod-wi-cluster/ocr_14102013.ocr

du -ksh /u02/app/11.2.0/grid/cdata/prod-wi-cluster/ocr_14102013.ocr
100K /u02/app/11.2.0/grid/cdata/prod-wi-cluster/ocr_14102013.ocr

./ocrconfig -local -import /u02/app/11.2.0/grid/cdata/prod-wi-cluster/ocr_14102013.ocr
PROTL-19: Cannot proceed while the Oracle High Availability Service is running

./ocrdump -help
Name:
        ocrdump - Dump contents of Oracle Cluster/Local Registry to a file.

Synopsis:
        ocrdump [-local] [|-stdout] [-backupfile ] [-keyname ] [-xml] [-noheader]

Description:
        Default filename is OCRDUMPFILE. Examples are:

        prompt> ocrdump
        writes cluster registry contents to OCRDUMPFILE in the current directory

        prompt> ocrdump MYFILE
        writes cluster registry contents to MYFILE in the current directory

        prompt> ocrdump -stdout -keyname SYSTEM
        writes the subtree of SYSTEM in the cluster registry to stdout

        prompt> ocrdump -local -stdout -xml
        writes local registry contents to stdout in xml format

        prompt> ocrdump -backupfile /oracle/CRSHOME/backup.ocr -stdout -xml
        writes registry contents in the backup file to stdout in xml format

Notes:
        The header information will be retrieved based on best effort basis.
        A log file will be created in
        $ORACLE_HOME/log//client/ocrdump_.log. Make sure
        you have file creation privileges in the above directory before
        running this tool.
        Use option '-local' to indicate that the operation is to be performed on the Oracle Local Registry.
cd $GRID_HOME/bin
root@prod-wifi-mdo1 bin]# ./ocrconfig -manualbackup

prod-wifi-mdo2     2013/10/14 15:07:04     /u02/app/11.2.0/grid/cdata/prod-wi-cluster/backup_20131014_150704.ocr
[root@prod-wifi-mdo1 bin]# ./ocrconfig -showbackup manual

prod-wifi-mdo2     2013/10/14 15:07:04     /u02/app/11.2.0/grid/cdata/prod-wi-cluster/backup_20131014_150704.ocr

Note : Backing up voting disks manually no longer required because voting disk is backed up automatically in the ocr as part of any configuration change and voting disk data is automatically restored to any added voting disks....

[root@prod-wifi-mdo1 bin]# ./crsctl query css votedisk
##  STATE    File Universal Id                File Name Disk group
--  -----    -----------------                --------- ---------
 1. ONLINE   9f039e92841d4fd3bfe8463fbe3b3616 (/u02/shared_config/vdsk) []
Located 1 voting disk(s).

Recover Corrupt OCR with no backup
http://jagjeet.wordpress.com/2010/06/30/recover-corrupt-ocr-with-no-backup/#!

Below procedure can be used for recovery.

1) Execute rootdelete.sh script from All Nodes.
2) Execute rootdeinstall.sh from Primary Node.
3) Run root.sh from Primary node.
4) Run root.sh from all remaining nodes.
5) Execute remaining configurations (ONS,netca,register required resources)

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.