Saturday, 4 April 2015

Moving OCR / Voting Disk to different ASM Diskgroup

1st Method

11gR2_OCR_VOTE

In case you wish to move OCR and Voting disk out of the current diskgroup, you can follow below steps. These steps can also be used to move files from ASM Diskgroup to Netapp filer and vice versaWe wish to move OCR/Voting disk from Diskgroup DATA to DG_DATA01
1) Create the new diskgroup DG_DATA01
2) Ensure that ASM Compatability is set to 11.2
 select name,COMPATIBILITY,DATABASE_COMPATIBILITY from V$ASM_DISKGROUP where name='DG_DATA01';
 
NAME       COMPATIBILITY      DATABASE_COMPATIBILITY
--------  ----------------   --------------------------
DG_DATA01  10.1.0.0.0        10.1.0.0.0
In case it is not, then you can change it using following command
alter diskgroup DG_DATA01 SET ATTRIBUTE 'compatible.asm'='11.2';
 
3) Replace voting disk using crsctl command as oracle user. You can do this without stopping the clusterware
 crsctl replace votedisk +DG_DATA01
Successful addition of voting disk 241b1e0a36344f7bbfaca4a576d514e9.                                                                                                                                                                                                                               
Successful deletion of voting disk 72e47e5e3afb4fe9bfb502b1b4340503.
Successfully replaced voting disk group with +DG_DATA01.
CRS-4266: Voting file(s) successfully replaced
To list the voting disk
crsctl query css votedisk
##  STATE    File Universal Id                File Name Disk group
--  -----    ---------------                --------- ---------
 1. ONLINE   241b1e0a36344f7bbfaca4a576d514e9 (ORCL:DISK4) [DG_DATA01]
 
Located 1 voting disk(s).
4) To replace OCR, we need to have multiple OCR configured. In our case we need to add OCR to new diskgroup and delete old one. We need to run this command as root.
[root ~]# ocrconfig -add +DG_DATA01
[root ~]# ocrcheck
Status of Oracle Cluster Registry is as follows :
    Version                  :          3
    Total space (kbytes)     :     262120
    Used space (kbytes)      :       2424
    Available space (kbytes) :     259696
    ID                       :  579998313
    Device/File Name         :      +DATA
                                    Device/File integrity check succeeded
    Device/File Name         : +DG_DATA01
                                    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
   
   
[root ~]# ocrconfig -delete +DATA
[root ~]# ocrcheck
Status of Oracle Cluster Registry is as follows :
    Version                  :          3
    Total space (kbytes)     :     262120
    Used space (kbytes)      :       2424
    Available space (kbytes) :     259696
    ID                       :  579998313
    Device/File Name         : +DG_DATA01
                                    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
Verify that OCR location is pointing to the correct diksgroup on both nodes.
# cat /etc/oracle/ocr.loc
#Device/file +DATA getting replaced by device +DG_DATA01 
ocrconfig_loc=+DG_DATA01
local_only=false
5) ASM Parameter file is also present in same diskgroup. In case you wish to remove it, then follow below steps
SQL> create pfile from spfile;
File created.
 
SQL> create spfile='+DG_DATA01' from pfile;
File created.
You will need to restart the cluster on both the nodes as ASM instance is still using the file. Run following commands on both the nodes
crsctl stop cluster
crsctl start cluster


NOTE:-The same is not the case with Voting device. Once you move voting devices from raw devices to ASM Diskgroup, it’s not possible to add or delete voting files from ASM diskgroup as shown below.


[root@RAC2 bin]# ./crsctl add css votedisk /dev/raw/raw2
CRS-4258: Addition and deletion of voting files are not allowed because the voting files are on ASM

SOLUTION : - multiplex voting disk

1) check voting disk
[oracle@myrac-1 bin]$  crsctl query css votedisk

##  STATE    File Universal Id                File Name Disk group
--  -----    -----------------                --------- ---------
1. ONLINE   37b49fb451214f06bf9cb720358bb189 (/rac/rhdiskdata01) [DATA]
Located 1 voting disk(s).


2) multiplex voting disk (as root or sudo)
Uset ‘crsctl replace’ to relocate/multiplexing Voting disk to another ASM disk group (With normal redundancy)
/u01/app/grid/product/11.2.0/bin/crsctl replace votedisk +CRS

3) check newly added voting disk
[oracle@myrac-1 bin]$ crsctl query css votedisk

##  STATE    File Universal Id                File Name Disk group
–  —–    —————–                ——— ———
1. ONLINE   afb77b2693a24f1ebfe876784103e82a (/rac/rhdiskdata03) [CRS]
2. ONLINE   3e2542c5b1154ffdbfc5b6dea7dce190 (/rac/rhdiskdata04) [CRS]
3. ONLINE   5e0f3c5921cc4f93bf223de1465d87cc (/rac/rhdiskdata05) [CRS]
Located 3 voting disk(s).


Note that we cannot use the ‘crsctl add css votedisk’ to add a vote disk on ASM disk group/ACFS file system. We can use crsctl replace votedisk’ to move voting disk to a ASM disk group with normal redundancy. The new ASM Diskgroup has minimum of 3 fail groups (total of 3 disks). This configuration will provide 3 Voting Disks (1 on each fail group) and a single OCR which takes on the redundancy of the disk group. Hence, use separate disk group with normal redundancy with one disk quorum is the method to multiplexing voting disks.

No comments: