sitemap

RSS地图

收藏本站

设为首页

Oracle研究中心

当前位置:Oracle研究中心 > 产品DBA > Oracle RAC >

【学习笔记】Oracle RAC环境中asm diskpath是否需要一致

时间:2016-10-22 22:50   来源:Oracle研究中心   作者:HTZ   点击:

天萃荷净 Oracle研究中心学习笔记:分享一篇关于Oracle RAC配置文件,关于RAC环境中asm diskpath是否需要一致的问题分析,结合MOS官方来验证。
实验结果

主机的DISKPATH可以不一致,但是需要asm_diskstring参数包括了所有路径名的信息

1,grid的版本


[grid@11rac1 ~]$ crsctl query crs activeversion
Oracle Clusterware active version on the cluster is [11.2.0.3.0]

2,修改前的udev配置文件


[oracle@11rac2 trace]$ cat /etc/udev/rules.d/99-oracle-asmdevices.rules
KERNEL==”sd*”, BUS==”scsi”, PROGRAM==”/sbin/scsi_id -g -u -s %p”, RESULT==”36000c29a8f589cc399d7c15506ece1d7″, NAME=”asm-diskb”, OWNER=”grid”, GROUP=”dba”, MODE=”0660″

KERNEL==”sd*”, BUS==”scsi”, PROGRAM==”/sbin/scsi_id -g -u -s %p”, RESULT==”36000c29973754df3af56f8ec6cbff708″, NAME=”asm-diskc”, OWNER=”grid”, GROUP=”dba”, MODE=”0660″

KERNEL==”sd*”, BUS==”scsi”, PROGRAM==”/sbin/scsi_id -g -u -s %p”, RESULT==”36000c2934d3b940ff6e7272421a63301″, NAME=”asm-diskd”, OWNER=”grid”, GROUP=”dba”, MODE=”0660″

KERNEL==”sd*”, BUS==”scsi”, PROGRAM==”/sbin/scsi_id -g -u -s %p”, RESULT==”36000c2989f39ec3bdd4e0f48b999c4e2″, NAME=”asm-diske”, OWNER=”grid”, GROUP=”dba”, MODE=”0660″

KERNEL==”sd*”, BUS==”scsi”, PROGRAM==”/sbin/scsi_id -g -u -s %p”, RESULT==”36000c29c195d133f2888c9bafe5fec9d”, NAME=”asm-diskf”, OWNER=”grid”, GROUP=”dba”, MODE=”0660″

KERNEL==”sd*”, BUS==”scsi”, PROGRAM==”/sbin/scsi_id -g -u -s %p”, RESULT==”36000c29bcfbb646f0f73d36512636fb9″, NAME=”asm-diskg”, OWNER=”grid”, GROUP=”dba”, MODE=”0660″

KERNEL==”sd*”, BUS==”scsi”, PROGRAM==”/sbin/scsi_id -g -u -s %p”, RESULT==”36000c29848f1095f2282f67c3ebe57c1″, NAME=”asm-diskh”, OWNER=”grid”, GROUP=”dba”, MODE=”0660″

3,修改前grid资源情况


[grid@11rac1 ~]$ crsctl stat resource -t
——————————————————————————–

NAME TARGET STATE SERVER STATE_DETAILS

——————————————————————————–

Local Resources

——————————————————————————–

ora.CRS.dg

ONLINE ONLINE 11rac1

ONLINE ONLINE 11rac2

ora.DATA.dg

ONLINE ONLINE 11rac1

ONLINE ONLINE 11rac2

ora.LISTENER.lsnr

ONLINE ONLINE 11rac1

OFFLINE OFFLINE 11rac2

ora.asm

ONLINE ONLINE 11rac1 Started

ONLINE ONLINE 11rac2 Started

ora.gsd

OFFLINE OFFLINE 11rac1

OFFLINE OFFLINE 11rac2

ora.net1.network

ONLINE ONLINE 11rac1

ONLINE ONLINE 11rac2

ora.ons

ONLINE ONLINE 11rac1

ONLINE ONLINE 11rac2

4,查看磁盘组中的磁盘路径信息


ASMCMD> lsdsk -p -G data
Group_Num Disk_Num Incarn Mount_Stat Header_Stat Mode_Stat State Path

2 0 3915936082 CACHED MEMBER ONLINE NORMAL /dev/asm-diskc

2 1 3915936081 CACHED MEMBER ONLINE NORMAL /dev/asm-diskg

ASMCMD> lsdsk -p -G crs

Group_Num Disk_Num Incarn Mount_Stat Header_Stat Mode_Stat State Path

1 0 3915936080 CACHED MEMBER ONLINE NORMAL /dev/asm-diskb

1 1 3915936079 CACHED MEMBER ONLINE NORMAL /dev/asm-diskd

