Monday, March 6, 2017

OCR Maintenance Operations

We can store OCR in ASM diskgroup from 11.2. In this post I'll demonstrate the OCR maintenance operations.

Permissions :-


For ASM disks used for OCR/Voting disk:-

1. chown griduser:asmadmin <asm disks>
2. chmod 660 <asm disks>


Redundancy :-


1. 10.2 and 11.1, maximum 2 OCR devices: OCR and OCRMIRROR
2. 11.2+, upto 5 OCR devices can be added.


Note:-


1. You must be logged in as the root user, because root owns the OCR files. "ocrconfig -replace" command can only be issued when CRS is running, otherwise "PROT-1: Failed to initialize ocrconfig" will occur.

2. Please ensure CRS is running on ALL cluster nodes during this operation, otherwise the change will not reflect in the CRS down node, CRS will have problem to startup from this down node."ocrconfig -repair" option will be required to fix the ocr.loc file on the CRS down node.

3. Make sure we have a recent copy of the OCR file before making any changes:
    ocrconfig -showbackup

4. If there is not a recent backup copy of the OCR file, please make sure to take a manual backup using below commands :-
   
  In 10.2   
   # ocrconfig -export <OCR export_filename> -s online

  In 11.1 and 11.2  
   # ocrconfig -manualbackup
   [root@rac1 bin]# ocrconfig -manualbackup
   rac1  2017/03/06 06:31:49 /u01/app/11.2/grid/cdata/rac-cluster/backup_20170306_063149.ocr


To check OCR health :-


[root@rac1 bin]# ./ocrcheck
Status of Oracle Cluster Registry is as follows :

         Version                  :          3
         Total space (kbytes)     :     262120
         Used space (kbytes)      :       2748
         Available space (kbytes) :     259372
         ID                       : 1056661873
         Device/File Name         :     +NORM1
                                   
                                    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


To add an OCRMIRROR device when only OCR device is defined :-


Note :- From 11.2 onward, up-to 4 ocrmirrors can be added.

[root@rac1 bin]# ./ocrconfig -add +DATA

[root@rac1 bin]# ./ocrcheck
Status of Oracle Cluster Registry is as follows :
         Version                  :          3
         Total space (kbytes)     :     262120
         Used space (kbytes)      :       2748
         Available space (kbytes) :     259372
         ID                       : 1056661873
         Device/File Name         :     +NORM1
                                    Device/File integrity check succeeded
         Device/File Name         :      +DATA
                                    Device/File integrity check succeeded
                                    Device/File not configured
                                    Device/File not configured
                                    Device/File not configured
         Cluster registry integrity check succeeded
         Logical corruption check succeeded



To remove an OCR/OCRMIRROR device :-

1. Once an OCR device is removed, ocrmirror device automatically changes to be OCR device.
2. It is not allowed to remove OCR device if only 1 OCR device is defined, the command will return PROT-16.


 [root@rac1 bin]# ./ocrconfig -delete +norm1

[root@rac1 bin]# ./ocrcheck
Status of Oracle Cluster Registry is as follows :                            
         Version                  :          3
         Total space (kbytes)     :     262120
         Used space (kbytes)      :       2748
         Available space (kbytes) :     259372
         ID                       : 1056661873
         Device/File Name         :      +DATA
                                    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


To replace or move the location of an OCR device :-


1. An ocrmirror must be in place before trying to replace the OCR device.The ocrconfig will fail with PROT-16, if there is no ocrmirror exists.


2. The command is same for replace either OCR or OCRMIRRORs (at least 2 OCR exist for replace command to work):# ocrconfig -replace <current filename> -replacement <new filename>

eg:
  # ocrconfig -replace /cluster_file/ocr.dat -replacement +OCRVOTE

  # ocrconfig -replace +CRS -replacement +OCRVOTE





No comments:

Post a Comment