Sie sind auf Seite 1von 19

Toggle navigation

partner-pub-99011

FORID:10

UTF-8

Home Articles Linux Here

UDEV SCSI Rules Configuration for ASM in Oracle


Linux 5, 6 and 7
For Oracle Automatic Storage Manager (ASM) to use disks, it needs to be able to
identify the devices consistently and for them to have the correct ownership and
permissions. In Linux you can use ASMLib to manage these tasks, but it is seen as an
additional layer of complexity and has never really gained any popularity. Instead, many
people use the Linux device manager "udev" to perform these tasks. This article
presents a brief overview of setting up udev rules with respect to disks for use with ASM
in Oracle 11g. The examples are all done using Oracle Linux 5, 6 and 7, so they will be
consistent with RHEL and CentOS 5, 6 and 7.

Background

Identify the Disks (/sbin/scsi_id)

Make SCSI Devices Trusted

Create UDEV Rules File

Load Updated Block Device Partitions (/sbin/partprobe)

Test Rules (udevtest)

Restart UDEV Service

Check Ownership and Permissions

Background

Essentially, what udev does is apply rules defined in files in the "/etc/udev/rules.d"
directory to the device nodes listed in the "/dev" directory. The rules can be defined in a
variety of ways, but what we need to do is identify the device and say what we want
udev to do with it.
In this case I know all my disk devices are named "/dev/sd?1", where the "?" represents
a letter from a-d, so I can identify the devices of interest using the following rule
parameters.
KERNEL=="sd?1", BUS=="scsi"

I want to tie each specific device to an alias, so it is always identified the same way,
regardless of the device name Linux assigns it. So I need to be able to test each device
that matches the previous pattern to see if it is the disk I am interested in. Each disk has
a unique SCSI ID, so I can place a test into the rule, telling it how to perform the test,
and the result it should return for a positive match. The following rule parameters explain
how to test the device and what result constitutes a match in Oracle Linux 5.
PROGRAM=="/sbin/scsi_id -g -u -s /block/$parent",
RESULT=="SATA_VBOX_HARDDISK_VBd306dbe0-df3367e3_"

The scsi_id command works a little differently in Oracle Linux 6, so for that the following
test works better.
PROGRAM=="/sbin/scsi_id -g -u -d /dev/$parent",
RESULT=="SATA_VBOX_HARDDISK_VBd306dbe0-df3367e3_"

The scsi_id command is located in a different place in Oracle Linux 7, so for that the
following test is correct.
PROGRAM=="/usr/lib/udev/scsi_id -g -u -d /dev/$parent",
RESULT=="SATA_VBOX_HARDDISK_VBd306dbe0-df3367e3_"

Once we have identified the specific device of interest, we need to indicate what actions
should be performed on it. The following parameters specify an alias, the ownership and
the permissions for the device.
NAME="asm-disk1", OWNER="oracle", GROUP="dba", MODE="0660"

So the whole rule for each disk will look something like this in Oracle Linux 5.

KERNEL=="sd?1", BUS=="scsi", PROGRAM=="/sbin/scsi_id -g -u -s /block/


$parent", RESULT=="SATA_VBOX_HARDDISK_VBd306dbe0-df3367e3_",
NAME="asm-disk1", OWNER="oracle", GROUP="dba", MODE="0660"

Or this in Oracle Linux 6.


KERNEL=="sd?1", BUS=="scsi", PROGRAM=="/sbin/scsi_id -g -u -d /dev/
$parent", RESULT=="SATA_VBOX_HARDDISK_VBd306dbe0-df3367e3_",
NAME="asm-disk1", OWNER="oracle", GROUP="dba", MODE="0660"

Or this in Oracle Linux 7.


KERNEL=="sd?1", SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id -g
-u -d /dev/$parent", RESULT=="SATA_VBOX_HARDDISK_VBd306dbe0df3367e3_", SYMLINK+="asm-disk1", OWNER="oracle", GROUP="dba",
MODE="0660"

This means that the device pointing to the partition "sd*1" on the disk with the SCSI ID
of "SATA_VBOX_HARDDISK_VBd306dbe0-df3367e3_" will always be called "/dev/asmdisk1", regardless of the letter "?" Linux assigns when the device is discovered. In
addition, the device will have the correct ownership and permissions for ASM.
There are a number of wildcards and matching patterns that can be used if you don't
want to write device-specific rules.
Now we know roughly what we are trying to achieve, we will look at each step
necessary for setting up the disks for ASM to use.

Identify the Disks (/sbin/scsi_id)


