[Oracle RAC 11.2 Installation on Oracle Linux 5.8 x86_64]: Installing asmlib


Need to install 3 packages:

  • oracleasm-*.rpm (package must match the kernel)
  • oracleasm-support*.rpm
  • oracleasmlib*.rpm


# yum search oracleasm
# yum search oracleasmlib
# yum search oracleasm-support

Packages that cannot be found in the Oracle repository should be downloaded from the official site:

http://www.oracle.com/technetwork/server-storage/linux/downloads/rhel5-084877.html

(by this link, probably nothing can be downloaded anymore)


Installing ASMlib packages

Server: node1, node2

First, determine which linux kernel is supported by the packages being installed.

Check which kernel is used on our virtual machine:

# uname -rm
2.6.32-300.10.1.el5uek x86_64

The repository has the latest oracleasm packages for the kernel. oracleasm-2.6.18-308.el5.x86_64

Need to select the required kernel.

In the grub.conf file, specify which kernel to use and then reboot the node.

# vi /etc/grub.conf


default=1
timeout=0
splashimage=(hd0,0)/boot/grub/splash.xpm.gz
hiddenmenu
title Oracle Linux Server (2.6.32-300.10.1.el5uek)
        root (hd0,0)
        kernel /boot/vmlinuz-2.6.32-300.10.1.el5uek ro root=LABEL=/
        initrd /boot/initrd-2.6.32-300.10.1.el5uek.img
title Oracle Linux Server-base (2.6.18-308.el5)
        root (hd0,0)
        kernel /boot/vmlinuz-2.6.18-308.el5 ro root=LABEL=/
        initrd /boot/initrd-2.6.18-308.el5.img


# reboot

After reboot:

# uname -rm
2.6.18-308.el5 x86_64

It is enough to run the following commands for installation:

# cd /tmp
# wget http://download.oracle.com/otn_software/asmlib/oracleasmlib-2.0.4-1.el5.x86_64.rpm


# yum install -y \
oracleasm-2.6.18-308.el5.x86_64 \
oracleasmlib-2.0.4-1.el5.x86_64.rpm \
oracleasm-support.x86_64

Make sure the following packages are installed on both cluster nodes

# rpm -qa | grep oracleasm
oracleasm-support-2.1.7-1.el5
oracleasm-2.6.18-308.el5-2.0.5-1.el5
oracleasmlib-2.0.4-1.el5



Configuring Oracle ASM

Server: node1, node2
# /etc/init.d/oracleasm configure


Default user to own the driver interface []: oracle11
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]: y
Writing Oracle ASM library driver configuration: done
Initializing the Oracle ASMLib driver:                 	[  OK  ]
Scanning the system for Oracle ASMLib disks:           	[  OK  ]

If [FAILED], check the logs

# less /var/log/oracleasm

The error may occur if incorrect user, group parameters are specified or if the wrong Oracle ASM driver version is selected (the driver must match the kernel).

# /etc/init.d/oracleasm status
Checking if ASM is loaded: yes
Checking if /dev/oracleasm is mounted: yes



Adding disks to ASM pool

Server: node1
# fdisk /dev/{mounted disk1}


# ls /dev/asm*

Label disks as ASM disks:

# /etc/init.d/oracleasm createdisk VOL1 /dev/asm-disk1
# /etc/init.d/oracleasm createdisk VOL2 /dev/asm-disk2
# /etc/init.d/oracleasm createdisk VOL3 /dev/asm-disk3
# /etc/init.d/oracleasm createdisk VOL4 /dev/asm-disk4
# /etc/init.d/oracleasm createdisk VOL5 /dev/asm-disk5
# /etc/init.d/oracleasm createdisk VOL6 /dev/asm-disk6
# /etc/init.d/oracleasm createdisk VOL7 /dev/asm-disk7

Marking disk "VOL1" as an ASM disk:                    	[  OK  ]

// If need to delete

# /etc/init.d/oracleasm deletedisk VOL1
# dd if=/dev/zero of=/dev/sdi1

// View list of ASM disks

# /etc/init.d/oracleasm listdisks

VOL1
VOL2
VOL3
VOL4
VOL5
VOL6
VOL7

// Or like this

# ls /dev/oracleasm/disks/
VOL1  VOL2  VOL3  VOL4  VOL5  VOL6  VOL7

// log file

# less /var/log/oracleasm

// In some cases, need to restart oracleasm

# /etc/init.d/oracleasm restart



Checking ASM installation and configuration

Server: node1, node2

node1:

# /etc/init.d/oracleasm scandisks

node2:

# /etc/init.d/oracleasm scandisks

node1:

# /etc/init.d/oracleasm listdisks

node2:

# /etc/init.d/oracleasm listdisks

Make sure disks are mounted on both servers. If not, reboot the nodes (after setting autostart priorities, see below)



Checking startup priority of packages

Server: node1, node2
# cd /etc/rc3.d

for example:

S60iscsi
S65iscsid
S80oracleasm