Sunday, May 1, 2011

Configure Oracle ASMLIB on RHEL5

[root@vmxdb02 ~]# groupadd -g 500 oinstall
[root@vmxdb02 ~]# groupadd -g 501 dba
[root@vmxdb02 ~]# useradd -g 500 -G 501 -u 500 -m -d /home/oracle oracle
[root@vmxdb02 ~]# echo ora123|passwd --stdin oracle
Changing password for user oracle.
passwd: all authentication tokens updated successfully.


[root@vmxdb02 stage]# rpm -ihv oracleasm-support-2.1.4-1.el5.i386.rpm
warning: oracleasm-support-2.1.4-1.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID b38a8516
Preparing... ########################################### [100%]
1:oracleasm-support ########################################### [100%]
[root@vmxdb02 stage]# rpm -ihv oracleasm-2.6.18-238.el5-2.0.5-1.el5.i686.rpm
Preparing... ########################################### [100%]
1:oracleasm-2.6.18-238.el########################################### [100%]
[root@vmxdb02 stage]# rpm -ihv oracleasmlib-2.0.4-1.el5.i386.rpm
Preparing... ########################################### [100%]
1:oracleasmlib ########################################### [100%]
[root@vmxdb02 stage]# /etc/init.d/
acpid cups-config-daemon irqbalance multipathd portmap single
anacron dnsmasq iscsi netconsole psacct smartd
apmd dund iscsid netfs rawdevices sshd
atd firstboot isdn netplugd rdisc syslog
auditd functions kdump network readahead_early sysstat
autofs gpm killall NetworkManager readahead_later vmware-tools
avahi-daemon haldaemon krb524 nfs restorecond vncserver
avahi-dnsconfd halt kudzu nfslock rhnsd wdaemon
bluetooth hidd lvm2-monitor nscd rpcgssd winbind
capi hplip mcstrans ntpd rpcidmapd wpa_supplicant
conman ip6tables mdmonitor oracleasm rpcsvcgssd xfs
cpuspeed ipmi mdmpd oraclevalidated saslauthd xinetd
crond iptables messagebus pand sendmail ypbind
cups irda microcode_ctl pcscd setroubleshoot yum-updatesd
[root@vmxdb02 stage]# /etc/init.d/oracle
oracleasm oraclevalidated
[root@vmxdb02 stage]# /etc/init.d/oracleasm
Usage: /etc/init.d/oracleasm {start|stop|restart|enable|disable|configure|createdisk|deletedisk|querydisk|listdisks|scandisks|status}
[root@vmxdb02 stage]# /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) [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 ]
[root@vmxdb02 stage]# /etc/init.d/oracleasm createdisk
Action "createdisk" requires two arguments, the device and the label.
See oracleasm.init(8) for more information.
[root@vmxdb02 stage]# /etc/init.d/oracleasm createdisk /dev/sdb1
Action "createdisk" requires two arguments, the device and the label.
See oracleasm.init(8) for more information.
[root@vmxdb02 stage]# man oracleasm.init
[root@vmxdb02 stage]# /etc/init.d/oracleasm createdisk DISK1 /dev/sdb1
Marking disk "DISK1" as an ASM disk: [ OK ]
[root@vmxdb02 stage]# /etc/init.d/oracleasm createdisk DISK2 /dev/sdb2
Marking disk "DISK2" as an ASM disk: [ OK ]
[root@vmxdb02 stage]# /etc/init.d/oracleasm createdisk DISK3 /dev/sdb3
Marking disk "DISK3" as an ASM disk: [ OK ]
[root@vmxdb02 stage]# /etc/init.d/oracleasm createdisk DISK4 /dev/sdb4
Marking disk "DISK4" as an ASM disk: [ OK ]
[root@vmxdb02 stage]# /etc/init.d/oracleasm listdisks
DISK1
DISK2
DISK3
DISK4
[root@vmxdb02 stage]# /etc/init.d/oracleasm querydisk disk1
Disk "DISK1" is a valid ASM disk
[root@vmxdb02 stage]# /etc/init.d/oracleasm status
Checking if ASM is loaded: yes
Checking if /dev/oracleasm is mounted: yes
[root@vmxdb02 stage]# ls -l /dev/oracleasm/
total 0
drwxr-xr-x 1 root root 0 May 1 11:42 disks
drwxrwx--- 1 oracle dba 0 May 1 11:42 iid
[root@vmxdb02 stage]# ls -l /dev/oracleasm/disks/
total 0
brw-rw---- 1 oracle dba 8, 17 May 1 11:44 DISK1
brw-rw---- 1 oracle dba 8, 18 May 1 11:44 DISK2
brw-rw---- 1 oracle dba 8, 19 May 1 11:44 DISK3
brw-rw---- 1 oracle dba 8, 20 May 1 11:45 DISK4
[root@vmxdb02 stage]#