Install and configure Oracle ASM: Easy step-by-step guide

Please follow the below step-by-step guide to install and configure Oracle ASM in your VirtualBox.

1. Install Oracle ASMLib package:

Below three ASM Libraries are required to configure Oracle ASM:

oracleasmlib
oracleasm-support
kmod-oracleasm

Install the first package oracleasmlib:

[root@localhost ~]# yum install -y oracleasmlib
Loaded plugins: langpacks, ulninfo
ol7_UEKR4                                                                                                                             | 3.0 kB  00:00:00
ol7_latest                                                                                                                            | 3.6 kB  00:00:00
No package oracleasmlib available.
Error: Nothing to do

Here we can see there is no package oracleasmlib available to install. So we have to download the package and install it manually. We will do this in the 2nd step.

Install the second package oracleasm-support:

[root@localhost ~]# yum install -y oracleasm-support
Loaded plugins: langpacks, ulninfo
Resolving Dependencies
--> Running transaction check
---> Package oracleasm-support.x86_64 0:2.1.11-2.el7 will be installed
--> Finished Dependency Resolution

Install the third package kmod-oracleasm:

[root@localhost ~]# yum install -y kmod-oracleasm
Loaded plugins: langpacks, ulninfo
Resolving Dependencies
--> Running transaction check
---> Package kmod-oracleasm.x86_64 0:2.0.8-28.0.1.el7 will be installed
--> Finished Dependency Resolution

2. To download the missing packages click on the required package:

oracleasmlib
oracleasm-support
kmod-oracleasm

we have to download only oracleasmlib as the other two packages have already been installed in this practice.

Place the downloaded package in the shared folder location on your Windows machine so that you can access it through the shared location of your Linux machine. If you do not know how to create a shared folder in VirtualBox, follow my other article Create a shared folder.

Install and configure Oracle ASM

Now go to the Linux shared location and install the downloaded package.

[root@localhost ~]# cd /media/sf_Linux

[root@localhost sf_Linux]# ls -ltr
total 24
-rwxrwx--- 1 root vboxsf 20684 Mar  3 08:51 oracleasmlib-2.0.15-1.el7.x86_64.rpm

[root@localhost sf_Linux]# rpm -Uvh oracleasmlib-2.0.15-1.el7.x86_64.rpm
Preparing...                          ################################# [100%]
Updating / installing...
   1:oracleasmlib-2.0.15-1.el7        ################################# [100%]

3. Verify if ASM libraries are installed or not:

[root@localhost ~]# rpm -qa | grep oracleasmlib
oracleasmlib-2.0.15-1.el7.x86_64

[root@localhost ~]# rpm -qa | grep oracleasm-support
oracleasm-support-2.1.11-2.el7.x86_64

[root@localhost ~]# rpm -qa | grep kmod-oracleasm
kmod-oracleasm-2.0.8-28.0.1.el7.x86_64

4. Configure oracle ASM:

It’s a utility to manage the ASM disks physically. To configure it run the oracleasm configure command.

[root@localhost ~]# oracleasm configure
ORACLEASM_ENABLED=false
ORACLEASM_UID=
ORACLEASM_GID=
ORACLEASM_SCANBOOT=true
ORACLEASM_SCANORDER=""
ORACLEASM_SCANEXCLUDE=""
ORACLEASM_SCAN_DIRECTORIES=""
ORACLEASM_USE_LOGICAL_BLOCK_SIZE="false"

We can see ORACLEASM_ENABLED=false, which means oracleasm is not enabled yet. To enable and configure oracle ASM, run the below command:

[root@localhost ~]# 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 []: asmadmin
Start Oracle ASM library driver on boot (y/n) [n]: y
Scan for Oracle ASM disks on boot (y/n) [y]: y
Writing Oracle ASM library driver configuration: done

5. Verify if oracleasm is enabled or not:

[root@localhost ~]# oracleasm configure
ORACLEASM_ENABLED=true
ORACLEASM_UID=grid
ORACLEASM_GID=asmadmin
ORACLEASM_SCANBOOT=true
ORACLEASM_SCANORDER=""
ORACLEASM_SCANEXCLUDE=""
ORACLEASM_SCAN_DIRECTORIES=""
ORACLEASM_USE_LOGICAL_BLOCK_SIZE="false"

6. Check the oracleasm status:

[root@localhost ~]# oracleasm status
Checking if ASM is loaded: no
Checking if /dev/oracleasm is mounted: no

7. Load the oracleasm kernel module to load the oracleasm module and mount the ASMlib driver filesystem:

[root@localhost ~]# /usr/sbin/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 the status now:

[root@localhost ~]# which oracleasm
/usr/sbin/oracleasm

[root@localhost ~]# oracleasm status
Checking if ASM is loaded: yes
Checking if /dev/oracleasm is mounted: yes

If oracleasm is not loaded and mounted after loading oracleasm kernel module, then you can follow the below steps:

[root@localhost ~]# which oracleasm
/usr/sbin/oracleasm
[root@localhost ~]# oracleasm status
Checking if ASM is loaded: no
Checking if /dev/oracleasm is mounted: no

[root@localhost ~]# modprobe oracleasm  
[root@localhost ~]# oracleasm status
Checking if ASM is loaded: yes
Checking if /dev/oracleasm is mounted: no

[root@localhost ~]# oracleasm init
Creating /dev/oracleasm mount point: /dev/oracleasm
Mounting ASMlib driver filesystem: /dev/oracleasm
[root@localhost ~]# mount | grep oracleasm
oracleasmfs on /dev/oracleasm type oracleasmfs (rw,relatime)

[root@localhost ~]# oracleasm status
Checking if ASM is loaded: yes
Checking if /dev/oracleasm is mounted: yes

I hope you have successfully installed and configured Oracle ASM in your VirtualBox.

This Post Has One Comment

Leave a Reply