Exact Steps To Migrate ASM Diskgroups To Another SAN Without Downtime

posted Mar 8, 2011, 11:25 AM by Sachchida Ojha
Here are the various steps required to  migrate ASM diskgroups from one SAN to another SAN without a downtime.

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

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_disktring to be recognized by ASM:

SQL> alter system set asm_disktring = '/dev/rhdisk*' , '/dev/rhdisknew*';

Where: '/dev/rhdisk*' are the current disks.
Where: '/dev/rhdisknew*' are the new disks.


3) Confirm that the new disks are being detected by ASM:

SQL> select path from v$asm_disk;

4) Add the new disks to your desired diskgroup:

SQL> alter diskgroup <diskgroup name> add disk
‘<new disk 1>’,
‘<new disk 2>’,
‘<new disk 3>’,
‘<new disk 4>’,
.
.
.
‘<new disk N>’ rebalance power <#>;

5) Then wait until the rebalance operation completes:

SQL> select * from v$asm_operation;
SQL> select * from gv$asm_operation;

6) Finally, remove the old disks:

SQL> alter diskgroup <diskgroup name> drop disk
<disk name A>,
<disk name B>,
<disk name D>,
<disk name E>,
.
.
.
<disk name X>  rebalance power <#>;

7) Then wait until the rebalance operation completes:

SQL> select * from v$asm_operation;
SQL> select * from gv$asm_operation;


8) Done, your ASM diskgroups and database have been migrated to the new storage.

Note: 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 <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 2>, ..,<old disk logical name N>
rebalance power <#>;

This is more efficient than separated commands (add disk & drop disk statements).

select path from v$asm_disk;

select * from v$asm_operation;

select * from V$ASM_CLIENT;


SQL> select path from v$asm_disk;

PATH
--------------------------------------------------------------------------------

/dev/rhdisk10
/dev/rhdisk11
/dev/rhdisk12
/dev/rhdisk13
/dev/rhdisk14
/dev/rhdisk15
/dev/rhdisk16
/dev/rhdisk17
/dev/rhdisk18
/dev/rhdisk19

PATH
--------------------------------------------------------------------------------
/dev/rhdisk20
/dev/rhdisk21
/dev/rhdisk22
/dev/rhdisk23
/dev/rhdisk24
/dev/rhdisk5
/dev/rhdisk6
/dev/rhdisk7
/dev/rhdisk8
/dev/rhdisk9

21 rows selected.

SQL> show parameter asm_disktring;
SQL> select * from v$asm_operation;

no rows selected

SQL> select * from V$ASM_CLIENT;

GROUP_NUMBER INSTANCE_NAME
------------ ----------------------------------------------------------------
DB_NAME  STATUS
-------- ------------
SOFTWARE_VERSION
------------------------------------------------------------
COMPATIBLE_VERSION
------------------------------------------------------------
           1 TXQADB2
TXQADB2  CONNECTED
11.2.0.1.0
10.2.0.4.0


GROUP_NUMBER INSTANCE_NAME
------------ ----------------------------------------------------------------
DB_NAME  STATUS
-------- ------------
SOFTWARE_VERSION
------------------------------------------------------------
COMPATIBLE_VERSION
------------------------------------------------------------
           1 TXQADB3
TXQADB3  CONNECTED
11.2.0.1.0
10.2.0.4.0


GROUP_NUMBER INSTANCE_NAME
------------ ----------------------------------------------------------------
DB_NAME  STATUS
-------- ------------
SOFTWARE_VERSION
------------------------------------------------------------
COMPATIBLE_VERSION
------------------------------------------------------------
           2 TXQADB3
TXQADB3  CONNECTED
11.2.0.1.0
10.2.0.4.0


GROUP_NUMBER INSTANCE_NAME
------------ ----------------------------------------------------------------
DB_NAME  STATUS
-------- ------------
SOFTWARE_VERSION
------------------------------------------------------------
COMPATIBLE_VERSION
------------------------------------------------------------
           1 TXQADB4
TXQADB4  CONNECTED
11.2.0.1.0
10.2.0.4.0


GROUP_NUMBER INSTANCE_NAME
------------ ----------------------------------------------------------------
DB_NAME  STATUS
-------- ------------
SOFTWARE_VERSION
------------------------------------------------------------
COMPATIBLE_VERSION
------------------------------------------------------------
           2 TXQADB4
TXQADB4  CONNECTED
11.2.0.1.0
10.2.0.4.0


GROUP_NUMBER INSTANCE_NAME
------------ ----------------------------------------------------------------
DB_NAME  STATUS
-------- ------------
SOFTWARE_VERSION
------------------------------------------------------------
COMPATIBLE_VERSION
------------------------------------------------------------
           1 TXQADB5
TXQADB5  CONNECTED
11.2.0.1.0
10.2.0.3.0


GROUP_NUMBER INSTANCE_NAME
------------ ----------------------------------------------------------------
DB_NAME  STATUS
-------- ------------
SOFTWARE_VERSION
------------------------------------------------------------
COMPATIBLE_VERSION
------------------------------------------------------------
           2 TXQADB5
TXQADB5  CONNECTED
11.2.0.1.0
10.2.0.3.0


GROUP_NUMBER INSTANCE_NAME
------------ ----------------------------------------------------------------
DB_NAME  STATUS
-------- ------------
SOFTWARE_VERSION
------------------------------------------------------------
COMPATIBLE_VERSION
------------------------------------------------------------
           1 STGRPTDB
STGRPTDB CONNECTED
11.2.0.1.0
11.0.0.0.0


8 rows selected.

SQL> show parameter ASM_DISKGROUPS;

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
asm_diskgroups                       string      DEV_DATA, QA_FLASH
SQL> show parameter ASM_DISKSTRING;

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
asm_diskstring                       string      /dev/rhdisk*


ASM_DISKSTRING

Property Description
Parameter type String
Syntax ASM_DISKSTRING = discovery_string [, discovery_string ] ...
Default value The null string; Automatic Storage Management discovery finds all disks in an operating system-specific location to which the Automatic Storage Management instance has read/write access.
Modifiable ALTER SYSTEM
Real Application Clusters Multiple instances can have different values. Different nodes might see the same disks under different names; however, each instance must be able to use its ASM_DISKSTRING to discover the same physical media as the other nodes in the cluster.

Note:

This parameter may only be specified in an Automatic Storage Management instance.

ASM_DISKSTRING specifies an operating system-dependent value used by Automatic Storage Management to limit the set of disks considered for discovery. When a new disk is added to a disk group, each Automatic Storage Management instance that has the disk group mounted must be able to discover the new disk using the value of ASM_DISKSTRING.

In most cases, the default value will be sufficient. Using a more restrictive value may reduce the time required for Automatic Storage Management to perform discovery, and thus improve disk group mount time or the time for adding a disk to a disk group. A "?" at the beginning of the string gets expanded to the Oracle home directory. Depending on the operating system, wildcard characters can be used. It may be necessary to dynamically change ASM_DISKSTRING before adding a disk so that the new disk will be discovered.

An attempt to dynamically modify ASM_DISKSTRING will be rejected and the old value retained if the new value cannot be used to discover a disk that is in a disk group that is already mounted.


Comments