We are going to write device-specific rules, so we need to be able to identify each
device consistently, irrespective of the order in which Linux discovers it. To do this we
are going to use the SCSI ID for each disk (not the partition), which we get using the
scsi_id command. The "-s" option makes the paths relative to the "/sys" directory. For
Oracle Linux 5, use the following command.
# /sbin/scsi_id -g -u -s /block/sdb
SATA_VBOX_HARDDISK_VBd306dbe0-df3367e3_
# /sbin/scsi_id -g -u -s /block/sdc

SATA_VBOX_HARDDISK_VB46dec7e0-192e8000_
# /sbin/scsi_id -g -u -s /block/sdd
SATA_VBOX_HARDDISK_VBce8c63bb-ac67a172_
# /sbin/scsi_id -g -u -s /block/sde
SATA_VBOX_HARDDISK_VB7437a3b7-95b199cd_
#

The "-s" is not available in Oracle Linux 6, so you must use the following syntax.
# /sbin/scsi_id -g -u -d /dev/sdb
SATA_VBOX_HARDDISK_VBd306dbe0-df3367e3_
# /sbin/scsi_id -g -u -d /dev/sdc
SATA_VBOX_HARDDISK_VB46dec7e0-192e8000_
# /sbin/scsi_id -g -u -d /dev/sdd
SATA_VBOX_HARDDISK_VBce8c63bb-ac67a172_
# /sbin/scsi_id -g -u -d /dev/sde
SATA_VBOX_HARDDISK_VB7437a3b7-95b199cd_
#

The location of the scsi_id command has changed in Oracle Linux 7, so you must use
the following syntax.
# /usr/lib/udev/scsi_id -g -u -d /dev/sdb
SATA_VBOX_HARDDISK_VBd306dbe0-df3367e3_
# /usr/lib/udev/scsi_id -g -u -d /dev/sdc
SATA_VBOX_HARDDISK_VB46dec7e0-192e8000_
# /usr/lib/udev/scsi_id -g -u -d /dev/sdd
SATA_VBOX_HARDDISK_VBce8c63bb-ac67a172_
# /usr/lib/udev/scsi_id -g -u -d /dev/sde
SATA_VBOX_HARDDISK_VB7437a3b7-95b199cd_
#

Make SCSI Devices Trusted


Add the following to the "/etc/scsi_id.config" file to configure SCSI devices as trusted.
Create the file if it doesn't already exist.
options=-g

Create UDEV Rules File


Create the "/etc/udev/rules.d/99-oracle-asmdevices.rules" file.
# vi /etc/udev/rules.d/99-oracle-asmdevices.rules

The file should contain the following lines for Oracle Linux 5. The PROGRAM parameter
must match the command you used to retrieve the SCSI ID, and the RESULT parameter
must match the value returned from your disks.
KERNEL=="sd?1", BUS=="scsi", PROGRAM=="/sbin/scsi_id -g -u -s /block/
$parent", RESULT=="SATA_VBOX_HARDDISK_VBd306dbe0-df3367e3_",
NAME="asm-disk1", OWNER="oracle", GROUP="dba", MODE="0660"
KERNEL=="sd?1", BUS=="scsi", PROGRAM=="/sbin/scsi_id -g -u -s /block/
$parent", RESULT=="SATA_VBOX_HARDDISK_VB46dec7e0-192e8000_",
NAME="asm-disk2", OWNER="oracle", GROUP="dba", MODE="0660"
KERNEL=="sd?1", BUS=="scsi", PROGRAM=="/sbin/scsi_id -g -u -s /block/
$parent", RESULT=="SATA_VBOX_HARDDISK_VBce8c63bb-ac67a172_",
NAME="asm-disk3", OWNER="oracle", GROUP="dba", MODE="0660"
KERNEL=="sd?1", BUS=="scsi", PROGRAM=="/sbin/scsi_id -g -u -s /block/
$parent", RESULT=="SATA_VBOX_HARDDISK_VB7437a3b7-95b199cd_",
NAME="asm-disk4", OWNER="oracle", GROUP="dba", MODE="0660"

The equivalent for Oracle Linux 6 is shown below.


KERNEL=="sd?1", BUS=="scsi", PROGRAM=="/sbin/scsi_id -g -u -d /dev/
$parent", RESULT=="SATA_VBOX_HARDDISK_VBd306dbe0-df3367e3_",
NAME="asm-disk1", OWNER="oracle", GROUP="dba", MODE="0660"
KERNEL=="sd?1", BUS=="scsi", PROGRAM=="/sbin/scsi_id -g -u -d /dev/
$parent", RESULT=="SATA_VBOX_HARDDISK_VB46dec7e0-192e8000_",
NAME="asm-disk2", OWNER="oracle", GROUP="dba", MODE="0660"

