其实还有另一种找asm disk dir的方法,这种方法利用了官方提供的amdu的工具,找起来更简单。
先利用amdu得到map文件,命令为:
amdu -dump <diskgroup_name|ALL> -diskstring '<diskstring_path>'
如,查到所有的diskgroup:
[oracle@rac1 amdu_2015_07_20_10_37_24]$ amdu -dump ALL -diskstring '/dev/asm*'
amdu_2015_07_20_10_54_35/
AMDU-00204: Disk N0001 is in currently mounted diskgroup ACFS
AMDU-00201: Disk N0001: '/dev/asm-acfs01'
AMDU-00204: Disk N0004 is in currently mounted diskgroup DATA
AMDU-00201: Disk N0004: '/dev/asm-data02'
AMDU-00204: Disk N0007 is in currently mounted diskgroup MYTEST
AMDU-00201: Disk N0007: '/dev/asm-data05'
AMDU-00204: Disk N0008 is in currently mounted diskgroup FRA
AMDU-00201: Disk N0008: '/dev/asm-fra01'
AMDU-00204: Disk N0012 is in currently mounted diskgroup OCRVOT
AMDU-00201: Disk N0012: '/dev/asm-ocrvot1'
AMDU-00204: Disk N0013 is in currently mounted diskgroup OCRVOT
AMDU-00201: Disk N0013: '/dev/asm-ocrvot2'
AMDU-00204: Disk N0014 is in currently mounted diskgroup OCRVOT
AMDU-00201: Disk N0014: '/dev/asm-ocrvot3'
[oracle@rac1 amdu_2015_07_20_10_54_35]$
此时,你就可以看到有map文件了。
[oracle@rac1 amdu_2015_07_20_10_54_35]$ ll
total 692396
-rw-r--r--. 1 oracle oinstall 102768640 Jul 20 10:54 ACFS_0001.img
-rw-r--r--. 1 oracle oinstall 8000 Jul 20 10:54 ACFS.map
-rw-r--r--. 1 oracle oinstall 106971136 Jul 20 10:54 DATA_0001.img
-rw-r--r--. 1 oracle oinstall 8800 Jul 20 10:54 DATA.map
-rw-r--r--. 1 oracle oinstall 102768640 Jul 20 10:55 FRA_0001.img
-rw-r--r--. 1 oracle oinstall 8480 Jul 20 10:55 FRA.map
-rw-r--r--. 1 oracle oinstall 100667392 Jul 20 10:54 MYTEST_0001.img
-rw-r--r--. 1 oracle oinstall 7840 Jul 20 10:54 MYTEST.map
-rw-r--r--. 1 oracle oinstall 295735296 Jul 20 10:55 OCRVOT_0001.img
-rw-r--r--. 1 oracle oinstall 24480 Jul 20 10:55 OCRVOT.map
-rw-r--r--. 1 oracle oinstall 23063 Jul 20 10:55 report.txt
此时,你对map文件,查找关键字F00000002即可。F00000002是表示第二号文件,即disk dir。其他的文件如下:
file# 1 ---ASM file 1,file directory
file# 2 ---ASM file 2,disk directory
file# 3 ---ASM file 3,active Change Directory(ACD)
file# 4 ---ASM file 4,continuing Operations Directory (COD)
file# 5 ---ASM file 5,template directory
file# 6 ---ASM file 6,alias directory
贴两个图便于理解下:
grep F00000002即可得到:
[oracle@rac1 amdu_2015_07_20_10_54_35]$ grep F00000002 *.map
ACFS.map:N0002 D0001 R00 A00000002 F00000002 I0 E00000000 U00 C00256 S0001 B0051388416
DATA.map:N0004 D0001 R00 A00000002 F00000002 I0 E00000000 U00 C00256 S0001 B0037744640
FRA.map:N0010 D0002 R00 A00000002 F00000002 I0 E00000000 U00 C00256 S0001 B0072359936
MYTEST.map:N0011 D0002 R00 A00000002 F00000002 I0 E00000000 U00 C00256 S0001 B0069210112
OCRVOT.map:N0012 D0000 R00 A00000003 F00000002 I0 E00000002 U00 C00256 S0001 B0003145728
OCRVOT.map:N0013 D0001 R00 A00000003 F00000002 I0 E00000001 U00 C00256 S0001 B0101724160
OCRVOT.map:N0014 D0002 R00 A00000003 F00000002 I0 E00000000 U00 C00256 S0001 B0200302592
[oracle@rac1 amdu_2015_07_20_10_54_35]$
如ACFS的diskgroup中,disk dir在第1个disk,第2个au。因为D0001表示第1个disk,A00000002表示第2个au。
检验了一下,我之前写的脚本查出来的还是正确的,和amdu的结果一致。:)
[oracle@rac1 amdu_2015_07_20_10_37_24]$ grep F00000002 DATA*.map
N0004 D0001 R00 A00000002 F00000002 I0 E00000000 U00 C00256 S0001 B0037744640
所以DATA diskgroup的disk dir就是在disk1 au2(D0001,A00000002)上。
符合我的脚本:
------------
==> DATA :
kfffde[0].xptr.au: 2 ; 0x4a0: 0x00000002
kfffde[0].xptr.disk: 1 ; 0x4a4: 0x0001
------------