Oracle RAC 19c Masterclass – Part 6

Oracle Cluster Registry (OCR): Architecture, Management, Backup, and Recovery

In the previous articles, we explored Oracle Clusterware, Grid Infrastructure, ASM, and RAC networking. All of these components rely on a central repository that stores the cluster configuration: the Oracle Cluster Registry (OCR).

Without the OCR, Oracle Clusterware does not know which resources exist, where they should run, or how they should be managed.

In this article, we’ll examine what the OCR contains, how it works, where it is stored, how to back it up, and how to recover it in case of failure.

What is the Oracle Cluster Registry (OCR)?

The Oracle Cluster Registry (OCR) is a repository used by Oracle Clusterware to store the configuration of the entire RAC cluster.

It contains information about:

  • Cluster nodes
  • ASM disk groups
  • Databases
  • Database instances
  • Listeners
  • SCAN listeners
  • VIP addresses
  • Services
  • Cluster resources
  • Resource dependencies
  • Resource attributes

Think of the OCR as the configuration database for Oracle Clusterware.

Why is OCR Important?

Every time Clusterware starts, it reads the OCR to determine:

  • Which resources exist.
  • Where resources should run.
  • Which services belong to which database.
  • Resource startup dependencies.
  • Restart and failover policies.

Without a valid OCR, Clusterware cannot manage the cluster.

OCR Architecture

A simplified architecture:

                   Oracle Clusterware
                           |
                    Read / Update OCR
                           |
                 +----------------------+
                 |      OCR File        |
                 +----------------------+
                           |
                     ASM Disk Group
                     (+OCR or +DATA)

Every node accesses the same OCR stored in shared storage.

OCR vs OLR

Many DBAs confuse the OCR and the OLR (Oracle Local Registry).

OCROLR
Shared across all nodesLocal to one node
Stores cluster configurationStores local startup information
Located in ASMLocated on the local filesystem
Used after Clusterware startsUsed before Clusterware starts

A simple way to remember the difference:

  • OLR starts the node.
  • OCR manages the cluster.

Where is the OCR Stored?

In Oracle 19c, Oracle recommends storing the OCR in an ASM disk group.

Typical layout:

+OCR
   |
   +-- OCR
   +-- Voting Files

Some environments place it in:

+DATA

However, using a dedicated +OCR disk group is considered a cleaner design.

Viewing OCR Location

Check the OCR configuration:

ocrcheck

Example:

Status of Oracle Cluster Registry is as follows:

Version : 4

Total space (kbytes) : 262120

Used space (kbytes) : 18240

Available space (kbytes) : 243880

Device/File Name : +OCR

This command should be part of every RAC administrator’s toolkit.

Verify OCR Integrity

Run:

ocrcheck

Example:

Cluster registry integrity check succeeded.

If corruption is detected, investigate immediately before making additional configuration changes.

OCR Configuration

Display OCR locations:

ocrconfig -showbackup

Example:

racnode1

/u01/app/grid/cdata/cluster

This command also displays available automatic backups.

Automatic OCR Backup

Oracle automatically backs up the OCR.

Typical schedule:

  • Every 4 hours
  • Daily
  • Weekly

These backups are created by Clusterware without administrator intervention.

Display available backups:

ocrconfig -showbackup

Example:

racnode1

backup00.ocr

backup01.ocr

day.ocr

week.ocr

Manual OCR Backup

Although Oracle creates automatic backups, it is good practice to create a manual backup before major maintenance.

Example:

ocrconfig -manualbackup

Verify:

ocrconfig -showbackup

Export OCR Configuration

Another useful option is exporting the OCR configuration.

Example:

ocrconfig -export /backup/ocr_export.dat

This creates a logical export that can be useful for documentation or migration.

OCR Recovery Scenario

Suppose the OCR becomes corrupted.

Symptoms might include:

  • CRS does not start.
  • Resources are missing.
  • CRSD fails.
  • OCR integrity check fails.

Example:

CRS-4535:
Cannot communicate with Cluster Ready Services

Restoring OCR

Restore from the latest backup:

ocrconfig -restore /u01/app/grid/cdata/cluster/day.ocr

After the restore:

Restart Clusterware.

Example:

crsctl stop crs

crsctl start crs

Always follow the Oracle documentation appropriate to your environment and version when performing an OCR restore, especially in multi-node production clusters.

Checking Cluster Resources

After recovery:

crsctl stat res -t

Verify that:

  • ASM
  • Listeners
  • VIPs
  • Databases
  • Services

are all ONLINE.

OCR Space Usage

Check OCR usage:

ocrcheck

Example:

Used space

18240 KB

Available space

243880 KB

Large environments with many resources should monitor OCR usage periodically.

OCR Administration Commands

Display OCR configuration:

ocrcheck

List backups:

ocrconfig -showbackup

Create backup:

ocrconfig -manualbackup

Export OCR:

ocrconfig -export backup.dat

Import OCR:

ocrconfig -import backup.dat

These commands cover most day-to-day OCR administration tasks.

Common OCR Problems

OCR Corruption

Symptoms:

  • CRSD fails.
  • Cluster resources disappear.
  • OCR integrity check fails.

Action:

  • Verify the storage.
  • Restore from backup if necessary.

OCR Disk Group Offline

Symptoms:

  • CRS startup failure.
  • OCR inaccessible.

Verify:

asmcmd lsdg

Ensure the +OCR disk group is mounted.

OCR Full

Rare, but possible in very large clusters.

Monitor:

ocrcheck

If usage grows unexpectedly, review cluster configuration changes.

Permission Issues

If OCR utilities fail unexpectedly:

Verify the Grid Infrastructure environment:

echo $ORACLE_HOME

echo $ORACLE_SID

Ensure commands are executed as the grid user.

Best Practices

  • Store OCR in an ASM disk group.
  • Use Normal or High Redundancy where appropriate.
  • Monitor OCR health regularly with ocrcheck.
  • Create a manual OCR backup before patching or major configuration changes.
  • Verify automatic OCR backups are being created.
  • Never modify OCR files directly at the operating system level.

DBA Tip

One of the best habits before any RAC maintenance—whether it’s applying Release Updates, adding nodes, changing services, or modifying network resources—is to create a manual OCR backup.

It takes only a few seconds:

ocrconfig -manualbackup

If a configuration mistake occurs during maintenance, having a recent backup can significantly simplify recovery.

Another habit worth adopting is to include ocrcheck in your regular health-check scripts. It provides a quick confirmation that the OCR is healthy and accessible before issues become critical.

The OCR doesn’t store your application data, but it stores the configuration that allows your RAC environment to function. Protect it with the same care you give to your database backups.

Conclusion

The Oracle Cluster Registry is the configuration repository for every Oracle RAC cluster. It stores the information required by Clusterware to manage databases, listeners, services, ASM disk groups, and other cluster resources.

Understanding how the OCR is organized, backed up, monitored, and restored is an essential skill for any Oracle RAC administrator. A healthy OCR contributes directly to cluster stability and recoverability.

Bookmark the permalink.
Loading Facebook Comments ...

Leave a Reply