Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Linux udev dynamic Management of Oracle ASM disks-Lab

2025-01-15 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

1 Overview before Red Hat Enterprise Linux (RHEL) 6, Oracle used the ASMLib package to manage ASM disks. But Oracle issued a statement in May 2011, saying that Oracle will no longer provide ASMLib packages and related updates for Red Hat Enterprise Linux (RHEL) 6.

Oracle said in the statement that ASMLib updates will be released through Unbreakable Linux Network (ULN) and will be available only to Oracle Linux customers. ULN serves Oracle and Red Hat customers, but if customers want to use ASMLib, they must use Oracle's kernel to replace Red Hat's kernel.

In this lab, Oracle+ASM is deployed, instead of using ASMLib, udev is used to dynamically manage ASM disks.

Note: udev is only supported with Linux kernel 2.6 or above.

Virtual machine: VMware Workstation 9

Operating system: Red Hat Enterprise Linux Server release 5.6

System kernel: 2.6.18-238.el5

Database: Oracle Database 11.2.0.1

2 in the experimental steps, ASM disks have been created based on udev, and Oracle Grid and Oracle Database have been installed and databases have been created. Next, four 1G disks will be added to extend the existing ASM disk group DG_DATA and create a new ASM disk group DG_NEW_DATA.

View the newly added disks as / dev/sdb, / dev/sdg, / dev/sdh, / dev/sdi.

[root@ora32 dev] # fdisk-l

Disk / dev/sda: 23.6 GB, 23622320128 bytes

255 heads, 63 sectors/track, 2871 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System

/ dev/sda1 * 1 65 522081 83 Linux

/ dev/sda2 66 457 3148740 82 Linux swap / Solaris

/ dev/sda3 458 2871 19390455 8e Linux LVM

Disk / dev/sdb: 1073 MB, 1073741824 bytes

255 heads, 63 sectors/track, 130 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Disk / dev/sdb doesn't contain a valid partition table

Disk / dev/sdc: 2147 MB, 2147483648 bytes

255 heads, 63 sectors/track, 261 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System

/ dev/sdc1 1 261 2096451 83 Linux

Disk / dev/sdd: 2147 MB, 2147483648 bytes

255 heads, 63 sectors/track, 261 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System

/ dev/sdd1 1 261 2096451 83 Linux

Disk / dev/sde: 2147 MB, 2147483648 bytes

255 heads, 63 sectors/track, 261 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System

/ dev/sde1 1 261 2096451 83 Linux

Disk / dev/sdf: 2147 MB, 2147483648 bytes

255 heads, 63 sectors/track, 261 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System

/ dev/sdf1 1 261 2096451 83 Linux

Disk / dev/sdg: 1073 MB, 1073741824 bytes

255 heads, 63 sectors/track, 130 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Disk / dev/sdg doesn't contain a valid partition table

Disk / dev/sdh: 1073 MB, 1073741824 bytes

255 heads, 63 sectors/track, 130 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Disk / dev/sdh doesn't contain a valid partition table

Disk / dev/sdi: 1073 MB, 1073741824 bytes

255 heads, 63 sectors/track, 130 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Disk / dev/sdi doesn't contain a valid partition table

Partition 4 disks, and each disk can be divided into 1 area.

[root@ora32 dev] # fdisk-l

Disk / dev/sda: 23.6 GB, 23622320128 bytes

255 heads, 63 sectors/track, 2871 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System

/ dev/sda1 * 1 65 522081 83 Linux

/ dev/sda2 66 457 3148740 82 Linux swap / Solaris

/ dev/sda3 458 2871 19390455 8e Linux LVM

Disk / dev/sdb: 1073 MB, 1073741824 bytes

255 heads, 63 sectors/track, 130 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System

/ dev/sdb1 1 130 1044193 + 83 Linux

Disk / dev/sdc: 2147 MB, 2147483648 bytes

255 heads, 63 sectors/track, 261 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System

/ dev/sdc1 1 261 2096451 83 Linux

Disk / dev/sdd: 2147 MB, 2147483648 bytes

255 heads, 63 sectors/track, 261 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System

/ dev/sdd1 1 261 2096451 83 Linux

Disk / dev/sde: 2147 MB, 2147483648 bytes

255 heads, 63 sectors/track, 261 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System

/ dev/sde1 1 261 2096451 83 Linux

Disk / dev/sdf: 2147 MB, 2147483648 bytes

255 heads, 63 sectors/track, 261 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System

/ dev/sdf1 1 261 2096451 83 Linux

Disk / dev/sdg: 1073 MB, 1073741824 bytes

255 heads, 63 sectors/track, 130 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System

/ dev/sdg1 1 130 1044193 + 83 Linux

Disk / dev/sdh: 1073 MB, 1073741824 bytes

255 heads, 63 sectors/track, 130 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System

/ dev/sdh2 1 130 1044193 + 83 Linux

Disk / dev/sdi: 1073 MB, 1073741824 bytes

255 heads, 63 sectors/track, 130 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System

/ dev/sdi1 1 130 1044193 + 83 Linux

Now you need to manage these disk device files through udev, map the disk to a fixed name through the rule file, and give users, user groups, operation rights, and so on.

View the udev rules file

[root@ora32 dev] # cd / etc/udev/rules.d

[root@ora32 rules.d] # ll

Total 248

-rw-r--r-- 1 root root 515 Nov 25 2010 05-udev-early.rules

-rw-r--r-- 1 root root 948 Dec 8 2010 40-multipath.rules

-rw-r--r-- 1 root root 16153 Nov 25 2010 50-udev.rules

-rw-r--r-- 1 root root 163 Dec 11 2010 51-dlm.rules

-rw-r--r-- 1 root root 471 Nov 25 2010 51-hotplug.rules

