Using Raw Devices for Oracle Databases
Configure a raw device
-
Configure the desired device in the
/etc/sysconfig/rawdevices
file:/dev/raw/raw1 /dev/sdb1
-
Start and enable the device by running:
# service rawdevices start # chkconfig rawdevices on
At this point, you could set ownership and permissions with
chmod
and chown
. However, because these devices will be created dynamically at boot time, permissions set in this manner will not persist after a reboot.Binding Logical Volumes to the raw devices:
I have added the below lines into the /etc/sysconfig/rawdevices and restarted the rawdevices service to bind logical volumes
created in the above steps.
/usr/bin/raw /dev/raw/raw11 oracle_vg/lvol0 # test db -- SYSAUX Tablespace
/usr/bin/raw /dev/raw/raw12 oracle_vg/lvol1 # test db -- UNDOTBS1
/usr/bin/raw /dev/raw/raw13 oracle_vg/lvol2 # test db -- TEMP tablespace
/usr/bin/raw /dev/raw/raw14 oracle_vg/lvol3 # test db -- EXAMPLE tablespace
/usr/bin/raw /dev/raw/raw15 oracle_vg/lvol4 # test db -- USERS tablespace
/usr/bin/raw /dev/raw/raw16 oracle_vg/lvol5 # test db -- redo1_1.log
/usr/bin/raw /dev/raw/raw17 oracle_vg/lvol6 # test db -- redo1_2.log
/usr/bin/raw /dev/raw/raw18 oracle_vg/lvol7 # test db -- redo1_3.log
/usr/bin/raw /dev/raw/raw19 oracle_vg/lvol8 # test db -- control1
/usr/bin/raw /dev/raw/raw20 oracle_vg/lvol9 # test db -- control2
/usr/bin/raw /dev/raw/raw21 oracle_vg/lvol10 # test db -- control2
/usr/bin/raw /dev/raw/raw22 oracle_vg/lvol11 # test db -- spfile
/usr/bin/raw /dev/raw/raw23 oracle_vg/lvol12 # test db -- pwfile
/usr/bin/raw /dev/raw/raw24 oracle_vg/lvol13 # test db -- SYSTEM Tablespace
Also, you need to change the ownership of these devices to oracle user. Raw devices are refreshed with the default
permissions and ownership every time you reboot your system. For this reason, I add these lines to the /etc/rc.local so
that every time machine reboots, this devices are assigned correct ownership/permissionsPlease add the below lines
to the /etc/rc.local
for i in `seq 1 25`
do
chown oracle:dba /dev/raw/raw$i
chmod 600 /dev/raw/raw$i
done