KERNEL=="sd?1", BUS=="scsi", PROGRAM=="/sbin/scsi_id -g -u -d /dev/


$parent", RESULT=="SATA_VBOX_HARDDISK_VBce8c63bb-ac67a172_",
NAME="asm-disk3", OWNER="oracle", GROUP="dba", MODE="0660"
KERNEL=="sd?1", BUS=="scsi", PROGRAM=="/sbin/scsi_id -g -u -d /dev/
$parent", RESULT=="SATA_VBOX_HARDDISK_VB7437a3b7-95b199cd_",
NAME="asm-disk4", OWNER="oracle", GROUP="dba", MODE="0660"

The equivalent for Oracle Linux 7 is shown below.


KERNEL=="sd?1", SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id -g
-u -d /dev/$parent", RESULT=="SATA_VBOX_HARDDISK_VBd306dbe0df3367e3_", SYMLINK+="asm-disk1", OWNER="oracle", GROUP="dba",
MODE="0660"
KERNEL=="sd?1", SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id -g
-u -d /dev/$parent", RESULT=="SATA_VBOX_HARDDISK_VB46dec7e0192e8000_", SYMLINK+="asm-disk2", OWNER="oracle", GROUP="dba",
MODE="0660"
KERNEL=="sd?1", SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id -g
-u -d /dev/$parent", RESULT=="SATA_VBOX_HARDDISK_VBce8c63bb-ac67a172",
SYMLINK+="asm-disk3", OWNER="oracle", GROUP="dba", MODE="0660"
KERNEL=="sd?1", SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id -g
-u -d /dev/$parent", RESULT=="SATA_VBOX_HARDDISK_VB7437a3b795b199cd_", SYMLINK+="asm-disk4", OWNER="oracle", GROUP="dba",
MODE="0660"

Load Updated Block Device Partitions (/sbin/partprobe)


Load updated block device partition tables.
# /sbin/partprobe /dev/sdb1
# /sbin/partprobe /dev/sdc1
# /sbin/partprobe /dev/sdd1
# /sbin/partprobe /dev/sde1

Test Rules (udevtest)


Test the rules are working as expected.

# #OL5
# udevtest /block/sdb/sdb1
# udevtest /block/sdc/sdc1
# udevtest /block/sdd/sdd1
# udevtest /block/sde/sde1

# #OL6 and OL7


# udevadm test /block/sdb/sdb1
# udevadm test /block/sdc/sdc1
# udevadm test /block/sdd/sdd1
# udevadm test /block/sde/sde1

The output from the first disk should look something like this.
# udevtest /block/sdb/sdb1
main: looking at device '/block/sdb/sdb1' from subsystem 'block'
udev_rules_get_name: add symlink 'disk/by-id/scsiSATA_VBOX_HARDDISK_VBd306dbe0-df3367e3-part1'
udev_rules_get_name: add symlink 'disk/by-path/pci-0000:00:0d.0-scsi-1:0:0:0part1'
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 -g -u -s /block/sdb/sdb1'
run_program: '/sbin/scsi_id' (stdout) 'SATA_VBOX_HARDDISK_VBd306dbe0df3367e3_'
run_program: '/sbin/scsi_id' returned with status 0
udev_rules_get_name: rule applied, 'sdb1' becomes 'asm-disk1'
udev_device_event: device '/block/sdb/sdb1' already in database, validate
currently present symlinks
udev_node_add: creating device node '/dev/asm-disk1', major = '8', minor =
'17', mode = '0660', uid = '1100', gid = '1200'

udev_node_add: creating symlink '/dev/disk/by-id/scsiSATA_VBOX_HARDDISK_VBd306dbe0-df3367e3-part1' to '../../asm-disk1'


udev_node_add: creating symlink '/dev/disk/by-path/pci-0000:00:0d.0-scsi1:0:0:0-part1' to '../../asm-disk1'
main: run: 'socket:/org/kernel/dm/multipath_event'
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-disk1 /dev/disk/by-id/scsiSATA_VBOX_HARDDISK_VBd306dbe0-df3367e3-part1 /dev/disk/by-path/pci0000:00:0d.0-scsi-1:0:0:0-part1'
#

Restart UDEV Service


Restart the UDEV service.
# #OL5
# /sbin/udevcontrol reload_rules

# #OL6 and OL7


# udevadm control --reload-rules

# #OL5 and OL6 : Not needed for OL7


# /sbin/start_udev

Check Ownership and Permissions


Check the disks are now available with the "asm-disk*" alias and the correct ownership
and permissions.
# cd /dev
# ls -al asm-disk*

brw-rw---- 1 oracle dba 8, 17 Apr 8 22:47 asm-disk1


