13.4. Using Block Devices for Oracle 10g Release 2 in Red Hat Enterprise Linux 4 and 5
For Oracle 10g Release 2 in Red Hat Enterprise Linux 4 and 5 it is not recommended to use raw devices but to use block devices instead. Raw I/O is still available in Red Hat Enterprise Linux 4 and 5, but it is now a deprecated interface. In fact, raw I/O has been deprecated by the Linux community. It has been replaced by the
O_DIRECT
flag, which can be used for opening block devices to bypass the operating system's cache. Unfortunately, Oracle Clusterware R2 OUI has not been updated and still requires raw devices or a Cluster File System. There is also another bug, see bug number 5021707.
By default, reading and writing to block devices are buffered I/Os. Oracle Database 10g R2 now automatically opens all block devices such as SCSI disks using the
O_DIRECT flag
, thus bypassing the OS cache. For example, when you create disk groups for ASM and you want to use the SCSI block devices /dev/sdb
and /dev/sdc
, you can simply set the Disk Discovery Path to "/dev/sdb, /dev/sdc
" to create the ASM disk group. There is no need to create raw devices and to point the Disk Discovery Path to it.
Using the ASM example from Section 13.3, “Using Raw Devices for Oracle Databases”, the Oracle data directory could be setup the following way:
$ ln -s /dev/emcpowera /u02/oradata/asmdisks/disk01 $ ln -s /dev/emcpowerb /u02/oradata/asmdisks/disk02 $ ln -s /dev/emcpowerc /u02/oradata/asmdisks/disk03 $ ln -s /dev/emcpowerd /u02/oradata/asmdisks/disk04
And the following command needs to be executed after each reboot:
# chown oracle.dba /u02/oradata/asmdisks/*
You need to ensure that the ownership of block devices is changed to
oracle:dba
or oracle:oinstall
. Otherwise Oracle can not access the block devices and ASM disk discovery will not list them. You also need to ensure that the ownership of block devices is set after each reboot since Linux changes the ownership of block devices back to "brw-rw---- 1 root disk
" at boot time.