Recently encountered a issue where we had to rename a diskgroup for 11gR2 RAC containing OCR and Voting Disk. Luckily we had not created any database yet, only installed Oracle Database binaries. In this blog, we will see the steps to Rename DiskGroup containing OCR and Voting Disks.
Below are the diskgroup details on which we will perform renaming operation.
Old Diskgroup name – RECO
New Diskgroup name – OCR_VOTE
======================================================================================================
– Replace Voting Disk
Since the current Diskgroup (+RECO) was storing OCR/Voting disk, it was not possible to dismount the diskgroup. Hence we created a new diskgroup named “+OCR_VOTE” with high redundancy.
1 2 3 4 5 |
$ crsctl query css votedisk ## STATE File Universal Id File Name Disk group -- ----- ----------------- --------- --------- 1. ONLINE 9aeb0deece144ff3bfd97ac4eedee8ef (/dev/raw/raw11) [RECO] Located 1 voting disk(s). |
In 11gR2 you can run this command while the cluster is up and running. [Run as root user]
1 2 3 4 5 6 7 8 9 |
# crsctl replace votedisk +OCR_VOTE Successful addition of voting disk 40ab4d7b4d2f4f78bfaa49f3569af04a. Successful addition of voting disk 057f006b94bc4f44bf7f53d62d1990ae. Successful addition of voting disk 0f130c0856494f6dbfc223da426138be. Successful addition of voting disk a4add1be4d814f8cbfa9ec1491df5a00. Successful addition of voting disk af4f61e7c0384ff0bf649f97415fe84c. Successful deletion of voting disk 9aeb0deece144ff3bfd97ac4eedee8ef. Successfully replaced voting disk group with +OCR_VOTE. CRS-4266: Voting file(s) successfully replaced |
Now again check the status of Voting disks
1 2 3 4 5 6 7 8 9 |
$ crsctl query css votedisk ## STATE File Universal Id File Name Disk group -- ----- ----------------- --------- --------- 1. ONLINE 40ab4d7b4d2f4f78bfaa49f3569af04a (/dev/raw/raw1) [OCR_VOTE] 2. ONLINE 057f006b94bc4f44bf7f53d62d1990ae (/dev/raw/raw2) [OCR_VOTE] 3. ONLINE 0f130c0856494f6dbfc223da426138be (/dev/raw/raw3) [OCR_VOTE] 4. ONLINE a4add1be4d814f8cbfa9ec1491df5a00 (/dev/raw/raw4) [OCR_VOTE] 5. ONLINE af4f61e7c0384ff0bf649f97415fe84c (/dev/raw/raw5) [OCR_VOTE] Located 5 voting disk(s). |
======================================================================================================
– Relocate OCR
Check the current OCR location
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
$ ocrcheck Status of Oracle Cluster Registry is as follows : Version : 3 Total space (kbytes) : 262120 Used space (kbytes) : 2752 Available space (kbytes) : 259368 ID : 1197289523 Device/File Name : +RECO 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 bypassed due to non-privileged user |
If you try to replace the OCR and if it is the only OCR file then it will give error as shown below.
1 2 |
# ocrconfig -replace +RECO -replacement +OCR_VOTE PROT-28: Cannot delete or replace the only configured Oracle Cluster Registry location |
So we need to add new OCR disk in our new diskgroup and then delete the old OCR disk.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# ocrconfig -add +OCR_VOTE $ ocrcheck Status of Oracle Cluster Registry is as follows : Version : 3 Total space (kbytes) : 262120 Used space (kbytes) : 2752 Available space (kbytes) : 259368 ID : 1197289523 Device/File Name : +RECO Device/File integrity check succeeded Device/File Name : +OCR_VOTE 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 bypassed due to non-privileged user |
Now remove the old OCR disk
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# ocrconfig -delete +RECO $ ocrcheck Status of Oracle Cluster Registry is as follows : Version : 3 Total space (kbytes) : 262120 Used space (kbytes) : 2752 Available space (kbytes) : 259368 ID : 1197289523 Device/File Name : +OCR_VOTE 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 bypassed due to non-privileged user |
======================================================================================================
– Drop the DiskGroup RECO
We cannot drop the RECO diskgroup directly since ASM instance is running via the spfile stored on this diskgroup. You can check as shown below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
$ sqlplus / as sysasm SQL*Plus: Release 11.2.0.3.0 Production on Sun Nov 29 21:00:49 2015 Copyright (c) 1982, 2011, Oracle. All rights reserved. Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production With the Real Application Clusters and Automatic Storage Management options SQL> show parameter spfile; NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ spfile string +RECO/rac-cluster/asmparameter file/registry.253.897074993 |
We need to create SPFILE on new diskgroup in order to drop the diskgroup
1 2 3 4 5 6 7 |
SQL> create pfile='/tmp/asm.ora' from spfile; File created. SQL> create spfile='+OCR_VOTE' from pfile='/tmp/asm.ora'; File created. |
Since the cluster is still up and running and ASM spfile is using the old (RECO) diskgroup path, we have to restart the cluster.
Run following commands on both the nodes to stop the cluster.
1 |
# crsctl stop cluster |
Check “ocrconfig_loc” value in ocr.loc file whether its pointing to new diskgroup or not. If its not updated then change it manually.
1 2 3 4 |
# cat /etc/oracle/ocr.loc #Device/file +RECO getting replaced by device +OCR_VOTE ocrconfig_loc=+OCR_VOTE local_only=false |
Now start the cluster on both the nodes one by one.
1 |
# crsctl start cluster |
Once the cluster is up and running, verify the ASM spfile location
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
$ sqlplus / as sysasm SQL*Plus: Release 11.2.0.3.0 Production on Sun Nov 29 21:14:33 2015 Copyright (c) 1982, 2011, Oracle. All rights reserved. Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production With the Real Application Clusters and Automatic Storage Management options SQL> show parameter spfile NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ spfile string +RECO/rac-cluster/asmparameter file/registry.253.897080629 |
Now that the ASM spfile is pointing to new diskgroup and OCR and Voting disks have been also relocated to new diskgroup, we can drop the RECO diskgroup.
1 2 3 |
SQL> drop diskgroup reco including contents; Diskgroup dropped. |
Thats’s it, we have completed renaming OCR and Voting disks to new diskgroup.
======================================================================================================
The spfile is still showing pointing to RECO after the cluster restart.
Please confirm.
Hi Manish,
After you stop the cluster, check the “/etc/oracle/ocr.loc” file whether the file is pointing to new disk group or not. If not then you need to change the new disk group name manually.
Same has been mentioned already in the blog. Sometimes it happens that the name doesn’t get changed.
Thanks,
TJ