Speed Up ASM Disk Movement From SAN To SAN..Or…”I Like To Move It, Move It!”

Sometimes in IT planning is just a bit off..So one day we found we ran out of speedy disks and it was cheaper to migrate (OK, OK, consolidate) the storage. In short: we needed to move a couple of databases to another SAN.

In order to have this done fairly quickly, one can follow these steps:

1) Let the storage manager present the new LUN  to the OS.

ls -l /dev/mapper/newDisk

2) Label the new disk with ASM:

# oracleasm createdisk NWDISK01 /dev/mapper/newDisk

3) Log into ASM with SQL:

$ rlwrap sqlplus / as sysasm

4) List the old disks in the disk-group:

SQL> col ASMDISK format A15;
SQL> col diskgroup format a15;
SQL> col PATH format a25;

SQL> SELECT SUBSTR(d.name,1,16) AS asmdisk, dg.name as diskgroup , d.path AS PATH FROM V$ASM_DISKGROUP dg, V$ASM_DISK d
WHERE dg.group_number = d.group_number and dg.name='FRADG'
order by asmdisk,diskgroup;

ASMDISK         DISKGROUP       PATH
--------------- --------------- -------------------------
FRAFPTST01      FRAFPSTDG       ORCL:FRAFPTST01

5) Add the new disk to the correct disk-group and drop the old one with one re-balance operation!

SQL> alter diskgroup FRADG add disk 'ORCL:NWDISK01' drop disk 'FRAFPTST01' rebalance power 11;

6) Monitor the progress:

SQL> select GROUP_NUMBER,OPERATION,STATE,POWER,ACTUAL,EST_MINUTES from v$asm_operation;

GROUP_NUMBER OPERA STAT      POWER     ACTUAL EST_MINUTES
------------ ----- ---- ---------- ---------- -----------
13 REBAL RUN          11         11           9

To “translate” the number to a name:

SQL> select name from v$asm_diskgroup where group_number=6;

Rinse and repeat until all disks-groups are done.

Some other commands which could be useful:

Adding disks:

SQL> alter DISKGROUP DATADG add disk '/dev/mapper/newDisk01;
SQL> alter DISKGROUP DATADG  add disk 'ORCL:NEWDISK';
SQL> alter diskgroup FRADG add disk 'ORCL:FRADISK_00','ORCL:FRADISK_01' drop disk 'OLDFRA01','OLDFRA02' rebalance power 11;

List all disks in all disk-groups:

SQL> SELECT SUBSTR(d.name,1,16) AS asmdisk, dg.name as diskgroup , d.path AS PATH FROM V$ASM_DISKGROUP dg, V$ASM_DISK d
WHERE dg.group_number = d.group_number
order by asmdisk,diskgroup;

Drop disk from disk-group:

SQL> alter DISKGROUP DATADG drop  disk DATA;

Drop disk-group (with only one disk remaining):

SQL> drop diskgroup DATADG;

Show status of disks in specific diskgroup:

 select path, free_mb,total_mb,state from v$asm_disk where group_number in (select group_number from v$asm_diskgroup where name='DATADG');

Update:

One day I managed to mess things up, and creating an imbalanced diskgroup..one can expect this, when adding a 1 GB disk with a diskgroup containing two other 1 TB disks..*sigh*.. This resulted in an imbalanced diskgroup, where the rebalance just kept failing with these error(s):

ERROR: ORA-15041 thrown in ARB0 for group number 4
Errors in file /oracle/11.2.0.4/base/diag/asm/+asm/+ASM1/trace/+ASM1_arb0_5309.trc:
ORA-15041: diskgroup "DATA" space exhausted

To get out of this predicament, I checked which disk was the “exhausted” one, and dropped this disk:

SQL> select failgroup,total_mb,FREE_MB from v$asm_disk where group_number = (select GROUP_NUMBER from v$asm_diskgroup where NAME='DATA');

FAILGROUP TOTAL_MB FREE_MB
------------------------------ ---------- ----------
DATA04     1048576   899756
DATA06     1024      0
DATA05     1048576   900088

SQL> alter diskgroup data drop disk 'DATA06' rebalance power 11;

Since emptying the disk is the opposite of filling it up, this actually did work..and I could swap in a 1 TB disk as was intended in the first place..

Advertisements

About GemsOfProgramming

Beeing a previously enthusiastic Java programmer, I rolled into the Oracle Database Administration world. It turned out I got a knack for this, and since approx. 2000 I'm a full time DBA. My experiences touches lot of Oracle products like Forms and Reports 9/10, JDAPI, Application Server, Weblogic Fusion and of course: Oracle Enterprise Databases, JavaFX, Swing and other Java components.
This entry was posted in ASM, Technical Stuff. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s