Configure Oracle ASMLib and disk multi-path on Linux
Configure Oracle ASMLIB and multi-path Disks
The following documents describe how to use Oracle asmlib to access a multi-path disk on the linux platform, no matter which multi-path software you use, this document is based on the multi-path disk that has been created. The name of the multi-path disk in this document is "multipatha", which is irrelevant to the storage vendor.
Problems involving multi-path software:
When using the multi-path software, we have two problems: ASM cannot view the same disk twice at the same time, which leads to errors. Each disk may appear at least three times in a multi-path configuration, for example:
First Path of the Disk
The second path of the disk.
Logical path aggregated by multi-path Software
The following is an example: Assume that a system has a local disk on/dev/sda and is connected to a disk through external storage. the host has two links or paths to access this external storage.
Linux SCSI drivers will see all these two paths. They are displayed as/dev/sdb and/dev/sdc. The system can access the same terminal through sdb or sdc.
At this point, if we enable the multi-path software for management, there will be a multi-path software aggregated disk, such as/dev/multipatha, it can access these two paths at the same time, that is, any I/O using multipatha can access the disk through any path. If a system uses the sdb path and the cable on the link is pulled out, the system will receive an error. However, the multipath disk will know the path to sdc to continue working.
Most software cannot identify the multi-path configuration. It can use any path: sdb, sdc, or multpatha, and cannot know the difference. The same is true for ASMLIB. in the default configuration, ASMLIB does not care about using that path.
ASMLIB selects and selects only one path, because ASM cannot manage two identical disks at the same time. In this way, we solve the first problem. ASM will only see one path and can work normally.
The second problem occurs: What path does ASM see?
By default, ASMLIB selects the first path it finds. The first path provided in Linux system, the first Path depends on the disk drive, it may be multipath or a single path.
The system administrator wants ASMLIB to always use a multi-path disk! If Oracle does not use it, is there any way to specify it?
The answer is no. Even so, if we want ASMLIB to know what the disk of the multi-path software looks like, We must configure it to tell it:
Disk scan sequence:
ASMLIB identifies a disk as the disk used by ASMLIB through the process described in ASMLIB installation. ASMLIB uses a disk scan process to identify which disks have been identified. ASMLIB runs such a scan every time it is started. Of course, the system administrator can use the/etc/init. d/oracleasm scandisks command to perform a scan. ASMLIB checks Each disk in the system. It checks whether each disk is identified as an asmlib disk. All identified disks are valid ASMLIB disks. Generally, ASMLIB checks these disks in the OS list order. Most of the operating systems can provide a reasonable order.
As we mentioned above, we describe a situation where the OS sequence is not good enough. The system administrator wants ASMLIB to scan the multi-path aggregate disk before seeing the disk in a single path. In this way, ASMLIB selects a multi-path aggregated disk and delivers it to Oracle.
ASMLib allows two modification methods to control the order of disk scans. First, it allows us to exclude some disks that do not need to be scanned. In other words, ASMLib will completely ignore these disks. Second, the system administrator can specify which disks are scanned first. The specified disks are scanned before other disks in the system are scanned.
In the multi-path software configuration, you can use any method. The system administrator can select to exclude all single-path disks. In this way, ASMLib ignores them and only scans multi-path disks. Or the system administrator can specify that a multi-path disk is scanned first. In this way, ASMLib will first find the disk in the aggregation path and select the disk first.
Configure the scan sequence:
The path of the ASMLib configuration file is in/etc/sysconfig/oracleasm. It is linked to the file/etc/sysconfig/oracleasm-_ dev_oracleasm and the tool will read the file later. It contains the startup configuration information configured by all system administrators through the/etc/init. d/oracleasm configure command, but the scanning sequence cannot be configured.
This configuration file contains many configuration variables. We can use the following two:
The ORACLEASM_SCANORDER parameter specifies which disks are scanned first;
The ORACLEASM_SCANEXCLUDE parameter specifies which disks are ignored during scanning;
This variable is matched by a list of prefix strings separated by spaces. In other words, if the starting part and prefix of a disk are the same, it is matched. For example, the prefix string sd matches all SCSI-driven devices. Note that it is not a fuzzy match. Do not use wildcards in parameters. They are simple prefixes. Note that the/dev/path is not part of the prefix.
Note: Only the device names that the kernel knows are scanned during the scan. When device-mapper is used, the kernel displays/dev/dm-XX. The device name in/dev/mapper/XXX is another readable name created by udev. Both ORACLEASM_SCANORDER and ORACLEASM_SCANEXCLUDE must use the pre-dm character.
Here are some examples:
Note: If you manually edit/etc/sysconfig/oracleasm, make sure that the link to/etc/sysconfig/oracleasm-_ dev_oracleasm is not damaged.
Multi-path disk preferentially read:
The system administrator configures ASMLib to read the aggregated disk of the multi-path software. In the ASMLib configuration file, edit the ORACLEASM_SCANORDER variable in the following format:
ORACLEASM_SCANORDER = "multipath sd"
In this case, ASMLib first searches for disks starting with "multipath" during the scanning process. Multipath devices/dev/multipatha are of course compliant. In this way, it will be scanned first. Then ASMLib starts searching for disks starting with "sd. These are SCSI disks. The local device/dev/sda will be scanned, but it is not an ASM disk.
Disk/dev/sdb and/dev/sdc in a single path will also be scanned. They are ASM disks, but ASMLib will find that there is already a channel to access it. ASMLib ignores them. Then, ASMLib continues to scan other disks that do not match the prefix.
Exclude disks with a single path:
The system administrator can configure ASMLib to ignore but path the disk. In the ASMLib configuration file, edit the ORACLEASM_SCANEXCLUDE variable in the following format:
ORACLEASM_SCANEXCLUDE = "sdb sdc"
Here, the system administrator has made some configuration. ASMLib will exclude/dev/sdb and/dev/sdc. It will not ignore other SCSI disks. In this way, ASMLib will ignore the two disks during scanning, and only the/dev/multipath disk will be seen. Similarly, Oracle will use a multi-path disk.
EMC PowerPath and ASMLib
Many system administrators use EMC PowerPatch to configure multiple paths and ASMLib disks.
However, PowerPath and 2.4 kernels EMC are not supported. Linux 2.6 kernel, such as RHEL 4, SLES 9, and 2.0 ASMLib kernel drivers are supported.
For use of EMC Power patches, see the EMC Support Matrix documentation to verify that any/all compatibility requirements meet.
If you have any questions about the use of ASMLib and PowerPath on Linux 2.4 Kernel, such as RHEL3 SLES8, please contact EMC
Install Oracle 11gR2 (x64) in CentOS 6.4)
Steps for installing Oracle 11gR2 in vmwarevm
Install Oracle 11g XE R2 In Debian