brw-rw---- 1 oracle dba 8, 33 Apr 8 22:47 asm-disk2
brw-rw---- 1 oracle dba 8, 49 Apr 8 22:47 asm-disk3
brw-rw---- 1 oracle dba 8, 65 Apr 8 22:47 asm-disk4
#

So the ASM_DISKSTRING initialization parameter in the ASM instance can be set to


'/dev/asm-disk*' to identify the ASM disks.
For more information see:

udev

Configuring Disk Devices Manually for Oracle ASM

Hope this helps. Regards Tim...


Back to the Top.

7 comments, read/add them...


Home | Articles | Scripts | Blog | Certification | Misc | About
About Tim Hall
Copyright & Disclaimer

Home

ABOUT
CommentsPosts

Weicheng Zhong

Oracle ASM on RHEL 5 with multipath

Oracle output Objects DDL Scripts

U
si
n
g
R
M
A
N
3
2
bi
t
to
6
4
bi
t
m
ig
ra
ti
o
n
Tr
a
n
s
p
or
ta
bl
e
D
at
a
b
a
s
e
O
ra
cl
e
In

Oracle ASM on
RHEL 6 with udev
and multipath

NoSQL
(15)
o

As the root user, install the devicemapper-multipath package using the yum
package manager

M
o
n
g
o
D
B
(1
4)

[root@vzwc1 ~]# cat /etc/redhat-release


Red Hat Enterprise Linux Server release 6.4
(Santiago)
[root@vzwc1 ~]# uname -p
x86_64

[root@vzwc1 ~]# yum install device-mappermultipath

Copy the multipath.conf file found


within /usr/share/doc/device-mappermultipath-0.4.9/ to /etc/

[root@vzwc1 ~]# cp /usr/share/doc/device-mappermultipath-0.4.9/multipath.conf /etc/multipath.conf

Capture the scsi id of the local disks on


the system.
[root@vzwc2 ~]# for i in b c d e f g h i j
> do
> scsi_id whitelisted replace-whitespace
device=/dev/sd$i
> done
1ATA_VBOX_HARDDISK_VBda7290c1-228b4bfb
1ATA_VBOX_HARDDISK_VBcb76adf7-43d27c31
1ATA_VBOX_HARDDISK_VB2077c81c-7cfe5922

R
e
di
s
(1
)

SCRIPTS

st
al
l
In
st
a
nt
Ci
le
nt

R
M
A
N
Di
sk
b
a
ck
u
p
s
R
e
st
or
e
of
R
A
C
D
at
a
b
a
s
e
to
Si
n
gl
e
In
st
a
n
c
e
C
e
nt
O

1ATA_VBOX_HARDDISK_VB7282bfc8-69601726
1ATA_VBOX_HARDDISK_VBa0072176-9e9ab0a0
1ATA_VBOX_HARDDISK_VB2a7b18e2-04053806
1ATA_VBOX_HARDDISK_VB40939671-89967d5e
1ATA_VBOX_HARDDISK_VB664cb850-2065525c
1ATA_VBOX_HARDDISK_VBa498ea69-53cdb110
[root@vzwc2 ~]#

Enter the above values into


