Consider an 11.2 Grid Infrastructure with CLUSTER setup having OCR, Vote File and ASM SPFILE on a diskgroup. Under certain circumstances, you may wish to rename that diskgroup. “renamedg” utility can be used to rename of the diskgroup when the diskgroup is dismounted. But since the diskgroup contains OCR and Vote File we need to use an intermediate diskgroup for storing OCR and Vote File temporarily while renaming the actual diskgroup.
Basic Steps to rename the diskgroup :
- Create a temporary diskgroup (TEMP) with suitable redundancy for OCR and Vote files.
- Move OCR and Vote file from [current diskgroup] to [TEMP].
- Change ASM SPFILE location from [current diskgroup] to [TEMP] diskgroup.
- Restart CRS in all Nodes to Startup CRS using New SPFILE from
diskgroup. - Dismount the OLD diskgroup in all cluster nodes that is not used by CRS.
- Rename OLD diskgroup to NEW diskgroup.
- Mount the renamed diskgroup.
- Move OCR and Vote file from TEMP diskgroup to renamed diskgroup.
- Change ASM SPFILE location from
to renamed diskgroup. - Restart CRS in all nodes to startup CRS using new SPFILE from renamed diskgroup. NOTE: Modify the asm resource to have the correct password file location else startup CRS will not start the ASM resource
- Drop the intermediate diskgroup TEMP.
- Need to remove the diskgroup resources TEMP and
from Oracle Clusterware. - Ensure ALL cluster resources are started successfully.
Below assumptions are made :
- Name of Temporary diskgroup is TEMP.
- OCR,Voting Disks and ASM SPFILE are originally stored in a diskgroup DATA.
- Diskgroup DATA should be renamed to CRS.
- $ORACLE_HOME points to GRID Home.
- Cluster is up and running in all nodes of RAC.
Detailed steps with commands to rename the diskgroup are as follows:
1. Create a temporary diskgroup:
Login as SYSASM using SQLPLUS into ASM instance on one node and run below commands:
SQL> create diskgroup TEMP normal redundancy disk [disk_1],[disk_2],[disk_3] attribute 'compatible.rdbms'='11.2.0.0', 'compatible.asm'='11.2.0.0', 'au_size'=[desired_au_size];
Sample Command and Output:
SQL> create diskgroup TEMP normal redundancy disk 'ORCL:DISK4' ,'ORCL:DISK5' ,'ORCL:DATA4' attribute 'compatible.rdbms'='11.2.0.0', 'compatible.asm'='11.2.0.0', 'au_size'='4M'; Diskgroup created.
2. Move OCR and Vote file from [current diskgroup] to [TEMP]:
$ORACLE_HOME/bin/bin/ocrconfig -add +TEMP $ORACLE_HOME/bin/bin/ocrconfig -delete +DATA $ORACLE_HOME/bin/crsctl replace votedisk +TEMP
Sample Command Output:
# $ORACLE_HOME/bin/ocrconfig -add +TEMP
# $ORACLE_HOME/bin/ocrconfig -delete +DATA
# $ORACLE_HOME/bin/crsctl replace votedisk +TEMP 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 +TEMP. 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) [TEMP] 2. ONLINE 302c23b19e864f92bfa68eda9045e5cc (ORCL:DISK5) [TEMP] 3. ONLINE 6eeca4920acb4f8fbf6ec5a4e2b8ea7b (ORCL:DATA4) [TEMP] 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 : +TEMP 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
3. Change ASM SPFILE location from [Current diskgroup] to [TEMP] 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='+TEMP' from pfile='/tmp/init/init';
Now GPNPTOOL will get updated with new ASM SPFILE location. That can be verified by below command:
$ORACLE_HOME/bin/gpnptool get
4. Restart CRS on all nodes to startup CRS using new SPFILE from TEMP diskgroup:
# crsctl stop crs # crsctl start crs
5. Dismount the OLD Diskgroup on all cluster nodes:
Login as SYSASM using SQLPLUS into ASM instance on one node and run below commands:
SQL>alter diskgroup data dismount;
Sample Command Output:
SQL> alter diskgroup data dismount; Diskgroup altered.
6. Rename OLD diskgroup to NEW diskgroup name:
$ renamedg phase=both dgname=DATA newdgname=CRS verbose=true
Sample Command Output:
$ renamedg phase=both dgname=DATA newdgname=CRS asm_diskstring='' verbose=true Parsing parameters.. Parameters in effect: Old DG name : DATA New DG name : CRS Phases : Phase 1 Phase 2 Discovery str : (null) Clean : TRUE Raw only : TRUE renamedg operation: phase=both dgname=DATA newdgname=CRS verbose=true Executing phase 1 Discovering the group Performing discovery with string: Identified disk ASM:/opt/oracle/extapi/32/asm/orcl/1/libasm.so:ORCL:DISK1 with disk number:0 and timestamp (32955539 -2120261632) Identified disk ASM:/opt/oracle/extapi/32/asm/orcl/1/libasm.so:ORCL:DISK2 with disk number:1 and timestamp (32955539 -2120261632) Identified disk ASM:/opt/oracle/extapi/32/asm/orcl/1/libasm.so:ORCL:DISK3 with disk number:2 and timestamp (32955539 -2120261632) Checking for hearbeat... Re-discovering the group Performing discovery with string: Identified disk ASM:/opt/oracle/extapi/32/asm/orcl/1/libasm.so:ORCL:DISK1 with disk number:0 and timestamp (32955539 -2120261632) Identified disk ASM:/opt/oracle/extapi/32/asm/orcl/1/libasm.so:ORCL:DISK2 with disk number:1 and timestamp (32955539 -2120261632) Identified disk ASM:/opt/oracle/extapi/32/asm/orcl/1/libasm.so:ORCL:DISK3 with disk number:2 and timestamp (32955539 -2120261632) Checking if the diskgroup is mounted or used by CSS Checking disk number:0 Checking disk number:1 Checking disk number:2 Generating configuration file.. Completed phase 1 Executing phase 2 Looking for ORCL:DISK1 Modifying the header Looking for ORCL:DISK2 Modifying the header Looking for ORCL:DISK3 Modifying the header Completed phase 2 Terminating kgfd context 0xb7ee8050
SQL> set line 1000 SQL> set pages 599 SQL> col path format a30 SQL> select name,path,group_number,header_status,total_mb,free_mb from v$asm_disk; SQL> select name,state,usable_file_mb,total_mb,free_mb,required_mirror_free_mb from v$asm_diskgroup; NAME PATH GROUP_NUMBER HEADER_STATU TOTAL_MB FREE_MB ------------------------------ ------------------------------ ------------ ------------ ---------- ---------- ORCL:DISK1 0 MEMBER 0 0 ORCL:DISK2 0 MEMBER 0 0 ORCL:DISK3 0 MEMBER 0 0 ORCL:DISK6 0 MEMBER 0 0 DATA1 ORCL:DATA1 2 MEMBER 977 642 DATA2 ORCL:DATA2 2 MEMBER 977 642 DATA3 ORCL:DATA3 1 MEMBER 15109 9982 DATA4 ORCL:DATA4 3 MEMBER 252 76 DATA6 ORCL:DATA6 3 MEMBER 860 576 DISK4 ORCL:DISK4 3 MEMBER 668 376 DISK5 ORCL:DISK5 3 MEMBER 668 372 11 rows selected. SQL> NAME STATE USABLE_FILE_MB TOTAL_MB FREE_MB REQUIRED_MIRROR_FREE_MB ------------------------------ ----------- -------------- ---------- ---------- ----------------------- DATA1 MOUNTED 9982 15109 9982 0 FLASH MOUNTED 642 1954 1284 0 TEMP MOUNTED 552 2448 1400 296 CRS DISMOUNTED 0 0 0 0
7. Mount the renamed diskgroup on All the nodes:
Login as SYSASM using SQLPLUS into ASM instance on one node and run below commands:
SQL>alter diskgroup CRS mount;
Sample Command Output:
SQL> alter diskgroup CRS mount; Diskgroup altered.
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 ------------------------------ ----------- -------------- ---------- ---------- ----------------------- DATA1 MOUNTED 9982 15109 9982 0 FLASH MOUNTED 642 1954 1284 0 TEMP MOUNTED 552 2448 1400 296 CRS MOUNTED 1196 3596 2644 252
8. Move OCR and Vote file from TEMP Diskgroup to Renamed Diskgroup:
$ORACLE_HOME/bin/ocrconfig -add +CRS $ORACLE_HOME/bin/ocrconfig -delete +TEMP $ORACLE_HOME/bin/crsctl replace votedisk +CRS
Sample Command Output:
# $ORACLE_HOME/bin/ocrconfig -add +CRS # $ORACLE_HOME/bin/ocrconfig -delete +TEMP # $ORACLE_HOME/bin/crsctl replace votedisk +CRS Successful addition of voting disk ae0f06430e724fb7bf3757a7cdf8a101. Successful addition of voting disk 1b355413f5904f5abff181938191ed97. Successful addition of voting disk a7f75c9872ac4f6fbf77bbcb10ea17a6. Successful deletion of voting disk 9d351cfdbef64facbfe2d1519880ef33. Successful deletion of voting disk 302c23b19e864f92bfa68eda9045e5cc. Successful deletion of voting disk 6eeca4920acb4f8fbf6ec5a4e2b8ea7b. Successfully replaced voting disk group with +CRS. CRS-4266: Voting file(s) successfully replaced
9. Change ASM SPFILE location from to Renamed Diskgroup:
Login as SYSASM using SQLPLUS into ASM instance on one node and run below commands:
SQL> create spfile='+CRS' from pfile='/tmp/init/init';
Sample Command Output:
SQL> create spfile='+CRS' from pfile='/tmp/init/init'; File created.
10. Restart CRS on all nodes to Startup CRS using new SPFILE from renamed diskgroup:
# crsctl stop crs # crsctl start crs
11. Drop the Intermediate Diskgroup TEMP:
Login as SYSASM using SQLPLUS into ASM instance on one node and run below commands:
SQL>drop diskgroup temp including contents;
12. Need to Remove the Diskgroup Resources TEMP and [OLD Diskgroup Name] from Oracle Clusterware:
# srvctl remove diskgroup -g data # srvctl remove diskgroup -g TEMP
Sample Command Output:
# $ORACLE_HOME/bin/srvctl remove diskgroup -g data # $ORACLE_HOME/bin/srvctl remove diskgroup -g TEMP
13. Ensure ALL Cluster resources are started successfully using below sample commands:
$ORACLE_HOME/bin/crsctl stat res -init -t $ORACLE_HOME/bin/crsctl check cluster -all $ORACLE_HOME/bin/crsctl stat res -t