ASM - Migrate Disks

In this example we migrate from one set of disks to another within the ORADATA2 diskgroup on AIX...

FROM: hdisk69 (asm69), hdisk70 (asm70), hdisk103 (asm103), hdisk104 (asm104), and hdisk105 (asm105)

TO: hdisk20 (asm20), hdisk21 (asm21), hdisk22 (asm22), hdisk23 ( asm23), and hdisk24 (asm24).

We are using hard links so that, for example, hdisk20 and asm20 reference the same disk.The instructions on this page assume you have created the scripts in /u01/dba/asm as described on the main ASM page here
@/u01/dba/asm/asm_disksDisk Group Name Path File Name Fail Group File Size (MB) Used Size (MB) Pct. Used-------------------- ----------------- -------------------- -------------------- -------------- -------------- ---------ORADATA2 /dev/asm69 ORADATA2_0000 ORADATA2_0000 102,400 52,119 50.90 /dev/asm70 ORADATA2_0001 ORADATA2_0001 102,400 51,781 50.57 /dev/asm103 ORADATA2_0002 ORADATA2_0002 102,400 51,784 50.57 /dev/asm104 ORADATA2_0003 ORADATA2_0003 102,400 52,110 50.89 /dev/asm105 ORADATA2_0004 ORADATA2_0004 117,132 60,070 51.28******************** -------------- -------------- 526,732 267,864 ORARECO1 /dev/rhdisk26 ORARECO1_0000 CONTROLLERA 69,494 840 1.21 /dev/rhdisk29 ORARECO1_0003 CONTROLLERB 69,494 843 1.21******************** -------------- -------------- 138,988 1,683 -------------- --------------Grand Total: 665,720 269,547

Hard Links (Common Names) for New Disks

All commands executed as 'root'...

Determine Major/Minor numbers of new disks

for disk in hdisk20 hdisk21 hdisk22 hdisk23 hdisk24

do

ls -alF /dev/r${disk}| \

tr ',' ' ' | \

awk '{ print " Major: " $5 " Minor: "$6 }'|\

while read line

do

echo "${disk} ${line}"

done

done

hdisk20 Major: 44 Minor: 26hdisk21 Major: 44 Minor: 27hdisk22 Major: 44 Minor: 28hdisk23 Major: 44 Minor: 29hdisk24 Major: 44 Minor: 30

Make Common Name

mknod /dev/asm20 c 44 26

mknod /dev/asm21 c 44 27

mknod /dev/asm22 c 44 28

mknod /dev/asm23 c 44 29

mknod /dev/asm24 c 44 30

Set Ownership

chown oracle:dba /dev/asm20

chown oracle:dba /dev/asm21

chown oracle:dba /dev/asm22

chown oracle:dba /dev/asm23

chown oracle:dba /dev/asm24

Set Permissions

chmod 640 /dev/asm20

chmod 640 /dev/asm21

chmod 640 /dev/asm22

chmod 640 /dev/asm23

chmod 640 /dev/asm24

Check

ls -alF /dev | grep "44, 26"

ls -alF /dev | grep "44, 27"

ls -alF /dev | grep "44, 28"

ls -alF /dev | grep "44, 29"

ls -alF /dev | grep "44, 30"

On AIX you would expect three device files for each major/minor number combination e.g. asm20, hdisk20 and rhdisk20
@/u01/dba/asm/asm_disksDisk Group Name Path File Name Fail Group File Size (MB) Used Size (MB) Pct. Used-------------------- ----------------- -------------------- -------------------- -------------- -------------- ---------ORADATA2 /dev/asm69 ORADATA2_0000 ORADATA2_0000 102,400 52,119 50.90 /dev/asm70 ORADATA2_0001 ORADATA2_0001 102,400 51,781 50.57 /dev/asm103 ORADATA2_0002 ORADATA2_0002 102,400 51,784 50.57 /dev/asm104 ORADATA2_0003 ORADATA2_0003 102,400 52,110 50.89 /dev/asm105 ORADATA2_0004 ORADATA2_0004 117,132 60,070 51.28******************** -------------- -------------- 526,732 267,864 ORARECO1 /dev/rhdisk26 ORARECO1_0000 CONTROLLERA 69,494 840 1.21 /dev/rhdisk29 ORARECO1_0003 CONTROLLERB 69,494 843 1.21******************** -------------- -------------- 138,988 1,683 [CANDIDATE] /dev/asm24 76,860 76,860 100.00 /dev/asm20 102,400 102,400 100.00 /dev/asm21 102,400 102,400 100.00 /dev/asm22 102,400 102,400 100.00 /dev/asm23 102,400 102,400 100.00******************** -------------- -------------- 486,460 486,460 -------------- --------------Grand Total: 1,152,180 756,007

Add Candidate Disks to Diskgroup

ALTER DISKGROUP oradata2 ADD DISK '/dev/asm20','/dev/asm21','/dev/asm22','/dev/asm23','/dev/asm24';

@/u01/dba/asm/asm_disksDisk Group Name Path File Name Fail Group File Size (MB) Used Size (MB) Pct. Used-------------------- ----------------- -------------------- -------------------- -------------- -------------- ---------ORADATA2 /dev/asm69 ORADATA2_0000 ORADATA2_0000 102,400 52,067 50.85 /dev/asm70 ORADATA2_0001 ORADATA2_0001 102,400 51,732 50.52 /dev/asm103 ORADATA2_0002 ORADATA2_0002 102,400 51,738 50.53 /dev/asm104 ORADATA2_0003 ORADATA2_0003 102,400 52,056 50.84 /dev/asm105 ORADATA2_0004 ORADATA2_0004 117,132 60,011 51.23 /dev/asm20 ORADATA2_0005 ORADATA2_0005 102,400 57 .06 /dev/asm21 ORADATA2_0006 ORADATA2_0006 102,400 56 .05 /dev/asm22 ORADATA2_0007 ORADATA2_0007 102,400 57 .06 /dev/asm23 ORADATA2_0008 ORADATA2_0008 102,400 57 .06 /dev/asm24 ORADATA2_0009 ORADATA2_0009 76,860 43 .06******************** -------------- -------------- 1,013,192 267,874 ORARECO1 /dev/rhdisk26 ORARECO1_0000 CONTROLLERA 69,494 840 1.21 /dev/rhdisk29 ORARECO1_0003 CONTROLLERB 69,494 843 1.21******************** -------------- -------------- 138,988 1,683 -------------- --------------Grand Total: 1,152,180 269,557

Drop Old Disks from Diskgroup

ALTER DISKGROUP oradata2 DROP DISK ORADATA2_0000, ORADATA2_0001, ORADATA2_0002, ORADATA2_0003, ORADATA2_0004;

Remember that disks won't drop until rebalance is complete.

@/u01/dba/asm/ops

GROUP_NUMBER OPERA STAT POWER ACTUAL SOFAR EST_WORK EST_RATE EST_MINUTES------------ ----- ---- ---------- ---------- ---------- ---------- ---------- ----------- 1 REBAL RUN 1 1 10347 129415 883 134

Remember you can change the rebalance power (at the risk of impacting database performance) using...

ALTER DISKGROUP oradata2 REBALANCE POWER 6;

Where power is a number from 0 (stop) to 11 (fastest)

Remove disks from OS

All commands executed as 'root'...

rmdev -dl hdisk69

rmdev -dl hdisk70

rmdev -dl hdisk103

rmdev -dl hdisk104

rmdev -dl hdisk105