Restoring the Oracle Cluster Registry on Linux or UNIX Systems

If you are storing OCR on an Oracle ASM disk group, and that disk group is corrupt, then you must restore the Oracle ASM disk group using Oracle ASM utilities, and then mount the disk group again before recovering OCR. Recover OCR by running the ocrconfig -restore command, as instructed in the following procedure.

Note:

If the original OCR location does not exist, then you must create an empty (0 byte) OCR location with the same name as the original OCR location before you run the ocrconfig -restore command.

See Also:

Oracle Automatic Storage Management Administrator's Guide for information about how to restore Oracle ASM disk groups

Use the following procedure to restore OCR on Linux or UNIX systems:

  1. List the nodes in your cluster by running the following command on one node:
    $ olsnodes
    
  2. Depending on whether OCR is located in an Oracle ASM disk group or on network attached storage (NAS), stop Oracle Clusterware by running one of the following commands as root on all of the nodes:

    If OCR is located in an Oracle ASM disk group, then stop the Oracle Clusterware daemon:

    # crsctl stop crs
    

    If the preceding command returns any error due to OCR corruption, then force stop Oracle Clusterware by running the following command as root on all of the nodes:

    # crsctl stop crs -f
    
  3. If you are restoring OCR to a cluster file system or network file system, then run the following command as root to restore OCR with an OCR backup that you can identify in "Listing Backup Files":
    # ocrconfig -restore file_name

    Note:

    If the OCR backup file is located in an Oracle ASM disk group, then ensure that the disk group exists and is mounted.

    After you complete this step, proceed to step 11.

    If you are not restoring OCR to a cluster file system or network file system, then proceed to the next step.

  4. Start the Oracle Clusterware stack on one node in exclusive mode by running the following command as root:
    # crsctl start crs -excl -nocrs
    

    The -nocrs option ensures that the CRSD process and OCR do not start with the rest of the Oracle Clusterware stack.

    Ignore any errors that display.

  5. Check whether CRSD is running by running the following command:
    $ crsctl status resource ora.crsd -init
    

    If CRSD is running, then stop it by running the following command as root:

    # crsctl stop resource ora.crsd -init

    Caution:

    Do not use the -init flag with any other command unless directed to do so by My Oracle Support.

  6. To restore OCR to an Oracle ASM disk group, you must first create a disk group using SQL*Plus that has the same name as the disk group you want to restore and mount it on the local node.

    If you cannot mount the disk group locally, then run the following SQL*Plus command:

    SQL> drop diskgroup disk_group_name force including contents;
    
  7. Restore OCR with an OCR backup that you can identify in "Listing Backup Files" by running the following command as root:
    # ocrconfig -restore file_name

    Note:

    • If the original OCR location does not exist, then you must create an empty (0 byte) OCR location before you run the ocrconfig -restore command.

    • Ensure that the OCR devices that you specify in the OCR configuration exist and that these OCR devices are valid.

    • If you configured OCR in an Oracle ASM disk group, then ensure that the Oracle ASM disk group exists and is mounted.

    • If the OCR backup file is located in an Oracle ASM disk group, then ensure that the disk group exists and is mounted.

    See Also:

  8. Verify the integrity of OCR:
    # ocrcheck
    
  9. Stop Oracle Clusterware on the node where it is running in exclusive mode:
    # crsctl stop crs -f
    
  10. Run the ocrconfig -repair -replace command as root on all the nodes in the cluster where you did not the ocrconfig -restore command. For example, if you ran the ocrconfig -restore command on node 1 of a four-node cluster, then you must run the ocrconfig -repair -replace command on nodes 2, 3, and 4.
  11. Begin to start Oracle Clusterware by running the following command as root on all of the nodes:
    # crsctl start crs
    
  12. Verify OCR integrity of all of the cluster nodes that are configured as part of your cluster by running the following CVU command:
    $ cluvfy comp ocr -n all -verbose

See Also:

Cluster Verification Utility Reference for more information about enabling and using CVU