-rw-r--r-- 1 root root 138 May 10 17:28 55-usm.rules

-rw-r--r-- 1 root root 58016 Oct 13 2006 60-libsane.rules

-rw-r--r-- 1 root root 143 Oct 13 2010 60-net.rules

-rw-r--r-- 1 root root 1088 Jul 18 2006 60-pcmcia.rules

-rw-r--r-- 1 root root 316 Sep 22 2010 60-raw.rules

-rw-r--r-- 1 root root 9175 Nov 13 2010 60-wacom.rules

-rw-r--r-- 1 root root 129 Nov 30 2010 61-uinput-stddev.rules

-rw-r--r-- 1 root root 214Nov 30 2010 61-uinput-wacom.rules

-rw-r--r-- 1 root root 1823 Sep 19 2008 85-pcscd_ccid.rules

-rw-r--r-- 1 root root 114 Aug 29 2008 90-alsa.rules

-rw-r--r-- 1 root root 61 Nov 25 2010 90-dm.rules

-rw-r--r-- 1 root root 82 Nov 4 2010 90-hal.rules

-rw-r--r-- 1 root root 107 Nov 25 2010 95-pam-console.rules

-rw-r--r-- 1 root root 292 Nov 30 2010 98-kexec.rules

-rw-r--r-- 1 root root 669 May 13 13:51 99-oracle-asmdevices.rules

-rw-r--r-- 1 root root 60 Sep 16 2012 99-oracle.rules

-rw-r--r-- 1 root root 334 Sep 15 2012 99-vmware-scsi-udev.rules

-rw-r--r-- 1 root root 2319 Jul 9 2008 bluetooth.rules

The udev rule file "99-oracle-asmdevices.rules" has been created before, so take a look at the current mapping rules and the ASM disk.

[root@ora32 rules.d] # cat 99-oracle-asmdevices.rules

KERNEL== "sd?1", BUS== "scsi", PROGRAM== "/ sbin/scsi_id"

RESULT== "36000c29c9a269653c7cd04ea2edb0c71", NAME= "ASM_DISK_2G_1", WNER= "grid", GROUP= "asmadmin", MODE= "0660"

KERNEL== "sd?1", BUS== "scsi", PROGRAM== "/ sbin/scsi_id"

RESULT== "36000c29861258ebc95eded634a1f36fd", NAME= "ASM_DISK_2G_2", WNER= "grid", GROUP= "asmadmin", MODE= "0660"

KERNEL== "sd?1", BUS== "scsi", PROGRAM== "/ sbin/scsi_id"

RESULT== "36000c296fd09d9ed213df1999820ca89", NAME= "ASM_DISK_2G_3", WNER= "grid", GROUP= "asmadmin", MODE= "0660"

KERNEL== "sd?1", BUS== "scsi", PROGRAM== "/ sbin/scsi_id"

RESULT== "36000c2934ae12fd4af0dd366d85b42f5", NAME= "ASM_DISK_2G_4", WNER= "grid", GROUP= "asmadmin", MODE= "0660"

Rule interpretation, take the first rule as an example.

When the system starts, udev filters out the devices that need to be dynamically mapped according to the system bus scsi (BUS== "scsi") and the kernel device file name sd?1 (KERNEL== "sd?1"), and then uses the SCSI disk id output by the / sbin/scsi_id (PROGRAM== "/ sbin/scsi_id") command to match the SCSI disk with "36000c29c9a269653c7cd04ea2edb0c71" in the output. Subsequent naming, authorization, and other operations (NAME= "ASM_DISK_2G_1", WNER= "grid", GROUP= "asmadmin", MODE= "0660") are applied, and the SCSI disk ID can be obtained through the / sbin/scsi_id command.

[root@ora32 rules.d] # / sbin/scsi_id-g-s / block/sdc/sdc1

36000c29c9a269653c7cd04ea2edb0c71

[root@ora32 rules.d] # / sbin/scsi_id-g-s / block/sdd/sdd1

36000c29861258ebc95eded634a1f36fd

[root@ora32 rules.d] # / sbin/scsi_id-g-s / block/sde/sde1

36000c296fd09d9ed213df1999820ca89

[root@ora32 rules.d] # / sbin/scsi_id-g-s / block/sdf/sdf1

36000c2934ae12fd4af0dd366d85b42f5

As can be seen from the above results, udev has done the following mapping relationship.

/ block/sdc/sdc1 = > ASM_DISK_2G_1

/ block/sdd/sdd1 = > ASM_DISK_2G_2

/ block/sde/sde1 = > ASM_DISK_2G_3

/ block/sdf/sdf1 = > ASM_DISK_2G_4

[grid@ora32 dev] $ll ASM*

Brw-rw---- 1 grid asmadmin 8, 33 May 13 14:57 ASM_DISK_2G_1

Brw-rw---- 1 grid asmadmin 8, 49 May 13 14:57 ASM_DISK_2G_2

Brw-rw---- 1 grid asmadmin 8, 65 May 13 14:54 ASM_DISK_2G_3

Brw-rw---- 1 grid asmadmin 8, 81 May 13 14:57 ASM_DISK_2G_4

Take a look at the current disk group and disk usage through the Oracle view.

[grid@ora32 ~] $sqlplus / as sysasm

SQL*Plus: Release 11.2.0.1.0 Production on Mon May 13 14:54:01 2013

Copyright (c) 1982, 2009, Oracle. All rights reserved.

Connected to:

Oracle Database 11g Enterprise Edition Release 11.2.0.1.0-64bit Production

With the Automatic Storage Management option

SQL >

SQL >

SQL > col name for A10

SQL > SELECT group_number,name,type,state,total_mb,free_mb,offline_disks FROM V$ASM_diskgroup