1 2 3915936078 CACHED MEMBER ONLINE NORMAL /dev/asm-diske

5,修改路径的名字


[root@11rac1 ~]# vi /etc/udev/rules.d/99-oracle-asmdevices.rules
KERNEL==”sd*”, BUS==”scsi”, PROGRAM==”/sbin/scsi_id -g -u -s %p”, RESULT==”36000c29a8f589cc399d7c15506ece1d7″, NAME=”asm-diskb”, OWNER=”grid”, GROUP=”dba”, MODE=”0660″

KERNEL==”sd*”, BUS==”scsi”, PROGRAM==”/sbin/scsi_id -g -u -s %p”, RESULT==”36000c29973754df3af56f8ec6cbff708″, NAME=”asm-disk1″, OWNER=”grid”, GROUP=”dba”, MODE=”0660″

KERNEL==”sd*”, BUS==”scsi”, PROGRAM==”/sbin/scsi_id -g -u -s %p”, RESULT==”36000c2934d3b940ff6e7272421a63301″, NAME=”asm-diskd”, OWNER=”grid”, GROUP=”dba”, MODE=”0660″

KERNEL==”sd*”, BUS==”scsi”, PROGRAM==”/sbin/scsi_id -g -u -s %p”, RESULT==”36000c2989f39ec3bdd4e0f48b999c4e2″, NAME=”asm-diske”, OWNER=”grid”, GROUP=”dba”, MODE=”0660″

KERNEL==”sd*”, BUS==”scsi”, PROGRAM==”/sbin/scsi_id -g -u -s %p”, RESULT==”36000c29c195d133f2888c9bafe5fec9d”, NAME=”asm-diskf”, OWNER=”grid”, GROUP=”dba”, MODE=”0660″

KERNEL==”sd*”, BUS==”scsi”, PROGRAM==”/sbin/scsi_id -g -u -s %p”, RESULT==”36000c29bcfbb646f0f73d36512636fb9″, NAME=”asm-disk2″, OWNER=”grid”, GROUP=”dba”, MODE=”0660″

KERNEL==”sd*”, BUS==”scsi”, PROGRAM==”/sbin/scsi_id -g -u -s %p”, RESULT==”36000c29848f1095f2282f67c3ebe57c1″, NAME=”asm-diskh”, OWNER=”grid”, GROUP=”dba”, MODE=”0660″

将11rac1主机上/dev/asm-diskc更改为/dev/asm-disk1,/dev/asm-diskg更改为/dev/asm-disk2

这里为了方面,直接重启11rac1主机

[root@11rac1 dev]# ls -l asm*
brw-rw—- 1 grid dba 8, 32 Apr 22 06:52 asm-disk1

brw-rw—- 1 grid dba 8, 96 Apr 22 06:56 asm-disk2

brw-rw—- 1 grid dba 8, 16 Apr 22 06:58 asm-diskb

brw-rw—- 1 grid dba 8, 48 Apr 22 06:58 asm-diskd

brw-rw—- 1 grid dba 8, 64 Apr 22 06:58 asm-diske

brw-rw—- 1 grid dba 8, 80 Apr 22 06:52 asm-diskf

brw-rw—- 1 grid dba 8, 112 Apr 22 06:52 asm-diskh

相应的磁盘路径已经生成

6,修改后的grid资源情况


[grid@11rac1 ~]$ crsctl check crs
CRS-4638: Oracle High Availability Services is online

CRS-4537: Cluster Ready Services is online

CRS-4529: Cluster Synchronization Services is online

CRS-4533: Event Manager is online

[grid@11rac1 ~]$ crsctl stat resource -t

——————————————————————————–

NAME TARGET STATE SERVER STATE_DETAILS

——————————————————————————–

Local Resources

——————————————————————————–

ora.CRS.dg

ONLINE ONLINE 11rac1

ONLINE ONLINE 11rac2

ora.DATA.dg

ONLINE ONLINE 11rac1

ONLINE ONLINE 11rac2

ora.LISTENER.lsnr

ONLINE ONLINE 11rac1

ONLINE ONLINE 11rac2

ora.asm

ONLINE ONLINE 11rac1 Started

ONLINE ONLINE 11rac2 Started

ora.gsd

OFFLINE OFFLINE 11rac1

OFFLINE OFFLINE 11rac2

ora.net1.network

ONLINE ONLINE 11rac1

ONLINE ONLINE 11rac2

ora.ons

ONLINE ONLINE 11rac1

ONLINE ONLINE 11rac2

grid的资源一切正常

这里我们查询磁盘组中的磁盘路径,发现两节点的磁盘路径不一致,但是磁盘组是正常mount的

[grid@11rac1 ~]$ strace -fo /tmp/1233 asmcmd

ASMCMD> lsdsk -p -t -G data