/etc/multipath and give friendly aliases
to uuid
[root@vzwc1 ~]# cat /etc/multipath.conf
blacklist {
devnode "^(ram|raw|loop|fd|md|dm-|sr|scd|
st)[0-9]*"
devnode "^hd[a-z]"
wwid 1ATA_VBOX_HARDDISK_VB82d3887fa892e124
#exclude sda wwid
}
defaults {
user_friendly_names no
getuid_callout "/sbin/scsi_id whitelisted
replace-whitespace device=/dev/%n"
}
multipaths {
multipath {
wwid
1ATA_VBOX_HARDDISK_VBda7290c1-228b4bfb
alias
ocrvotedisk1
path_grouping_policy
multibus
path_selector
"roundrobin 0"
failback
immediate
rr_weight
priorities
no_path_retry
5
}
multipath {
wwid
1ATA_VBOX_HARDDISK_VBcb76adf7-43d27c31
alias
ocrvotedisk2
path_grouping_policy
multibus
path_selector
"roundrobin 0"
failback
immediate
rr_weight
priorities
no_path_retry
5
}
multipath {
wwid
1ATA_VBOX_HARDDISK_VB2077c81c-7cfe5922
alias

(7)

(41)
o

AI
X
(3
)

H
PU
X
(2
)

Li
n
u
x
(3
3)

S
ol
ar
is
(6
)

W
in
d
o
w
s
(2
)

S
6
in
st
al
la
ti
o
n
P
er
c
o
n
a
To
k
u
d
b

O
ra
cl
e

R
e
d
o
L
o
g
M
y
S
Q
L
E
nt
er
pr
is
e
M
o
ni
to
r
S
h

ocrvotedisk3
path_grouping_policy
multibus
path_selector
"roundrobin 0"
failback
immediate
rr_weight
priorities
no_path_retry
5
}
multipath {
wwid
1ATA_VBOX_HARDDISK_VB7282bfc8-69601726
alias
ocrvotedisk4
path_grouping_policy
multibus
path_selector
"roundrobin 0"
failback
immediate
rr_weight
priorities
no_path_retry
5
}
multipath {
wwid
1ATA_VBOX_HARDDISK_VBa0072176-9e9ab0a0
alias
ocrvotedisk5
path_grouping_policy
multibus
path_selector
"roundrobin 0"
failback
immediate
rr_weight
priorities
no_path_retry
5
}
multipath {
wwid
1ATA_VBOX_HARDDISK_VB2a7b18e2-04053806
alias
data1
path_grouping_policy
multibus
path_selector
"roundrobin 0"
failback
immediate
rr_weight
priorities
no_path_retry
5
}
multipath {
wwid
1ATA_VBOX_HARDDISK_VB40939671-89967d5e
alias
data2
path_grouping_policy
multibus
path_selector
"roundrobin 0"
failback
immediate
rr_weight
priorities
no_path_retry
5
}
multipath {
wwid
1ATA_VBOX_HARDDISK_VB664cb850-2065525c
alias
fra1

(202)
o

D
B
2
(5
)

G
re
e
n
Pl
u
m
D
at
a
b
as
e
(1
0)

M
y
S
Q
L
(4

o
w
Vi
e
w

W
hi
c
h
V
er
si
o
n
s
of
M
y
S
Q
L
S
er
v
er
ar
e
C
o
m
p
at
ib
le
wi
th
M
y
S
Q
L
E
nt
er
pr
is
e
B
a
ck
u
p
M

path_grouping_policy
multibus
path_selector
"roundrobin 0"
failback
immediate
rr_weight
priorities
no_path_retry
5
}
multipath {
wwid
1ATA_VBOX_HARDDISK_VBa498ea69-53cdb110
alias
fra2
path_grouping_policy
multibus
path_selector
"roundrobin 0"
failback
immediate
rr_weight
priorities
no_path_retry
5
}
}

7)

Restart multipathd service

[root@vzwc1 ~]# service multipathd restart


ok
Stopping multipathd daemon: [ OK ]
Starting multipathd daemon: [ OK ]

[root@vzwc1 ~]# chkconfig multipathd on

Check if multipath is setup properly


[root@vzwc2 ~]# multipath -ll
fra2 (1ATA_VBOX_HARDDISK_VBa498ea69-53cdb110) dm-8
ATA,VBOX HARDDISK
size=12G features='1 queue_if_no_path'
hwhandler='0' wp=rw
`-+- policy='round-robin 0' prio=1 status=active
`- 11:0:0:0 sdj 8:144 active ready running
ocrvotedisk5 (1ATA_VBOX_HARDDISK_VBa00721769e9ab0a0) dm-4 ATA,VBOX HARDDISK
size=2.0G features='1 queue_if_no_path'
hwhandler='0' wp=rw
`-+- policy='round-robin 0' prio=1 status=active
`- 7:0:0:0 sdf 8:80 active ready running
fra1 (1ATA_VBOX_HARDDISK_VB664cb850-2065525c) dm-7
ATA,VBOX HARDDISK
size=12G features='1 queue_if_no_path'
hwhandler='0' wp=rw
`-+- policy='round-robin 0' prio=1 status=active
`- 10:0:0:0 sdi 8:128 active ready running
ocrvotedisk4 (1ATA_VBOX_HARDDISK_VB7282bfc869601726) dm-3 ATA,VBOX HARDDISK
size=2.0G features='1 queue_if_no_path'
hwhandler='0' wp=rw

O
ra
cl
e
(1
4
0)

o
n
g
o
D
B
G
ri
d
F
S

m
o
n
g
o
d
b
b
a
ck
u
p
s
h
el
l
sc
ri
pt
s
m
o
n
g
o
d
b

My

CSDN