GROUP_NUMBER NAME TYPE STATE TOTAL_MB FREE_MB OFFLINE_DISKS

1 DG_DATA EXTERN MOUNTED 8188 6448 0

SQL > col group# for 99

SQL > col disk# for 99

SQL > col name for A5

SQL > col path for A11

SQL > col LABEL for A7

SQL > col FAILGROUP for A10

SQL > select GROUP_NUMBER group#,DISK_NUMBER disk#,LABEL,STATE,FAILGROUP,name,path,TOTAL_MB,FREE_MB from v$asm_disk

GROUP# DISK# LABEL STATE FAILGROUP NAME PATH TOTAL_MB FREE_MB

12 NORMAL DG_DATA_00 DG_DA / dev/ASM_DI 2047 1612

02 TA_00 SK_2G_3

02

1 3 NORMAL DG_DATA_00 DG_DA / dev/ASM_DI 2047 1611

03 TA_00 SK_2G_4

03

1 1 NORMAL DG_DATA_00 DG_DA / dev/ASM_DI 2047 1613

01 TA_00 SK_2G_2

01

GROUP# DISK# LABEL STATE FAILGROUP NAME PATH TOTAL_MB FREE_MB

1 0 NORMAL DG_DATA_00 DG_DA / dev/ASM_DI 2047 1612

00 TA_00 SK_2G_1

00

Now map the 4 new hard drives to the required device files through udev, and then add 2 of them to the ASM disk group DG_DATA, and the other 2 will create a new ASM disk group DG_NEW_DATA.

[root@ora32 rules.d] # / sbin/scsi_id-g-s / block/sdb/sdb1

36000c2968513d97eb7cdd25bdbd10600

[root@ora32 rules.d] # / sbin/scsi_id-g-s / block/sdg/sdg1

36000c29682ba5ec7a4c8a189499a89bb

[root@ora32 rules.d] # / sbin/scsi_id-g-s / block/sdh/sdh2

36000c292aa4a4ebbb25d15d2084c01ca

[root@ora32 rules.d] # / sbin/scsi_id-g-s / blokc/sdi/sdi1

New device mapping rules

[root@ora32 rules.d] # vi 99-oracle-asmdevices.rules

KERNEL== "sd?1", BUS== "scsi", PROGRAM== "/ sbin/scsi_id"

RESULT== "36000c29c9a269653c7cd04ea2edb0c71", NAME= "ASM_DISK_2G_1", WNER= "grid", GROUP= "asmadmin", MODE= "0660"

KERNEL== "sd?1", BUS== "scsi", PROGRAM== "/ sbin/scsi_id"

RESULT== "36000c29861258ebc95eded634a1f36fd", NAME= "ASM_DISK_2G_2", WNER= "grid", GROUP= "asmadmin", MODE= "0660"

KERNEL== "sd?1", BUS== "scsi", PROGRAM== "/ sbin/scsi_id"

RESULT== "36000c296fd09d9ed213df1999820ca89", NAME= "ASM_DISK_2G_3", WNER= "grid", GROUP= "asmadmin", MODE= "0660"

KERNEL== "sd?1", BUS== "scsi", PROGRAM== "/ sbin/scsi_id"

RESULT== "36000c2934ae12fd4af0dd366d85b42f5", NAME= "ASM_DISK_2G_4", WNER= "grid", GROUP= "asmadmin", MODE= "0660"

KERNEL== "sd?1", BUS== "scsi", PROGRAM== "/ sbin/scsi_id"

RESULT== "36000c2968513d97eb7cdd25bdbd10600", NAME= "ASM_DISK_1G_1", WNER= "grid", GROUP= "asmadmin", MODE= "0660"

KERNEL== "sd?1", BUS== "scsi", PROGRAM== "/ sbin/scsi_id"

RESULT== "36000c29682ba5ec7a4c8a189499a89bb", NAME= "ASM_DISK_1G_2", WNER= "grid", GROUP= "asmadmin", MODE= "0660"

KERNEL== "sd?1", BUS== "scsi", PROGRAM== "/ sbin/scsi_id"

RESULT== "36000c292aa4a4ebbb25d15d2084c01ca", NAME= "ASM_DISK_1G_3", WNER= "grid", GROUP= "asmadmin", MODE= "0660"

KERNEL== "sd?1", BUS== "scsi", PROGRAM== "/ sbin/scsi_id"

RESULT== "36000c29a98ca1bd8a0012e99f992a19d", NAME= "ASM_DISK_1G_4", WNER= "grid", GROUP= "asmadmin", MODE= "0660"

If you are configuring the udev mapping relationship for the first time, you need to do the following.

1. Create a new 99-oracle-asmdevices.rules file in the directory / etc/udev/rules.d/.

2. Configure SCSI devices as trusted devices, configure / etc/scsi_id.config file, and add options=-g configuration items.

[root@ora32 rules.d] # cat / etc/scsi_id.config

#

# scsi_id configuration

#

# lower or upper case has no affect on the left side. Quotes (") are

# required for spaces in values. Model is the same as the SCSI

# INQUIRY product identification field. Per the SCSI INQUIRY, the vendor

# is limited to 8 bytes, model to 16 bytes.

#

# The first matching line found is used. Short matches match longer ones

# if you do not want such a match space fill the extra bytes. If no model

# is specified, only the vendor string need match.

#

# ptions=

# vendor=string [, model=string], options=

# some libata drives require vpd page 0x80

Vendor= "ATA", options=-p 0x80

Options=-g

Test whether udev can be mapped correctly

[root@ora32 ~] # testudev / block/sdg/sdg1

-bash: testudev: command not found

[root@ora32 ~] # udevtest / block/sdb/sdb1

Main: looking at device'/ block/sdb/sdb1' from subsystem 'block'

