Udev SCSI rules configuration in Oracle Linux

Source: Internet
Author: User

The configuration of ASM in Oracle RAC can be implemented in two ways: raw and asmlib. Raw is recommended for actual maintenance.

 

There are two ways to use raw: Multipath and udev. On the RedHat platform, refer:

RedHat 5.4 + ASM + raw + Oracle 10g RAC installation documentation

Http://blog.csdn.net/tianlesoftware/article/details/5872593

 

RedHat 5.4 Oracle 10g RAC openfiler + multipath + raw + ASM installation document

Http://blog.csdn.net/tianlesoftware/article/details/6048792

 

For asmlib, refer:

Raw + asm rac installation document

Http://blog.csdn.net/tianlesoftware/article/details/5332909

 

In this article, let's take a look at the udev configuration in the oraclelinux system.

 

Reference:

Http://www.oracle-base.com/articles/linux/UdevScsiRulesConfigurationInOracleLinux5and6.php

Http://www.oracle-base.com/articles/11g/OracleDB11gR2RACInstallationOnOracleLinux6UsingVirtualBox.php

 

 

My experimental platform here is oraclelinux 6.1 + virtual box.

Oraclevirtual box installation instructions

Http://blog.csdn.net/tianlesoftware/article/details/6826389

 

 

I. Preparations 1.1 create a shared Disk

Use the virtualbox command to create the image. Shut down the VM before creating the VM.

 

1.1.1 create a shared directory sharedisk:

F: \ vbox \ sharedisk

 

1.1.2 create virtual Media

C: \ Users \ administrator. David Dai> CDF: \ vbox \ sharedisk

 

C: \ Users \ administrator. David Dai> F:

 

F: \ vbox \ sharedisk> vboxmanage createhd -- filename asm01.vdi -- size 5120 -- format VDI -- variant fixed

0%... 10%... 20%... 30%... 40%... 50%... 60%... 70%... 80%... 90%... 100%

Disk image created. UUID: 83552343-5254-4fe0-8f4d-949389a4d528

 

F: \ vbox \ sharedisk> vboxmanage createhd -- filename asm02.vdi -- size 5120 -- format VDI -- variant fixed

0%... 10%... 20%... 30%... 40%... 50%... 60%... 70%... 80%... 90%... 100%

Disk image created. UUID: b96d5ecb-168a-4eaf-851e-0f21961dae4e

 

F: \ vbox \ sharedisk> vboxmanage createhd -- filename asm03.vdi -- size 5120 -- format VDI -- variant fixed

0%... 10%... 20%... 30%... 40%... 50%... 60%... 70%... 80%... 90%... 100%

Disk image created. UUID: fd7bba6c-9530-433f-a7e0-24d470ba1fb9

 

F: \ vbox \ sharedisk> vboxmanage createhd -- filename asm04.vdi -- size 5120 -- format VDI -- variant fixed

0%... 10%... 20%... 30%... 40%... 50%... 60%... 70%... 80%... 90%... 100%

Disk image created. UUID: 3239ed0d-bd0b-4124-a389-db21ecbb15db

 

 

1.1.3 match the virtual media to the Virtual Machine

 

F: \ vbox \ sharedisk> vboxmanage storageattach oralinuxrac1 -- storagectl "SATA controller" -- Port 1 -- device 0 -- type HDD -- medium asm01.vdi -- mtype retriable

 

F: \ vbox \ sharedisk> vboxmanage storageattach oralinuxrac1 -- storagectl "SATA controller" -- Port 2 -- device 0 -- type HDD -- medium asm02.vdi -- mtype retriable

 

F: \ vbox \ sharedisk> vboxmanage storageattach oralinuxrac1 -- storagectl "SATA controller" -- Port 3 -- device 0 -- type HDD -- medium asm03.vdi -- mtype retriable

 

F: \ vbox \ sharedisk> vboxmanage storageattach oralinuxrac1 -- storagectl "SATA controller" -- Port 4 -- device 0 -- type HDD -- medium asm04.vdi -- mtype retriable

 

Notes:

(1) controller name

What I wrote here is: "SATA controller", because my VM is displayed in Chinese, such:

 

In English, the name must be written as "SATA controller", for example:

F: \ vbox \ sharedisk> vboxmanagestorageattach oralinuxrac1 -- storagectl "SATA controller" -- Port 1 -- device 0 -- type HDD -- medium asm04.vdi -- mtype retriable

 

(2) storageattach corresponds to the name of the VM displayed in the VM.

 

(3) to add a disk to another node, you only need to change the Virtual Machine name here. For example:

F: \ vbox \ sharedisk> vboxmanagestorageattach oralinuxrac2 -- storagectl "SATA controller" -- Port 1 -- device 0 -- typehdd -- medium asm04.vdi -- mtype retriable

 

 

1.1.4 configure virtual media sharing. You can also perform this operation on the vbox interface. Here, use the command

This information will be recorded in the file header of each virtual disk file. Therefore, you do not need to set it as shared when other files are used.

 

F: \ vbox \ sharedisk> vboxmanage modifyhdasm01.vdi -- type retriable

F: \ vbox \ sharedisk> vboxmanage modifyhdasm02.vdi -- type retriable

F: \ vbox \ sharedisk> vboxmanage modifyhdasm03.vdi -- type retriable

F: \ vbox \ sharedisk> vboxmanage modifyhdasm04.vdi -- type retriable

 

 

1.2 format shared media

Start the VM and perform formatting.

 

[Root @ Rac1 ~] # Cd/dev

[Root @ Rac1 Dev] # ls SD *

SDA sda1 sda2 sda3 SDB SDC SDD SDE

-- SDB, SDC, SDD, and SDE here are the virtual media we have added.

 

[Root @ Rac1 Dev] # fdisk-l

 

Disk/dev/SDA: 16.1 GB, 16106127360 bytes

255 heads, 63 sectors/track, 1958 Cylinders

Units = cylinders of 16065*512 = 8225280 bytes

Sector size (logical/physical): 512 bytes/512 bytes

I/O size (minimum/optimal): 512 bytes/512 bytes

Disk identifier: 0x0008dd19

 

Device boot start end blocks ID system

/Dev/sda1 × 1 26 204800 83 Linux

Partition 1 does not end on cylinderboundary.

/Dev/sda2 26 154 1024000 82 Linux swap/Solaris

Partition 2 does not end on cylinderboundary.

/Dev/sda3 154 1959 14498816 83 Linux

 

Disk/dev/SDB: 5368 MB, 5368709120 bytes

255 heads, 63 sectors/track, 652 Cylinders

Units = cylinders of 16065*512 = 8225280 bytes

Sector size (logical/physical): 512 bytes/512 bytes

I/O size (minimum/optimal): 512 bytes/512 bytes

Disk identifier: 0x00000000

 

Disk/dev/SDB doesn' t contain a validpartition table

 

Disk/dev/SDC: 5368 MB, 5368709120 bytes

255 heads, 63 sectors/track, 652 Cylinders

Units = cylinders of 16065*512 = 8225280 bytes

Sector size (logical/physical): 512 bytes/512 bytes

I/O size (minimum/optimal): 512 bytes/512 bytes

Disk identifier: 0x00000000

 

Disk/dev/SDC doesn' t contain a validpartition table

 

Disk/dev/SDD: 5368 MB, 5368709120 bytes

255 heads, 63 sectors/track, 652 Cylinders

Units = cylinders of 16065*512 = 8225280 bytes

Sector size (logical/physical): 512 bytes/512 bytes

I/O size (minimum/optimal): 512 bytes/512 bytes

Disk identifier: 0x00000000

 

Disk/dev/SDD doesn't contain a validpartition table

 

Disk/dev/SDE: 5368 Mbit/s, 5368709120 bytes

255 heads, 63 sectors/track, 652 Cylinders

Units = cylinders of 16065*512 = 8225280 bytes

Sector size (logical/physical): 512 bytes/512 bytes

I/O size (minimum/optimal): 512 bytes/512 bytes

Disk identifier: 0x00000000

 

Disk/dev/SDE doesn't contain a validpartition table

[Root @ Rac1 Dev] #

 

 

Start formatting media:

[Root @ Rac1 Dev] # fdisk/dev/SDB

Device contains neither a valid dospartition table, Nor Sun, SGI or OSF disklabel

Building a new dos disklabel with diskidentifier 0xbe1b86b0.

Changes will remain in memory only, untilyou decide to write them.

After that, of course, the previous contentwon't be recoverable.

 

