Creation of ASM disks on Oracle Linux using ASMLib

This article describes the creating of Oracle ASM disks on Oracle Linux 6u5 with Unbreakable Enterprise Kernel using the Oracle ASMLib.

This article is the first part of installing Oracle Database 11.2.0.4 with Oracle Grid infrastructure 11.2.0.4 standalone on Oracle Linux 6 update 5.

Table of Contents:

– Description of Oracle ASM Lib

– Setting up Oracle ASMLib on Oracle Linux.

– Creation of the user Oracle

– Creating Oracle ASM disks.

1. Description of Oracle ASM Lib

ASMLib is an optional support library for the Automatic Storage Management feature of the Oracle Database. Automatic Storage Management (ASM) simplifies database administration and greatly reduces kernel resource usage.  It eliminates the need for the DBA to directly manage potentially thousands of Oracle database files, requiring only the management of groups of disks allocated to the Oracle Database. ASMLib allows an Oracle Database using ASM more efficient and capable access to the disk groups it is using. For More Information, URL.

2. Setting up Oracle ASMLib on Oracle Linux:

The Oracle ASMLib kernel driver is now included in the Unbreakable Enterprise Kernel.  No driver package needs to be installed when using this kernel.

#  uname -a
Linux ol6u5.local.domain 3.8.13-16.2.1.el6uek.x86_64 #1 SMP Thu Nov 7 17:01:44 PST 2013 x86_64 x86_64 x86_64 GNU/Linux
# lsb_release -r
Release:        6.5

Note: I am using Oracle Linux version 6 update 5 with the kernel version is 3.8.13-16.2.1.el6uek

Installing the package oracleasm-support:

The package oracleasm-support is existed on the Oracle Linux DVD.

Just install it from the DVD with the command RPM or with the command YUM after the configuration of the repository.

Set up an YUM repository using the DVD image.

# yum install oracleasm-support

 Download the package Oracle ASMLib 2.0

# rpm -Uvh oracleasmlib-2.0.4-1.el6.x86_64.rpm

 3. Creation of the user Oracle:

We will create the user Oracle with the group oinstall as the primary group and the group dba as a secondary group.

Also with Oracle Linux, there are two packages oracle-rdbms-server-12cR1-preinstall and oracle-rdbms-server-11gR2-preinstal preconfigured that include the user creation and many others thinks:

  • Automatically downloading and installing any additional software packages and specific package versions needed for installing Oracle Grid Infrastructure and Oracle Database 12 c Release 1 (12.1) or 11g Release 2 (11.2.0.3), with package dependencies resolved via yum or up2date capabilities.
  • Creating the user oracle and the groups oinstall (for OraInventory) and dba (for OSDBA), which are used during database installation. (For security purposes, this user has no password by default and cannot log in remotely. To enable remote login, please set a password using the passwd tool.)
  • Modifying kernel parameters in /etc/sysctl.conf to change settings for shared memory, semaphores, the maximum number of file descriptors, and so on.
  • Setting hard and soft shell resource limits in /etc/security/limits.conf, such as the locked-in memory address space, the number of open files, the number of processes, and core file size.
  • Setting numa=off in the kernel for x86_64 machines.

For more info.

Note: Just install one of them and deponds of the Oracle Database version that you want to install.

# yum install oracle-rdbms-server-12cR1-preinstall

Or

# yum install oracle-rdbms-server-11gR2-preinstal

Note: Just create the password of the user oracle.

# password oracle

To check the identification of the user oracle:

# id oracle
uid=54321(oracle) gid=54321(oinstall) groups=54321(oinstall),54322(dba)

 4. Creating Oracle ASM disks:

After a successful oracleasm installing there command oracleasm which will manage the ASM disks.

# /etc/init.d/oracleasm 
Usage: /etc/init.d/oracleasm {start|stop|restart|enable|disable|configure|createdisk|deletedisk|querydisk|listdisks|scandisks|status}

Step 1: Configure the Oracle ASMLib:

configure the ASM kernel module as the user oracle will be the default user to own the driver interface and the group dba the default group to own the driver interface.

# /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 <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 []: dba 
Start Oracle ASM library driver on boot (y/n) [n]: y 
Scan for Oracle ASM disks on boot (y/n) [y]: 
Writing Oracle ASM library driver configuration: done
Initializing the Oracle ASMLib driver:                     [  OK ]
Scanning the system for Oracle ASMLib disks:               [  OK ]

Step 2: Creation of One Disk Partition :

I have one disk has the name sdb, and I created one partition sdb1 with the command fdisk.

# fdisk /dev/sdb
........
Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-261, default 1):
Using default value 1
Last cylinder, +cylinders or +size{K,M,G} (1-261, default 261):
Using default value 261
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.

Step 3 : Check the creation of the partition:

# fdisk -l /dev/sdb
Disk /dev/sdb: 2147 MB, 2147483648 bytes
255 heads, 63 sectors/track, 261 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xf45d832b
   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1         261     2096451   83  Linux

Step 4: Creation of One ASM disk:

# /etc/init.d/oracleasm  createdisk  ASM1 /dev/sdb1
Marking disk "ASM1" as an ASM disk:                    [  OK  ]
# /etc/init.d/oracleasm scandisks
Scanning the system for Oracle ASMLib disks:           [  OK  ]
# /etc/init.d/oracleasm listdisks
ASM1

Note:  To create many Oracle ASM disks, just do the same with your disks.

Conclusion:

This article describes how to set up Oracle ASM disks on Oracle Linux using ASMLib.

Share it now!
Bookmark the permalink.
Loading Facebook Comments ...

2 Responses to Creation of ASM disks on Oracle Linux using ASMLib

  1. Pingback: Wadhah DAOUEHI - Part 2: Upgrade Oracle Grid Infrastructure & Database from 11gR2 to 12C

  2. Pingback: Wadhah DAOUEHI - List of Linux physical devices, mapped by ASM disks, using Major & minor number

Leave a Reply