Udev_rules_get_name: add symlink 'disk/by-id/scsi-36000c2968513d97eb7cdd25bdbd10600-part1'

Udev_rules_get_name: add symlink 'disk/by-path/pci-0000:00:10.0-scsi-0:0:1:0-part1'

Run_program:'/ lib/udev/vol_id-- export / dev/.tmp-8-17'

Run_program:'/ lib/udev/vol_id' returned with status 4

Run_program:'/ sbin/scsi_id'

Run_program:'/ sbin/scsi_id' (stdout) '36000c2968513d97eb7cdd25bdbd10600'

Run_program:'/ sbin/scsi_id' returned with status 0

Run_program:'/ sbin/scsi_id'

Run_program:'/ sbin/scsi_id' (stdout) '36000c2968513d97eb7cdd25bdbd10600'

Run_program:'/ sbin/scsi_id' returned with status 0

Run_program:'/ sbin/scsi_id'

Run_program:'/ sbin/scsi_id' (stdout) '36000c2968513d97eb7cdd25bdbd10600'

Run_program:'/ sbin/scsi_id' returned with status 0

Run_program:'/ sbin/scsi_id'

Run_program:'/ sbin/scsi_id' (stdout) '36000c2968513d97eb7cdd25bdbd10600'

Run_program:'/ sbin/scsi_id' returned with status 0

Run_program:'/ sbin/scsi_id'

Run_program:'/ sbin/scsi_id' (stdout) '36000c2968513d97eb7cdd25bdbd10600'

Run_program:'/ sbin/scsi_id' returned with status 0

Udev_rules_get_name: rule applied, 'sdb1' becomes' ASM_DISK_1G_1'

Run_program:'/ sbin/scsi_id'

Run_program:'/ sbin/scsi_id' (stdout) '36000c2968513d97eb7cdd25bdbd10600'

Run_program:'/ sbin/scsi_id' returned with status 0

Run_program:'/ sbin/scsi_id'

Run_program:'/ sbin/scsi_id' (stdout) '36000c2968513d97eb7cdd25bdbd10600'

Run_program:'/ sbin/scsi_id' returned with status 0

Run_program:'/ sbin/scsi_id'

Run_program:'/ sbin/scsi_id' (stdout) '36000c2968513d97eb7cdd25bdbd10600'

Run_program:'/ sbin/scsi_id' returned with status 0

Udev_device_event: device'/ block/sdb/sdb1' already in database, validate currently present symlinks

Udev_node_add: creating device node'/ dev/ASM_DISK_1G_1', major = '813, minor =' 179, mode = '0660, uid =' 503, gid = '504'

Udev_node_add: creating symlink'/ dev/disk/by-id/scsi-36000c2968513d97eb7cdd25bdbd10600-part1' to'.. /.. / ASM_DISK_1G_1'

Udev_node_add: creating symlink'/ dev/disk/by-path/pci-0000:00:10.0-scsi-0:0:1:0-part1' to'.. /.. / ASM_DISK_1G_1'

Main: run: 'socket:/org/kernel/udev/monitor'

Main: run:'/ lib/udev/udev_run_devd'

Main: run: 'socket:/org/freedesktop/hal/udev_event'

Main: run:'/ sbin/pam_console_apply / dev/ASM_DISK_1G_1 / dev/disk/by-id/scsi-36000c2968513d97eb7cdd25bdbd10600-part1 / dev/disk/by-path/pci-0000:00:10.0-scsi-0:0:1:0-part1'

Main: run:'/ bin/sh-c 'echo 180 > / sys/block/sdb/sdb1/timeout''

[root@ora32 ~] # udevtest / block/sdg/sdg1

Main: looking at device'/ block/sdg/sdg1' from subsystem 'block'

Udev_rules_get_name: add symlink 'disk/by-id/scsi-36000c29682ba5ec7a4c8a189499a89bb-part1'

Udev_rules_get_name: add symlink 'disk/by-path/pci-0000:00:10.0-scsi-0:0:6:0-part1'

Run_program:'/ lib/udev/vol_id-- export / dev/.tmp-8-97'

Run_program:'/ lib/udev/vol_id' returned with status 4

Run_program:'/ sbin/scsi_id'

Run_program:'/ sbin/scsi_id' (stdout) '36000c29682ba5ec7a4c8a189499a89bb'

Run_program:'/ sbin/scsi_id' returned with status 0

Run_program:'/ sbin/scsi_id'

Run_program:'/ sbin/scsi_id' (stdout) '36000c29682ba5ec7a4c8a189499a89bb'

Run_program:'/ sbin/scsi_id' returned with status 0

Run_program:'/ sbin/scsi_id'

Run_program:'/ sbin/scsi_id' (stdout) '36000c29682ba5ec7a4c8a189499a89bb'

Run_program:'/ sbin/scsi_id' returned with status 0

Run_program:'/ sbin/scsi_id'

Run_program:'/ sbin/scsi_id' (stdout) '36000c29682ba5ec7a4c8a189499a89bb'

Run_program:'/ sbin/scsi_id' returned with status 0

Run_program:'/ sbin/scsi_id'

Run_program:'/ sbin/scsi_id' (stdout) '36000c29682ba5ec7a4c8a189499a89bb'

Run_program:'/ sbin/scsi_id' returned with status 0

Run_program:'/ sbin/scsi_id'

Run_program:'/ sbin/scsi_id' (stdout) '36000c29682ba5ec7a4c8a189499a89bb'

Run_program:'/ sbin/scsi_id' returned with status 0

Udev_rules_get_name: rule applied, 'sdg1' becomes' ASM_DISK_1G_2'

Run_program:'/ sbin/scsi_id'

Run_program:'/ sbin/scsi_id' (stdout) '36000c29682ba5ec7a4c8a189499a89bb'

