How to Install and Configure ASMLIb on RHEL Linux 7

Make sure oracleasm packages are installed , go to Red Hat website to download the required ones:

$ rpm -qa|grep -i oracleasm
kmod-oracleasm-version.el7.x86_64
oracleasm-support-version.el7.x86_64
oracleasmlib-version.el7.x86_64

Check orcaleasm.service is activated:

# systemctl is-enabled oracleasm.service
enabled

Check  oracleasm kernel module is installed:

#modinfo oracleasm
filename: /lib/modules/3.10.0-514.el7.x86_64/weak-updates/oracleasm/oracleasm.ko
description: Kernel driver backing the Generic Linux ASM Library.
author: Joel Becker <joel.becker@oracle.com>
version: 2.0.8
license: GPL
rhelversion: 7.3
srcversion: 3AA2BF05E1F8A2D0EEAFD4E
depends:
vermagic: 3.10.0-510.el7.x86_64 SMP mod_unload modversions
signer: Red Hat Enterprise Linux Driver Update Program (key 3)
sig_key: BF:57:F3:E8:73:62:BC:72:29:D9:F4:65:32:17:73:DF:D1:F7:7A:80
sig_hashalgo: sha256
parm: use_logical_block_size:Prefer logical block size over physical (Y=logical, N=physical [default]) (bool)

Check whether oracleasm module is loaded into Linux kernel:

# lsmod | grep oracleasm
                          < -- not loaded yet

Initialize oracleasm module:

# oracleasm init
Creating /dev/oracleasm mount point: /dev/oracleasm
Loading module "oracleasm": oracleasm
Configuring "oracleasm" to use device physical block size
Mounting ASMlib driver filesystem: /dev/oracleasm

Check whether oracleasm module is loaded into Linux kernel:

# lsmod | grep oracleasm
oracleasm 63318 1

Configuring the Oracle ASM library driver:

# oracleasm configure -i
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 <ENTER> without typing an
answer will keep that current value. Ctrl-C will abort.

Default user to own the driver interface []: grid
Default group to own the driver interface []: dba
Scan for Oracle ASM disks on boot (y/n) [y]: y
Writing Oracle ASM library driver configuration: done

Check oracleasm status:

# oracleasm status
Checking if ASM is loaded: yes
Checking if /dev/oracleasm is mounted: yes

#cd /etc/sysconfig
#ls -ltr *oracleasm*
-rw-r--r--. 1 root root 685 Jul 10 2014 oracleasm-_dev_oracleasm
lrwxrwxrwx. 1 root root 24 Aug 24 22:59 oracleasm -> 
                    oracleasm-_dev_oracleasm <---- this is required.

# oracleasm configure
ORACLEASM_UID=grid
ORACLEASM_GID=dba
ORACLEASM_SCANBOOT=true
ORACLEASM_SCANORDER="dm"
ORACLEASM_SCANEXCLUDE="sd"
ORACLEASM_USE_LOGICAL_BLOCK_SIZE="false"


# cat oracleasm

#
# This is a configuration file for automatic loading of the Oracle
# Automatic Storage Management library kernel driver. It is generated
# By running /etc/init.d/oracleasm configure. Please use that method
# to modify this file
#
# ORACLEASM_UID: Default user owning the /dev/oracleasm mount point.
ORACLEASM_UID=grid

# ORACLEASM_GID: Default group owning the /dev/oracleasm mount point.
ORACLEASM_GID=dba

# ORACLEASM_SCANBOOT: 'true' means scan for ASM disks on boot.
ORACLEASM_SCANBOOT=true

# ORACLEASM_SCANORDER: Matching patterns to order disk scanning
ORACLEASM_SCANORDER="dm"

# ORACLEASM_SCANEXCLUDE: Matching patterns to exclude disks from scan
ORACLEASM_SCANEXCLUDE="sd"

# ORACLEASM_USE_LOGICAL_BLOCK_SIZE: 'true' means use the logical block size
# reported by the underlying disk instead of the physical. The default
# is 'false'
ORACLEASM_USE_LOGICAL_BLOCK_SIZE=false

#

Scan ASM disks, and list ASM disks:

# oracleasm scandisks
Scanning the system for Oracle ASMLib disks: [ OK ]

#oracleasm listdisks
OCR_VOTE
ASM_DISK1
ASM_DISK2
...
..
.

Check oracleasm log:

$ vi /var/log/oracleasm

WARNING: FAILED to load library: /opt/oracle/extapi/64/asm/orcl/1/libasm.so

Database instance starts up failure with below errors:

ORA-15183: ASMLIB initialization error [driver/agent not installed]
Wed Jan 31 17:48:16 2018
WARNING: FAILED to load library: /opt/oracle/extapi/64/asm/orcl/1/libasm.so

Check “oracleasm.service” with errors:

# systemctl status oracleasm.service
 oracleasm.service - Load oracleasm Modules
 Loaded: loaded (/usr/lib/systemd/system/oracleasm.service; enabled; vendor preset: disabled)
 Active: inactive (dead) since Wed 2018-01-31 18:31:50 AEDT; 2s ago
 Process: 34627 ExecStop=/usr/sbin/service oracleasm stop_sysctl (code=exited, status=0/SUCCESS)
 Process: 429 ExecStart=/usr/sbin/service oracleasm start_sysctl (code=exited, status=0/SUCCESS)
 Main PID: 429 (code=exited, status=0/SUCCESS)