`-+- policy='round-robin 0' prio=1 status=active


`- 6:0:0:0 sde 8:64 active ready running
ocrvotedisk3 (1ATA_VBOX_HARDDISK_VB2077c81c7cfe5922) dm-2 ATA,VBOX HARDDISK
size=2.0G features='1 queue_if_no_path'
hwhandler='0' wp=rw
`-+- policy='round-robin 0' prio=1 status=active
`- 5:0:0:0 sdd 8:48 active ready running
ocrvotedisk2 (1ATA_VBOX_HARDDISK_VBcb76adf743d27c31) dm-1 ATA,VBOX HARDDISK
size=2.0G features='1 queue_if_no_path'
hwhandler='0' wp=rw
`-+- policy='round-robin 0' prio=1 status=active
`- 4:0:0:0 sdc 8:32 active ready running
ocrvotedisk1 (1ATA_VBOX_HARDDISK_VBda7290c1228b4bfb) dm-0 ATA,VBOX HARDDISK
size=2.0G features='1 queue_if_no_path'
hwhandler='0' wp=rw
`-+- policy='round-robin 0' prio=1 status=active
`- 3:0:0:0 sdb 8:16 active ready running
data2 (1ATA_VBOX_HARDDISK_VB40939671-89967d5e) dm6 ATA,VBOX HARDDISK
size=20G features='1 queue_if_no_path'
hwhandler='0' wp=rw
`-+- policy='round-robin 0' prio=1 status=active
`- 9:0:0:0 sdh 8:112 active ready running
data1 (1ATA_VBOX_HARDDISK_VB2a7b18e2-04053806) dm5 ATA,VBOX HARDDISK
size=20G features='1 queue_if_no_path'
hwhandler='0' wp=rw
`-+- policy='round-robin 0' prio=1 status=active
`- 8:0:0:0 sdg 8:96 active ready running

[root@vzwc1 ~]# ls -l /dev/mapper/


total 0
crw-rw- 1 root root 10, 236 Sep 24 13:56 control
lrwxrwxrwx 1 root root
7 Sep 24 13:57 data1
-> ../dm-5
lrwxrwxrwx 1 root root
7 Sep 24 13:57 data2
-> ../dm-6
lrwxrwxrwx 1 root root
7 Sep 24 13:56 fra1
-> ../dm-7
lrwxrwxrwx 1 root root
7 Sep 24 13:56 fra2
-> ../dm-8
lrwxrwxrwx 1 root root
7 Sep 24 13:57
ocrvotedisk1 -> ../dm-0
lrwxrwxrwx 1 root root
7 Sep 24 13:56
ocrvotedisk2 -> ../dm-1
lrwxrwxrwx 1 root root
7 Sep 24 13:56
ocrvotedisk3 -> ../dm-2
lrwxrwxrwx 1 root root
7 Sep 24 13:56
ocrvotedisk4 -> ../dm-3
lrwxrwxrwx 1 root root
7 Sep 24 13:56
ocrvotedisk5 -> ../dm-4

P
os
tg
re

blog

SYKSKY
Luocs

Technolo
gy Blog

hedengc
heng

ryviuske
y

AnySQL

mysqlop
s

osdba's
blog

ryviuske
y

linuxeye

NoSQL

[root@vzwc1 ~]# for i in ocrvotedisk1 ocrvotedisk2


ocrvotedisk3 ocrvotedisk4 ocrvotedisk5 data1 data2
fra1 fra2
> do
> printf "%s %s\n" "$i" "$(ls -ll /dev/mapper/$i)"
> done
ocrvotedisk1 lrwxrwxrwx 1 root root 7 Sep 24 13:57
/dev/mapper/ocrvotedisk1 -> ../dm-0
ocrvotedisk2 lrwxrwxrwx 1 root root 7 Sep 24 13:56
/dev/mapper/ocrvotedisk2 -> ../dm-1
ocrvotedisk3 lrwxrwxrwx 1 root root 7 Sep 24 13:56
/dev/mapper/ocrvotedisk3 -> ../dm-2
ocrvotedisk4 lrwxrwxrwx 1 root root 7 Sep 24 13:56
/dev/mapper/ocrvotedisk4 -> ../dm-3
ocrvotedisk5 lrwxrwxrwx 1 root root 7 Sep 24 13:56
/dev/mapper/ocrvotedisk5 -> ../dm-4
data1 lrwxrwxrwx 1 root root 7 Sep 24 13:57
/dev/mapper/data1 -> ../dm-5
data2 lrwxrwxrwx 1 root root 7 Sep 24 13:57
/dev/mapper/data2 -> ../dm-6
fra1 lrwxrwxrwx 1 root root 7 Sep 24 13:56
/dev/mapper/fra1 -> ../dm-7
fra2 lrwxrwxrwx 1 root root 7 Sep 24 13:56
/dev/mapper/fra2 -> ../dm-8

Determine partitioned alias for target


device
[root@vzwc1 ~]# dmsetup ls|sort
data1
(252:5)
data2
(252:6)
fra1
(252:7)
fra2
(252:8)
ocrvotedisk1
(252:0)
ocrvotedisk2
(252:1)
ocrvotedisk3
(252:2)
ocrvotedisk4
(252:3)
ocrvotedisk5
(252:4)

