One of the big selling points of ASM is the ability to reconfigure the storage online.
This is basically achievable because ASM distributes data across all disks in a disk group evenly, and assuming you have enough space, you can happily drop disks in a disk group and ASM will seamlessly migrate the data to the existing disks in the disk group.
First your ASM Diskgroup Name:-
SQL> SELECT name, type, total_mb, free_mb, required_mirror_free_mb, usable_file_mb FROM V$ASM_DISKGROUP;
NAME TYPE TOTAL_MB FREE_MB REQUIRED_MIRROR_FREE_MB USABLE_FILE_MB
—————————— —— ———- ———- ———————– ————–
DATA EXTERN 7168000 7167858 0 7167858
FRA EXTERN 512000 511222 0 511222
NAME TYPE TOTAL_MB FREE_MB REQUIRED_MIRROR_FREE_MB USABLE_FILE_MB
—————————— —— ———- ———- ———————– ————–
DATA EXTERN 7168000 7167858 0 7167858
FRA EXTERN 512000 511222 0 511222
First UN-mount All Disk Group:-
sql> alter diskgroup data dismount;
Drop Disk group:-
SQL> DROP DISKGROUP data;
sql> alter diskgroup data dismount;
Drop Disk group:-
SQL> DROP DISKGROUP data;
If the ASM Diskgroup has files in it, use this version:
GROUP_NUMBER NAME TOTAL_MB FREE_MB ------------ ---------------- ---------- ---------- 1 VOL1 61439 61187 2 VOL2 61439 61164 3 VOL3 61439 61164 4 VOL4 409594 310962 4 VOL5 153597 95240 So, we see here that VOL4 and VOL5 are two disks (luns) in disk group 4. Previously I had expanded VOL4 and this now has enough capacity to encompass all the data resident on this disk group. I am now safe to drop VOL5 and this is an online operation:
This alter diskgroup command essentially shuffles extents from the disk you are removing and distributes them to the remaining disks in your disk group. While the operation is continuing you can check V$ASM_OPERATION for the progress you are making:
GROUP_NUMBER OPERA STAT POWER ACTUAL SOFAR EST_WORK EST_RATE EST_MINUTES ------------ ----- ---- ----- ----- ------ ------- ---------- ---------- 4 REBAL RUN 1 1 100 42234 1007 41 Most of the columns here are self explanatory, however the SOFAR column tells you the number of Allocation Units (au) that have been moved, the EST_WORK and EST_RATE are also in au and au/minute.
Once the rebalance has moved all the Allocation Units the disk is removed from the disk group:
SQL> DROP DISKGROUP data including contents;
SQL> DROP DISKGROUP data FORCE INCLUDING CONTENTS;
Dropping a disk in an ASM Disk Group
SQL> select group_number, name, TOTAL_MB, FREE_MB
from V$asm_disk_stat;
GROUP_NUMBER NAME TOTAL_MB FREE_MB ------------ ---------------- ---------- ---------- 1 VOL1 61439 61187 2 VOL2 61439 61164 3 VOL3 61439 61164 4 VOL4 409594 310962 4 VOL5 153597 95240 So, we see here that VOL4 and VOL5 are two disks (luns) in disk group 4. Previously I had expanded VOL4 and this now has enough capacity to encompass all the data resident on this disk group. I am now safe to drop VOL5 and this is an online operation:
SQL> alter diskgroup DATA4 drop disk VOL5;
Diskgroup altered.
This alter diskgroup command essentially shuffles extents from the disk you are removing and distributes them to the remaining disks in your disk group. While the operation is continuing you can check V$ASM_OPERATION for the progress you are making:
SQL> select * from v$asm_operation;
GROUP_NUMBER OPERA STAT POWER ACTUAL SOFAR EST_WORK EST_RATE EST_MINUTES ------------ ----- ---- ----- ----- ------ ------- ---------- ---------- 4 REBAL RUN 1 1 100 42234 1007 41 Most of the columns here are self explanatory, however the SOFAR column tells you the number of Allocation Units (au) that have been moved, the EST_WORK and EST_RATE are also in au and au/minute.
Once the rebalance has moved all the Allocation Units the disk is removed from the disk group:
SQL> select group_number, name, TOTAL_MB, FREE_MB
from V$asm_disk_stat;
GROUP_NUMBER NAME TOTAL_MB FREE_MB
------------ ---------------- ---------- ----------
1 VOL1 61439 61187
2 VOL2 61439 61164
3 VOL3 61439 61164
4 VOL4 409594 252006
Dropping a disk in a disk group seemed to work as advertised, the
real benefit of course, is instead of it being just a disk you were
dropping but that it was a lun representing a whole storage array, then
this has real potential for allowing you to upgrade storage or even
migrate to a different storage platform entirely.
No comments:
Post a Comment