Thursday, February 25, 2016

Oracle RAC Mirror copy of OCR onto different asm diskgroup


 
From 11gr2 OCR files  (Oracle cluster registry) and voting files are stored on ASM. When we Install Oracle Cluster-ware software by selecting Normal redundancy, we  allocate at-least 3 disks to store OCR and Voting files on ASM.  Oracle Clusterware software will create diskgroup using 3 disks and places cluster-ware files OCR and Voting files on ASM disk-group. When we go with normal redundancy cluster-ware software Places Original OCR and Mirror of OCR in same disk-group & Place voting file on each disk inside the disk-group. OCR stores all cluster-ware information, if the disk-group which is carrying OCR on cluster crashes, we loose both Original and Mirror copy of OCR. (Anyway, we take backup  of OCR using ocrconfig, In that scenario, we need to restore both OCR Files /  need downtime to recover OCR from backup) 

To stabilize the RAC Environment we mirror copy of OCR to newly created diskgroup;

Pre-req's to add a mirror copy on another diskgroup;
a) Make Sure new diskgroup is mounted on all instances
b) Database and diskgroup compatibility is greater than 11.2

 when we ignore pre-req's, we will encounter with following error


[root@tnc1 ~]# ocrconfig -add +ocnew
PROT-30: The Oracle Cluster Registry location to be added is not usable
PROC-50: The Oracle Cluster Registry location to be added is inaccessible on nodes tnc1.

failed ——

Before —
col COMPATIBILITY form a15
col DATABASE_COMPATIBILITY form a20
col NAME form a20
select group_number, name, compatibility, database_compatibility from v$asm_diskgroup;

GROUP_NUMBER NAME          COMPATIBILITY   DATABASE_COMPATIBILITY
------------ -------------------- --------------- --------------------
       4 OCNEW          12.1.0.0.0            10.1.0.0.0
       1 FRA               12.1.0.0.0            10.1.0.0.0
       2 GRID             12.1.0.0.0            10.1.0.0.0
       3 SDXH             12.1.0.0.0            10.1.0.0.0
 

changing  DATABASE COMPATIBILITY of NEW disk-group "OCRNEW"

SQL> alter diskgroup ocnew set attribute 'compatible.asm'='12.1';
Diskgroup altered.
SQL> alter diskgroup ocnew set attribute 'compatible.rdbms'='12.1';
Diskgroup altered.

-After —

col COMPATIBILITY form a15
col DATABASE_COMPATIBILITY form a20
col NAME form a20
select group_number, name, compatibility, database_compatibility from v$asm_diskgroup;

GROUP_NUMBER NAME          COMPATIBILITY   DATABASE_COMPATIBILI
------------ -------------------- --------------- --------------------
       4 OCNEW          12.1.0.0.0             12.1.0.0.0
 
Before —Original Copy and Mirror copy is on same diskgroup "+GRID"
[root@tnc1 ~]# grid_env
[root@tnc1 ~]#
[root@tnc1 ~]# ocrcheck
Status of Oracle Cluster Registry is as follows :
     Version                  :          4
     Total space (kbytes)     :     409568
     Used space (kbytes)      :       1716
     Available space (kbytes) :     407852
     ID                       :  143829273
     Device/File Name         :      +GRID
                                    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
Placing copy of OCR on another disk group as follows


After Meeting all pre-req's, add mirror copy of OCR  into new diskgroup "OCNEW" as follows  


—Perform Operation as root

[root@tnc1 ~]# ocrconfig -add +ocnew

CRS log as follows
2016-02-25 00:57:02.743 [OCTSSD(5273)]CRS-2408: The clock on host tnc1 has been updated by the Cluster Time Synchronization Service to be synchronous with the mean cluster time.
2016-02-25 01:24:23.365 [CRSD(5837)]CRS-1007: The OCR/OCR mirror location was replaced by +OCNEW/tnc-cluster/OCRFILE/registry.255.904699441.


After —


[root@tnc1 ~]# ocrcheck
Status of Oracle Cluster Registry is as follows :
     Version                  :          4
     Total space (kbytes)     :     409568
     Used space (kbytes)      :       1716
     Available space (kbytes) :     407852
     ID                       :  143829273
     Device/File Name         :      +GRID
                                    Device/File integrity check succeeded
     Device/File Name         :     +OCNEW
                                    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


Finally Mirror copy is placed on Different diskgroup 

Location of OCR
[oracle@tnc2 ~]$ cat /etc/oracle/ocr.loc
#Device/file  getting replaced by device +OCNEW/tnc-cluster/OCRFILE/registry.255.904699441 
ocrconfig_loc=+GRID/tnc-cluster/OCRFILE/registry.255.903665167
ocrmirrorconfig_loc=+OCNEW/tnc-cluster/OCRFILE/registry.255.904699441

--Nikhil Tatineni--
--12c Oracle RAC Cluster--

Querys to monitor RAC

following few  Query's will help to find out culprits-  Query to check long running transaction from last 8 hours  Col Sid Fo...