Restore OCR

Env: 11.2.0.3
OS: Linux 5.7

I had only one OCR file and lost it. The cluster didn’t restart as the voting file was still available.

1. By default OCR file will be backed up by the GRID of the primary node under the $GI_HOME/cdata/<cluster_name>/

ab0012:oracle() cdata % ocrconfig -showbackup
PROT-26: Oracle Cluster Registry backup locations were retrieved from a local copy

ab0012     2013/08/27 02:17:19     /u01/app/11.2.0/grid/cdata/pm-cluster/backup00.ocr
ab0012     2013/08/26 22:17:18     /u01/app/11.2.0/grid/cdata/pm-cluster/backup01.ocr
ab0012     2013/08/26 18:17:18     /u01/app/11.2.0/grid/cdata/pm-cluster/backup02.ocr
ab0012     2013/08/25 06:17:13     /u01/app/11.2.0/grid/cdata/pm-cluster/day.ocr
ab0012     2013/08/20 05:34:11     /u01/app/11.2.0/grid/cdata/pm-cluster/week.ocr

2. Shutdown the CRS on both the nodes. Will have to use ‘-f’ as OCR files are missing

[root@ab0022 ~]# /u01/app/11.2.0/grid/bin/crsctl stop crs -f
[root@ab0012 ~]# /u01/app/11.2.0/grid/bin/crsctl stop crs -f

3. Restore the OCR file from backup as ROOT user. I had to ‘touch ocr1’ in the location for it to restore. ocr1 was the name of the file earlier.

[root@ab0012 ocr]# /u01/app/11.2.0/grid/bin/ocrconfig -restore /u01/app/11.2.0/grid/cdata/pm-cluster/backup00.ocr
PROT-35: The configured Oracle Cluster Registry locations are not accessible

[root@ab0012 ~]# cd /data/ocr_voting/ocr/
[root@ab0012 ocr]# touch ocr1
[root@ab0012 ocr]#  /u01/app/11.2.0/grid/bin/ocrconfig -restore /u01/app/11.2.0/grid/cdata/pm-cluster/backup00.ocr
[root@ab0012 ocr]# ls -ltr
total 7305
-rw-r--r--+ 1 root root 272756736 Aug 27 21:55 ocr1
[root@ab0012 ocr]#


4
. Check OCR

[root@ab0012 ocr]# /u01/app/11.2.0/grid/bin/ocrcheck
Status of Oracle Cluster Registry is as follows :
         Version                  :          3
         Total space (kbytes)     :     262120
         Used space (kbytes)      :       2880
         Available space (kbytes) :     259240
         ID                       : 1550700056
         Device/File Name         : /data/ocr_voting/ocr/ocr1
                                    Device/File integrity check succeeded
                                    Device/File not configured
                                    Device/File not configured
                                    Device/File not configured
                                    Device/File not configured

         Cluster registry integrity check succeeded

         Logical corruption check succeeded


5
. Start the CRS

[root@ab0012 ~]# /u01/app/11.2.0/grid/bin/crsctl start crs
[root@ab0022 ~]# /u01/app/11.2.0/grid/bin/crsctl start crs
Advertisements

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s