ASMLib is a support library for the Automatic Storage Management feature of the Oracle Database. This document is a set of tips for installing the library and its supporting driver. The complete installation guide is part of the Oracle Database Documentation.
This document describes the steps required to install the Linux specific ASM library and its associated driver. This library is provided to enable ASM I/O to Linux disks without the limitations of the standard Unix I/O API. The steps below are steps that the system administrator must follow.
Note: For Oracle Linux 7, 8 and 9 please refer to Oracle ASMLib
More details on Oracle Instant Client is in the Oracle Call Interface Programmer's Guide. A video of installing the Instant Client Basic package on Linux is on the Application Development with Oracle Database channel.
The ASMLib software must first be installed. The easiest way is via the Unbreakable Linux Network. For other environments, please download ASMLib from OTN.
Once the ASMLib software is installed, you are ready to configure it.
Now that the ASMLib software is installed, a few steps have to be taken by the system administrator to make the ASM driver available. The ASM driver needs to be loaded, and the driver filesystem needs to be mounted. This is taken care of by the initialization script, /etc/init.d/oracleasm.
Run the /etc/init.d/oracleasm
script with the 'configure' option. It will ask for the user and group that default to owning the ASM driver access point. If the database was running as the 'oracle' user and the 'dba' group, the output would look like this:
[root@ca-test1 /]# /etc/init.d/oracleasm configure
Configuring the Oracle ASM library driver.
This will configure the on-boot properties of the Oracle ASM library
driver. The following questions will determine whether the driver is
loaded on boot and what permissions it will have. The current values
will be shown in brackets ('[]'). Hitting without typing an
answer will keep that current value. Ctrl-C will abort.
Default user to own the driver interface []: oracle
Default group to own the driver interface []: dba
Start Oracle ASM library driver on boot (y/n) [n]: y
Fix permissions of Oracle ASM disks on boot (y/n) [y]: y
Writing Oracle ASM library driver configuration [ OK ]
Creating /dev/oracleasm mount point [ OK ]
Loading module "oracleasm" [ OK ]
Mounting ASMlib driver filesystem [ OK ]
Scanning system for ASM disks [ OK ]
This should load the oracleasm.o driver module and mount the ASM driver filesystem. By selecting enabled = 'y'
during the configuration, the system will always load the module and mount the filesystem on boot.
The automatic start can be enabled or disabled with the 'enable' and 'disable' options to /etc/init.d/oracleasm:
[root@ca-test1 /]# /etc/init.d/oracleasm disable
Writing Oracle ASM library driver configuration [ OK ]
Unmounting ASMlib driver filesystem [ OK ]
Unloading module "oracleasm" [ OK ]
[root@ca-test1 /]# /etc/init.d/oracleasm enable
Writing Oracle ASM library driver configuration [ OK ]
Loading module "oracleasm" [ OK ]
Mounting ASMlib driver filesystem [ OK ]
Scanning system for ASM disks [ OK ]
The system administrator has one last task. Every disk that ASMLib is going to be accessing needs to be made available. This is accomplished by creating an ASM disk. The /etc/init.d/oracleasm
script is again used for this task:
[root@ca-test1 /]# /etc/init.d/oracleasm createdisk VOL1 /dev/sdg1
Creating Oracle ASM disk "VOL1" [ OK ]
Disk names are ASCII capital letters, numbers, and underscores. They must start with a letter.
Disks that are no longer used by ASM can be unmarked as well:
[root@ca-test1 /]# /etc/init.d/oracleasm deletedisk VOL1
Deleting Oracle ASM disk "VOL1" [ OK ]
Any operating system disk can be queried to see if it is used by ASM:
[root@ca-test1 /]# /etc/init.d/oracleasm querydisk /dev/sdg1
Checking if device "/dev/sdg1" is an Oracle ASM disk [ OK ]
[root@ca-test1 /]# /etc/init.d/oracleasm querydisk /dev/sdh1
Checking if device "/dev/sdh1" is an Oracle ASM disk [FAILED]
Existing disks can be listed and queried:
[root@ca-test1 /]# /etc/init.d/oracleasm listdisks
VOL1
VOL2
VOL3
[root@ca-test1 /]# /etc/init.d/oracleasm querydisk VOL1
Checking for ASM disk "VOL1" [ OK ]
When a disk is added to a RAC setup, the other nodes need to be notified about it. Run the 'createdisk' command on one node, and then run 'scandisks' on every other node:
[root@ca-test1 /]# /etc/init.d/oracleasm scandisks
Scanning system for ASM disks [ OK ]
ASMLib uses discovery strings to determine what disks ASM is asking for. The generic Linux ASMLib uses glob strings. The string must be prefixed with "ORCL:".
Disks are specified by name. A disk created with the name "VOL1" can be discovered in ASM via the discovery string "ORCL:VOL1".
Similarly, all disks that start with the string "VOL" can be queried with the discovery string "ORCL:VOL*".
Disks cannot be discovered with path names in the discovery string. If the prefix is missing, the generic Linux ASMLib will ignore the discovery string completely, expecting that it is intended for a different ASMLib. The only exception is the empty string ( ""), which is considered a full wildcard. This is precisely equivalent to the discovery string "ORCL:*".
ASMLib uses configuration file /etc/sysconfig/oracleasm, which is a link to file /etc/sysconfig/oracleasm-_dev_oracleasm. Tools read file /etc/sysconfig/oracleasm-_dev_oracleasm so make sure that it's link from /etc/sysconfig/oracleasm is not broken. User should run /usr/sbin/oracleasm configure -I to modify configuration parameters