Sunday, January 10, 2010

ASM Adding and Removing Disks

Had been using ASM quite a long time and once such maintenance that keeps me busy these days are to replace some of the disk that are used by ASM.
To do so some disks has to be removed from the existing diskgroup and use the newly added disks.

Steps Involved
Step 1: Add the new devices to the hardware
Step 2: Update the asm_diskstring with the new device path
Step 3: Add the new devices to the existing diskgroup.
alter diskgroup dg1 add disk '/dev/newdisk1','/dev/newdisk2','/dev/newdisk3';
Step 4: Wait for ASM to rebalance the data.
this process will redistribute the data onto the new storage but not 100%
Step 5: Remove the old devices from ASM
alter diskgroup dg1 drop disk '/dev/olddisk1','/dev/olddisk2','/dev/olddisk3';
Step 6: Wait for ASM to rebalance the data.
this process will redistribute the data onto the new storage 100%

The above process can be still made quicker
Alternate to this you can avoid step 4 by running the alter diskgroup to add and drop the disk in one command. ASM will take care of it internally.

Example:
alter diskgroup dg1 add disk '/dev/newdisk1','/dev/newdisk2','/dev/newdisk3' drop disk '/dev/olddisk1','/dev/olddisk2','/dev/olddisk3';

Then you have to wait for one rebalance. This second alternate is a much quicker approach.
Additional tip to speed up the rebalance is to alter the power of the diskgroup.

I hope this helps people involved in disk management with ASM and Oracle.

Popular Posts