Oracle ASM Filter Driver (ASMFD) – Thin Provisioning

Background

Before we start if you are new to the Oracle ASM Filter Driver (ASMFD) you may want to visit a couple of my previous Blog posts where I detailed how to set-up the ASM Filter Driver (ASMFD) via Oracle 19c Grid Infrastructure installer or the Linux command line interface (CLI).

In this Blog I am going to show the impact of the Oracle ASM Filter Driver (ASMFD) ‘Thin Provisioning’ flag on flash stoarge.

Oracle ASM Diskgroup Set-up

For my testing I have created 3 PDB’s 3 additional Oracle ASM Disk Groups each with 3 volumes thus:

  • pdb1- DATA_UDEV (Traditional UDEV managed)
  • pdb2 – DATA_TP (ASM Filter Driver initial thin_provisioned=true )
  • pdb3 – DATA_AFD (ASM Filter Driver initial thin_provisioned=false )
ASMCA – ASM Configuration Assistant: Disk Groups
Pre Oracle ASM Label creation
[oracle@z-oracle ~]$ asmcmd lsdsk -p -G DATA_UDEV
 Group_Num  Disk_Num      Incarn  Mount_Stat  Header_Stat  Mode_Stat  State   Path
         4         0  4042632098  CACHED      MEMBER       ONLINE     NORMAL  /dev/oracleasm/dg_oradata7
         4         1  4042632097  CACHED      MEMBER       ONLINE     NORMAL  /dev/oracleasm/dg_oradata8
         4         2  4042632096  CACHED      MEMBER       ONLINE     NORMAL  /dev/oracleasm/dg_oradata9
[oracle@z-oracle ~]$ asmcmd lsdsk -p -G DATA_AFD
 Group_Num  Disk_Num      Incarn  Mount_Stat  Header_Stat  Mode_Stat  State   Path
         5         0  4042632172  CACHED      MEMBER       ONLINE     NORMAL  AFD:DATA_AFD1
         5         1  4042632173  CACHED      MEMBER       ONLINE     NORMAL  AFD:DATA_AFD2
         5         2  4042632174  CACHED      MEMBER       ONLINE     NORMAL  AFD:DATA_AFD3
[oracle@z-oracle ~]$ asmcmd lsdsk -p -G DATA_TP
 Group_Num  Disk_Num      Incarn  Mount_Stat  Header_Stat  Mode_Stat  State   Path
         6         0  4042632212  CACHED      MEMBER       ONLINE     NORMAL  AFD:DATA_TP1
         6         1  4042632213  CACHED      MEMBER       ONLINE     NORMAL  AFD:DATA_TP2
         6         2  4042632214  CACHED      MEMBER       ONLINE     NORMAL  AFD:DATA_TP3

From the operating system it’s possible to determine the physical volume for and ASM Filter Driver diskgroup by navigating to ‘/dev/oracleafd/disks’ and reading the files e.g.

[oracle@z-oracle disks]$ cd /dev/oracleafd/disks
[oracle@z-oracle disks]$ ls -l
total 32
-rw-r----- 1 oracle oinstall 26 Oct 17 13:36 CONTROL_REDO1
-rw-r----- 1 oracle oinstall 24 Oct 28 21:33 DATA_AFD1
-rw-r----- 1 oracle oinstall 24 Oct 28 21:33 DATA_AFD2
-rw-r----- 1 oracle oinstall 24 Oct 28 21:33 DATA_AFD3
-rw-r----- 1 oracle oinstall 24 Oct 28 21:34 DATA_TP1
-rw-r----- 1 oracle oinstall 24 Oct 28 21:34 DATA_TP2
-rw-r----- 1 oracle oinstall 24 Oct 28 21:34 DATA_TP3
-rw-r----- 1 oracle oinstall 25 Oct 17 13:35 FRA1
[oracle@z-oracle disks]$ cat DATA_AFD1
/dev/mapper/dg_oradata1

If we check our newly labeled ASM volumes we can see a few MB of data has been written to each volume header.

Post Oracle ASM label creation

ASMFD Thin Provisioned Attribute

By default the ‘thin_provisioned’ flag is FALSE, even for ASMFD managed disks, we can check this with:

set feed off
set pages 100
set linesize 250

column diskgroup heading 'Diskgroup' format a15
column name heading 'Attribute Name' format a25
column value heading 'Value' format a15
column read_only heading 'Read Only' format a15

SELECT 
  SUBSTR(dg.name,1,12) AS diskgroup, SUBSTR(a.name,1,24) AS name,
  SUBSTR(a.value,1,24) AS value, read_only 
FROM 
  V$ASM_DISKGROUP dg, 
  V$ASM_ATTRIBUTE a 