Group_Num Disk_Num Incarn Mount_Stat Header_Stat Mode_Stat State Create_Date Mount_Date Repair_Timer Path

2 0 3915936270 CACHED MEMBER ONLINE NORMAL 06-FEB-13 21-APR-14 0 /dev/asm-disk1

2 1 3915936269 CACHED MEMBER ONLINE NORMAL 06-FEB-13 21-APR-14 0 /dev/asm-disk2

-?? ?ASMCMD> lsdsk -p -t -G data

Group_Num Disk_Num Incarn Mount_Stat Header_Stat Mode_Stat State Create_Date Mount_Date Repair_Timer Path

2 0 3915935880 CACHED MEMBER ONLINE NORMAL 06-FEB-13 21-APR-14 0 /dev/asm-diskc

2 1 3915935879 CACHED MEMBER ONLINE NORMAL 06-FEB-13 21-APR-14 0 /dev/asm-diskg

下面来看看数据库的资源

[grid@11rac1 ~]$ crsctl stat resource -t

——————————————————————————–

NAME TARGET STATE SERVER STATE_DETAILS

——————————————————————————–

Local Resources

——————————————————————————–

ora.CRS.dg

ONLINE ONLINE 11rac1

ONLINE ONLINE 11rac2

ora.DATA.dg

ONLINE ONLINE 11rac1

ONLINE ONLINE 11rac2

ora.LISTENER.lsnr

ONLINE ONLINE 11rac1

ONLINE ONLINE 11rac2

ora.asm

ONLINE ONLINE 11rac1 Started

ONLINE ONLINE 11rac2 Started

ora.gsd

OFFLINE OFFLINE 11rac1

OFFLINE OFFLINE 11rac2

ora.net1.network

ONLINE ONLINE 11rac1

ONLINE ONLINE 11rac2

ora.ons

ONLINE ONLINE 11rac1

ONLINE ONLINE 11rac2

——————————————————————————–

Cluster Resources

——————————————————————————–

ora.11rac1.vip

1 ONLINE ONLINE 11rac1

ora.11rac2.vip

1 ONLINE ONLINE 11rac2

ora.LISTENER_SCAN1.lsnr

1 ONLINE ONLINE 11rac2

ora.cvu

1 ONLINE ONLINE 11rac2

ora.oc4j

1 ONLINE ONLINE 11rac2

ora.power.db

1 ONLINE ONLINE 11rac2 Open

2 ONLINE ONLINE 11rac1 Open

ora.power.power1.svc

1 ONLINE ONLINE 11rac2

ora.power.power2.svc

1 ONLINE ONLINE 11rac2

ora.scan1.vip

1 ONLINE ONLINE 11rac2

所有的资源一切正常,说明磁盘路径并不影响磁盘组的状态,其实我们知道,ASM实例启动的时候,是根据asm_diskstring指路的路径去扫描磁盘,读取磁盘头的信息来判断是否是ASM磁盘。

需要注意的:新生成的路径与asm_diskstring不致时,需要修改asm_diskstring参数,增加新的路径名。

7,测试diskpath对crs的影响


[grid@11rac1 ~]$ gpnptool get -o-
< xml version=”1.0″ encoding=”UTF-8″ > UkHOnb2coUbmi0FmVkK5cJAb98M=jgPUqIB8EgPObEaUuW6A2tHfywV1pBC29RPvbREZcVxaifG6dNeKkb8Qc+4jHT6Er7kCiL4xYpZnzhPA8Hbcj5UgkdEPIpj/MIUA4kqGADDpqKEOWCWMxFA2od7rYVe4zhP5MWbk7ipTo8hQD67aFpyizeSjFucnDRhEYkmcL+U=

Success.

修改磁盘的路径名

[root@11rac1 dev]# vi /etc/udev/rules.d/99-oracle-asmdevices.rules

KERNEL==”sd*”, BUS==”scsi”, PROGRAM==”/sbin/scsi_id -g -u -s %p”, RESULT==”36000c29a8f589cc399d7c15506ece1d7″, NAME=”asm-disk3″, OWNER=”grid”, GROUP=”dba”, MODE=”0660″

KERNEL==”sd*”, BUS==”scsi”, PROGRAM==”/sbin/scsi_id -g -u -s %p”, RESULT==”36000c29973754df3af56f8ec6cbff708″, NAME=”asm-disk1″, OWNER=”grid”, GROUP=”dba”, MODE=”0660″

KERNEL==”sd*”, BUS==”scsi”, PROGRAM==”/sbin/scsi_id -g -u -s %p”, RESULT==”36000c2934d3b940ff6e7272421a63301″, NAME=”asm-disk4″, OWNER=”grid”, GROUP=”dba”, MODE=”0660″

