当前位置: 首页 > ASM > 正文

grid环境关于asm diskpath是否需要一致

最后在群里面与itpub都看到有人问grid环境中asm diskpath是否要求一致,下面用实验来说明

实验结果

主机的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″?><gpnp:GPnP-Profile Version=”1.0″ xmlns=”http://www.grid-pnp.org/2005/11/gpnp-profile” xmlns:gpnp=”http://www.grid-pnp.org/2005/11/gpnp-profile” xmlns:orcl=”http://www.oracle.com/gpnp/2005/11/gpnp-profile” xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance” xsi:schemaLocation=”http://www.grid-pnp.org/2005/11/gpnp-profile gpnp-profile.xsd” ProfileSequence=”10″ ClusterUId=”9b787a787bdeef57ff2ed72df38a3e95″ ClusterName=”scan” PALocation=””><gpnp:Network-Profile><gpnp:HostNetwork id=”gen” HostName=”*”><gpnp:Network id=”net1″ IP=”192.168.111.0″ Adapter=”eth0″ Use=”public”/><gpnp:Network id=”net2″ IP=”192.168.112.0″ Adapter=”eth1″ Use=”cluster_interconnect”/></gpnp:HostNetwork></gpnp:Network-Profile><orcl:CSS-Profile id=”css” DiscoveryString=”+asm” LeaseDuration=”400″/><orcl:ASM-Profile id=”asm” DiscoveryString=”/dev/asm*” SPFile=”+CRS/scan/asmparameterfile/registry.253.843053829″/><ds:Signature xmlns:ds=”http://www.w3.org/2000/09/xmldsig#”><ds:SignedInfo><ds:CanonicalizationMethod Algorithm=”http://www.w3.org/2001/10/xml-exc-c14n#”/><ds:SignatureMethod Algorithm=”http://www.w3.org/2000/09/xmldsig#rsa-sha1″/><ds:Reference URI=””><ds:Transforms><ds:Transform Algorithm=”http://www.w3.org/2000/09/xmldsig#enveloped-signature”/><ds:Transform Algorithm=”http://www.w3.org/2001/10/xml-exc-c14n#”> <InclusiveNamespaces xmlns=”http://www.w3.org/2001/10/xml-exc-c14n#” PrefixList=”gpnp orcl xsi”/></ds:Transform></ds:Transforms><ds:DigestMethod Algorithm=”http://www.w3.org/2000/09/xmldsig#sha1″/><ds:DigestValue>UkHOnb2coUbmi0FmVkK5cJAb98M=</ds:DigestValue></ds:Reference></ds:SignedInfo><ds:SignatureValue>jgPUqIB8EgPObEaUuW6A2tHfywV1pBC29RPvbREZcVxaifG6dNeKkb8Qc+4jHT6Er7kCiL4xYpZnzhPA8Hbcj5UgkdEPIpj/MIUA4kqGADDpqKEOWCWMxFA2od7rYVe4zhP5MWbk7ipTo8hQD67aFpyizeSjFucnDRhEYkmcL+U=</ds:SignatureValue></ds:Signature></gpnp:GPnP-Profile>

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

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

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 | 认真就输

该日志由 huangtingzhong 于2014年04月22日发表在 ASM 分类下, 你可以发表评论,并在保留原文地址及作者的情况下引用到你的网站或博客。
原创文章转载请注明: grid环境关于asm diskpath是否需要一致 | 认真就输