Sie sind auf Seite 1von 8

Application Notes

Device Mapper Multipath with Oracle


ASM on Linux

Part number: 5697-7806


First edition: October 2008

Legal and notice information


Copyright 2008 Hewlett-Packard Development Company, L.P.

Document overview
This document focuses on the best practices to leverage the features provided by Device Mapper
Multipath while deploying Oracle Automatic Storage Management (ASM) on Linux.
This document is not designed to replace the documentation supplied with individual solution components.
It is intended to provide customers an additional resource for configuring Oracle ASM with Device
Mapper multipath on Linux.

Intended audience
This document is intended for users who would be deploying Oracle ASM with Device Mapper Multipath
on Linux operating systems.

Prerequisites
This document assumes that the user is familiar with the following concepts:
Oracle ASM
Linux Device Mapper Multipath

Information not provided


This document does not provide the following information:
Installation and array specific configuration settings for Device Mapper multipath
Installation and configuration of Oracle database

Introduction
Automatic Storage Management (ASM) is a feature of Oracle 10g database that provides the services of
a filesystem, logical volume manager, and software RAID in a platform-independent manner.
From a hardware configuration standpoint, high availability means eliminating single points of failure
which is a key requirement. Multipathing is an important aspect of high availability configurations. HP
recommends Device Mapper Multipath as multipathing solution on Linux.
This document assumes that the storage devices used by Oracle ASM are the logical drives or LUs
with multiple paths.

Device Mapper Multipath for Linux


Device Mapper (DM) is an infrastructure included in the Linux kernel, which provides a generic way
to create virtual layers of block devices. The multipathing feature is provided with the combination
of DM Multipath kernel modules and multipath-tools userspace package. DM Multipath provides the
following key benefits:
I/O failover and failback: Provides transparent failover and failback of I/Os by rerouting I/Os
automatically to an alternative path when a path failure is sensed and routing them back when
the path is restored.
I/O load balancing policies: Provides weighted Round Robin load balancing policy within a path
group.
Device name persistence: Device names are persistent across reboots and Storage Area Network
(SAN) reconfigurations. Device Mapper also provides configurable device name aliasing feature for
easier management.
Persistent device settings: All the device settings such as load balancing policies, path grouping
policies are persistent across reboots and SAN reconfigurations.
Path monitoring: Periodically monitors each path for status and enables faster failover and failback.

Device Mapper Multipath with Oracle ASM on Linux

On Linux, every path to the storage disk on SAN is represented by a device file /dev/sd*. DM multipath
driver creates a pseudo device /dev/mapper/* which can be used by the application for I/O. DM
multipath driver manages the I/Os sent to the disk and monitors the disk paths to balance the load across
all the available paths or to take corrective action in case of path failures.
In general, the pseudo devices under /dev/mapper are represented by the Universal Unique Identifier
(UUID) of the corresponding logical devices. If the user_friendly_names parameter in the multipath
configuration file is set to yes, then the devices under /dev/mapper are represented as mpath*.
The representation of the disks with user_friendly_names parameter set may differ (for example,
mpatha, mpath1) depending on the operating system distribution and version. The partition to these
disks may be represented as mpatha1, mpath1p1, and so on.
NOTE:
Using fdisk command to create partitions may fail to create multipath device for the partition device. It
is recommended to use parted command to create partitions for the device.
For more information on device name aliases and multipath configurations, see the Linux Device Mapper
Multipath guide provided with the kit.

Configuring Oracle ASM with DM multipath


ASM is a management tool specifically built to simplify the job of the DBA. It provides a simple storage
management interface across all servers and storage platforms. ASM provides DBA the flexibility to
manage a dynamic database environment with increased efficiency. Oracle ASM can stripe and mirror
your disks and allow disks to be added or removed while the database is under load. It also supports
direct and asynchronous I/O.
There are two different methods to configure ASM on Linux:
ASM with ASMLib I/O: This method creates all Oracle database files on raw block devices managed
by ASM using ASMLib calls. Raw devices are not required with this method as ASMLib works with
block devices.
ASM with Standard Linux I/O: This method creates all Oracle database files on raw character devices
managed by ASM using standard Linux I/O system calls. You will be required to create raw devices
for all disk partitions used by ASM.
We will examine the ASM with ASMLib I/O method here. ASMLib is a library add-on for use with the
Oracle ASM feature. Ensure that all the packages required to configure ASMLib are installed on the host.

Configuring DM devices as ASM disks


To configure ASMLib, you must run a configuration script to prepare the driver. Run the command
# /etc/init.d/oracleasm configure as superuser, and answer the prompts as shown in the
following example.
Example:
# /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

Fix permissions of Oracle ASM disks on boot (y/n) [y]:y


Writing Oracle ASM library driver configuration:[ OK ]
Scanning system for ASM disks:[ OK ]
ASMLib on startup scans the devices available on the system and discovers ASMLib labeled disks. Edit
the ASMLib configuration file /etc/sysconfig/oracleasm as below to scan only DM multipath
devices and exclude underlying sd devices:
# ORACLEASM_SCANORDER: Matching patterns to order disk scanning
ORACLEASM_SCANORDER=mapper/*
# ORACLEASM_SCANEXCLUDE: Matching patterns to exclude disks from scan
ORACLEASM_SCANEXCLUDE=sd

Making disks available to ASMLib


ASM requires unique device for each disk. To make the disks available to ASMLib, complete the
following steps:
1. Select the multipath devices to be associated under ASM management.
2. Mark the selected devices to be used by ASMLib and run the following command as superuser:
# /etc/init.d/oracleasm createdisk <DISK_NAME> <device_name>, where
DISK_NAME can be any valid string and device_name is the multipath device.
Example:
# /etc/init.d/oracleasm createdisk VOL1 /dev/mapper/mpath1p1
Marking disk /dev/mapper/mpath1p1 as an ASM disk:[ OK ]
3. Scan the marked devices by running the following command:
# /etc/init.d/oracleasm scandisks
To verify that ASMLib has marked the disks, run the following command:
# /etc/init.d/oracleasm listdisks

Configuring ASM
While configuring ASM, the configured ASM disks will be listed as candidate disks. Select each of the
disks to be included in the disk group and complete the installation.
After installing an ASM instance, perform the final ASM configuration. When ASMLib and DM based
paths are used, the ASM initialization parameter asm_diskstring must be specified as ORCL:*. This
parameter specifies a comma-delimited list of strings that limits the set of disks that an ASM instance
discovers. Using a more restrictive value may reduce the time required for ASM to perform discovery, and
thus improve disk group mount time or the time for adding a disk to a disk group.

Troubleshooting and recovery


All path failed condition
When all the paths to the DM devices fail, the database becomes inaccessible. Once the paths are
recovered, the ASM disks need to be remounted using the following steps:
1. Run the following command:
oracle@foo> $ORACLE_HOME/bin/dbca
The following screen displays:

Device Mapper Multipath with Oracle ASM on Linux

2. Click Next. The following screen displays:

3. Select Configure Automatic Storage Management and click Next.


4. Select the disk groups used by the database instance required to be mounted and click Mount.
The following screen displays:

5.

Click Finish and login to the Oracle Enterprise Manager (as shown in the following figure) as sys,
click Startup, and complete the startup procedure by providing the required access credentials.

Device Mapper Multipath with Oracle ASM on Linux

References
Installation and Reference Guide Device Mapper Multipath Enablement Kit for HP StorageWorks
Disk Arrays
http://www.hp.com/go/devicemapper
For a more detailed overview of ASM
http://www.oracle.com/technology/asm

Das könnte Ihnen auch gefallen