Warning: Invalid flag 0x0000 of partitiontable 4 will be corrected by W (RITE)

 

Warning: DOS-compatible mode is deprecated. It's stronugly recommended

Switch off the mode (command 'C') and change display units

Sectors (command 'U ').

 

Command (M for help): n

Command action

E extended

P primary partition (1-4)

P

Partition Number (1-4): 1

First cylinder (1-652, default 1 ):

Using default value 1

Last cylinder, + cylinders or + size {K, M, g} (1-652, default 652 ):

Using default value 652

 

Command (M for help): W

The partition table has been altered!

 

Calling IOCTL () to re-read partition table.

Syncing disks.

[Root @ Rac1 Dev] #

 

Repeat the preceding operations to format the remaining three media.

 

Verification:

[Root @ Rac1 Dev] # ls SD *

SDA sda1 sda2 sda3 SDB sdb1 SDC sdc1 SDD sdd1 SDE sde1

[Root @ Rac1 Dev] # fdisk-l

 

Disk/dev/SDA: 16.1 GB, 16106127360 bytes

255 heads, 63 sectors/track, 1958 Cylinders

Units = cylinders of 16065*512 = 8225280 bytes

Sector size (logical/physical): 512 bytes/512 bytes

I/O size (minimum/optimal): 512 bytes/512 bytes

Disk identifier: 0x0008dd19

 

Device boot start end blocks ID system

/Dev/sda1 × 1 26 204800 83 Linux

Partition 1 does not end on cylinderboundary.

/Dev/sda2 26 154 1024000 82 Linux swap/Solaris

Partition 2 does not end on cylinderboundary.

/Dev/sda3 154 1959 14498816 83 Linux

 

Disk/dev/SDB: 5368 MB, 5368709120 bytes

255 heads, 63 sectors/track, 652 Cylinders

Units = cylinders of 16065*512 = 8225280 bytes

Sector size (logical/physical): 512 bytes/512 bytes

I/O size (minimum/optimal): 512 bytes/512 bytes

Disk identifier: 0xbe1b86b0

 

Device boot start end blocks ID system

/Dev/sdb1 1 652 5237158 + 83 Linux

 

Disk/dev/SDC: 5368 MB, 5368709120 bytes

255 heads, 63 sectors/track, 652 Cylinders

Units = cylinders of 16065*512 = 8225280 bytes

Sector size (logical/physical): 512 bytes/512 bytes

I/O size (minimum/optimal): 512 bytes/512 bytes

Disk identifier: 0x52c60017

 

Device boot start end blocks ID system

/Dev/sdc1 1 652 5237158 + 83 Linux

 

Disk/dev/SDD: 5368 MB, 5368709120 bytes

255 heads, 63 sectors/track, 652 Cylinders

Units = cylinders of 16065*512 = 8225280 bytes

Sector size (logical/physical): 512 bytes/512 bytes

I/O size (minimum/optimal): 512 bytes/512 bytes

Disk identifier: 0xb3564300

 

Device boot start end blocks ID system

/Dev/sdd1 1 652 5237158 + 83 Linux

 

Disk/dev/SDE: 5368 Mbit/s, 5368709120 bytes

255 heads, 63 sectors/track, 652 Cylinders

Units = cylinders of 16065*512 = 8225280 bytes

Sector size (logical/physical): 512 bytes/512 bytes

I/O size (minimum/optimal): 512 bytes/512 bytes

Disk identifier: 0x688384a0

 

Device boot start end blocks ID system

/Dev/sde1 1 652 5237158 + 83 Linux

You have new mail in/var/spool/mail/root

[Root @ Rac1 Dev] #

 

2. Configure udev

 

2.1 determine the SCSI ID

In Oracle Linux 5, run the following command:

#/Sbin/scsi_id-g-u-s/block/sdb/sdb1

SATA_VBOX_HARDDISK_VBd306dbe0-df3367e3 _

#/Sbin/scsi_id-g-u-s/block/SDC/sdc1

SATA_VBOX_HARDDISK_VB46dec7e0-192e8000 _

#/Sbin/scsi_id-g-u-s/block/SDD/sdd1

SATA_VBOX_HARDDISK_VBce8c63bb-ac67a172 _

#/Sbin/scsi_id-g-u-s/block/SDE/sde1

