Home » Restore the OCR on Linux or Unix in Oracle RAC

Restore the OCR on Linux or Unix in Oracle RAC

by tuanlp

 Restoring the Oracle Cluster Registry on Linux or UNIX Systems

If OCR is failed then first check with OCRCHECK command before start restoring the OCR disk

Note: If OCR location does not exists like diskgroup then recreate that location with same name or recover diskgroup then start restore operation with OCR -restore.

Following are the steps to restore the OCR

Restore the OCR to cluster file system or Network file system in Linux or Unix

1. Check all the nodes running in cluster.

olsnodes

2. Stop the Oracle Clusterware on all of the nodes.

crsctl stop crs
-- stop force fully
crsctl stop crs -f

3. List the available backup of OCR.

ocrconfig -showbackup

4. Restore the latest backup of OCR to network file system or Cluster file system.
if OCR on ASM diskgroup then ASM diskgroup must be mounted.

ocrconfig -restore file_name

5. Start Oracle Clusterware on all nodes.

crsctl start crs

6. Verify OCR integrity of all of the cluster nodes that are configured by Cluvfy command.

cluvfy comp ocr -n all -verbose

Restore the OCR backup in non cluster or network file system
Update OCR manually on each node with restore or replace command.

1. Check all the nodes running in cluster.

olsnodes

2. Stop the Oracle Clusterware on all nodes.

crsctl stop crs
-- stop force fully
crsctl stop crs -f

3. List the available backup of OCR.

ocrconfig -showbackup

4. Start the Oracle Clusterware stack on one node in exclusive mode.

crsctl start crs -excl -nocrs

5. Check whether CRSD is running, if running stop it.

-- Check CRSD is running
crsctl status resource ora.crsd -init

--Stop the CRSD
crsctl stop resource ora.crsd -init

6. Restore the OCR to ASM diskgroup, you must have the same diskgroup name and mount it on local node.

-- Check diskgroup present
SELECT STATE, NAME FROM V$ASM_DISKGROUP;

-- Mount the diskgroup
alter diskgroup disk_group_name mount;

--If not able to mount then drop, create and again mount
drop diskgroup disk_group_name force including contents;

-- Create diskgroup
CREATE DISKGROUP TEST EXTERNAL REDUNDANCY
DISK '/dev/oracleasm/disks/DG_TEST';

7. Restore OCR with an OCR backup at ASM Diskgroup.(Node 1 is running)

ocrconfig -restore file_name

Note: OCR location does not exist, then you must create an empty OCR location

8. Verify the OCR Integrity.

ocrcheck

9. Stop Clusterware in exclusive node

crsctl stop crs -f

10. Suppose you have 3 node RAC then you run the command on all other nodes which left for restore OCR(node 2 or node 3)

ocrconfig -repair -replace

11. Start Oracle Clusterware on all nodes.

crsctl start crs

12. Verify OCR integrity of all of the cluster nodes that are configured by Cluvfy command.

cluvfy comp ocr -n all -verbose

You may also like