Using FLEX ASM Disk Groups to Regain Storage Space

I recently came across an issue where a client was using more space than they anticipated in one of their Exadata Cloud Service Instances within OCI. Unlike an on-premise Exadata, when that machine is delivered in OCI, you do not have the ability to specify the redundancy of the disk groups as they are always delivered with the disk groups set to HIGH redundancy. This level of redundancy is perfect for Production or DR type environments, but sometimes it may be worthwhile in a Test environment to have the ability to free up space by reducing the redundancy. This option also doesn’t require the full tear down of a disk group to rebuild it with the redundancy of your choice. Certainly a savings of downtime and man-hours.

Specific to this problem, the FLEX ASM disk group allows you to specify the redundancy to use at the filetype level within a given file group. There are many other settings that can be adjusted, but none of them are as potentially as useful as the redundancy option. To make things easier, a file group is automatically created within ASM for each Container and Pluggable database. This granularity allows a ton of flexibility should you find this feature useful for you.

There are several other blogs out there that discuss this, however, none that I came across showed space numbers or the file group properties.

Now to demonstrate how it works, I will start with a simple 19c database that contains the sample HR data and some other sample data consuming about 8GB. (For the purposes of this test, the disk group has already been converted to FLEX. At HIGH redundancy the space used is as follows:

StateTypeRebalSectorBlockAUTotal_MBFree_MBName
MOUNTEDFLEXN512409641943049214863352DATA/

Further information can be seen about the individual data files and its redundancy property by querying the files within the specified file group:

sqlplus / as sysasm
select file_number,round(bytes/1024/1024) file_size, round(space/1024/1024) disk_size,type,redundancy from v$asm_file where filegroup_number = 3;
FILE_NUMBERFILE_SIZE_MBDISK_SIZE_MBTYPEREDUNDANCY
275100324DATAFILEHIGH
276270828DATAFILEHIGH
2773401044DATAFILEHIGH
27815134585TEMPFILEHIGH
279524DATAFILEHIGH
280512015384DATAFILEHIGH

Now, we can convert the datafilee in the disk group to MIRROR (NORMAL) redundancy. In order to see the full results, an ASM Rebalance Operation will need to occur which could take some time:

sqlplus / as sysasm
alter diskgroup DATA  modify filegroup VBOXDB1_PDB1  set 'datafile.redundancy' = 'mirror';

Now, once the rebalance finishes, we can query the size of the data files and the disk group:

StateTypeRebalSectorBlockAUTotal_MBFree_MBName
MOUNTEDFLEXN512409641943049214869204DATA/
FILE_NUMBERFILE_SIZE_MBDISK_SIZE_MBTYPEREDUNDANCY
275100220DATAFILEMIRROR
276270556DATAFILEMIRROR
277340700DATAFILEMIRROR
27815134585TEMPFILEHIGH
279516DATAFILEMIRROR
280512010260DATAFILEMIRROR

As you can see, only the data files were effected for a space savings within the disk group of approximately 5.7GB.

Of course there are potential availability drawbacks with changing disk group redundancy, however, if your situation takes the pros and the cons into account, the ASM FLEX disk group may be a good alternative for your environment.

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.