个人还是推荐用第二种办法,第一种感觉危险,因为我不太熟悉HP-UX。不知道ioinit具体用法
在HPUX(特别是HPUX 11.31,不能安装其它多路径软件)下安装ORACLE RAC时,建ASM磁盘组时有时会碰到两个节点上存储映射过来的磁盘盘符不一致,有时是物理路径一致,但聚合后路径不一致,有时甚至物理路径也不一致,此时就需将两个节点上的磁盘盘符修改为一致,上网找了很久,找到一篇HPUX网站上的一篇文档,将实施过程记录下来,以备后查:
1.确认LUN ID与磁盘的对应关系,确认两个节点磁盘的对应关系
首先找到存储映射到主机的磁盘的LUN ID,并将两台主机之间相同LUN ID的磁盘对应关系找到,因为HP 11.31使用的是HP自己的多路径软件,如果存储是HDS的话可以通过HDS提供的工具脚本来找到磁盘和LUN ID的对应关系:
HPUX下Lun对应关系查看方式如下:
请将附件的工具inqraid.hpux以二进制模式ftp上传到主机/tmp目录,执行以下命令
a>cd /tmp
b>chmod +x /tmp/inqraid.hpux
c>ioscan -fun | grep -e rdisk -e rdsk | ./inqraid.hpux -CLI -fx
d>ioscan -fun | grep -e rdisk -e rdsk | ./inqraid.hpux -CLI -fx -fg
-h可以看到更多选项。。。。。。 -------------------------------------------因为没有这个工具那么可以使用查询WWID来一一对应也可以
scsimgr lun_map -D /dev/rdisk/diskxx |grep WWID 这里是关键,不能弄错了,每个盘一一对应
根据命令的输出结果可以核对出主机设备名与存储设备Lun的对应关系。
如果是EMC或者其它的需要找存储厂商了解,如果找不到办法就只有用最笨的办法,一块盘一块盘的映射来找磁盘和LUN ID的对应关系
以下映射了5块磁盘,存储是EMC CX4-240,在两个节点上磁盘与LUN ID的对应关系如下:
LUNID 节点1磁盘名 节点2磁盘名
lun 36 /dev/rdisk/disk216 /dev/rdisk/disk191
lun 37 /dev/rdisk/disk217 /dev/rdisk/disk192
lun 38 /dev/rdisk/disk218 /dev/rdisk/disk193
lun 39 /dev/rdisk/disk219 /dev/rdisk/disk194
lun 40 /dev/rdisk/disk220 /dev/rdisk/disk195
查看两个节点上聚合后和聚合前磁盘对应关系
节点1 节点2
nodeA#ioscan -m dsf nodeB#ioscan -m dsf
Persistent DSF Legacy DSF(s) Persistent DSF Legacy DSF(s)
=================================== ===================================
/dev/rdisk/disk216 /dev/rdsk/c36t0d0 /dev/rdisk/disk191 /dev/rdsk/c37t0d0
/dev/rdsk/c35t0d0 /dev/rdsk/c36t0d0
/dev/rdsk/c38t0d0 /dev/rdsk/c38t0d0
/dev/rdsk/c37t0d0 /dev/rdsk/c39t0d0
/dev/rdisk/disk217 /dev/rdsk/c36t0d1 /dev/rdisk/disk192 /dev/rdsk/c37t0d1
/dev/rdsk/c35t0d1 /dev/rdsk/c36t0d1
/dev/rdsk/c38t0d1 /dev/rdsk/c38t0d1
/dev/rdsk/c37t0d1 /dev/rdsk/c39t0d1
/dev/rdisk/disk218 /dev/rdsk/c36t0d2 /dev/rdisk/disk193 /dev/rdsk/c37t0d2
/dev/rdsk/c35t0d2 /dev/rdsk/c36t0d2
/dev/rdsk/c38t0d2 /dev/rdsk/c38t0d2
/dev/rdsk/c37t0d2 /dev/rdsk/c39t0d2
/dev/rdisk/disk219 /dev/rdsk/c36t0d3 /dev/rdisk/disk194 /dev/rdsk/c37t0d3
/dev/rdsk/c35t0d3 /dev/rdsk/c36t0d3
/dev/rdsk/c38t0d3 /dev/rdsk/c38t0d3
/dev/rdsk/c37t0d3 /dev/rdsk/c39t0d3
/dev/rdisk/disk220 /dev/rdsk/c35t0d4 /dev/rdisk/disk195 /dev/rdsk/c37t0d4
/dev/rdsk/c36t0d4 /dev/rdsk/c36t0d4
/dev/rdsk/c38t0d4 /dev/rdsk/c38t0d4
/dev/rdsk/c37t0d4 /dev/rdsk/c39t0d4
节点1 节点2
/dev/rdisk/disk216 /dev/rdisk/disk191
/dev/rdisk/disk217 /dev/rdisk/disk192
/dev/rdisk/disk218 /dev/rdisk/disk193
/dev/rdisk/disk219 /dev/rdisk/disk194
/dev/rdisk/disk220 /dev/rdisk/disk195
根据以上情况决定以第一个节点上的盘符为准,将第二个节点上的盘符进行更改:
2.根据磁盘路径信息生成IO初始化的infile文件
查找磁盘聚合后路径:
nodeB#ioscan -fnNkCdisk
Class I H/W Path Driver S/W State H/W Type Description
===========================================================================
disk 191 64000/0xfa00/0x1e esdisk CLAIMED DEVICE DGC CX4-240WDR5
/dev/disk/disk191 /dev/rdisk/disk191
disk 192 64000/0xfa00/0x1f esdisk CLAIMED DEVICE DGC CX4-240WDR5
/dev/disk/disk192 /dev/rdisk/disk192
disk 193 64000/0xfa00/0x20 esdisk CLAIMED DEVICE DGC CX4-240WDR5
/dev/disk/disk193 /dev/rdisk/disk193
disk 194 64000/0xfa00/0x21 esdisk CLAIMED DEVICE DGC CX4-240WDR5
/dev/disk/disk194 /dev/rdisk/disk194
disk 195 64000/0xfa00/0x22 esdisk CLAIMED DEVICE DGC CX4-240WDR5
/dev/disk/disk195 /dev/rdisk/disk195
.....
查找磁盘聚合前路径:
nodeB#ioscan -fnkCdisk
Class I H/W Path Driver S/W State H/W Type Description
============================================================================
disk 28 0/3/1/0.1.21.0.0.0.0 sdisk CLAIMED DEVICE DGC CX4-240WDR5
/dev/dsk/c37t0d0 /dev/rdsk/c37t0d0
disk 149 0/3/1/0.1.21.0.0.0.1 sdisk CLAIMED DEVICE DGC CX4-240WDR5
/dev/dsk/c37t0d1 /dev/rdsk/c37t0d1
disk 150 0/3/1/0.1.21.0.0.0.2 sdisk CLAIMED DEVICE DGC CX4-240WDR5
/dev/dsk/c37t0d2 /dev/rdsk/c37t0d2
disk 151 0/3/1/0.1.21.0.0.0.3 sdisk CLAIMED DEVICE DGC CX4-240WDR5
/dev/dsk/c37t0d3 /dev/rdsk/c37t0d3
disk 152 0/3/1/0.1.21.0.0.0.4 sdisk CLAIMED DEVICE DGC CX4-240WDR5
/dev/dsk/c37t0d4 /dev/rdsk/c37t0d4
disk 153 0/3/1/0.1.21.0.0.0.5 sdisk CLAIMED DEVICE DGC CX4-240WDR5
/dev/dsk/c37t0d5 /dev/rdsk/c37t0d5
disk 154 0/3/1/0.1.21.0.0.0.6 sdisk CLAIMED DEVICE DGC CX4-240WDR5
/dev/dsk/c37t0d6 /dev/rdsk/c37t0d6
disk 155 0/3/1/0.1.21.0.0.0.7 sdisk CLAIMED DEVICE DGC CX4-240WDR5
/dev/dsk/c37t0d7 /dev/rdsk/c37t0d7
disk 156 0/3/1/0.1.21.0.0.1.0 sdisk CLAIMED DEVICE DGC CX4-240WDR5
/dev/dsk/c37t1d0 /dev/rdsk/c37t1d0
disk 157 0/3/1/0.1.21.0.0.1.1 sdisk CLAIMED DEVICE DGC CX4-240WDR5
/dev/dsk/c37t1d1 /dev/rdsk/c37t1d1
disk 158 0/3/1/0.1.21.0.0.1.2 sdisk CLAIMED DEVICE DGC CX4-240WDR5
/dev/dsk/c37t1d2 /dev/rdsk/c37t1d2
....
disk 174 0/7/1/0.1.23.0.0.1.4 sdisk CLAIMED DEVICE DGC CX4-240WDR5
/dev/dsk/c38t1d4 /dev/rdsk/c38t1d4
disk 175 0/7/1/0.1.23.0.0.1.5 sdisk CLAIMED DEVICE DGC CX4-240WDR5
/dev/dsk/c38t1d5 /dev/rdsk/c38t1d5
disk 176 0/7/1/0.1.23.0.0.1.6 sdisk CLAIMED DEVICE DGC CX4-240WDR5
/dev/dsk/c38t1d6 /dev/rdsk/c38t1d6
生成infile文件
# cd /tmp
# ioscan -kNf | grep ^disk | awk '{printf "%s %s %s\n",$3,$1,$2}' > infile
# ioscan -kf | grep ^disk | awk '{printf "%s %s %s\n",$3,$1,$2}' >> infile
修改生成的infile文件,以64000/0xfa00/0x1e开始的行,除了需要修改设备名的,其它的都删除掉:
# vi infile
nodeBtmp/hpdisk#vi infile
"infile" 109 lines, 3144 characters
64000/0xfa00/0x1e disk 191
64000/0xfa00/0x1f disk 192
64000/0xfa00/0x20 disk 193
64000/0xfa00/0x21 disk 194
64000/0xfa00/0x22 disk 195
0/0/2/1.0.16 disk 3
0/3/1/0.1.21.0.0.0.0 disk 28
……
0/3/1/0.1.22.0.0.0.1 disk 118
0/3/1/0.1.22.0.0.0.2 disk 119
将红色部分修改成以下内容:
64000/0xfa00/0x1e disk 216 ------------------这里根据WWID对应的顺序来变更。
64000/0xfa00/0x1f disk 217
64000/0xfa00/0x20 disk 218
64000/0xfa00/0x21 disk 219
64000/0xfa00/0x22 disk 220
0/0/2/1.0.16 disk 3
0/3/1/0.1.21.0.0.0.0 disk 28
……
0/3/1/0.1.22.0.0.0.1 disk 118
0/3/1/0.1.22.0.0.0.2 disk 119
3.初始化修改后设备文件
执行生成的文件:
nodeB #ioinit -f ./infile
ioinit: Input is identical to kernel, line ignored
Input line 2: 0/0/2/1.0.16 disk 3
…
ioinit: Input is identical to kernel, line ignored
Input line 83: 0/7/1/0.1.23.0.0.1.6 disk 176
4.删除之前旧的设备
nodeB#rmsf /dev/disk/disk191 /dev/rdisk/disk191
nodeB#rmsf /dev/disk/disk192 /dev/rdisk/disk192
nodeB#rmsf /dev/disk/disk193 /dev/rdisk/disk193
nodeB#rmsf /dev/disk/disk194 /dev/rdisk/disk194
nodeB#rmsf /dev/disk/disk195 /dev/rdisk/disk195
5.验证查询
nodeBtmp#ioscan -m dsf
Persistent DSF Legacy DSF(s)
========================================
/dev/rdisk/disk1 /dev/rdsk/c34t0d0
/dev/rdsk/c35t0d0
/dev/rdisk/disk41 /dev/rdsk/c34t0d2
/dev/rdsk/c35t0d2
.....
/dev/rdisk/disk216 /dev/rdsk/c37t0d0
/dev/rdsk/c36t0d0
/dev/rdsk/c38t0d0
/dev/rdsk/c39t0d0
/dev/rdisk/disk217 /dev/rdsk/c37t0d2
/dev/rdsk/c36t0d2
/dev/rdsk/c38t0d2
/dev/rdsk/c39t0d2
/dev/rdisk/disk218 /dev/rdsk/c37t0d4
/dev/rdsk/c36t0d4
/dev/rdsk/c38t0d4
/dev/rdsk/c39t0d4
/dev/rdisk/disk219 /dev/rdsk/c37t0d6
/dev/rdsk/c36t0d6
/dev/rdsk/c38t0d6
/dev/rdsk/c39t0d6
/dev/rdisk/disk220 /dev/rdsk/c37t1d0
/dev/rdsk/c36t1d0
/dev/rdsk/c38t1d0
/dev/rdsk/c39t1d0
第二种办法
hp-ux 11g RAC asm 添加磁盘 .
system : hp-ux B.11.31 --查看hp-ux版本 #uname -a
storage : hp
db : 10.2.0.5.0
由于RAC环境下的数据存储空间快撑满了,于是在存储上划了4个256G的LUN指定给RAC(IP1:10.1.10.56;IP2:10.1.10.57)
1、查看各HOST下现有的磁盘路径,并将LUN指定给HOST后,查看指定后的磁盘路径,对比:
IP1:10.1.10.56
通过#smh, 在SMH->Disks and File Systems->Disks下
Path(s) Device File(s) Use VG Names Paths Size(GB) Description
----------------------------------------------------------------------------------------------------------------------
0/0/0/5/0/0/0.21.13.0.0.0.2 /dev/dsk/c22t0d2 unused - 8 256.00 HP HSV450
0/0/0/5/0/0/0.21.13.0.0.0.3 /dev/dsk/c22t0d3 unused - 8 256.00 HP HSV450
0/0/0/5/0/0/0.21.13.0.0.0.4 /dev/dsk/c22t0d4 unused - 8 256.00 HP HSV450
0/0/0/5/0/0/0.21.13.0.0.0.5 /dev/dsk/c22t0d5 unused - 8 256.00 HP HSV450
指定磁盘后
Path(s) Device File(s) Use VG Names Paths Size(GB) Description
------------------------------------------------------------------------------------------------------
0/0/0/5/0/0/0.21.13.0.0.1.3 /dev/dsk/c48t1d3 unused - 8 256.00 HP HSV450
0/0/0/5/0/0/0.21.15.0.0.1.4 /dev/dsk/c50t1d4 unused - 8 256.00 HP HSV450
0/0/0/5/0/0/1.22.13.0.0.1.5 /dev/dsk/c60t1d5 unused - 8 256.00 HP HSV450
0/0/0/5/0/0/0.21.13.0.0.1.6 /dev/dsk/c48t1d6 unused - 8 256.00 HP HSV450
0/0/0/5/0/0/0.21.13.0.0.0.3 /dev/dsk/c48t0d3 unused - 8 256.00 HP HSV450
0/0/0/5/0/0/0.21.13.0.0.0.4 /dev/dsk/c48t0d4 unused - 8 256.00 HP HSV450
0/0/0/5/0/0/0.21.13.0.0.0.5 /dev/dsk/c48t0d5 unused - 8 256.00 HP HSV450
0/0/0/5/0/0/0.21.13.0.0.0.6 /dev/dsk/c48t0d6 unused - 8 256.00 HP HSV450
IP2:10.1.194.57
SMH->Disks and File Systems->Disks
------------------------------------------------------------------------------------------------------
H/W Scan: Thu Oct 11 09:12:14 2012
Path(s) Device File(s) Use VG Names Paths Size(GB) Description
------------------------------------------------------------------------------------------------------
0/0/0/5/0/0/0.21.13.0.0.0.2 /dev/dsk/c22t0d2 unused - 8 256.00 HP HSV450
0/0/0/5/0/0/0.21.13.0.0.0.3 /dev/dsk/c22t0d3 unused - 8 256.00 HP HSV450
0/0/0/5/0/0/0.21.13.0.0.0.4 /dev/dsk/c22t0d4 unused - 8 256.00 HP HSV450
0/0/0/5/0/0/0.21.13.0.0.0.5 /dev/dsk/c22t0d5 unused - 8 256.00 HP HSV450
指定磁盘后
IP:10.1.194.57
SMH->Disks and File Systems->Disks
------------------------------------------------------------------------------------------------------
H/W Scan: Thu Oct 11 14:25:26 2012
Path(s) Device File(s) Use VG Names Paths Size(GB) Description
------------------------------------------------------------------------------------------------------
0/0/0/5/0/0/0.21.13.0.0.0.2 /dev/dsk/c22t0d2 unused - 8 256.00 HP HSV450
0/0/0/5/0/0/0.21.13.0.0.0.3 /dev/dsk/c22t0d3 unused - 8 256.00 HP HSV450
0/0/0/5/0/0/0.21.13.0.0.0.4 /dev/dsk/c22t0d4 unused - 8 256.00 HP HSV450
0/0/0/5/0/0/0.21.13.0.0.0.5 /dev/dsk/c22t0d5 unused - 8 256.00 HP HSV450
0/0/0/5/0/0/1.22.9.0.0.1.4 /dev/dsk/c26t1d4 unused - 8 256.00 HP HSV450
0/0/0/5/0/0/0.21.9.0.0.1.5 /dev/dsk/c18t1d5 unused - 8 256.00 HP HSV450
0/0/0/5/0/0/0.21.15.0.0.1.6 /dev/dsk/c24t1d6 unused - 8 256.00 HP HSV450
0/0/0/5/0/0/1.22.15.0.0.1.7 /dev/dsk/c32t1d7 unused - 8 256.00 HP HSV450
2、找出新增加的磁盘路径,找出对应盘符及WWN:
第一种方法:ioscan -funNC disk
第二种方法:根据以上4个结果集,对比出新增加的磁盘路径,找出对应盘符及相应的WWN(eg:c22t0d2前三位应为磁盘通道,对比后四位)
10.1.10.56
新增加的磁盘路径
/dev/dsk/c26t1d4
/dev/dsk/c18t1d5
/dev/dsk/c24t1d6
/dev/dsk/c32t1d7
10.1.10.57
新增加的磁盘路径
/dev/dsk/c48t1d3
/dev/dsk/c50t1d4
/dev/dsk/c60t1d5
/dev/dsk/c48t1d6
3、根据磁盘路径,查找ioscan -m dsf输出结果,找出对应盘符
10.1.10.56 对应盘符
/dev/rdisk/disk121
/dev/rdisk/disk126
/dev/rdisk/disk133
/dev/rdisk/disk139
10.1.10.57 对应盘符
/dev/rdisk/disk93
/dev/rdisk/disk99
/dev/rdisk/disk108
/dev/rdisk/disk116
4、找出对应盘符的唯一ID,并找出其WWN(盘符应该是字符设备文件):
10.1.1.94.56
$ ll disk121 disk126 disk133 disk139
crw-r----- 1 bin sys 13 0x000025 Oct 11 13:53 disk121
crw-r----- 1 bin sys 13 0x000026 Oct 11 13:54 disk126
crw-r----- 1 bin sys 13 0x000027 Oct 11 13:56 disk133
crw-r----- 1 bin sys 13 0x000028 Oct 11 14:08 disk139
scsimgr lun_map -D /dev/rdisk/disk121 | grep WWID
scsimgr lun_map -D /dev/rdisk/disk126 | grep WWID
scsimgr lun_map -D /dev/rdisk/disk133 | grep WWID
scsimgr lun_map -D /dev/rdisk/disk139 | grep WWID
WWN的结果省略
10.1.194.57
#cd /dev/rdisk
# ll disk93 disk99 disk108 disk116
crw-r----- 1 bin sys 13 0x000015 Oct 11 13:53 disk108
crw-r----- 1 bin sys 13 0x000016 Oct 11 14:06 disk116
crw-r----- 1 bin sys 13 0x000013 Oct 11 13:50 disk93
crw-r----- 1 bin sys 13 0x000014 Oct 11 13:51 disk99
scsimgr lun_map -D /dev/rdisk/disk93 | grep WWID
scsimgr lun_map -D /dev/rdisk/disk99 | grep WWID
scsimgr lun_map -D /dev/rdisk/disk108 | grep WWID
scsimgr lun_map -D /dev/rdisk/disk116 | grep WWID
WWN的结果省略
5、根据一一对应的WWN值,将相应WWN对应两个节点的盘符设置成一致:
10.1.10.56
#mknod /dev/rdisk/data5disk c 13 0x000013
#mknod /dev/rdisk/data6disk c 13 0x000014
#mknod /dev/rdisk/data7disk c 13 0x000015
#mknod /dev/rdisk/data8disk c 13 0x000016
10.1.10.57
#mknod /dev/rdisk/data5disk c 13 0x000025
#mknod /dev/rdisk/data6disk c 13 0x000026
#mknod /dev/rdisk/data7disk c 13 0x000027
#mknod /dev/rdisk/data8disk c 13 0x000028
6、设置两个节点对应盘符路径的权限:
#chown oracle:oinstall /dev/rdisk/data5disk
#chown oracle:oinstall /dev/rdisk/data6disk
#chown oracle:oinstall /dev/rdisk/data7disk
#chown oracle:oinstall /dev/rdisk/data8disk
7、以ORACLE用户检验读写权限
$dd if=/dev/zero f=/dev/rdisk/data5disk count=10 count=1024
8、在其中一节点上为ASM磁盘组添加磁盘
export ORACLE_SID=+ASM3
sqlplus / as sysdba
alter diskgroup DATADG add disk '/dev/rdisk/data5disk';
alter diskgroup DATADG add disk '/dev/rdisk/data6disk';
alter diskgroup DATADG add disk '/dev/rdisk/data7disk';
alter diskgroup DATADG add disk '/dev/rdisk/data8disk';
(注意: 检查diskgroup添加前后的对比.
select a.GROUP_NUMBER, a.name, a.path, b.NAME
from v$asm_disk a,
v$asm_diskgroup b
where a.GROUP_NUMBER = b.GROUP_NUMBER
)
转自:http://blog.itpub.net/27038344/viewspace-751163/