huoding
ha97

leshami
wmxz
TianYi

debugo

Edit /etc/udev/rules.d/12-dmpermissions.rules file to set the above


device ownership as grid:asmadmin
[root@vzwc1 ~]# cat /etc/udev/rules.d/12-dmpermissions.rules
ENV{DM_NAME}=="ocrvotedisk1", OWNER:="grid",
GROUP:="asmadmin", MODE:="660",
SYMLINK+="iscsi/oraasm-$env{DM_NAME}"
ENV{DM_NAME}=="ocrvotedisk2", OWNER:="grid",
GROUP:="asmadmin", MODE:="660",
SYMLINK+="iscsi/oraasm-$env{DM_NAME}"
ENV{DM_NAME}=="ocrvotedisk3", OWNER:="grid",
GROUP:="asmadmin", MODE:="660",

S
Q
L
(4
)

S
Q
L
S
er
v
er
(1
)

2016

2016

2016

2015

2015

2015

2015

2015

2015

gavinsoo
rma

askdba.o
rg

Oracle
MAA us

Oracle
MAA zh

Oracle
OTN

SYMLINK+="iscsi/oraasm-$env{DM_NAME}"
ENV{DM_NAME}=="ocrvotedisk4", OWNER:="grid",
GROUP:="asmadmin", MODE:="660",
SYMLINK+="iscsi/oraasm-$env{DM_NAME}"
ENV{DM_NAME}=="ocrvotedisk5", OWNER:="grid",
GROUP:="asmadmin", MODE:="660",
SYMLINK+="iscsi/oraasm-$env{DM_NAME}"
ENV{DM_NAME}=="data1", OWNER:="grid",
GROUP:="asmadmin", MODE:="660",
SYMLINK+="iscsi/oraasm-$env{DM_NAME}"
ENV{DM_NAME}=="data2", OWNER:="grid",
GROUP:="asmadmin", MODE:="660",
SYMLINK+="iscsi/oraasm-$env{DM_NAME}"
ENV{DM_NAME}=="fra1", OWNER:="grid",
GROUP:="asmadmin", MODE:="660",
SYMLINK+="iscsi/oraasm-$env{DM_NAME}"
ENV{DM_NAME}=="fra2", OWNER:="grid",
GROUP:="asmadmin", MODE:="660",
SYMLINK+="iscsi/oraasm-$env{DM_NAME}"

Oracle
Tech
Index

Oracle
12c
notes

OraDBA

dioncho
ixora

oraclebase

oracledevelope
r

database
journal

djuliandy
ke blog

jonathan

Restart multipathd service


[root@vzwc1 ~]# /etc/init.d/multipathd restart
ok
Stopping multipathd daemon: [ OK ]
Starting multipathd daemon: [ OK ]

Check if permissions are correct


[root@vzwc1 ~]# ls -l /dev/dm-*
brw-rw- 1 grid asmadmin 252, 0 Sep 24
/dev/dm-0
brw-rw- 1 grid asmadmin 252, 1 Sep 24
/dev/dm-1
brw-rw- 1 grid asmadmin 252, 2 Sep 24
/dev/dm-2
brw-rw- 1 grid asmadmin 252, 3 Sep 24
/dev/dm-3
brw-rw- 1 grid asmadmin 252, 4 Sep 24
/dev/dm-4
brw-rw- 1 grid asmadmin 252, 5 Sep 24
/dev/dm-5
brw-rw- 1 grid asmadmin 252, 6 Sep 24
/dev/dm-6
brw-rw- 1 grid asmadmin 252, 7 Sep 24
/dev/dm-7
brw-rw- 1 grid asmadmin 252, 8 Sep 24
/dev/dm-8

16:35
16:35

2015

2015

2015

2015

2015

2015

2014

2014

2014

2014

2014

2014

2014

2014

2014

16:35
16:35
16:35
16:35
16:35
16:35
16:35

Check if oracle ASM symbolic links

12c ACFS agent


AIX Apache

lewis

Tanelpod
er

idevelop
ment

Oracle
Technolo
gy
Network

oracledb
a.org

mysqlinn
odb blog
Chirs

MySQL

Oracle's
MySQL
Blog

exists for multipath devices


