Create and Configure Oracle ASM Disk in Linux

Create and Configure Oracle ASM Disk in Linux: In this article we will see how to Create and Configure Oracle ASM Disk in Linux.

Before this article, read the following article to add Disk on VirtualBox.

How to Add Hard disk in VirtualBox and Disk format and Mount Steps on Linux.

In the above article, /dev/sdb and /dev/sdc two disks were added and partitioning done for both. We mounted the first one as /dev/sdb1 /u03.

Install the package Oracle database prereuisites :

Make sure oracle database prereuisites are installed on this server. You need to install prerequisites as per your required Database version. Here we install prereuisites for Oracle 19c.

[root@localhost ~]# yum search preinstall
Loaded plugins: langpacks, ulninfo
======================================================================= N/S matched: preinstall ========================================================================
oracle-database-preinstall-19c.x86_64 : Oracle Database Preinstallation RPM
oracle-database-preinstall-21c.x86_64 : Oracle Database Preinstallation RPM
oracle-database-preinstall-18c.x86_64 : Sets the system for Oracle Database single instance and Real Application Cluster install for Oracle Linux 7
oracle-database-server-12cR2-preinstall.x86_64 : Sets the system for Oracle Database single instance and Real Application Cluster install for Oracle Linux 7
oracle-rdbms-server-11gR2-preinstall.x86_64 : Sets the system for Oracle single instance and Real Application Cluster install for Oracle Linux 7
oracle-rdbms-server-12cR1-preinstall.x86_64 : Sets the system for Oracle Database single instance and Real Application Cluster install for Oracle Linux 7

  Name and summary matches only, use "search all" for everything.
[root@localhost ~]#
[root@localhost ~]#

[root@localhost ~]# yum install oracle-database-preinstall-19c.x86_64 -y

Installing and Configuring Oracle ASMLIB Software :

ASMLib software is used to format or configure any disk on Linux as an ASM disk. Download and install them as given below.

[root@localhost ~]#
[root@localhost ~]# yum install oracleasm
[root@localhost ~]#
[root@localhost ~]# yum install oracleasm-support.x86_64
[root@localhost ~]#
[root@localhost ~]# yum install kmod-oracleasm
[root@localhost ~]#
[root@localhost ~]# yum install oracleasmlib

After installing Oracle ASM lib packages you need to configure as below.

[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 []: oracle
Default group to own the driver interface []: oinstall
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
[root@localhost ~]#

Check oracleasm status :

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

Load the oracleasm kernel module :

[root@localhost ~]# 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
[root@localhost ~]#

Now prepare /dev/sdc1 partition as Oracle ASM Disk.

Create asm disk :

[root@localhost ~]# oracleasm createdisk DATA /dev/sdc1
Writing disk header: done
Instantiating disk: done
[root@localhost ~]#

Lastly, Check list of ASM disks :

[root@localhost ~]# oracleasm listdisks
DATA
[root@localhost ~]#
[root@localhost ~]#
[root@localhost ~]# oracleasm scandisks
Reloading disk partitions: done
Cleaning any stale ASM disks...
Scanning system for ASM disks...
[root@localhost ~]#
[root@localhost ~]#
[root@localhost ~]# oracleasm listdisks
DATA
[root@localhost ~]#
Now Oracle ASM Disk (DATA) is created, we can use it for Automatic Storage Management Installation.

I hope my written content will helped you. Your suggestions/feedback are most welcome from orakldba.com.
Keep learning… Have a great day!!!
Please comment here for your any query related to above content. You can write to mail me through : orakldba@gmail.com.

1 thought on “Create and Configure Oracle ASM Disk in Linux”

Leave a Comment