Run_program:'/ sbin/scsi_id' returned with status 0

Run_program:'/ sbin/scsi_id'

Run_program:'/ sbin/scsi_id' (stdout) '36000c29682ba5ec7a4c8a189499a89bb'

Run_program:'/ sbin/scsi_id' returned with status 0

Udev_device_event: device'/ block/sdg/sdg1' already in database, validate currently present symlinks

Udev_node_add: creating device node'/ dev/ASM_DISK_1G_2', major = '813, minor =' 97, mode = '0660, uid =' 503, gid = '504'

Udev_node_add: creating symlink'/ dev/disk/by-id/scsi-36000c29682ba5ec7a4c8a189499a89bb-part1' to'.. /.. / ASM_DISK_1G_2'

Udev_node_add: creating symlink'/ dev/disk/by-path/pci-0000:00:10.0-scsi-0:0:6:0-part1' to'.. /.. / ASM_DISK_1G_2'

Main: run: 'socket:/org/kernel/udev/monitor'

Main: run:'/ lib/udev/udev_run_devd'

Main: run: 'socket:/org/freedesktop/hal/udev_event'

Main: run:'/ sbin/pam_console_apply / dev/ASM_DISK_1G_2 / dev/disk/by-id/scsi-36000c29682ba5ec7a4c8a189499a89bb-part1 / dev/disk/by-path/pci-0000:00:10.0-scsi-0:0:6:0-part1'

Main: run:'/ bin/sh-c 'echo 180 > / sys/block/sdg/sdg1/timeout''

[root@ora32 ~] # udevtest / block/sdh/sdh2

Main: looking at device'/ block/sdh/sdh2' from subsystem 'block'

Udev_rules_get_name: add symlink 'disk/by-id/scsi-36000c292aa4a4ebbb25d15d2084c01ca-part1'

Udev_rules_get_name: add symlink 'disk/by-path/pci-0000:00:10.0-scsi-0:0:8:0-part1'

Run_program:'/ lib/udev/vol_id-export / dev/.tmp-8-113'

Run_program:'/ lib/udev/vol_id' returned with status 4

Run_program:'/ sbin/scsi_id'

Run_program:'/ sbin/scsi_id' (stdout) '36000c292aa4a4ebbb25d15d2084c01ca'

Run_program:'/ sbin/scsi_id' returned with status 0

Run_program:'/ sbin/scsi_id'

Run_program:'/ sbin/scsi_id' (stdout) '36000c292aa4a4ebbb25d15d2084c01ca'

Run_program:'/ sbin/scsi_id' returned with status 0

Run_program:'/ sbin/scsi_id'

Run_program:'/ sbin/scsi_id' (stdout) '36000c292aa4a4ebbb25d15d2084c01ca'

Run_program:'/ sbin/scsi_id' returned with status 0

Run_program:'/ sbin/scsi_id'

Run_program:'/ sbin/scsi_id' (stdout) '36000c292aa4a4ebbb25d15d2084c01ca'

Run_program:'/ sbin/scsi_id' returned with status 0

Run_program:'/ sbin/scsi_id'

Run_program:'/ sbin/scsi_id' (stdout) '36000c292aa4a4ebbb25d15d2084c01ca'

Run_program:'/ sbin/scsi_id' returned with status 0

Run_program:'/ sbin/scsi_id'

Run_program:'/ sbin/scsi_id' (stdout) '36000c292aa4a4ebbb25d15d2084c01ca'

Run_program:'/ sbin/scsi_id' returned with status 0

Run_program:'/ sbin/scsi_id'

Run_program:'/ sbin/scsi_id' (stdout) '36000c292aa4a4ebbb25d15d2084c01ca'

Run_program:'/ sbin/scsi_id' returned with status 0

Udev_rules_get_name: rule applied, 'sdh2' becomes' ASM_DISK_1G_3'

Run_program:'/ sbin/scsi_id'

Run_program:'/ sbin/scsi_id' (stdout) '36000c292aa4a4ebbb25d15d2084c01ca'

Run_program:'/ sbin/scsi_id' returned with status 0

Udev_device_event: device'/ block/sdh/sdh2' already in database, validate currently present symlinks

Udev_node_add: creating device node'/ dev/ASM_DISK_1G_3', major = '813, minor =' 113, mode = '0660, uid =' 503, gid = '504'

Udev_node_add: creating symlink'/ dev/disk/by-id/scsi-36000c292aa4a4ebbb25d15d2084c01ca-part1' to'.. /.. / ASM_DISK_1G_3'

Udev_node_add: creating symlink'/ dev/disk/by-path/pci-0000:00:10.0-scsi-0:0:8:0-part1' to'.. /.. / ASM_DISK_1G_3'

Main: run: 'socket:/org/kernel/udev/monitor'

Main: run:'/ lib/udev/udev_run_devd'

Main: run: 'socket:/org/freedesktop/hal/udev_event'

Main: run:'/ sbin/pam_console_apply / dev/ASM_DISK_1G_3 / dev/disk/by-id/scsi-36000c292aa4a4ebbb25d15d2084c01ca-part1 / dev/disk/by-path/pci-0000:00:10.0-scsi-0:0:8:0-part1'

Main: run:'/ bin/sh-c 'echo 180 > / sys/block/sdh/sdh2/timeout''

[root@ora32 ~] # udevtest / block/sdi/sdi1

Main: looking at device'/ block/sdi/sdi1' from subsystem 'block'

Udev_rules_get_name: add symlink 'disk/by-id/scsi-36000c29a98ca1bd8a0012e99f992a19d-part1'

Udev_rules_get_name: add symlink 'disk/by-path/pci-0000:00:10.0-scsi-0:0:9:0-part1'

Run_program:'/ lib/udev/vol_id-export / dev/.tmp-8-129'

