Monday, June 30, 2014

Install/Configure ASMLIB on Oracle Linux 6.5

 

Files to be installed:
  • kmod-oracleasm
  • oracleasm-support.x86_64
  • oracleasmlib

[root@vmxdb01 ~]# uname -a
Linux vmxdb01.dbaglobe.com 2.6.39-400.215.3.el6uek.x86_64 #1 SMP Fri Jun 20 00:37:05 PDT 2014 x86_64 x86_64 x86_64 GNU/Linux

[root@vmxdb01 ~]# yum install kmod-oracleasm oracleasm-support.x86_64

[root@vmxdb01 ~]# wget http://download.oracle.com/otn_software/asmlib/oracleasmlib-2.0.4-1.el6.x86_64.rpm

[root@vmxdb01 ~]# rpm -ihv oracleasmlib-2.0.4-1.el6.x86_64.rpm

Configure the ASMLIB:

[root@vmxdb01 ~]# /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]: y
Writing Oracle ASM library driver configuration: done
Initializing the Oracle ASMLib driver:                     [  OK  ]
Scanning the system for Oracle ASMLib disks:               [  OK  ]

[root@vmxdb01 ~]# /etc/init.d/oracleasm createdisk VOL4G /dev/sdb1
Marking disk "VOL4G" as an ASM disk:                       [  OK  ]
[root@vmxdb01 ~]# /etc/init.d/oracleasm createdisk VOL12G /dev/sdc1
Marking disk "VOL12G" as an ASM disk:                      [  OK  ]

[root@vmxdb01 ~]# ls -l /dev/sd[bc]1 /dev/oracleasm/disks/
brw-rw----. 1 root disk 8, 17 Jun 29 22:29 /dev/sdb1
brw-rw----. 1 root disk 8, 33 Jun 29 22:26 /dev/sdc1

/dev/oracleasm/disks/:
total 0
brw-rw----. 1 oracle dba 8, 33 Jun 29 22:26 VOL12G
brw-rw----. 1 oracle dba 8, 17 Jun 29 22:29 VOL4G


[root@vmxdb01 ~d]# oracleasm querydisk -d /dev/sdb1
Device "/dev/sdb1" is marked an ASM disk with the label "VOL4G"
[root@vmxdb01 ~]# oracleasm querydisk -d VOL4G
Disk "VOL4G" is a valid ASM disk on device [8,17]

[root@vmxdb01 ~]# 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:VOL12G [25163776 blocks (12883853312 bytes), maxio 512]
Discovered disk: ORCL:VOL4G [8385867 blocks (4293563904 bytes), maxio 512]

Create the DiskGroup:

SQL> CREATE DISKGROUP DATA EXTERNAL REDUNDANCY  DISK 'ORCL:VOL12G' SIZE 12287M  ATTRIBUTE 'compatible.asm'='11.2.0.0.0','au_size'='1M' /* ASMCA */
NOTE: Assigning number (1,0) to disk (ORCL:VOL12G)
NOTE: initializing header on grp 1 disk VOL12G
NOTE: initiating PST update: grp = 1
GMON updating group 1 at 1 for pid 17, osid 2509
NOTE: group DATA: initial PST location: disk 0000 (PST copy 0)
NOTE: PST update grp = 1 completed successfully
NOTE: cache registered group DATA number=1 incarn=0x9798f809
NOTE: cache began mount (first) of group DATA number=1 incarn=0x9798f809
NOTE: cache opening disk 0 of grp 1: VOL12G label:VOL12G
NOTE: cache creating group 1/0x9798F809 (DATA)
NOTE: cache mounting group 1/0x9798F809 (DATA) succeeded
NOTE: allocating F1X0 on grp 1 disk VOL12G
NOTE: Created Used Space Directory for 1 threads
NOTE: diskgroup must now be re-mounted prior to first use
NOTE: cache dismounting (clean) group 1/0x9798F809 (DATA)
NOTE: messaging CKPT to quiesce pins Unix process pid: 2509, image: oracle@vmxdb01.dbaglobe.com (TNS V1-V3)
NOTE: lgwr not being msg'd to dismount
NOTE: cache dismounted group 1/0x9798F809 (DATA)
GMON dismounting group 1 at 2 for pid 17, osid 2509
GMON dismounting group 1 at 3 for pid 17, osid 2509
NOTE: Disk VOL12G in mode 0x7e marked for de-assignment
SUCCESS: diskgroup DATA was created

Possible errors if oracleasmlib not installed:

1. oracleasm-discover is missing

2. /opt/oracle/extapi/64/asm/orcl/1/libasm.so is missing

3. Errors:ORA-15014 ORA-15031

Sun Jun 29 23:45:52 2014
SQL> CREATE DISKGROUP DATA EXTERNAL REDUNDANCY  DISK '/dev/oracleasm/disks/VOL12G' SIZE 12287M  ATTRIBUTE 'compatible.asm'='11.2.0.0.0','au_size'='1M' /* ASMCA */
NOTE: failed to discover disks from gpnp profile asm diskstring
Errors in file /u01/app/oracle/diag/asm/+asm/+ASM/trace/+ASM_rbal_20523.trc:
ORA-29786: SIHA attribute GET failed with error [Attribute 'ASM_DISKSTRING' sts[200] lsts[0]]
ORA-15018: diskgroup cannot be created
ORA-15031: disk specification '/dev/oracleasm/disks/VOL12G' matches no disks
ORA-15014: path '/dev/oracleasm/disks/VOL12G' is not in the discovery set
ERROR: CREATE DISKGROUP DATA EXTERNAL REDUNDANCY  DISK '/dev/oracleasm/disks/VOL12G' SIZE 12287M  ATTRIBUTE 'compatible.asm'='11.2.0.0.0','au_size'='1M' /* ASMCA */
Sun Jun 29 23:45:52 2014
GMON dismounting group 1 at 2 for pid 17, osid 20619
ERROR: diskgroup DATA was not created
Sun Jun 29 23:46:12 2014
NOTE: failed to discover disks from gpnp profile asm diskstring
Errors in file /u01/app/oracle/diag/asm/+asm/+ASM/trace/+ASM_rbal_20523.trc:
ORA-29786: SIHA attribute GET failed with error [Attribute 'ASM_DISKSTRING' sts[200] lsts[0]]
Sun Jun 29 23:46:12 2014