Jan 31 17:58:46 racnode1 systemd[1]: Starting Load oracleasm Modules...
Jan 31 17:58:46 racnode1 service[429]: Initializing the Oracle ASMLib driver: [ OK ]
Jan 31 17:58:48 racnode1 service[429]: Scanning the system for Oracle ASMLib disks: [ OK ]
Jan 31 17:58:48 racnode1 systemd[1]: Started Load oracleasm Modules.
Jan 31 18:31:50 racnode1 systemd[1]: Stopping Load oracleasm Modules...
Jan 31 18:31:50 racnode1 service[34627]: Dropping Oracle ASMLib disks: [ OK ]
Jan 31 18:31:50 racnode1 service[34627]: Shutting down the Oracle ASMLib driver: [ OK ]

Stop “oracleasm.service’, and re-enable it. After this, all works fine and database instance can be started up successfully.

# systemctl stop oracleasm.service

# systemctl status oracleasm.service
 oracleasm.service - Load oracleasm Modules
 Loaded: loaded (/usr/lib/systemd/system/oracleasm.service; enabled; vendor preset: disabled)
 Active: inactive (dead) since Wed 2018-01-31 18:31:50 AEDT; 2s ago
 Process: 34627 ExecStop=/usr/sbin/service oracleasm stop_sysctl (code=exited, status=0/SUCCESS)
 Process: 429 ExecStart=/usr/sbin/service oracleasm start_sysctl (code=exited, status=0/SUCCESS)
 Main PID: 429 (code=exited, status=0/SUCCESS)

Jan 31 17:58:46 racnode1 systemd[1]: Starting Load oracleasm Modules...
Jan 31 17:58:46 racnode1 service[429]: Initializing the Oracle ASMLib driver: [ OK ]
Jan 31 17:58:48 racnode1 service[429]: Scanning the system for Oracle ASMLib disks: [ OK ]
Jan 31 17:58:48 racnode1 systemd[1]: Started Load oracleasm Modules.
Jan 31 18:31:50 racnode1 systemd[1]: Stopping Load oracleasm Modules...
Jan 31 18:31:50 racnode1 service[34627]: Dropping Oracle ASMLib disks: [ OK ]
Jan 31 18:31:50 racnode1 service[34627]: Shutting down the Oracle ASMLib driver: [ OK ]
Jan 31 18:31:50 racnode1 systemd[1]: Stopped Load oracleasm Modules.

# systemctl enable oracleasm.service

# systemctl start oracleasm.service

# systemctl status oracleasm.service
 oracleasm.service - Load oracleasm Modules
 Loaded: loaded (/usr/lib/systemd/system/oracleasm.service; enabled; vendor preset: disabled)
 Active: active (exited) since Wed 2018-01-31 18:32:30 AEDT; 2s ago
 Process: 35360 ExecStart=/usr/sbin/service oracleasm start_sysctl (code=exited, status=0/SUCCESS)
 Main PID: 35360 (code=exited, status=0/SUCCESS)

Jan 31 18:32:29 racnode1 systemd[1]: Starting Load oracleasm Modules...
Jan 31 18:32:29 racnode1 service[35360]: Initializing the Oracle ASMLib driver: [ OK ]
Jan 31 18:32:30 racnode1 service[35360]: Scanning the system for Oracle ASMLib disks: [ OK ]
Jan 31 18:32:30 racnode1 systemd[1]: Started Load oracleasm Modules.

Alert.log

Wed Jan 31 18:40:09 2018
NOTE: Loaded library: /opt/oracle/extapi/64/asm/orcl/1/libasm.so

Huge ASM LMHB Trace File Size

The ASM LMHB trace file is huge in 12.1.0.2 GI environment.

$cd /u01/app/grid/diag/asm/+asm/+ASM1/trace
$ ls -ltr *lmhb*
-rw-r----- 1 grid oinstall 11551946219 Jan 8 16:59 +ASM1_lmhb_88049.trc

According to (Doc ID 2137683.1), it is a known bug, which is fixed in 12cR2 GI.

Or

Apply one-off Patch 20878790.

Or

Just empty the trace file periodically by :

$ cat /dev/null>+ASM1_lmhb_88049.trc

How to Make ASM Instance to Use HugePages

The ASM instance is configured in the same way as normal databases instance for using hugepages in Linux 7. But ASM is not using hugepages, while the normal instance is using hugepages. There are enough free hugepages available  as per /etc/meminfo.

Let’s configure ASM to use HugePages.

Subscribe to get access

Read more of this content when you subscribe today.

How to Copy ASM Password File From Primary to Standby

It is a prerequisite for both primary and secondary databases have same copy of password file, and stored in ASM diskgroup preferred

From 12.1.0.2 on, since primary database password file is stored in ASM, so it needs to be manually copied onto standby database ASM for dataguard configuration. Otherwise the below errors will occur:

*** 2017-09-06 14:34:29.216
OCISessionBegin failed. Error -1
.. Detailed OCI error val is 1017 and errmsg is 'ORA-01017: invalid username/password; logon denied
'
ORA-01017: invalid username/password; logon denied
OCI_DBVER attribute value retrieval failed error=1017

*** 2017-09-06 14:34:30.323
OCISessionBegin failed. Error -1
.. Detailed OCI error val is 1017 and errmsg is 'ORA-01017: invalid username/password; logon denied
'
*** 2017-09-06 14:34:30.323737 4929 krsh.c
Error 1017 received logging on to the standby

Subscribe to get access

Read more of this content when you subscribe today.