KERNEL==”sd*”, BUS==”scsi”, PROGRAM==”/sbin/scsi_id -g -u -s %p”, RESULT==”36000c2989f39ec3bdd4e0f48b999c4e2″, NAME=”asm-disk5″, OWNER=”grid”, GROUP=”dba”, MODE=”0660″

KERNEL==”sd*”, BUS==”scsi”, PROGRAM==”/sbin/scsi_id -g -u -s %p”, RESULT==”36000c29c195d133f2888c9bafe5fec9d”, NAME=”asm-disk7″, OWNER=”grid”, GROUP=”dba”, MODE=”0660″

KERNEL==”sd*”, BUS==”scsi”, PROGRAM==”/sbin/scsi_id -g -u -s %p”, RESULT==”36000c29bcfbb646f0f73d36512636fb9″, NAME=”asm-disk2″, OWNER=”grid”, GROUP=”dba”, MODE=”0660″

KERNEL==”sd*”, BUS==”scsi”, PROGRAM==”/sbin/scsi_id -g -u -s %p”, RESULT==”36000c29848f1095f2282f67c3ebe57c1″, NAME=”asm-disk6″, OWNER=”grid”, GROUP=”dba”, MODE=”0660″

直接重启主机

查询两台主机分别识别的CSS所有磁盘组的DISKPATH信息

[grid@11rac1 ~]$ crsctl query css votedisk

## STATE File Universal Id File Name Disk group

— —– —————– ——— ———

1. ONLINE a99714e20d244f11bf47b10113c5ef03 (/dev/asm-disk3) [CRS]

2. ONLINE 02b995d2096d4f1dbf7f3135ad547b66 (/dev/asm-disk4) [CRS]

3. ONLINE 8fa83f3613054fa6bfdfa2c8e8d6843c (/dev/asm-disk5) [CRS]

[oracle@11rac2 sql]$ su – grid

Password:

[grid@11rac2 ~]$ crsctl query css votedisk

## STATE File Universal Id File Name Disk group

— —– —————– ——— ———

1. ONLINE a99714e20d244f11bf47b10113c5ef03 (/dev/asm-diskb) [CRS]

2. ONLINE 02b995d2096d4f1dbf7f3135ad547b66 (/dev/asm-diskd) [CRS]

3. ONLINE 8fa83f3613054fa6bfdfa2c8e8d6843c (/dev/asm-diske) [CRS]

grid的资源一切正常

[grid@11rac1 ~]$ crsctl stat resource -t

——————————————————————————–

NAME TARGET STATE SERVER STATE_DETAILS

——————————————————————————–

Local Resources

——————————————————————————–

ora.CRS.dg

ONLINE ONLINE 11rac1

ONLINE ONLINE 11rac2

ora.DATA.dg

ONLINE ONLINE 11rac1

ONLINE ONLINE 11rac2

ora.LISTENER.lsnr

ONLINE ONLINE 11rac1

ONLINE ONLINE 11rac2

ora.asm

ONLINE ONLINE 11rac1 Started

ONLINE ONLINE 11rac2 Started

ora.gsd

OFFLINE OFFLINE 11rac1

OFFLINE OFFLINE 11rac2

ora.net1.network

ONLINE ONLINE 11rac1

ONLINE ONLINE 11rac2

ora.ons

ONLINE ONLINE 11rac1

ONLINE ONLINE 11rac2

————————————Oracle?о?????——————————————–

Cluster Resources

——————————————————————————–

ora.11rac1.vip

1 ONLINE ONLINE 11rac1

ora.11rac2.vip

1 ONLINE ONLINE 11rac2

ora.LISTENER_SCAN1.lsnr

1 ONLINE ONLINE 11rac1

ora.cvu

1 ONLINE ONLINE 11rac1

ora.oc4j

1 ONLINE ONLINE 11rac1

ora.power.db

1 ONLINE ONLINE 11rac2 Open

2 ONLINE ONLINE 11rac1 Open

ora.power.power1.svc

1 ONLINE ONLINE 11rac1

ora.power.power2.svc

1 ONLINE ONLINE 11rac1

ora.scan1.vip

1 ONLINE ONLINE 11rac1

本文固定链接: http://www.htz.pw/2014/04/22/grid%e7%8e%af%e5%a2%83%e5%85%b3%e4%ba%8easm-diskpath%e6%98%af%e5%90%a6%e9%9c%80%e8%a6%81%e4%b8%80%e8%87%b4.html | 认真就输

--------------------------------------ORACLE-DBA----------------------------------------

最权威、专业的Oracle案例资源汇总之【学习笔记】Oracle RAC环境中asm diskpath是否需要一致

本文由大师惜分飞原创分享,网址:http://www.oracleplus.net/arch/1037.html

Oracle研究中心

关键词:

asm diskpath

Oracle RAC diskpath