Run_program:'/ lib/udev/vol_id' returned with status 4

Run_program:'/ sbin/scsi_id'

Run_program:'/ sbin/scsi_id' (stdout) '36000c29a98ca1bd8a0012e99f992a19d'

Run_program:'/ sbin/scsi_id' returned with status 0

Run_program:'/ sbin/scsi_id'

Run_program:'/ sbin/scsi_id' (stdout) '36000c29a98ca1bd8a0012e99f992a19d'

Run_program:'/ sbin/scsi_id' returned with status 0

Run_program:'/ sbin/scsi_id'

Run_program:'/ sbin/scsi_id' (stdout) '36000c29a98ca1bd8a0012e99f992a19d'

Run_program:'/ sbin/scsi_id' returned with status 0

Run_program:'/ sbin/scsi_id'

Run_program:'/ sbin/scsi_id' (stdout) '36000c29a98ca1bd8a0012e99f992a19d'

Run_program:'/ sbin/scsi_id' returned with status 0

Run_program:'/ sbin/scsi_id'

Run_program:'/ sbin/scsi_id' (stdout) '36000c29a98ca1bd8a0012e99f992a19d'

Run_program:'/ sbin/scsi_id' returned with status 0

Run_program:'/ sbin/scsi_id'

Run_program:'/ sbin/scsi_id' (stdout) '36000c29a98ca1bd8a0012e99f992a19d'

Run_program:'/ sbin/scsi_id' returned with status 0

Run_program:'/ sbin/scsi_id'

Run_program:'/ sbin/scsi_id' (stdout) '36000c29a98ca1bd8a0012e99f992a19d'

Run_program:'/ sbin/scsi_id' returned with status 0

Run_program:'/ sbin/scsi_id'

Run_program:'/ sbin/scsi_id' (stdout) '36000c29a98ca1bd8a0012e99f992a19d'

Run_program:'/ sbin/scsi_id' returned with status 0

Udev_rules_get_name: rule applied, 'sdi1' becomes' ASM_DISK_1G_4'

Udev_device_event: device'/ block/sdi/sdi1' already in database, validate currently present symlinks

Udev_node_add: creating device node'/ dev/ASM_DISK_1G_4', major = '813, minor =' 129, mode = '0660, uid =' 503, gid = '504'

Udev_node_add: creating symlink'/ dev/disk/by-id/scsi-36000c29a98ca1bd8a0012e99f992a19d-part1' to'.. /.. / ASM_DISK_1G_4'

Udev_node_add: creating symlink'/ dev/disk/by-path/pci-0000:00:10.0-scsi-0:0:9:0-part1' to'.. /.. / ASM_DISK_1G_4'

Main: run: 'socket:/org/kernel/udev/monitor'

Main: run:'/ lib/udev/udev_run_devd'

Main: run: 'socket:/org/freedesktop/hal/udev_event'

Main: run:'/ sbin/pam_console_apply / dev/ASM_DISK_1G_4 / dev/disk/by-id/scsi-36000c29a98ca1bd8a0012e99f992a19d-part1 / dev/disk/by-path/pci-0000:00:10.0-scsi-0:0:9:0-part1'

Main: run:'/ bin/sh-c 'echo 180 > / sys/block/sdi/sdi1/timeout''

Restart the udev service

[root@ora32 ~] # / sbin/udevcontrol reload_rules

[root@ora32 ~] # / sbin/start_udev

Starting udev: [OK]

Check out the newly mapped disk

[root@ora32 ~] # ll / dev/ASM*

Brw-rw---- 1 grid asmadmin 8, 17 May 13 15:40 / dev/ASM_DISK_1G_1

Brw-rw---- 1 grid asmadmin 8, 97 May 13 15:40 / dev/ASM_DISK_1G_2

Brw-rw---- 1 grid asmadmin 8, 113 May 13 15:40 / dev/ASM_DISK_1G_3

Brw-rw---- 1 grid asmadmin 8, 129 May 13 15:40 / dev/ASM_DISK_1G_4

Brw-rw---- 1 grid asmadmin 8, 33 May 13 15:43 / dev/ASM_DISK_2G_1

Brw-rw---- 1 grid asmadmin 8, 49 May 13 15:43 / dev/ASM_DISK_2G_2

Brw-rw---- 1 grid asmadmin 8, 65 May 13 15:42 / dev/ASM_DISK_2G_3

Brw-rw---- 1 grid asmadmin 8, 81 May 13 15:43 / dev/ASM_DISK_2G_4

Check the ASM disk situation through the Oracle view

[grid@ora32 ~] $sqlplus / as sysasm

SQL*Plus: Release 11.2.0.1.0 Production on Mon May 13 15:42:05 2013

Copyright (c) 1982, 2009, Oracle. All rights reserved.

Connected to:

Oracle Database 11g Enterprise Edition Release 11.2.0.1.0-64bit Production

With the Automatic Storage Management option

SQL >

SQL > col group# for 99

SQL > col disk# for 99

SQL > col name for A5

SQL > col path for A11

SQL > col LABEL for A7

SQL > col FAILGROUP for A10

SQL > select GROUP_NUMBER group#,DISK_NUMBER disk#,LABEL,STATE,FAILGROUP,name,path,TOTAL_MB,FREE_MB from v$asm_disk

GROUP# DISK# LABEL STATE FAILGROUP NAME PATH TOTAL_MB FREE_MB

0 0 NORMAL / dev/ASM_DI 0 0

SK_1G_3

0 1 NORMAL / dev/ASM_DI 0 0

SK_1G_2

0 2 NORMAL / dev/ASM_DI 0 0

SK_1G_1

0 3 NORMAL / dev/ASM_DI 0 0

SK_1G_4

