Steps to Migrate ASM Diskgroups to Another SAN/Disk-Array/DAS/Etc without Downtime
In that blog I will show how to migrate ASM diskgroup from one storage to another storage online without any downtime. In that example I will migrate an ASM diskgroup DATA_0001 which reside in disk device /dev/sda3 to a newly created ASM diskgroup DATA_0002 that reside on disk device /dev/sda4.
[root@testdb1 ~]# /etc/init.d/oracleasm listdisks
DATA_0001
[root@testdb1 ~]# /etc/init.d/oracleasm querydisk -d DATA_0001
Disk "DATA_0001" is a valid ASM disk on device /dev/sda3[8,3]
Create ASM disk on disk device /dev/sda4
[root@testdb1 ~]# /etc/init.d/oracleasm createdisk DATA_0002 /dev/sda4
Marking disk "DATA_0002" as an ASM disk: [ OK ]
Make sure that the new disks are being detected by ASM
[grid@testdb1 ~]$ sqlplus / as sysasm
SQL> 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;
SQL> select path from v$asm_disk;
PATH
--------------------------------------------------------------------------------
ORCL:DATA_0002
ORCL:DATA_0001
Add the new disks to your desired diskgroup
SQL> alter diskgroup DATA add disk
‘ORCL:DATA_0002’ rebalance power 11;
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
Finally, remove the old disks
SQL> alter diskgroup DATA drop disk
DATA_0001 rebalance power 11;
Diskgroup altered
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
Alternatively, we can execute add disk & drop disk statements in one operation, in that way only one rebalance operation will be started as follow
SQL> alter diskgroup DATA add disk
‘ORCL:DATA_0002’
drop disk
DATA_0001 rebalance power 11;
SQL>
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;
Delete the old disk from ASM
[root@testdb1 ~]# /etc/init.d/oracleasm deletedisk DATA_0001
Removing ASM disk "DATA_0001": [ OK ]
[grid@testdb1 ~]$ sqlplus / as sysasm
SQL> 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;
For more information please check Oracle Support Doc ID 1918350.1