Restore OCR from a weekly backup

Tested Version

  • CRS – version : 11.2.0.4

Verify OCR backup and check OCR location

Locate OCR backups 
[root@grac42 ~]#   ocrconfig -showbackup auto
grac42     2014/10/01 12:53:10     /u01/app/11204/grid/cdata/grac4/backup00.ocr
grac42     2014/10/01 08:53:09     /u01/app/11204/grid/cdata/grac4/backup01.ocr
grac42     2014/09/30 18:41:00     /u01/app/11204/grid/cdata/grac4/backup02.ocr
grac42     2014/09/30 09:16:23     /u01/app/11204/grid/cdata/grac4/day.ocr
grac42     2014/09/16 09:34:38     /u01/app/11204/grid/cdata/grac4/week.ocr

--> After an OCR corruption we need to restore:   /u01/app/11204/grid/cdata/grac4/week.ocr
Locate our OCR location
[root@grac42 ~]# ocrcheck
Status of Oracle Cluster Registry is as follows :
     Version                  :          3
     Total space (kbytes)     :     262120
     Used space (kbytes)      :       4040
     Available space (kbytes) :     258080
     ID                       :  630679368
     Device/File Name         :       +OCR

Check OCR DG content
ASMCMD> ls -l OCR/grac4/asmparameterfile/
Type              Redund  Striped  Time             Sys  Name
ASMPARAMETERFILE  MIRROR  COARSE   JUN 21 10:00:00  Y    REGISTRY.253.850819057
                                                    N    spfileASM.ora => +OCR/grac4/asmparameterfile/REGISTRY.253.850819057
ASMCMD>  ls -l OCR/grac4/OCRFILE/
Type     Redund  Striped  Time             Sys  Name
OCRFILE  MIRROR  COARSE   OCT 02 09:00:00  Y    REGISTRY.255.828888017

Restore OCR from weekly backup

Stop the CRS stack on all nodes  and restart ASM in exclusive mode on grac42 
[root@grac42 ~]# crsctl stop crs 
[root@grac42 ~]# crsctl stop crs
[root@grac42 ~]# $GRID_HOME/bin/crsctl start crs -excl -nocrs

Remove the corrupted OCR file 
ASMCMD> cd +OCR/grac4/OCRFILE
ASMCMD> rm REGISTRY.255.828888017

Restore OCR 
[root@grac42 ~]# $GRID_HOME/bin/ocrconfig -restore /u01/app/11204/grid/cdata/grac4/week.ocr

ASMCMD> pwd
+OCR/grac4/OCRFILE
ASMCMD> ls -l
Type     Redund  Striped  Time             Sys  Name
OCRFILE  MIRROR  COARSE   OCT 02 10:00:00  Y    REGISTRY.255.859888799

Restart CRS on all nodes any verify database startup  
[root@grac42 ~]# crsctl stop crs 
[root@grac42 ~]# crsctl stop crs 
[root@grac43 ~]# crsctl start crs
[grid@grac42 bin]$ crs | egrep 'NAME|---|db'
NAME                           TARGET     STATE           SERVER       STATE_DETAILS   
-------------------------      ---------- ----------      ------------ ------------------
ora.grac4.db                   ONLINE     ONLINE          grac42       Open 
ora.grac4.db                   ONLINE     ONLINE          grac43       Open

Reference

Leave a Reply

Your email address will not be published. Required fields are marked *