How to free space from an ASM diskgroup? (Doc ID 1553744.1)

rongshiyuan發表於2015-02-27

How to free space from an ASM diskgroup? (Doc ID 1553744.1)


Applies to:

Oracle Database - Enterprise Edition - Version 11.1.0.7 to 12.1.0.1 [Release 11.1 to 12.1]
Information in this document applies to any platform.

Symptoms

You need to take free space from an ASM diskgroup and move it to another host or another diskgroup on the same host. All of the disks are currently used.

Cause

You have allocated LUNs for a DISKGROUP but have not used all the space in that diskgroup and would like to move some of the space to another host or another diskgroup on the same server.

Example:

Disk Group            Sector   Block   Allocation
Name                    Size    Size    Unit Size State       Type   Total Size (MB) Used Size (MB) Pct. Used
-------------------- ------- ------- ------------ ----------- ------ --------------- -------------- ---------
DATADG_02               512   4,096    1,048,576 MOUNTED     EXTERN       3,112,780      1,446,038     46.45
FRADG_02                512   4,096    1,048,576 MOUNTED     EXTERN         344,001         18,006      5.23
                                                                    --------------- --------------
Grand Total:                                                               3,456,781      1,464,044

 
How can you reorganize data to clear out some luns to move them ?

NAME               PATH                   GROUP_NUMBER      OS_MB   TOTAL_MB    FREE_MB
------------------ ---------------------- ------------ ---------- ---------- ----------
DATADG_02_0000     /dev/rdsk/emcpower89g             1     155639     155639      83343
DATADG_02_0001     /dev/rdsk/emcpower90g             1     155639     155639      83329
DATADG_02_0002     /dev/rdsk/emcpower91g             1     155639     155639      83323
DATADG_02_0003     /dev/rdsk/emcpower92g             1     155639     155639      83331
DATADG_02_0004     /dev/rdsk/emcpower93g             1     155639     155639      83340
DATADG_02_0005     /dev/rdsk/emcpower94g             1     155639     155639      83343
DATADG_02_0006     /dev/rdsk/emcpower95g             1     155639     155639      83334
DATADG_02_0007     /dev/rdsk/emcpower96g             1     155639     155639      83341
DATADG_02_0008     /dev/rdsk/emcpower97g             1     155639     155639      83338
DATADG_02_0009     /dev/rdsk/emcpower98g             1     155639     155639      83341
DATADG_02_0010     /dev/rdsk/emcpower87g             1     155639     155639      83336

NAME               PATH                   GROUP_NUMBER      OS_MB   TOTAL_MB    FREE_MB
------------------ ---------------------- ------------ ---------- ---------- ----------
DATADG_02_0011     /dev/rdsk/emcpower79g             1     155639     155639      83344
DATADG_02_0012     /dev/rdsk/emcpower78g             1     155639     155639      83342
DATADG_02_0013     /dev/rdsk/emcpower77g             1     155639     155639      83320
DATADG_02_0014     /dev/rdsk/emcpower76g             1     155639     155639      83326
DATADG_02_0015     /dev/rdsk/emcpower75g             1     155639     155639      83352
DATADG_02_0016     /dev/rdsk/emcpower74g             1     155639     155639      83345
DATADG_02_0017     /dev/rdsk/emcpower73g             1     155639     155639      83333
DATADG_02_0018     /dev/rdsk/emcpower72g             1     155639     155639      83340
DATADG_02_0019     /dev/rdsk/emcpower88g             1     155639     155639      83341

 

Solution

ASM load balances file activity by uniformly distributing file extents across all disks in a diskgroup.
If you try to downsize a physical LUN and there is Oracle data in that section of the LUN, that will truncate the diskgroup and files inside, causing corruption of an asm diskgroup.
That is why do not downsize a physical LUN.

Dropping an oracle ASM disk and releasing underlying LUNs after rebalance went through is the correct approach to downsize free space in a diskgroup.
Keep in mind to at least leave 10% of free space in each asm disk, otherwise you will get ORA-15041 upon rebalance.


ASM automatically rebalances whenever disks are added or dropped.

For a normal drop operation (without the FORCE option), a disk is not released from a disk group until data is moved off of the disk through rebalancing.
Likewise, a newly added disk cannot support its share of the I/O workload until rebalancing completes.
It is more efficient to add or drop multiple disks at the same time so that they are rebalanced as a single operation. This avoids unnecessary movement of data.
For a drop operation, when rebalance is complete, ASM takes the disk offline momentarily, and then drops it, setting disk header status to FORMER.

You can add or drop disks without shutting down the database. However, a performance impact on I/O activity may result.

To drop disks from a disk group, use the DROP DISK clause of the ALTER DISKGROUP statement.

When a disk is dropped, the disk group is rebalanced by moving all of the file extents from the dropped disk to other disks in the disk group.
A drop disk operation may fail if not enough free space is available on the other disks. If you intend to add some disks and drop others, it is prudent to add disks first to ensure that enough space is available for the drop operation.

The best approach is to perform both the add and drop with the same ALTER DISKGROUP statement. This can reduce total time spent rebalancing.

 

Below are detailed steps how to drop an oracle ASM disk.

This example drops DATA3 from diskgroup dgroup1.

ALTER DISKGROUP dgroup1 DROP DISK DATA3;

 
Where 'DATA3' is column 'NAME' from v$asm_disk.

When ASMLIB is used, "/etc/init.d/oracleasm querydisk"  will tell you if you are using correct alias for the drop command.  If it comes as 'Marked as ASM disk' then you are using the right alias name for drop.

The main thing after you issue DROP command, is to make sure rebalance completes.

Rebalance will happen automatically if there is a need. If you add/drop/resize a disk rebalance will take place, there is no need to start rebalance manually.
When you add/drop/resize you can specify rebalance power manually. Power can be 0-11.  0 is stopped, 11 is fastest.
It will put more load on the system, and slow down access to the DG. Power 7 will be faster than 4 and will provide balance between DG vs. rebalance speed.
RBAL background process opens all device files as part of discovery and coordinates the rebalance activity.

The main objective of the rebalance operation is always to provide an even distribution of file extents and space usage across all disks in the diskgroup.
The rebalance is done on a per-file basis to ensure that each file is evenly balanced across all disks. This is critical to ASM's assurance of balanced I/O load.

Is the rebalance still performing the movement of extents?


If yes, you can watch the movement with the following query:

select sofar "AUs moved So Far", est_work "Aprox AU's to be moved"
from v$asm_operation
where group_number = *** disk group number ***;

 

IMPORTANT: DO NOT inadvertently remove the disk unit physically from the storage array BEFORE it is completely dropped from the diskgroup.

When a disk is dropped, it is not immediately expelled from the diskgroup. Verify that the HEADER_STATUS from the V$ASM_DISK view shows FORMER status, not DROPPING.
Additionally, check to make sure that the rebalance operation from the DROP DISK is completed.

Disks that belong to a disk group, that is, disks that have a disk group name in the disk header, show a header status of MEMBER.
Disks that were discovered, but that have not yet been assigned to a disk group, have a status of either CANDIDATE or PROVISIONED.
Disks that previously belonged to a disk group and were dropped cleanly from the disk group have a status of FORMER.

For IGNORED disks, it means there may be some duplicate disk paths pointing to the same physical disk.
To fix this, we need to remove the duplicate disk paths or revoke the access to the duplicate disk paths. ASM should only see one disk path for each physical device.

References

NOTE:270066.1 - Manage ASM instance-creating diskgroup,adding/dropping/resizing disks.
NOTE:265633.1 - ASM Technical Best Practices For 10g and 11gR1 Release
NOTE:402526.1 - Asm Devices Are Still Held Open After Dismount or Drop
NOTE:1306574.1 - ASM 11.2.0.2 Is Not Releasing File Descriptors After Drop or Dismount Diskgroup.
 

Document Details

 
Rate this document Email link to this documentOpen document in new windowPrintable Page
Type:
Status:
Last Major Update:
Last Update:
PROBLEM
PUBLISHED
04-Jun-2014
04-Jun-2014
     
 

Related Products

 
Oracle Database - Enterprise Edition
     
 

Document References

 
     
 

Recently Viewed

 
     





來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/17252115/viewspace-1442647/,如需轉載,請註明出處,否則將追究法律責任。

相關文章