Oracle 12c RAC Construction II: Shared Disk Configuration

ASM introduction and selection

Oracle ASM (Automatic Storage Management) is a data volume manager for Oracle databases. ASM assists users in disk management by tracking storage devices dedicated to the Oracle database and allocating space on these devices according to the request of the Oracle database instance. It has two ways to create ASM shared disks: ASMLib and UDEV:

  • ASMLib

In May 2011, Oracle issued a statement on Oracle database ASMLib, which stated that Oracle will no longer provide Red Hat Enterprise Linux (RHEL) 6 ASMLib and related updates.

Oracle said in this statement that ASMLib updates will be released through the Unbreakable Linux Network (ULN) and will only be available to Oracle Linux customers.

Oracle Metalink documentation:Oracle ASMLib Software Update Policy for Red Hat Enterprise Linux Supported by Red Hat [ID 1089399.1]

ASM advantages:

  1. Always use direct, async IO
  2. Solved the problem of permanent device name, even if the device name has changed after restart
  3. Solved the problem of file permissions and owners
  4. Reduce the context switch from user mode to kernel mode during I/O, which may reduce cpu usage
  5. Reduced file handle usage
  6. ASMLIB API provides the possibility to transfer meta-information such as I/O priority to storage devices

Disadvantages of ASM:

  1. For multipathing devices, you need to set ORACLEASM_SCANORDER and ORACLEASM_SCANEXCLUDE in the /etc/sysconfig/oracleasm-_dev_oracleasm configuration file so that ASMLIB can find the correct device file. For details, please refer to [Metalink Note<How To Setup ASM & ASMLIB On Native Linux Multipath Mapper disks? [ID 602952.1]>]
  2. Because ASM INSTANCE uses the asm disk provided by ASMLIB, an additional layer is added
  3. Every time Linux Kernel is updated, a new ASMLIB package needs to be replaced
  4. Increased the possibility of downtime caused by human error
  5. Using ASMLIB means it takes more time to create and maintain
  6. Because of the existence of ASMLIB, more bugs may be introduced, which is the last thing we want to see
  7. The disk header created with ASMLIB will not be different from the ordinary asm disk header, only the ASMLIB attribute space is added to the header.
  • UDEV
    udev is a function in the Linux 2.6 kernel. It replaces the original devfs and becomes the current Linux default device management tool. udev runs as a daemon and manages the device files in the /dev directory by listening to the uevent sent by the kernel. Unlike previous device management tools, udev runs in user space, not in kernel space.

In terms of the choice between the two applications, ASMLib is basically not used in the new version due to its background and features, because it brings many defects and the performance does not exceed UDEV. UDEV method will be the most used method currently or in the future.

UDEV configuration method

  • disk partition
    Insert picture description here
[root@RACNode01 ~]# fdisk /dev/sdb
Welcome to fdisk (util-linux 2.23.2).

Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.

Device does not contain a recognized partition table
Building a new DOS disklabel with disk identifier 0xf6614091.

The device presents a logical sector size that is smaller than
the physical sector size. Aligning to a physical sector (or optimal
I/O) size boundary is recommended, or performance may be impacted.

Command (m for help): p

Disk /dev/sdb: 10.7 GB, 10737418240 bytes, 20971520 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk label type: dos
Disk identifier: 0xf6614091

   Device Boot      Start         End      Blocks   Id  System

Command (m for help): n
Partition type:
   p   primary (0 primary, 0 extended, 4 free)
   e   extended
Select (default p): p
Partition number (1-4, default 1): 1
First sector (2048-20971519, default 2048): 
Using default value 2048
Last sector, +sectors or +size{
    
    K,M,G} (2048-20971519, default 20971519): 
Using default value 20971519
Partition 1 of type Linux and of size 10 GiB is set

Command (m for help): p

Disk /dev/sdb: 10.7 GB, 10737418240 bytes, 20971520 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk label type: dos
Disk identifier: 0xf6614091

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1            2048    20971519    10484736   83  Linux

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.

According to this method, all other disks are partitioned.

  • UDEV rule creation

CentOS 7

for i in b c d e f g h i ;
do
echo "KERNEL==\"sd*\", ENV{DEVTYPE}==\"disk\", SUBSYSTEM==\"block\", PROGRAM==\"/lib/udev/scsi_id -g -u -d \$devnode\",RESULT==\"`/lib/udev/scsi_id -g -u -d /dev/sd$i`\", SYMLINK+=\"asm-sd$i\", OWNER=\"grid\", GROUP=\"asmadmin\", MODE=\"0660\"" >> /etc/udev/rules.d/99-oracle-asmdevices.rules
done
# 加载rules文件,重新加载udev rule
/sbin/udevadm control --reload
# 检查新的设备名称
/sbin/udevadm trigger --type=devices --action=change
# 诊断udev rule
/sbin/udevadm test /sys/block/*

CentOS 6

for i in b c d e f g h i ;
do
echo "KERNEL==\"sd*\", BUS==\"scsi\", PROGRAM==\"/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/\$name\",RESULT==\"`/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/sd$i`\", NAME=\"asm-sd$i\", OWNER=\"grid\",GROUP=\"asmadmin\", MODE=\"0660\"" >> /etc/udev/rules.d/99-oracle-asmdevices.rules
done
启动UDEV
/sbin/start_udev
  • View UDEV disk information
ll -l /dev/asm*

lrwxrwxrwx 1 root root 3 May 26 11:11 /dev/asm-sdb -> sdb
lrwxrwxrwx 1 root root 3 May 26 11:11 /dev/asm-sdc -> sdc
lrwxrwxrwx 1 root root 3 May 26 11:11 /dev/asm-sdd -> sdd
lrwxrwxrwx 1 root root 3 May 26 11:11 /dev/asm-sde -> sde
lrwxrwxrwx 1 root root 3 May 26 11:11 /dev/asm-sdf -> sdf
lrwxrwxrwx 1 root root 3 May 26 11:11 /dev/asm-sdg -> sdg
lrwxrwxrwx 1 root root 3 May 26 11:11 /dev/asm-sdh -> sdh
lrwxrwxrwx 1 root root 3 May 26 11:11 /dev/asm-sdi -> sdi

Guess you like

Origin blog.csdn.net/weixin_38623994/article/details/106348862