配置rhel4的raw device service

wisdomone1發表於2010-03-07

Configuring Raw Devices on Red Hat Enterprise Linux 4.0

If you intend to use raw devices for Oracle Clusterware or Oracle Database files, then you need to configure the raw devices. Starting with the 2. 6 Linux kernel distributions, raw devices are not supported by default in the kernel. However, Red Hat Enterprise Linux 4.0 continues to provide raw support. To confirm that raw devices are enabled, enter the following command:

# chkconfig --list

Scan the output for raw devices. If you do not find raw devices, then use the following command to enable the raw device service:

# chkconfig --level 345 rawdevices on

After you confirm that the raw devices service is running, you should change the default ownership of raw devices. When you restart a Red Hat Enterprise Linux 4.0 system, ownership and permissions on raw devices revert by default to root. If you are using raw devices with this operating system for your Oracle files (for example, for ASM storage or Oracle Clusterware files), then you need to override this default behavior.

In this section, we will use the scenario of two ASM disk files (/dev/raw/raw6 and /dev/raw/raw7), two Oracle Cluster Registry files (/dev/raw/raw1 and /dev/raw/raw2), and three Oracle Clusterware voting disks (/dev/raw/raw3, /dev/raw/raw4, and /dev/raw/raw5).

To ensure correct ownership of these devices when the operating system is restarted, create a new file in the /etc/udev/permissions.d directory, called oracle.permissions, and enter the raw device permissions information.

Note that Oracle Clusterware software can be owned either by the same user that owns the Oracle database software (typically oracle), or can be owned by a separate Oracle Clusterware user. If you create a separate Oracle Clusterware user, then that user must own the voting disks.

This example shows the permissions to be set if you use a separate Oracle Clusterware user, named crs, and the Oracle user is named oracle. The ASM disks should be owned by oracle, and the voting disks owned by crs. The Oracle Cluster Registry (OCR) is always owned by root.With the scenario for this section, the following is an example of the contents of /etc/udev/permissions.d/oracle.permissions:

# ASM
raw/raw[67]:oracle:dba:0660
# OCR
raw/raw[12]:root:oinstall:0640
# Voting Disks
raw/raw[3-5]:crs:oinstall:0640

Note that path lines can use the shell glob module, so entries such as raw/raw[3-4] or raw/raw* are permitted. Refer to your operating system help for character range usage.

After creating the oracle.permissions file, the permissions of the rawdevices files are set automatically the next time the system is restarted. To set permissions to take effect immediately, without restarting the system, use the chown and chmod commands:

chown oracle:dba /dev/raw/raw[67]
chmod 660 /dev/raw/raw[67]
chown root:oinstall /dev/raw/raw[12]
chmod 640 /dev/raw/raw[12]
chown crs:oinstall /dev/raw/raw[3-5]
chmod 640 /dev/raw/raw[3-5]

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/9240380/viewspace-628817/,如需轉載,請註明出處,否則將追究法律責任。

相關文章