Saturday, August 28, 2010

How To Setup ASM & ASMLIB On Native Linux Multipath Mapper disks?

Applies to:
Oracle Server - Enterprise Edition - Version: 10.1.0.2 to 11.1.0.7
Linux Itanium
Linux x86-64
Goal
The present document provides an example about how to setup ASM & ASMLIB disks using
Mapper Multipath disks.
Solution

1) Install the ASMLIB API (on each node for RAC environments) and configure it following the steps described in the
next documents:
http://www.oracle.com/technology/tech/linux/asmlib/index.html
http://www.oracle.com/technology/tech/linux/asmlib/install.html

2) Partition the mapper devices located at /dev/dm-* thru the fdisk command, Oracle recommends creating one partition
per disks as follow:
# fdisk /dev/dm-
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-1017, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-1017, default 1017):
Using default value 1017
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Note: Keep in mind for ASMLIB disks you will need to use the /dev/dm-* disks instead of the /dev/mapper/mpath* devices since they are present in the partition table ==)> /proc/partitions and ASMLIB will look at that
file during the disk discovering phase. If you do not use the disks located at /dev/dm-* then ASM will not be
able to discover them.

3) Check the partition was created (you should see both the dm- and the dm-):
# ls -l /dev/dm-*
brw-rw---- 1 root disk 8, 0 Jun 11 15:11 dm-
brw-rw---- 1 root disk 8, 1 Jun 11 19:12 dm-

4) Update the kernel partition table with the new partition as follow:
# /sbin/partprobe /dev/dm-

5) Check the new partition is present in the /proc/partitions file.
# cat /proc/partitions

6) Create the ASMLIB disks on the new mapper partitions as follow:
# /etc/init.d/oracleasm createdisk DISK1 /dev/dm-

7) If this is a RAC configuration, then from each node execute:
# /etc/init.d/oracleasm scandisks
# /etc/init.d/oracleasm listdisks

8) After you complete the creation of each ASMLIB disk you will need to configure ASMLIB to use multipath disks as
described in the next document (from each node on RAC environments):
http://www.oracle.com/technology/tech/linux/asmlib/multipath.html
For the ORACLEASM_SCANORDER parameter you need to set it using the dm-XX devices as

follow:
ORACLEASM_SCANORDER="dm"

NOTE: When scanning, only the device names known by the kernel are scanned. With device-mapper, the
kernel sees the devices as /dev/dm-XX. The /dev/mapper/XXX names are created by udev for human readability.
Any configuration of ORACLEASM_SCANORDER or ORACLEASM_SCANEXCLUDE must use the dm prefix.

9) Create the diskgroup(s) on the new ASMLIB disks
https://support.oracle.com/CSP/main/article?cmd=show&type=NOT&doc...

Example:
SQL> create diskgroup DATA external redundancy disk 'ORCL:DISK1';
Note: Oracle really and strongly recommends using ASMLIB instead of udev since it effectively handles
multipath disks per the advantages described in the next document:

Note: 394959.1 Device Persistence and Oracle Linux ASMLib

Note: On release RH 5 the /dev/dm-N devices are not persistent, starting, these devices are no longer created
by udev. So release RedHat 5 you can create the ASMLIB disks on the /dev/mpath/ or /dev/mapper
/
Example:
# /etc/init.d/oracleasm createdisk VOL1 /dev/mpath/sata01p1
Or
# /etc/init.d/oracleasm createdisk VOL1 /dev/mapper/mpath2p1

References
ASMLIB
mapper Linux /dev/dm-* /dev/mapper/mpath*
mapper ASMLIB Linux
multipath ASMLIB mapper
multipath ASM ASMLIB mapper
multipath ASMLIB mapper Linux
multi path ASMLIB mapper dm- mpath
fdisk partprobe ASMLIB ASM mapper
Related
Products

Oracle Database Products > Oracle Database > Oracle Database > Oracle Server - Enterprise Edition
Keywords
CONFIGURATION; ORACLEASM; ASMLIB

No comments:

Post a Comment