Tuesday, September 8, 2009

Oracle ASMLIB configuration - 11gR2

There are 3 storage options to setup ASM on Linux
1) Raw devices
2) ASMlib
3) Block devices
In this post i have focused on ASMlib which is oracle's recomended storage options. I am on Redhat Linux AS 4 ( 2.6.9-78.ELsmp)

The very first thing we need to do is identify the partition which can be used for asm storage, i have used local drive and created partition using
fdisk /dev/sda
Note: do not create any file system on the partition

once the partition's are created you can download the asmlib rpm's from oracle.
check the Linux release and download asmlib drivers
uname -rm
2.6.9-78.ELsmp x86_64
and download drivers from oracle site, match the above release http://www.oracle.com/technology/software/tech/linux/asmlib/rhel4.html

Example:
oracleasm-2.6.9-78.ELsmp-2.0.5-1.el4
We have to download three rpm's and apply in same order
1)oracleasm-support-2.1.3-1.el4.x86_64.rpm
2)oracleasm-2.6.9-78.ELsmp-2.0.5-1.el4.x86_64.rpm
3)oracleasmlib-2.0.4-1.el4.x86_64.rpm

Once rpm's are installed verfiy
rpm -qa | grep oracleasm -- should return above three

Once ASMLIB software is installed make asm driver available by below commands, this will create /dev/oracleasm mount point
#/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 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) [y]: 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 ]

Check status
#/etc/init.d/oracleasm

Next, use below create disk to place the disk in asm management
#/etc/init.d/oracleasm createdisk ORADATA /dev/sda6
Checking if ASM is loaded: yes
Checking if /dev/oracleasm is mounted: yes

#df -ha must show
oracleasmfs 0 0 0 - /dev/oracleasm

check if the disks created above can be discovered,
#/usr/sbin/oracleasm-discover
Using ASMLib from /opt/oracle/extapi/64/asm/orcl/1/libasm.so
[ASM Library - Generic Linux, version 2.0.4 (KABI_V2)]
Discovered disk: ORCL:ORADATA [230468427 blocks (117999834624 bytes), maxio 256]

Install ASM from grid infrastructure home.Download grid control from below link for 11gR2 and install ASM.

http://www.oracle.com/technology/software/products/database/oracle11g/112010_linx8664soft.html

1 comment:

Muskeen said...

Hi there,
My name Kabir and email address is kabir.kazimi@astound.net , in case if you want to respond back. I live in the States.I looked at your blog and I this one question. You see to have gotten ASM working for you for 11gR2. I want to copy my df -ha from Linux server and then ask you my question.

[root@rac2 ~]# uname -rm
2.6.18-164.el5 x86_64

[root@rac2 ~]# df -ha
Filesystem Size Used Avail Use% Mounted on
/dev/sda2 20G 3.6G 15G 20% /
proc 0 0 0 - /proc
sysfs 0 0 0 - /sys
devpts 0 0 0 - /dev/pts
/dev/sda6 2.0G 36M 1.9G 2% /home
/dev/sdb2 3.0G 71M 2.8G 3% /tmp
/dev/sda3 310G 6.0G 289G 3% /u01
/dev/sdb1 340G 9.9G 312G 4% /u02
/dev/sda1 251M 16M 222M 7% /boot
tmpfs 1.9G 0 1.9G 0% /dev/shm
none 0 0 0 - /proc/sys/fs/binfmt_misc
sunrpc 0 0 0 - /var/lib/nfs/rpc_pipefs
nfsd 0 0 0 - /proc/fs/nfsd

you mentioned at the top of your blog that " Note: do not create any filesystem in /dev/sda2, for example".

I want to user one of the su-partition of my /dev/sda , namely /dev/sda6, to install ASMLib in it in order to be able to use ASM storage.

My question is why is this not possible? Hope this comment will reach at healthy times. If you get please respond to ASAP. Good blog by the way
thanks,
Kabir
kabir.kazimi@astound.net