The post explains in detail the exact steps to migrate ASM diskgroups from one storage to another storage without a downtime. This procedure will also work for diskgroups hosting OCR and Votefiles and ASM spfile.
If your plans are replacing the current disks associated to your diskgroups with a new storage, this operation can be accomplished without any downtime, so you can follow the next steps
Add the new asm_diskstring
1. Backup all your databases and valid the backup (always required to protect your data).
2. Add the new path (new disks from the new storage) to your asm_diskstring to be recognized by ASM:
For Example:
SQL> alter system set asm_diskstring = '/dev/emcpowerc*' , '/dev/emcpowerh*';
Where,
‘/dev/emcpowerc*‘ are the current disks.
‘/dev/emcpowerh*‘ are the new disks.
Here, we have taken an example of EMC powerpath devices. You could have device from Veritas VxDMP as well or any other multipath software. Change the asm_diskstring accordingly.
Verify if the new disks are visible
1. Confirm that the new disks are being detected by ASM using the below command.
SQL> select path from v$asm_disk;
2. Validate all the new disks as described in the below post.
Add the disks to the Disk Group
1. Add the new disks to your desired diskgroup. The query syntax to add new disks to the diskgroup is as follows:
SQL> alter diskgroup [diskgroup name] add disk '[new disk 1]', '[new disk 2]', . . . '[new disk N]' rebalance power N;
2. Then wait until the rebalance operation completes:
SQL> select * from v$asm_operation; no rows selected
SQL> select * from gv$asm_operation; no rows selected
Remove the old disks
1. Finally, you can remove the old disks from the disk group. The query syntax to remove the old disks is as follows:
SQL> alter diskgroup [diskgroup name] drop disk [disk name A], [disk name B], . . . [disk name N] rebalance power X;
2. Then wait until the rebalance operation completes:
SQL> select * from v$asm_operation; no rows selected
SQL> select * from gv$asm_operation; no rows selected
3. Done, your ASM diskgroups and database have been migrated to the new storage.
Executing Add and delete operations together
Alternatively, we can execute add disk & drop disk statements in one operation, in that way only one rebalance operation will be started as follow:
Syntax
SQL> alter diskgroup [diskgroup name] add disk '[new device physical name 1]', ..., '[new device physical name N]' drop disk [old disk logical name 1], ..., [old disk logical name N] rebalance power N;
This is more efficient than separated commands (add disk & drop disk statements). Then wait until the rebalance operation completes:
SQL> select * from v$asm_operation; no rows selected
SQL> select * from gv$asm_operation; no rows selected
Notes
– Disk from the old storage are finally expelled from the diskgroup(s) once the rebalance operation (from the drop operation) completes and when HEADER_STATUS = FORMER is reported thru the v$asm_disk view.
– On 10g, a manual rebalance operation is required to restart the diskgroup rebalance and expel the disk(s) because on 10g (if something wrong happens on disk expelling, e.g. hanging) ASM will not restart the ASM rebalance automatically (this was already enhanced on 11g and 12c), therefore you will need to restart a manual rebalance operation as follows:
SQL> alter diskgrouprebalance power 11;