Move the OCR, VotingDisk and spfile to new diskgroup in Oracle RAC

Move the OCR, VotingDisk and spfile to new diskgroup in Oracle RAC

Oracle Cluster Registry
Oracle Cluster Registry (OCR) which records cluster configuration information.
such as Oracle RAC databases, listeners, virtual IP addresses (VIPs), and services and any applications.
OCR stores configuration information in a series of key-value pairs in a tree structure.

Voting files
Voting files which record node membership information. Oracle Clusterware uses voting files to determine which nodes are members of a
cluster. Configure voting files on Oracle ASM or on shared storage.
Note: In Shared storage you should create 3 minimum voting files in separate storage.
Oracle recommends that you do not use more than five voting files

Following are the steps to move OCR, Voting Disk and Spfile to new disk group

1. Check the location of OCR Disk from GRID Home with root user.

[root@NODE01 ~]# /u01/app/11.2.0.4/grid/bin/ocrcheck
Status of Oracle Cluster Registry is as follows :
         Version                  :          3
         Total space (kbytes)     :     409548
         Used space (kbytes)      :       2408
         Available space (kbytes) :     407140‬
         ID                       : 3024567651
         Device/File Name         :   +OCRVD_DG
                                    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

2. Check the Voting Disk Location

[root@NODE01 ~]# /u01/app/11.2.0.4/grid/bin/crsctl query css votedisk

##  STATE  File Universal Id               File Name                         Disk group
--  ------ ------------------------------- --------------------------------- ----------
 1 ONLINE 8b62c257e7fa2bfabf363cb4791c1f4c (/dev/oracleasm/disks/OCR_DISK01) [OCRVD_DG]
 2 ONLINE 0e3a9c8e306a2befaf5548b77231be3a (/dev/oracleasm/disks/OCR_DISK02) [OCRVD_DG]
 3 ONLINE da722ae356dd2e3ee871601add127e3c (/dev/oracleasm/disks/OCR_DISK03) [OCRVD_DG]

3. Check the SPFILE location.

SQL> show parameter spfile

NAME      TYPE      VALUE
--------  --------  --------------------------------------------------
spfile    string    +OCRVD_DG/RAC-cluster/asmparameterfile/registry.183.284573136

[grid@RAC1 ~]$ asmcmd spget
+OCRVD_DG/RAC-cluster/asmparameterfile/registry.183.284573136

4. List the Candidate Disk present for creating DISKGROUP.

--Connect with SQLPLUS ASM instance
col path for a30
col name for a20
col header_status for a20
select path,name,header_status from v$asm_disk
where path like '/dev/oracleasm/disks/%' and header_status = 'CANDIDATE';

PATH                            NAME                 HEADER_STATUS
------------------------------- -------------------- --------------------
/dev/oracleasm/disks/OCR_DISK11                      CANDIDATE
/dev/oracleasm/disks/OCR_DISK12                      CANDIDATE
/dev/oracleasm/disks/OCR_DISK13                      CANDIDATE  

5. Create the New Diskgroup in ASM for moving OCR, VotingDisk and SPFILE

CREATE DISKGROUP OCR_NEWDG NORMAL REDUNDANCY
FAILGROUP fg01 DISK '/dev/oracleasm/disks/OCR_DISK11'
FAILGROUP fg02 DISK '/dev/oracleasm/disks/OCR_DISK12'
FAILGROUP fg03 DISK '/dev/oracleasm/disks/OCR_DISK13';

6. Mount and check status Diskgroup in all Nodes

-- Mount diskgroup
srvctl start diskgroup -g OCR_NEWDG -n NODE01,NODE02


--Check Status
srvctl status diskgroup -g OCR_NEWDG
Disk Group ocr_newdg is running on node01,node02

8. Move the VotingDisk to new diskgroup.

--Connect with Grid User
[grid@NODE01 ~]$ crsctl replace votedisk +OCR_NEWDG
Successful addition of voting disk fa21c52bdf245d89acb2ae7bb245e193.
Successful addition of voting disk 34b3f9458e042b58eb8b601523fb6ef2.
Successful addition of voting disk B6FF6C1D64B9837D82B1B41D38760445.
Successful deletion of voting disk 8b62c257e7fa2bfabf363cb4791c1f4c.
Successful deletion of voting disk 0e3a9c8e306a2befaf5548b77231be3a.
Successful deletion of voting disk da722ae356dd2e3ee871601add127e3c.
Successfully replaced voting disk group with +OCR_NEWDG.
CRS-4266: Voting file(s) successfully replaced

9. Verify the VotingDisk movement on both nodes.

[grid@NODE01 ~]$ crsctl query css votedisk

##  STATE    File Universal Id                File Name                         Disk group
--  -----    -----------------                --------------------------------  -----------
 1. ONLINE   fa21c52bdf245d89acb2ae7bb245e193 (/dev/oracleasm/disks/OCR_DISK11) [OCR_NEWDG]
 2. ONLINE   34b3f9458e042b58eb8b601523fb6ef2 (/dev/oracleasm/disks/OCR_DISK12) [OCR_NEWDG]
 3. ONLINE   B6FF6C1D64B9837D82B1B41D38760445 (/dev/oracleasm/disks/OCR_DISK13) [OCR_NEWDG]
Located 3 voting disk(s).


Note: After verfied on all nodes then move to OCR Disks.

10. Move the OCR to new diskgroup.

--add the new diskgroup with root user.
[root@NODE01 ~]# /u01/app/11.2.0.4/grid/bin/ocrconfig -add +OCR_NEWDG

--Verify the OCR is show in two diskgroup
[root@NODE01 ~]# /u01/app/11.2.0.4/grid/bin/ocrcheck

Status of Oracle Cluster Registry is as follows :
         Version                  :          3
         Total space (kbytes)     :     409548
         Used space (kbytes)      :       2408
         Available space (kbytes) :     407140‬
         ID                       : 3024567651
         Device/File Name         :   +OCRVD_DG
                                    Device/File integrity check succeeded
		 Device/File Name         :   +OCR_NEWDG
                                    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

--Delete the old diskgroup
[root@NODE01 ~]# /u01/app/11.2.0.4/grid/bin/ocrconfig -delete +OCRVD_DG

11. Move the SPFILE to newdiskgroup.

--With Spmove command we will move the spfile
[grid@NODE01 ~]$ asmcmd spmove '+OCRVD_DG/RAC-cluster/asmparameterfile/registry.183.284573136' '+OCR_NEWDG/RAC-cluster/spfileASM.ora'


--Verify
[grid@RAC1 ~]$ asmcmd spget
+OCR_NEWDG/RAC-cluster/spfileASM.ora

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.