ASM HANDS-ON TRAINING

Lab 2 Install and Configure ASMLib
Alejandro Vargas | Principal Support Consultant
Oracle Advanced Customer Services

INDEX
Part 1 : Install The ASMLib Drivers...............................................................................................................................2
Cheking The Kernel Version.........................................................................................................................................2
Downloading the Drivers for ASMLib............................................................................................................................2
Installing the ASMLib Drivers .......................................................................................................................................3
Part 2 : Configure ASMLib.............................................................................................................................................4
Configure ASMLib ........................................................................................................................................................4
Create ASM Disks
......................................................................................................................................................................................5
Part 3 : ASMLib Directory Structures............................................................................................................................6
ASM Directories
.......................................................................................................................................................................................6
ASM files on /opt directory............................................................................................................................................7
Map ASMLib Disks to Physical Devices .......................................................................................................................8
File /etc/sysconfig/oracleasm .......................................................................................................................................8
ASM init file....................................................................................................................................................................9
Scripts..........................................................................................................................................................................10

1/10

el5.el5-2.18-8.i386.rpm Aditionally we need to download the driver that exactly match our kernel.el5 #1 SMP Tue Jun 5 23:11:13 EDT 2007 i686 i686 i386 GNU/Linux Downloading the Drivers for ASMLib On the download page find the OS you are using.oracle.0.6.com/technology/tech/linux/asmlib/index.18-8.com/technology/software/tech/linux/asmlib/rhel5.18-8. http://www.i386.0.el5: Drivers for kernel 2.rpm • oracleasmlib-2.6. in our case OEL 5.rpm In our lab the drivers were already downloaded and are located in this directory: /root/asmlibrpms 2/10 .el5 • oracleasm-2.6.ASM HANDS-ON TRAINING Lab 2 Install and Configure ASMLib Part 1 : Install The ASMLib Drivers Cheking The Kernel Version [oracle@asmxpt ~]$ uname -a Linux asmxpt 2. that is 2.18-8.1.oracle.3-1.html Once on the page “Oracle ASMLib Downloads for Red Hat Enterprise Linux Server 5” http://www.4-1.el5.i686.6.el5.html we need to find the drivers for “Intel IA32 (x86) Architecture” and download the generic Library and Tools drivers located at the head of the group: Library and Tools • oracleasm-support-2.2-1.

rpm Preparing.4-1.el5 ########################################### 3:oracleasmlib ########################################### 3/10 [100%] [ 33%] [ 67%] [100%] ..4-1.18-8.18-8.ASM HANDS-ON TRAINING Lab 2 Install and Configure ASMLib Installing the ASMLib Drivers As root execute the following commands: # cd /root/asmlibrpms # rpm -Uvh /root/asmlibrpms/oracleasm-support-2.3-1.6. ########################################### 1:oracleasm-support ########################################### 2:oracleasm-2.i386..i386.el5.el5-2.el5.rpm \ /root/asmlibrpms/oracleasmlib-2.0.i686.rpm \ /root/asmlibrpms/oracleasm-2.0.6.el5.0.

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 Fix permissions of Oracle ASM disks on boot (y/n) [y]: y Writing Oracle ASM library driver configuration: Creating /dev/oracleasm mount point: Loading module "oracleasm": Mounting ASMlib driver filesystem: 4/10 [ [ [ [ OK OK OK OK ] ] ] ] . it will return a list of available commands. Ctrl-C will abort.d/oracleasm Usage: /etc/init. The current values will be shown in brackets ('[]').ASM HANDS-ON TRAINING Lab 2 Install and Configure ASMLib Part 2 : Configure ASMLib Configure ASMLib Once ASMLib is installed we can execute it’s executable ‘oracleasm’ located at /etc/init.d. The following questions will determine whether the driver is loaded on boot and what permissions it will have. Hitting <ENTER> without typing an answer will keep that current value. [root@asmxpt asmlibrpms]# /etc/init. This will configure the on-boot properties of the Oracle ASM library driver.d/oracleasm configure Configuring the Oracle ASM library driver.d/oracleasm {start|stop|restart|enable|disable|configure|createdisk|deletedisk| querydisk|listdisks|scandisks|status} ASMLib configure command: [root@asmxpt asmlibrpms]# /etc/init.

d/oracleasm listdisks VOL1 VOL2 VOL3 VOL4 5/10 vol1 /dev/sdb1 [ OK vol2 /dev/sdc1 [ OK vol3 /dev/sdd1 [ OK vol4 /dev/sde1 [ OK ] ] ] ] .d/oracleasm status Checking if ASM is loaded: Checking if /dev/oracleasm is mounted: Create ASM Disks We have a set of 8 LUN’s ready.d/oracleasm createdisk "/dev/sde1" as an ASM disk: Check the created ASM disks [root@asmxpt ~]# /etc/init. we will create 4 ASM disks on LUN’s sdb1.d/oracleasm createdisk "/dev/sdd1" as an ASM disk: ~]# /etc/init.ASM HANDS-ON TRAINING Lab 2 Install and Configure ASMLib Scanning system for ASM disks: [ OK ] [ [ OK OK ] ] Checking ASMLib status [root@asmxpt asmlibrpms]# /etc/init.d/oracleasm createdisk "/dev/sdc1" as an ASM disk: ~]# /etc/init.d/oracleasm createdisk "/dev/sdb1" as an ASM disk: ~]# /etc/init.sdc1.sdd1 and sde1 [root@asmxpt Marking disk [root@asmxpt Marking disk [root@asmxpt Marking disk [root@asmxpt Marking disk ~]# /etc/init.

