Rename Disk Label for reallocating disks from one diskgroup to other diskgroup
Before :
login as sysasm :
1 2 3 4 5 6 7 8 9 |
NAME ALLOCATION_UNIT_SIZE STATE TYPE TOTAL_MB FREE_MB PCT_FREE ------------------------------ -------------------- ----------- ------ ---------- ---------- ---------- FRA01 1048576 CONNECTED EXTERN 1024000 517938 50.5798828 DATA01 1048576 CONNECTED EXTERN 17408000 11416800 65.5836397 SQL> alter diskgroup DATA01 drop disk PROD_TEST_DATA01_79,PROD_TEST_DATA01_80,PROD_TEST_DATA01_81,PROD_TEST_DATA01_82,PROD_TEST_DATA01_83,PROD_TEST_DATA01_84,PROD_TEST_DATA01_85 REBALANCE POWER 11; Diskgroup altered. |
Wait till rebalnce completes.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
[root@SERVER11 ~]# /etc/init.d/oracleasm force-renamedisk PROD_TEST_DATA01_79 PROD_TEST_FRA01_06 Renaming disk "PROD_TEST_DATA01_79" to "PROD_TEST_FRA01_06": [ OK ] [root@SERVER11 ~]# /etc/init.d/oracleasm force-renamedisk PROD_TEST_DATA01_80 PROD_TEST_FRA01_07 Renaming disk "PROD_TEST_DATA01_80" to "PROD_TEST_FRA01_07": [ OK ] [root@SERVER11 ~]# /etc/init.d/oracleasm force-renamedisk PROD_TEST_DATA01_81 PROD_TEST_FRA01_08 Renaming disk "PROD_TEST_DATA01_81" to "PROD_TEST_FRA01_08": [ OK ] [root@SERVER11 ~]# /etc/init.d/oracleasm force-renamedisk PROD_TEST_DATA01_82 PROD_TEST_FRA01_09 Renaming disk "PROD_TEST_DATA01_82" to "PROD_TEST_FRA01_09": [ OK ] [root@SERVER11 ~]# /etc/init.d/oracleasm force-renamedisk PROD_TEST_DATA01_83 PROD_TEST_FRA01_10 Renaming disk "PROD_TEST_DATA01_83" to "PROD_TEST_FRA01_10": [ OK ] [root@SERVER11 ~]# /etc/init.d/oracleasm force-renamedisk PROD_TEST_DATA01_84 PROD_TEST_FRA01_11 Renaming disk "PROD_TEST_DATA01_84" to "PROD_TEST_FRA01_11": [ OK ] [root@SERVER11 ~]# /etc/init.d/oracleasm force-renamedisk PROD_TEST_DATA01_85 PROD_TEST_FRA01_12 Renaming disk "PROD_TEST_DATA01_85" to "PROD_TEST_FRA01_12": [ OK ] |
Please perform “ asm scan” command on other nodes which exists in the cluster :
1 2 3 4 5 |
[root@SERVER11 ~]# oracleasm scandisks Reloading disk partitions: done Cleaning any stale ASM disks... Scanning system for ASM disks... [root@SERVER11 ~]# |
Check Status on all nodes:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
BREAK ON report ON disk_group_name SKIP 1 set pagesize 50 set linesize 300 col DISK_GROUP_NAME for a20 col DISK_FILE_PATH for a50 col DISK_FILE_FAIL_GROUP for a40 col DISK_FILE_NAME for a25 SELECT NVL(a.name, '[CANDIDATE]') disk_group_name , b.path disk_file_path , b.name disk_file_name , b.failgroup disk_file_fail_group FROM v$asm_diskgroup a RIGHT OUTER JOIN v$asm_disk b USING (group_number) ORDER BY a.name; [CANDIDATE] ORCL:PROD_TEST_FRA01_06 ORCL:PROD_TEST_FRA01_12 ORCL:PROD_TEST_FRA01_07 ORCL:PROD_TEST_FRA01_08 ORCL:PROD_TEST_FRA01_10 ORCL:PROD_TEST_FRA01_09 ORCL:PROD_TEST_FRA01_11 |
1 2 3 4 5 6 7 8 |
ALTER DISKGROUP FRA01 ADD DISK 'ORCL:PROD_TEST_FRA01_06' name PROD_TEST_FRA01_06, 'ORCL:PROD_TEST_FRA01_07' name PROD_TEST_FRA01_07, 'ORCL:PROD_TEST_FRA01_08' name PROD_TEST_FRA01_08, 'ORCL:PROD_TEST_FRA01_09' name PROD_TEST_FRA01_09, 'ORCL:PROD_TEST_FRA01_10' name PROD_TEST_FRA01_10, 'ORCL:PROD_TEST_FRA01_11' name PROD_TEST_FRA01_11, 'ORCL:PROD_TEST_FRA01_12' name PROD_TEST_FRA01_12 rebalance power 11; |
1 2 3 4 5 6 |
After : NAME ALLOCATION_UNIT_SIZE STATE TYPE TOTAL_GB FREE_GB PCT_FREE ------------------------------ -------------------- ----------- ------ ---------- ---------- ---------- DATA01 1048576 MOUNTED EXTERN 15600 9744.18066 62.4626966 FRA01 1048576 MOUNTED EXTERN 2400 2056.50098 85.6875407 |
Note: Please test scripts in Non Prod before trying in Production.