Oracle Cluster Registry (OCR) in Oracle RAC

Oracle Cluster Registry (OCR) provides cluster configuration information. Collectively, voting files and OCR are referred to as Oracle Clusterware files.

The main purpose for Oracle Cluster Registry (OCR) is to hold cluster & database information for RAC and Cluster Ready Services (CRS)

  1. Cluster database instance to node mapping
  2. Cluster node list
  3. CRS application resource profiles.
  4. Local listener & scan listener
  5. VIP,Scan IP & Services.
  6. ASM disk groups, volumes, file systems, and instances
  7. OCRs Automatic and Manual backups information

Migrating Oracle Cluster Registry to Oracle Automatic Storage Management

Ensure the upgrade to Oracle Clusterware 12c is complete. Run the following command to verify the current running version:

$ crsctl query crs activeversion

To add OCR to an Oracle ASM disk group, ensure that the Oracle Clusterware stack is running and run the following command as root:

# ocrconfig -add +new_disk_group

To remove storage configurations no longer in use, run the following command as root:

# ocrconfig -delete old_storage_location

The following example shows how to migrate two OCRs to Oracle ASM using OCRCONFIG.

# ocrconfig -add +new_disk_group
# ocrconfig -delete /ocrdata/ocr_1
# ocrconfig -delete /ocrdata/ocr_2

Adding, Replacing, Repairing, and Removing Oracle Cluster Registry Locations

Adding an Oracle Cluster Registry Location

As the root user, run the following command to add an OCR location to either Oracle ASM or other storage device:

# ocrconfig -add +asm_disk_group | file_name

Run the following command on any node in the cluster to remove an OCR location from either Oracle ASM or other location:

# ocrconfig -delete +ASM_disk_group | file_name

To change an Oracle Cluster Registry location:

Use the OCRCHECK utility to verify that a copy of OCR

$ ocrcheck

Use the following command to verify that Oracle Clusterware is running on the node on which you are going to perform the replace operation:

$ crsctl check crs

Run the following command as root to replace the current OCR location using either destination_file or +ASM_disk_group to indicate the current and target OCR locations:

# ocrconfig -replace current_OCR_location -replacement new_OCR_location

If you have only one OCR location configured and online, then you must first add a new location and then delete the failed location, as follows:

# ocrconfig -add new_OCR_location
# ocrconfig -delete current_OCR_location

Backing Up Oracle Cluster Registry

Run the following command to list the backup files:

ocrconfig -showbackup

Run the following command to inspect the contents and verify the integrity of the backup file:

ocrdump -backupfile backup_file_name

Restoring the Oracle Cluster Registry on Linux or UNIX Systems

List the nodes in your cluster by running the following command on one node:

$ olsnodes

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

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

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.

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

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

Verify the integrity of OCR:

# ocrcheck

Stop Oracle Clusterware on the node where it is running in exclusive mode:

# crsctl stop crs -f

Begin to start Oracle Clusterware by running the following command as root on all of the nodes:

# crsctl start crs

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

Also See:

Oracle Clusterware

Oracle Cluster Registry and Voting Files