WHERE 
  dg.group_number = a.group_number AND
  a.name NOT LIKE '%template%' AND
  a.name LIKE '%thin%'
/ 
exit
thin_provisioned attribute

However we can easily change the ‘thin_provisioned’ attribute using ASMCA or using ‘alter disk group <DISK_GROUP> set attribute ‘thin_provisioned’=’TRUE’;’ e.g.

[oracle@z-oracle ~]$ sqlplus / as sysasm
SQL> alter diskgroup DATA_TP set attribute 'thin_provisioned'='TRUE';
Diskgroup altered.
thin_provisioned attribute

Create Test Data

To understand the impact of ‘thin_provisioning’ flag we will now create 3 empty Tablespaces each of 1TB in each or my PDB’s using three different ASM disk groups and then use Dominic Giles’ SwingBench to create SOE schemas in each of the new Tablespaces ~320GB.

	   Container	   Tablespace	       Free    Alloc	 Used
    CON_ID Name 	   Name 	   Space GB Space GB Space GB
---------- --------------- --------------- -------- -------- --------
	 3 PDB1 	   SOE			703    1,024	  321 (UDEV,  TP=FALSE)
	 4 PDB2 	   SOE			703    1,024	  321 (ASMFD, TP=TRUE)
	 5 PDB3 	   SOE			703    1,024	  321 (ASMFD, TP=FALSE)   

The screen shot below shows the updated 3 ASM DiskGroups.

Oracle ASM Diskgroups – DATA_APD, DATA_TP & DATA_UDEV

Test 1 – Remove data from pdb2

To explore the impact of the ‘thin_provisioned’ attribute we can now drop the test data from our ASMFD labeled diskgroup and monitor the storage platform to see if any storage is returned.

SQL> drop user soe cascade;
User dropped.

SQL> drop tablespace soe including contents;
Tablespace dropped.

Oracle ASM Rebalance

The Oracle documentation tells us that the ‘thin_provisioned attribute only discards unused storage space after a disk group rebalance is completed, so we will need to also trigger a rebalance.

[oracle@z-oracle ~]$ sqlplus / as sysasm
SQL> alter diskgroup DATA_TP rebalance with balance compact wait;
Diskgroup altered.

The ‘wait’ keyword can be useful in scripts as this ensures the rebalance function completes before returning.

Pure Storage FlashArray space released

Test 2 – Remove data from pdb3

In our second test we will update the ‘thin_provisioned’ attribute to ‘TRUE’ and repeat the same test, again monitoring the storage platform to see if data needs to be created with an initial thin_provisioned value of true to have any impact.

[oracle@z-oracle ~]$ sqlplus / as sysasm
SQL> alter diskgroup DATA_AFD set attribute 'thin_provisioned'='TRUE';
Diskgroup altered.
Both Oracle ASM Filter Driver Diskgroups set to TRUE
SQL> drop user soe cascade;
User dropped.

SQL> drop tablespace soe including contents;
Tablespace dropped.
[oracle@z-oracle ~]$ sqlplus / as sysasm
SQL> alter diskgroup DATA_AFD rebalance with balance compact wait;
Diskgroup altered.
+DATA_AFD space released

Test 3 – Remove data from pdb1

In our final test we repeat the above tests and check to see if setting the ‘thin_provisioned’ attribute toTRUE’ for a UDEV managed Oracle ASM diskgroup releases any storage space.

[oracle@z-oracle ~]$ sqlplus / as sysasm
SQL> alter diskgroup DATA_UDEV set attribute 'thin_provisioned'='TRUE';
Diskgroup altered.
Oracle ASM Filter Driver and UDEV managed disk groups
[oracle@z-oracle ~]$ sqlplus / as sysdba
SQL> drop user soe cascade;
User dropped.

SQL> drop tablespace soe including contents;
Tablespace dropped.
[oracle@z-oracle ~]$ sqlplus / as sysasm
SQL> alter diskgroup DATA_UDEV rebalance with balance compact wait;
Diskgroup altered.
+DATA_AFD no space released

Conclusion

If your using Oracle Automatic Storage Management (ASM) with an all-flash storage platform should definitely put some time aside and test the Oracle ASM Filter Driver (ASMFD) in your environment.

For Oracle ASM Filter Driver labeled diskgroups you can update the ‘thin_provisioned’ attribute after the data created was initially created and still release space.

Please note setting it’s possible to set the ‘thin_provisioned’ attribute to ‘TRUE’ for UDEV managed Diskgroups but it will not release storage space.

If you have found this Post informative you may want to check out my video of ASMFD in action.

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 )

Google photo

You are commenting using your Google 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 )

Connecting to %s

Create a website or blog at WordPress.com

Up ↑

%d bloggers like this: