The goal here is to move OCR, voting disk file and ASM spfile in a Grid Infrastructure with RAC cluster to a new ASM disk group. One example would be that you have created these components in the +DATA diskgroup and you wish to move the OCR, Vote File and ASM spfile to a NORMAL or HIGH redundant diskgroup. Basic steps to move to the new diskgroup are outlined below:
- Create New diskgroup(CRS) with suitable redundancy for OCR and Voting files.
- Ensure that the new diskgroup is mounted on all cluster nodes.
- Move OCR and Vote file from [Current diskgroup] to [CRS].
- Change ASM SPFILE location from [current diskgroup] to [CRS] Diskgroup.
- Mount new [CRS] diskgroup in all nodes and restart CRS in all Nodes to Startup CRS using New SPFILE from [CRS] Diskgroup.
- Verify mount of disks and diskgroups.
- Ensure ALL Cluster Resources are started successfully .
Assumptions
Below assumptions are made:
1. OCR,Voting Disks and ASM SPFILE is originally stored in a Diskgroup +DATA.
2. $ORACLE_HOME points to GRID HOME.
3. Cluster is up and running in all nodes of RAC.
Create New CRS Disk Group
Login as SYSASM using SQLPLUS into ASM instance on one of the nodes and run below command:
SQL> create diskgroup CRS normal redundancy disk 'ORCL:DISK4' ,'ORCL:DISK5' ,'ORCL:DISK6' attribute 'compatible.rdbms'='11.2.0.0', 'compatible.asm'='11.2.0.0'; Diskgroup created.
Mount the CRS Disk Group on all the nodes
If the diskgroup you are moving the OCR to is not online on all nodes, then the ocr.loc file on those nodes where the Diskgroup is not online will not be updated. This will prevent CRS from restarting on those nodes that the diskgroup is not online. And the ocr.loc file may need manual intervention. Thus make sure the diskgroup is mounted on all the nodes.
SQL> alter diskgroup CRS mount;
SQL> select name, state, type from v$asm_diskgroup;
Move OCR and Vote file from [Current diskgroup] to [CRS]
Next step is to move the OCT and Voting Disk files from the current disk group to the new disk group we have just created. Follow the below commands to perform the movement.
Run as Root user
# $ORACLE_HOME/bin/ocrconfig -add +CRS
# $ORACLE_HOME/bin/ocrconfig -delete +DATA
# $ORACLE_HOME/bin/crsctl replace votedisk +CRS Successful addition of voting disk 9d351cfdbef64facbfe2d1519880ef33. Successful addition of voting disk 302c23b19e864f92bfa68eda9045e5cc. Successful addition of voting disk 6eeca4920acb4f8fbf6ec5a4e2b8ea7b. Successful deletion of voting disk 32f7d65cf17d4fa3bf2932998251635f. Successful deletion of voting disk 10c31fb0891d4f5abfb38ef34cd49f4d. Successful deletion of voting disk 7d6f7d6480554f01bfc2621a3adb8f5f. Successfully replaced voting disk group with +CRS. CRS-4266: Voting file(s) successfully replaced
$ORACLE_HOME/bin/crsctl query css votedisk ## STATE File Universal Id File Name Disk group -- ----- ----------------- --------- --------- 1. ONLINE 9d351cfdbef64facbfe2d1519880ef33 (ORCL:DISK4) [CRS] 2. ONLINE 302c23b19e864f92bfa68eda9045e5cc (ORCL:DISK5) [CRS] 3. ONLINE 6eeca4920acb4f8fbf6ec5a4e2b8ea7b (ORCL:DISK6) [CRS] Located 3 voting disk(s).
# $ORACLE_HOME/bin/ocrcheck Status of Oracle Cluster Registry is as follows : Version : 3 Total space (kbytes) : 262120 Used space (kbytes) : 2804 Available space (kbytes) : 259316 ID : 1778064925 Device/File Name : +CRS 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
Change the ASM spfile location
1. Next is to Change ASM SPFILE location from [Current diskgroup] to [CRS] Diskgroup. Login as SYSASM using SQLPLUS into ASM instance on one node and run below commands:
SQL> create pfile='/tmp/init/init' from spfile;
SQL> create spfile='+CRS' from pfile='/tmp/init/init';
2. Now GPNPTOOL will get updated with new ASM SPFILE location. That can be verified by below command:
As grid user or root
$ORACLE_HOME/bin/gpnptool get
Restart CRS
1. Double check if you have mounted the CRS disk group in all the RAC nodes. If not, mount using below command.
SQL> alter diskgroup CRS mount;
2. Restart CRS in all nodes to startup CRS using new SPFILE from [CRS] diskgroup:
$ crsctl stop crs $ crsctl start crs
Verify the mounting of CRS disk group
Verify the mount of the CRS diskgroup and its disks using the below commands:
SQL> select name,path,group_number,header_status,total_mb,free_mb from v$asm_disk; NAME PATH GROUP_NUMBER HEADER_STATU TOTAL_MB FREE_MB ------------------------------ ------------------------------ ------------ ------------ ---------- ---------- DATA1 ORCL:DATA1 2 MEMBER 15109 9982 DATA2 ORCL:DATA2 2 MEMBER 15109 9982 DATA3 ORCL:DATA3 1 MEMBER 15109 9982 DATA4 ORCL:DATA4 3 MEMBER 15109 9982 DISK4 ORCL:DISK4 3 MEMBER 860 576 DISK5 ORCL:DISK5 3 MEMBER 668 376 DISK6 ORCL:DISK6 3 MEMBER 668 372
SQL> select name,state,usable_file_mb,total_mb,free_mb,required_mirror_free_mb from v$asm_diskgroup; NAME STATE USABLE_FILE_MB TOTAL_MB FREE_MB REQUIRED_MIRROR_FREE_MB ------------------------------ ----------- -------------- ---------- ---------- ----------------------- DATA MOUNTED 9982 15109 9982 0 CRS MOUNTED 552 2448 1400 296
Verify all cluster resources
Ensure ALL Cluster resources are started successfully using below commands:
$ORACLE_HOME/bin/crsctl stat res -init -t $ORACLE_HOME/bin/crsctl check cluster -all $ORACLE_HOME/bin/crsctl stat res -t
How to Migrate ASM Disk Groups to another Storage Online [non ASMLIB Devices]