Introduction
Following the recent announcement of the deprecation and desupport of the Oracle ASM Filer Driver (ASMFD), and the release of a new version of the Oracle ASMLib for Oracle Automatic Storage Management (ASM).
It’s the perfect time to revisit ASMLib and write a blog on how to download, install, and configure the ASM library on Oracle Linux 9.
See Note: Oracle Automatic Storage Management Filter Driver (ASMFD) (Doc ID 2806979.1)
Note: AFD is deprecated and unsupported, as a similar I/O filtering capability is included with the latest release of ASMLIB V3.
Additionally, before deploying Oracle ASMLib, check Oracle ASMLib Software Update and Support Policy (Doc ID 1089399.1) for the latest updates and current support position.
What is Oracle ASMLib
ASMLib is optional, free piece of software provide by Oracle to simplify the management of Oracle Automatic Storage Management (ASM) managed storage.
Oracle ASMLib is not mandatory for the Automatic Storage Management (ASM) feature of Oracle Database on Linux as all features and functionality of ASM will work without ASMLib. However it is required for io_uring and thin_provisioning.
ASMLib Installation
If you have an active Unbreakable Linux Network (ULN) subscription, you can perform the following:
# dnf install oracleasm-support oracleasmlib
Alternatively, downloaded the oracleasm-support & oracleasmlib packages and install using sudo rpm -ivh <filename.rpm>
oracleasm-support is available from the Unbreakable Linux Network (ULN) or yum.oracle.com if you don’t have an active subscription.
oracleasmlib can be downloaded from https://www.oracle.com/linux/downloads/linux-asmlib-v9-downloads.html
$ sudo rpm -ivh oracleasm-support-3.1.0-10.el9.x86_64.rpm
$ sudo rpm -ivh oracleasmlib-3.1.0-6.el9.x86_64.rpm

Oracleasm Options
The oracleasm command supports the options below, which we will explore in this blog post.
configure- Configure the oracleasm service
init- Load and initialize the oracleasm service
exit- Stop the oracleasm service
scandisks- Scan the system for Oracle ASM disks
status- Display the status of the oracleasm service
listdisks- List known Oracle ASM disks
querydisk- Determine if a disk belongs to the oracleasm service
createdisk- Label a device for Oracle ASM use
deletedisk- Clear Oracle ASM disk label
renamedisk- Change the label of an Oracle ASM disk
discover- List disks matching a given discovery string

