Home > Workload Solutions > Oracle > White Papers > Dell PowerMax 2500 and 8500 Best Practices for Mission Critical Oracle Databases > ASM and storage reclamation
When database files are deleted, ASM can immediately make use of the deleted space. However, the storage extents holding the deleted data remain allocated in PowerMax. To reclaim the capacity, take one of the following steps:
While these options are valid, they all require that the device is first removed from the ASM disk group. If the ASM disk group has many other files that have not been deleted, such an operation may not be possible.
Oracle ASM Filter Driver online storage reclamation reclaims storage capacity of deleted database files without having to remove the volumes from ASM and while the ASM disk group remains online and active.
Oracle ASM Filter Driver (AFD) is a kernel module that resides in the I/O path of the Oracle ASM disks. It is available as a Grid Infrastructure 12c. AFD is not compatible with ASMlib and is not supported on all combinations of Linux kernels and Oracle releases.
AFD has many advantages over ASM, such as:
The protection is disabled only when the AFD labels are removed from the disks. In other words, AFD is no longer managing these disks.
ASM is efficient in reusing deleted space. For example, if datafiles are deleted and new files are created, ASM will reuse the same storage space that the deleted files occupied. However, if large datasets are removed, such as when whole databases or large tablespaces are deleted, by using AFD online storage reclamation the storage capacity is freed and made available to other applications.
During AFD storage reclamation, ASM first performs a manual rebalance, which defrags (compacts) the ASM disk group extents. When this operation is completed, the disk group high-water mark is updated. AFD then sends SCSI unmap commands to the storage system to free extents above the new high-water mark of the disk group. The reclamation is efficient and fast.
To use AFD online storage reclamation:
ALTER DISKGROUP <NAME> SET ATTRIBUTE ’THIN_PROVISIONED’=’TRUE’;
ALTER DISKGROUP <NAME> REBALANCE WAIT;
The WAIT flag is optional in a scenario where the DBA requires a returned prompt only after the operation is complete.
In the following example, a 100 GB tablespace and datafile are added to an empty ASM Filter Driver disk group with the THIN attribute, and then deleted. Following that, an ASM rebalance is performed. The full details of the example are in Appendix 3. AFD online storage reclamation example. The following table summarizes the test results:
Step | PowerMax SG used capacity (GB) |
Before adding 100 GB tablespace | 0.1 |
After adding 100 GB tablespace and datafile | 100.0 |
After deleting 100 GB tablespace and datafile | 100.0 |
After ASM disk group rebalance | 0.1 |
Before the tablespace is created, the SG capacity only shows 0.1 GB due to the efficiency of ASM metadata. After a 100 GB tablespace and datafile are created, the SG capacity shows 100 GB, as expected. When the tablespace and datafile are deleted, the ASM disk group capacity reflects the change. However, the storage does not recognize this change and continues to display a 100 GB of capacity consumed in the SG. During the ASM disk group rebalance, AFD sends SCSI unmap requests to the PowerMax storage system to reclaim the deleted capacity. After the rebalance, PowerMax shows that only 0.1 GB is consumed in the SG.