SATA_VBOX_HARDDISK_VB7437a3b7-95b199cd _

#

 

 

Here, the-s option is unavailable in Oracle Linux 6, and the environment here is also oraclelinux 6, so use the command below:

 

[Root @ Rac1 Dev] #/sbin/scsi_id-g-u/dev/sdb1

1ata_vbox_harddisk_vb83552343-28d5a489

[Root @ Rac1 Dev] #/sbin/scsi_id-g-u/dev/sdc1

1ata_vbox_harddisk_vbb96d5ecb-4eae1d96

[Root @ Rac1 Dev] #/sbin/scsi_id-g-u/dev/sdd1

1ata_vbox_harddisk_vbfd7bba6c-b91fba70

[Root @ Rac1 Dev] #/sbin/scsi_id-g-u/dev/sde1

1ata_vbox_harddisk_vb3239ed0d-db15bbec

 

2.2 create and configure the udevrules File

 

[Root @ Rac1 rules. d] # Touch/etc/udev/rules. d/99-oracle-asmdevices.rules

 

Add the following content:

Kernel = "SD? 1 ", bus =" SCSI ", program ="/sbin/scsi_id-g-u/dev/$ name ", result =" 1ata_vbox_harddisk_vb83552343-28d5a489 ", name = "asm-disk1", owner = "oracle", group = "dba", mode = "0660"

Kernel = "SD? 1 ", bus =" SCSI ", program ="/sbin/scsi_id-g-u/dev/$ name ", result =" 1ata_vbox_harddisk_vbb96d5ecb-4eae1d96 ", name = "asm-disk2", owner = "oracle", group = "dba", mode = "0660"

Kernel = "SD? 1 ", bus =" SCSI ", program ="/sbin/scsi_id-g-u/dev/$ name ", result =" 1ata_vbox_harddisk_vbfd7bba6c-b91fba70 ", name = "asm-disk3", owner = "oracle", group = "dba", mode = "0660"

Kernel = "SD? 1 ", bus =" SCSI ", program ="/sbin/scsi_id-g-u/dev/$ name ", result =" 1ata_vbox_harddisk_vb3239ed0d-db15bbec ", name = "asm-disk4", owner = "oracle", group = "dba", mode = "0660"

 

 

2.3 load updated block device partition tables.

 

#/Sbin/partprobe/dev/sdb1

#/Sbin/partprobe/dev/sdc1

#/Sbin/partprobe/dev/sdd1

#/Sbin/partprobe/dev/sde1

 

2.4 restart udev

[Root @ Rac1 Dev] # start_udev

Starting udev: [OK]

 

2.5 check the relationship and permissions of the shared Device

 

[Root @ Rac1 rules. d] # cd/dev

[Root @ Rac1 Dev] # ls-Al ASM-disk *

BRW-RW ----. 1 Oracle DBA 8, 17 Apr 6 asm-disk1

BRW-RW ----. 1 Oracle DBA 8, 33 APR 6 asm-disk2

BRW-RW ----. 1 Oracle DBA 8, 49 APR 6 asm-disk3

BRW-RW ----. 1 Oracle DBA 8, 65 APR 6 18:04 asm-disk4

 

Now the configuration is complete. In the ASM configuration, the asm_diskstring parameter points to '/dev/ASM-disk.

 

 

 

 

 

Bytes -------------------------------------------------------------------------------------------------------

All rights reserved. reprinted articles are allowed, but source addresses must be indicated by links. Otherwise, the documents will be held legally responsible!

Skype: tianlesoftware

Email: tianlesoftware@gmail.com

Blog: http://www.tianlesoftware.com

WEAVER: http://weibo.com/tianlesoftware

Twitter: http://twitter.com/tianlesoftware

Facebook: http://www.facebook.com/tianlesoftware

LinkedIn: http://cn.linkedin.com/in/tianlesoftware

 

 

------- Add a group to describe the relationship between Oracle tablespace and data files in the remarks section. Otherwise, reject the application ----

Dba1 group: 62697716 (full); dba2 group: 62697977 (full) dba3 group: 62697850 (full)

Super DBA group: 63306533 (full); dba4 group: 83829929 dba5 group: 142216823

Dba6 group: 158654907 dba7 group: 172855474 DBA group: 104207940

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.