[root@vzwc2 ~]# ls -l /dev/iscsi/*
lrwxrwxrwx 1 root root 7 Sep 24 16:38
/dev/iscsi/oraasm-data1 -> ../dm-5
lrwxrwxrwx 1 root root 7 Sep 24 16:38
/dev/iscsi/oraasm-data2 -> ../dm-6
lrwxrwxrwx 1 root root 7 Sep 24 16:38
/dev/iscsi/oraasm-fra1 -> ../dm-7
lrwxrwxrwx 1 root root 7 Sep 24 16:38
/dev/iscsi/oraasm-fra2 -> ../dm-8
lrwxrwxrwx 1 root root 7 Sep 24 16:38
/dev/iscsi/oraasm-ocrvotedisk1 -> ../dm-0
lrwxrwxrwx 1 root root 7 Sep 24 16:38
/dev/iscsi/oraasm-ocrvotedisk2 -> ../dm-1
lrwxrwxrwx 1 root root 7 Sep 24 16:38
/dev/iscsi/oraasm-ocrvotedisk3 -> ../dm-2
lrwxrwxrwx 1 root root 7 Sep 24 16:38
/dev/iscsi/oraasm-ocrvotedisk4 -> ../dm-3
lrwxrwxrwx 1 root root 7 Sep 24 16:38
/dev/iscsi/oraasm-ocrvotedisk5 -> ../dm-4

Archivelog ASM
CentOS6 cvu

database
DataGuard
DataPump DB2
DB2 installation
db2move
dbms_backup_restor
e dbms_metadata
drop database emcli
Flashback Galera

GreenPlum
Database
HP-UX InnoDB java

Linux
logminer memcache

MiddleWare

MongoDB
MOS MySQ

Configure ASM disk change discovery


path

MySQL
MySQL5.6

MySQL5.7

MySQL
backup
recovery
MySQL
Cluster MySQL

GreenPlu
mDBA

Enterprise Monitor

MySQL MMM

scripting
mysql

RONALD
BRADFO
RD

Martins
Blog

oraclescripts

Kamran

MySQL MHA

MySQL
Replication
MySQL scripts

Nginx ntp OEM

Oracle
oracle client

Oracle
GoldenGa
te Oracle
internal

Oracle
scripts OS

Agayev's

Percona Server

PostgreSQL

PSU pymongo

MariaDB
Spider
Storage

RAC Redis
RHEL7

secaserv
er blog

silent Solaris
sqlplus SQL Server
squid SuSE swap
TAF tokudb

pythian
blog

Troubleshoo
ting UNIX

sql

Coskan's
blog

postgres
qltutorial

datachar
mer
mysql

NoSQL
ARCHIVE

Jilevski's
Oracle
BLOG
Linux

pkgs

severalni
nes

Spider
for
MySQL
mysql

step-bystep

MySQL

RMAN

samba SCRIPTS

##

[grid@vzwc2 ~]$ crsctl query css votedisk


STATE
File Universal Id
File
Name Disk group


1. ONLINE
1374f266ca874f15bfde7ca23d073e5f
(/dev/mapper/ocrvotedisk1) [CRSDG]
2. ONLINE
4145a926ff0d4f6dbf63e2c3695c580e
(/dev/mapper/ocrvotedisk2) [CRSDG]
3. ONLINE
6f3ab4bbe0c14f97bfb20c91820d898b
(/dev/mapper/ocrvotedisk3) [CRSDG]
4. ONLINE
8c973dd3f1da4f0dbf2080e04fcf9bd7
(/dev/mapper/ocrvotedisk4) [CRSDG]
5. ONLINE
1bed4a3c6f624fabbfbe2564e81df250

High
Availabili
ty

(/dev/mapper/ocrvotedisk5) [CRSDG]
Located 5 voting disk(s).
[grid@vzwc2 ~]$ sqlplus / as sysasm
SQL*Plus: Release 11.2.0.4.0 Production on Wed Sep
24 17:17:22 2014
Copyright (c) 1982, 2013, Oracle.
reserved.

All rights

Connected to:
Oracle Database 11g Enterprise Edition Release
11.2.0.4.0 64bit Production
With the Real Application Clusters and Automatic
Storage Management options
SQL> select * from v$active_instances;
INST_NUMBER INST_NAME

1 vzwc1:+ASM1
2 vzwc2:+ASM2
SQL> select path from v$asm_disk;
PATH

/dev/mapper/data2
/dev/mapper/fra2
/dev/mapper/fra1
/dev/mapper/data1
/dev/mapper/ocrvotedisk2
/dev/mapper/ocrvotedisk3
/dev/mapper/ocrvotedisk1
/dev/mapper/ocrvotedisk4
/dev/mapper/ocrvotedisk5
9 rows selected.

24th, 2014 | Tags: ASM, Oracle | Category: Oracle,


Oracle ASM, Oracle RAC,
Comments are closed.

Copyright 2016 Weicheng Zhong - All Rights Reserved


Powered by WordPress & Atahualpa

Das könnte Ihnen auch gefallen