GROUP# DISK# LABEL STATE FAILGROUP NAME PATH TOTAL_MB FREE_MB

12 NORMAL DG_DATA_00 DG_DA / dev/ASM_DI 2047 1612

02 TA_00 SK_2G_3

02

1 3 NORMAL DG_DATA_00 DG_DA / dev/ASM_DI 2047 1611

03 TA_00 SK_2G_4

03

1 1 NORMAL DG_DATA_00 DG_DA / dev/ASM_DI 2047 1613

01 TA_00 SK_2G_2

GROUP# DISK# LABEL STATE FAILGROUP NAME PATH TOTAL_MB FREE_MB

01

1 0 NORMAL DG_DATA_00 DG_DA / dev/ASM_DI 2047 1612

00 TA_00 SK_2G_1

00

8 rows selected.

At this time, it is found that the four newly added hard drives can be queried through the view, but the attributes such as FAILGROUP, NAME and so on are empty because the disk has not yet been added to the ASM disk group. How did ASM recognize the newly added disks? In fact, it is automatically scanned based on the property asm_diskstring in the parameter file, which is set when you install GRID and configure ASM.

SQL > show parameter ASM

NAME TYPE VALUE

-

Asm_diskgroups string

Asm_diskstring string / dev/ASM*

Asm_power_limit integer 1

Asm_preferred_read_failure_groups string

Add disks ASM_DISK_1G_1, ASM_DISK_1G_2 to disk group DG_DATA.

SQL > ALTER DISKGROUP DG_DATA ADD disk'/ dev/ASM_DISK_1G_1'

Diskgroup altered.

SQL > ALTER DISKGROUP DG_DATA ADD disk'/ dev/ASM_DISK_1G_2'

Diskgroup altered.

Create a new disk group DG_NEW_DATA and add ASM_DISK_1G_3 and ASM_DISK_1G_4 to the disk group.

SQL > CREATE DISKGROUP DG_NEW_DATA external REDUNDANCY DISK'/ dev/ASM_DISK_1G_3','/dev/ASM_DISK_1G_4'

Diskgroup created.

Check out the new ASM disk groups and ASM disks through the Oracle view.

SQL > col name for A10

SQL > SELECT group_number,name,type,state,total_mb,free_mb,offline_disks FROM V$ASM_diskgroup

GROUP_NUMBER NAME TYPE STATE TOTAL_MB FREE_MB OFFLINE_DISKS

1 DG_DATA EXTERN MOUNTED 10226 8482 0

2 DG_NEW_DAT EXTERN MOUNTED 2038 1986 0

A

SQL > select GROUP_NUMBER group#,DISK_NUMBER disk#,LABEL,STATE,FAILGROUP,name,path,TOTAL_MB,FREE_MB from v$asm_disk

GROUP# DISK# LABEL STATE FAILGROUP NAME PATH TOTAL_MB

--

FREE_MB

-

1 2 NORMAL DG_DATA_00 DG_DA / dev/ASM_DI 2047

02 TA_00 SK_2G_3

02

1697

1 3 NORMAL DG_DATA_00 DG_DA / dev/ASM_DI 2047

03 TA_00 SK_2G_4

03

1697

GROUP# DISK# LABEL STATE FAILGROUP NAME PATH TOTAL_MB

--

FREE_MB

-

1 1 NORMAL DG_DATA_00 DG_DA / dev/ASM_DI 2047

01 TA_00 SK_2G_2

01

1699

1 0 NORMAL DG_DATA_00 DG_DA / dev/ASM_DI 2047

00 TA_00 SK_2G_1

00

GROUP# DISK# LABEL STATE FAILGROUP NAME PATH TOTAL_MB

--

FREE_MB

-

1697

2 0 NORMAL DG_NEW_DAT DG_NE / dev/ASM_DI 1019

A_0000 W_DAT SK_1G_3

A_000

0

nine hundred and ninety four

1 5 NORMAL DG_DATA_00 DG_DA / dev/ASM_DI 1019

GROUP# DISK# LABEL STATE FAILGROUP NAME PATH TOTAL_MB

--

FREE_MB

-

05 TA_00 SK_1G_2

05

eight hundred and forty six

1 4 NORMAL DG_DATA_00 DG_DA / dev/ASM_DI 1019

04 TA_00 SK_1G_1

04

eight hundred and forty six

GROUP# DISK# LABEL STATE FAILGROUP NAME PATH TOTAL_MB

--

FREE_MB

-

2 1 NORMAL DG_NEW_DAT DG_NE / dev/ASM_DI 1019

A_0001 W_DAT SK_1G_4

A_000

one

nine hundred and ninety two

8 rows selected.

According to the requirements of the experiment, 4 hard drives are added, then the hard drives ASM_DISK_1G_1 and ASM_DISK_1G_2 are deleted from the ASM disk group DG_DATA, and then the udev mapping rules are deleted.

SQL > ALTER DISKGROUP DG_DATA DROP DISK DG_DATA_0004

Diskgroup altered.

SQL > ALTER DISKGROUP DG_DATA DROP DISK DG_DATA_0005

Diskgroup altered.

SQL > col group# for 99

SQL > col disk# for 99

SQL > col name for A5

SQL > col path for A11

SQL > col LABEL for A7

SQL > col FAILGROUP for A10

SQL > select GROUP_NUMBER group#,DISK_NUMBER disk#,LABEL,STATE,FAILGROUP,name,path,TOTAL_MB,FREE_MB from v$asm_disk

GROUP# DISK# LABEL STATE FAILGROUP NAME PATH TOTAL_MB FREE_MB

0 0 NORMAL / dev/ASM_DI 0 0

SK_1G_2

0 1 NORMAL / dev/ASM_DI 0 0

SK_1G_1

12 NORMAL DG_DATA_00 DG_DA / dev/ASM_DI 2047 1612

