Configuring I/O For Raw Partitions; General - Red Hat ENTERPRISE LINUX 5.1 - LINUX ORACLE Tuning Manual

Oracle 9i and 10g tuning guide
Table of Contents

Advertisement

Chapter 13.

Configuring I/O for Raw Partitions

13.1. General

Raw partitions allow Oracle to bypass the OS cache. A raw device can be assigned or bound to block
devices such as disk or disk partitions. When a raw device is bound to a disk, any read or write access
to the raw device will perform a raw I/O with the disk. A raw I/O through the /dev/raw interface
bypasses the kernel's block buffer cache entirely that is normally associated with block devices and
goes right to the low level device itself. By bypassing the cache it accesses a physical device directly
which allows applications such as Oracle databases to have more control over the I/O to the physical
device. In fact, Oracle does it is own data caching and raw devices allow Oracle to ensure that data
gets written to the disk immediately without OS caching.
Since Automatic Storage Management (ASM) is the recommended option for large amounts of storage
in RAC environments, the focus of this article and section is on the usage of raw devices and block
devices for ASM. ASM offers many advantages over conventional file systems. The ASM file system
is not buffered and supports asynchronous I/O. It allows you to group sets of physical disks to logical
entities as disk groups. You can add or remove disks without downtime. In fact, you could move a
whole database from one SAN storage to another SAN without downtime. ASM spreads I/O over
all the available disks automatically to avoid hot spots. ASM does also it is own striping and offers
mirroring. ASM can be setup using the ASM library driver or raw devices. Starting with 10g R2, neither
is necessarily required.
Note
Since raw I/O is now being deprecated by the Linux community and Red Hat Enterprise
Linux 4 and 5, Oracle 10g R2 no longer requires raw devices for the database. Oracle 10g
R2 automatically opens all block devices such as SCSI disks using the O_DIRECT flag,
thus bypasses the OS cache. But for older Oracle Database and Red Hat Enterprise Linux
versions raw devices are still a recommended option for ASM and data files. For more
information on using block devices, see
Release 2 in Red Hat Enterprise Linux 4 and
OUI still requires raw devices or a Cluster File System.
Caution
The name of the devices are assigned by the Linux and is determined by the scan order
of the bus. Therefore, the device names are not guaranteed to persist across reboots.
For example, SCSI device /dev/sdb can change to /dev/sda if the scan order of the
controllers is not configured. To force the scan order of the controllers, aliases can be set
in /etc/modprobe.conf. For example:
alias scsi_hostadapter1 aic7xxx
alias scsi_hostadapter2 lpfc
These settings will guarantee that the Adaptec adapter for local storage is used first and
then the Emulex adapter(s) for SAN storage. Fortunately, Red Hat Enterprise Linux 4 and
5 have already addressed this issue by delaying the loading of lpfc (Emulex) and various
qla (QLogic) drivers until after all other SCSI devices have been loaded. This means that
Section 13.4, "Using Block Devices for Oracle 10g
5". Unfortunately, Oracle Clusterware R2
37

Advertisement

Table of Contents
loading

Table of Contents