17 Jan 31 22:13 /dev/sdb1 6/10 .1 ~]# ls -l /dev/oracleasm/disks oracle oracle oracle oracle dba dba dba dba 8.1 oracle dba 8. 17 33 49 65 Jan Jan Jan Jan 31 31 31 31 22:23 22:24 22:24 22:24 VOL1 VOL2 VOL3 VOL4 The major and minor numbers permit to map the ASM Disks to the physical devices [root@asmxpt ~]# ls -l /dev/* | grep 8. | grep " 17 " brw-rw---. 8. 8.1 brw-rw---. 8.1 brw-rw---.ASM HANDS-ON TRAINING Lab 2 Install and Configure ASMLib Part 3 : ASMLib Directory Structures ASM Directories Once ASM is configured and ASM disks are created several structures are created [root@asmxpt ~]# ls -l /dev/oracleasm/ total 0 drwxr-xr-x 1 root root 0 Jan 31 22:13 disks drwxrwx--.1 oracle dba 0 Jan 31 22:13 iid On the /dev/oracleasm/disks directory are located the ASMLib mappings of ASM devices to physical devices [root@asmxpt total 0 brw-rw---.1 brw-rw---.

/oracle/extapi/32/asm/orcl/1 24K ./oracle/extapi/32/asm/orcl 28K .0K ORCLfmap/prot1_32/log 8.ASM HANDS-ON TRAINING Lab 2 Install and Configure ASMLib ASM files on /opt directory Note that is the ASM directories located on opt are removed ASMLib still will be appera to be functional./oracle/ 20K ./oracle/extapi/32/asm 32K ./oracle/extapi 40K ./oracle/ [oracle@asmxpt /opt]$ du -h ORCLfmap/ 940K ORCLfmap/prot1_32/bin 4.org2. but discovery will not work./oracle/extapi/32 36K .0K ORCLfmap/prot1_32/etc 956K ORCLfmap/prot1_32 960K ORCLfmap/ 7/10 openoffice.3 oracle OracleCalendar_inst ORCLfmap . I’ve seen this problem happening a couple of times [oracle@asmxpt ~]$ cd [oracle@asmxpt /opt]$ drwxr-xr-x 8 root drwxr-xr-x 3 root drwxrwxr-x 3 root drwxr-xr-x 3 root /opt ls -l | grep -i or root 4096 Sep 10 2007 root 4096 Jan 31 22:05 users 4096 Oct 15 12:54 root 4096 Oct 16 17:31 [oracle@asmxpt /opt]$ du -h .

Please use that method # to modify this file # ORACLEASM_ENABELED: 'true' means to load the driver on boot. it is updated by running oracleasm configure. [8. Usually scanorder and scanexclude can be manually configured if necessary [root@asmxpt etc]# strings .ASM HANDS-ON TRAINING Lab 2 Install and Configure ASMLib Map ASMLib Disks to Physical Devices Using a script we can check which is the mapping of ASM disks to physical devices [root@asmxpt ~]# . ORACLEASM_ENABLED=true # ORACLEASM_UID: Default user owning the /dev/oracleasm mount point. [8. 17] 33] 49] 65] File /etc/sysconfig/oracleasm The /etc/sysconfig/oracleasm file has configurable parameters to control ASMLib behaviour./sysconfig/oracleasm # This is a configuration file for automatic loading of the Oracle # Automatic Storage Management library kernel driver./chkasmdisks ASM disk VOL1 based on /dev/sdb1 ASM disk VOL2 based on /dev/sdc1 ASM disk VOL3 based on /dev/sdd1 ASM disk VOL4 based on /dev/sde1 [8. [8. ORACLEASM_GID=dba # ORACLEASM_SCANBOOT: 'true' means fix disk perms on boot ORACLEASM_SCANBOOT=true # ORACLEASM_CLEARBOOT: 'true' means clean old disk perms on boot ORACLEASM_CLEARBOOT=true 8/10 . It is generated # By running /etc/init. ORACLEASM_UID=oracle # ORACLEASM_GID: Default group owning the /dev/oracleasm mount point.d/oracleasm configure.

d/rc4.d/S29oracleasm /etc/rc.d/oracleasm /etc/rc.d/rc5.d/rc2.d/S29oracleasm /etc/rc.d/K20oracleasm /etc/rc.d/S29oracleasm /etc/rc.d/K20oracleasm 9/10 .d/init.d/rc0.d/S29oracleasm /etc/rc.d/K20oracleasm /etc/rc.d/rc3.d/rc1.ASM HANDS-ON TRAINING Lab 2 Install and Configure ASMLib # ORACLEASM_SCANORDER: Matching patterns to order disk scanning ORACLEASM_SCANORDER= # ORACLEASM_SCANEXCLUDE: Matching patterns to exclude disks from scan ORACLEASM_SCANEXCLUDE= ASM init file One init file is setup at ASMLib install time on different levels of system startup/shutdown init directories /etc/rc.d/rc6.

d/oracleasm listdisks` | cut -f2.ASM HANDS-ON TRAINING Lab 2 Install and Configure ASMLib Scripts #!/bin/ksh # chkasmdisks /etc/init.11 -d" " | perl -pe 's/"(. *$v_major " | awk '{print $10}'` echo "ASM disk $v_asmdisk based on /dev/$v_device [$v_minor.*).d/oracleasm querydisk `/etc/init.*)\]/$1 $2 $3/g.' | while read v_asmdisk v_minor v_major do v_device=`ls -la /dev | grep " $v_minor.10. *(.*)". $v_major]" done # eof chkasmdisks End of Lab2 10/10 .*\[(.

Sign up to vote on this title
UsefulNot useful