Configure
To Configure the oracleasm service run the oracleasm configure with option -I (interactive)
The first time run, the oracleasm configure utility will asks a series of questions, including which user id and group id to assign permission to use Oracle ASMLib, subsequent runs allow updates of the configuration.
Usage: oracleasm configure [-i|-I] [-e|-d] [-u <user>] [-g <group>] [-b|-p] [-s y|n] [-f y|n] [-m <max-disks>] [[-o <order>] ...] [[-x <exclude>] [-D <scan_directories>...]
$ sudo /usr/sbin/oracleasm configure -i

Use oracleasm configure command to return current settings, for example:
# /usr/sbin/oracleasm configure

We can also see these settings stored in /etc/sysconfig/oracleasm, but updates should be performed using the oracleasm configure command.
After configuring ASMLIB, enable and start the oracleasm service with the below.
$ sudo systemctl enable --now oracleasm
$ sudo systemctl start oracleasm
Enabling or Restricting io_uring

The io_uring interface is used instead of the oracleasm kernel driver, when the system is running UEK R7 or Oracle Linux 9 with RHCK.
If the system is running Oracle Linux 9 with RHCK, you can either enable io_uring globally, or you can enable io_uring so that it’s restricted to processes that are run by a particular group.
Scan Disks
Scan the system for Oracle ASM disks, using oracleasm scan disks
Usage: oracleasm scandisks [-s] [[-o <order_pattern>] ...] [[-x <exclude_pattern>] ...] [[-D <scan_directories>] ...] [-v] [<device> ...]
$ sudo oracleasm scandisks

Status
Display the status of the oracleasm service, check the status of ASMLib with oracleasm status, remember to repeat on all nodes within the RAC cluster.
Usage: oracleasm status [-v]
$ sudo /usr/sbin/oracleasm status

If you hit ‘Checking if io_uring is accessible to the configured DB user: no (Unable to call io_uring_setup() as oracle/asmadmin: Operation not permitted)’
You will need to fix this before continuing. To do this add a new entry of kernel.io_uring_disabled = 0 to the end of /etc/sysctl.conf.
Once updated, update the kernel with sysctl -p and check setting with sysctl kernel.io_uring_disabled.
$ sudo sudo sysctl -p
$ sysctl kernel.io_uring_disabled
Now repeat oracleasm status, to check issue has been fixed.

Create Disk
Label a device for Oracle ASM use with oracleasm creatdisk
Usage: oracleasm createdisk [-v] <label> <device>
$ sudo oracleasm createdisk -f DATA08 /dev/mapper/dg_data08

Rename Disk
Change the label of an Oracle ASM disk using oracleasm renamedisk
Usage: oracleasm renamedisk [-v] [-f] <label>|<device> <new_label>
$ sudo oracleasm renamedisk -f DATA08 TEST

Delete Disk
Clear Oracle ASM disk label
Usage: oracleasm deletedisk [-v] <label>|<device>
$ sudo oracleasm deletedisk -v TEST

Query Disk
Determine if a disk belongs to the Oracle ASM service using oracleasm query disk
Usage: oracleasm querydisk [-v] [-d|-i|-p] <label>|<device> ...
$ oracleasm querydisk /dev/mapper/dg_data01

$ oracleasm querydisk -i DATA01

- Device
- The ASM disk’s block device node.
- Device UUID
- Universally unique identifier of the underlying storage hardware (if supported).
- Disk Group
- Name of the ASM Disk Group that the ASM disk belongs to.
- Capabilities
- Features implemented by this ASM disk.
- Size
- Storage capacity of the ASM disk.
- Logical Block Size
- The logical block size of the underlying storage hardware.
- Physical Block Size
- The physical block size of the underlying storage hardware.
- Max I/O Size
- Maximum I/O size supported by the underlying storage hardware.
- Data Integrity
- Indicates whether the ASM disk supports end-to-end data integrity protection. A value of T10-DIF-TYPE1-CRC indicates that the device is formatted with T10 Protection Information, Type 1, and that exchanging protection information with the underlying storage hardware is enabled.
- Thin Provisioning
- Indicates whether the underlying storage hardware supports reclaiming unused space through an Unmap operation.
- Max TP I/O Size
- Indicates the maximum size of an Unmap operation.
List Disks
List known Oracle ASM disks using oracleasm listdisks
Usage: oracleasm listdisks [-v]
$ oracleasm listdisks

Oracle ASMLib v3.1 no longer uses the /dev/oracleasm directory

However we can search for and locate the correct path of the disks using find /dev -name <ASM Disk Name>, for example:

From above we can see the actual path has been updated to /dev/disk/by-label
We can see that /dev/disk/by-label/DATA01 is a symbolic link back to our multipath device.

Discover
List disks matching a given discovery string, use the oracleasm discover command to validate ASM discovery strings and view characteristics of the associated ASM disks.
Usage: oracleasm discover [ORCL:pattern]
--help Print this help text
--long Produce detailed output
--version Print oracleasm-discover version
$ oracleasm discover

When working with as large number of disks you can filter results using oracleasm discover ORCL:<label>.
For example to list all disks labeled beginning with DATA, you could use the following:
$ sudo oracleasm discover ORCL:DATA\*

And confirm Oracle ASMLib versions with oracleasm discover –version

Summary
In this blog post I have shared how to install, configure and use ASMLib v3.1.
In my next post I will demonstrate Oracle ASMLib v3.1 Thin Provisioning.