02 TA_00 SK_2G_3

02

1 3 NORMAL DG_DATA_00 DG_DA / dev/ASM_DI 2047 1611

GROUP# DISK# LABEL STATE FAILGROUP NAME PATH TOTAL_MB FREE_MB

03 TA_00 SK_2G_4

03

1 1 NORMAL DG_DATA_00 DG_DA / dev/ASM_DI 2047 1614

01 TA_00 SK_2G_2

01

1 0 NORMAL DG_DATA_00 DG_DA / dev/ASM_DI 2047 1611

00 TA_00 SK_2G_1

00

GROUP# DISK# LABEL STATE FAILGROUP NAME PATH TOTAL_MB FREE_MB

2 0 NORMAL DG_NEW_DAT DG_NE / dev/ASM_DI 1019 994

A_0000 W_DAT SK_1G_3

A_000

0

2 1 NORMAL DG_NEW_DAT DG_NE / dev/ASM_DI 1019 992

A_0001 W_DAT SK_1G_4

A_000

one

8 rows selected.

[root@ora32 ~] # vi / etc/udev/rules.d/99-oracle-asmdevices.rules

KERNEL== "sd?1", BUS== "scsi", PROGRAM== "/ sbin/scsi_id"

RESULT== "36000c29c9a269653c7cd04ea2edb0c71", NAME= "ASM_DISK_2G_1", WNER= "grid", GROUP= "asmadmin", MODE= "0660"

KERNEL== "sd?1", BUS== "scsi", PROGRAM== "/ sbin/scsi_id"

RESULT== "36000c29861258ebc95eded634a1f36fd", NAME= "ASM_DISK_2G_2", WNER= "grid", GROUP= "asmadmin", MODE= "0660"

KERNEL== "sd?1", BUS== "scsi", PROGRAM== "/ sbin/scsi_id"

RESULT== "36000c296fd09d9ed213df1999820ca89", NAME= "ASM_DISK_2G_3", WNER= "grid", GROUP= "asmadmin", MODE= "0660"

KERNEL== "sd?1", BUS== "scsi", PROGRAM== "/ sbin/scsi_id"

RESULT== "36000c2934ae12fd4af0dd366d85b42f5", NAME= "ASM_DISK_2G_4", WNER= "grid", GROUP= "asmadmin", MODE= "0660"

# KERNEL== "sd?1", BUS== "scsi", PROGRAM== "/ sbin/scsi_id"

# RESULT== "36000c2968513d97eb7cdd25bdbd10600", NAME= "ASM_DISK_1G_1", WNER= "grid", GROUP= "asmadmin", MODE= "0660"

# KERNEL== "sd?1", BUS== "scsi", PROGRAM== "/ sbin/scsi_id"

# RESULT== "36000c29682ba5ec7a4c8a189499a89bb", NAME= "ASM_DISK_1G_2", WNER= "grid", GROUP= "asmadmin", MODE= "0660"

KERNEL== "sd?1", BUS== "scsi", PROGRAM== "/ sbin/scsi_id"

RESULT== "36000c292aa4a4ebbb25d15d2084c01ca", NAME= "ASM_DISK_1G_3", WNER= "grid", GROUP= "asmadmin", MODE= "0660"

KERNEL== "sd?1", BUS== "scsi", PROGRAM== "/ sbin/scsi_id"

RESULT== "36000c29a98ca1bd8a0012e99f992a19d", NAME= "ASM_DISK_1G_4", WNER= "grid", GROUP= "asmadmin", MODE= "0660"

Restart udev

[root@ora32 dev] # / sbin/udevcontrol reload_rules

[root@ora32 dev] # / sbin/start_udev

Starting udev: [OK]

Check the devices under dev and find that / dev/ASM_DISK_1G_1,/dev/ASM_DISK_1G_2 still exists

[root@ora32 dev] # ll / dev/ASM*

Brw-rw---- 1 grid asmadmin 8, 17 May 13 16:15 / dev/ASM_DISK_1G_1

Brw-rw---- 1 grid asmadmin 8, 97 May 13 16:15 / dev/ASM_DISK_1G_2

Brw-rw---- 1 grid asmadmin 8, 113 May 13 16:38 / dev/ASM_DISK_1G_3

Brw-rw---- 1 grid asmadmin 8, 129 May 13 16:37 / dev/ASM_DISK_1G_4

Brw-rw---- 1 grid asmadmin 8, 33 May 13 16:38 / dev/ASM_DISK_2G_1

Brw-rw---- 1 grid asmadmin 8, 49 May 13 16:38 / dev/ASM_DISK_2G_2

Brw-rw---- 1 grid asmadmin 8, 65 May 13 16:38 / dev/ASM_DISK_2G_3

Brw-rw---- 1 grid asmadmin 8, 81 May 13 16:37 / dev/ASM_DISK_2G_4

I don't know why. After stopping both the database instance and the ASM instance, and restarting the udev service, it is found that / dev/ASM_DISK_1G_1,/dev/ASM_DISK_1G_2 still exists under dev. Through udevinfo query, it is found that there is no record in udev.

[root@ora32 dev] # udevinfo-Q path-n / dev/ASM_DISK_1G_1

No record for 'ASM_DISK_1G_1' in database

[root@ora32 dev] # udevinfo-Q path-n / dev/ASM_DISK_1G_2

No record for 'ASM_DISK_1G_2' in database

[root@ora32 dev] #

[root@ora32 dev] # udevinfo-Q path-n / dev/ASM_DISK_1G_3

/ block/sdh/sdh2

After looking up the information on the Internet, we can't find the reason why / dev/ASM_DISK_1G_1,/dev/ASM_DISK_1G_2 still exists, and continue to follow up on this problem.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report