Disk directory是asm的2号文件,对于磁盘组中的每一个磁盘都有对应的磁盘条目记录该asm磁盘的磁盘号,磁盘状态,磁盘名称,所在failgroup,创建时间,磁盘repair time等等信息,x$kfdsk部分信息来自于Disk directory。可以通过2号文件的File directory去定位Disk directory所在位置
1 2 3 4 5 6 |
SQL> select PXN_KFFXP,DISK_KFFXP,AU_KFFXP from x$kffxp where GROUP_KFFXP=2 and NUMBER_KFFXP=2; PXN_KFFXP DISK_KFFXP AU_KFFXP ---------- ---------- ---------- 0 2 2 |
当asm磁盘组无法mount时,可以也通过kfed去读取2号文件的File directory,从而定位到Disk directory所在位置。
1 2 3 4 5 6 7 8 9 10 11 12 |
[grid@rac1 ~]$ kfed read /dev/asmdisk-data4|grep f1b1 kfdhdb.f1b1locn: 2 ; 0x0d4: 0x00000002 [grid@rac1 ~]$ kfed read /dev/asmdisk-data4 aun=2 blkn=2|grep kfffde kfffde[0].xptr.au: 2 ; 0x4a0: 0x00000002 kfffde[0].xptr.disk: 2 ; 0x4a4: 0x0002 kfffde[0].xptr.flags: 0 ; 0x4a6: L=0 E=0 D=0 S=0 kfffde[0].xptr.chk: 42 ; 0x4a7: 0x2a kfffde[1].xptr.au: 4294967295 ; 0x4a8: 0xffffffff kfffde[1].xptr.disk: 65535 ; 0x4ac: 0xffff kfffde[1].xptr.flags: 0 ; 0x4ae: L=0 E=0 D=0 S=0 kfffde[1].xptr.chk: 42 ; 0x4af: 0x2a |
Disk directory最重要的结构就是磁盘条目(kfddde),其结构如下:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
[grid@rac1 ~]$ kfed read /dev/asmdisk-data6 aun=2 |grep "kfddde\[0"|more kfddde[0].entry.incarn: 1 ; 0x024: A=1 NUMM=0x0 kfddde[0].entry.hash: 0 ; 0x028: 0x00000000 kfddde[0].entry.refer.number:4294967295 ; 0x02c: 0xffffffff kfddde[0].entry.refer.incarn: 0 ; 0x030: A=0 NUMM=0x0 kfddde[0].dsknum: 0 ; 0x034: 0x0000 kfddde[0].state: 2 ; 0x036: KFDSTA_NORMAL kfddde[0].ddchgfl: 132 ; 0x037: 0x84 kfddde[0].dskname: DATA_1M_0000 ; 0x038: length=12 kfddde[0].fgname: DATA_1M_0000 ; 0x058: length=12 kfddde[0].crestmp.hi: 33115693 ; 0x078: HOUR=0xd DAYS=0x11 MNTH=0x3 YEAR=0x7e5 kfddde[0].crestmp.lo: 2729510912 ; 0x07c: USEC=0x0 MSEC=0x42 SECS=0x2b MINS=0x28 kfddde[0].failstmp.hi: 0 ; 0x080: HOUR=0x0 DAYS=0x0 MNTH=0x0 YEAR=0x0 kfddde[0].failstmp.lo: 0 ; 0x084: USEC=0x0 MSEC=0x0 SECS=0x0 MINS=0x0 kfddde[0].timer: 0 ; 0x088: 0x00000000 kfddde[0].size: 5120 ; 0x08c: 0x00001400 kfddde[0].srRloc.super.hiStart: 0 ; 0x090: 0x00000000 kfddde[0].srRloc.super.loStart: 0 ; 0x094: 0x00000000 kfddde[0].srRloc.super.length: 0 ; 0x098: 0x00000000 kfddde[0].srRloc.incarn: 0 ; 0x09c: 0x00000000 kfddde[0].dskrprtm: 0 ; 0x0a0: 0x00000000 kfddde[0].start0: 0 ; 0x0a4: 0x00000000 kfddde[0].size0: 5120 ; 0x0a8: 0x00001400 kfddde[0].used0: 22 ; 0x0ac: 0x00000016 kfddde[0].slot: 0 ; 0x0b0: 0x00000000 kfddde[0].imbal00[0]: 20 ; 0x0b4: 0x00000014 The disk directory structure (kfddde) is defined as follows: KF3_FIELD(kfddde, kffden, entry_kfddde) /* Common entry fields */ KF3_FIELD(kfddde, ub2, dsknum_kfddde) /* Disk number [KEY] */ KF3_FIELD(kfddde, kfdsta, state_kfddde) /* Disk state */ KF3_FIELD(kfddde, kfddchfl, ddchgfl_kfddde) /* Bit flags for chngs */ KF3_ARRAY(kfddde, oratext, KFD_IDENT, dskname_kfddde) /* ASM disk name */ KF3_ARRAY(kfddde, oratext, KFD_IDENT, fgname_kfddde) /* Fail group name */ KF3_FIELD(kfddde, kfts, crestmp_kfddde) /* Create timestamp */ KF3_FIELD(kfddde, kfts, failstmp_kfddde) /* Failure timestamp */ KF3_FIELD(kfddde, ub4, timer_kfddde) /* Failure timer */ KF3_FIELD(kfddde, ub4, size_kfddde) /* Resize target(AUs) */ KF3_FIELD(kfddde, kfdsDdLoc, srRloc_kfddde) /* Relative loc in SR */ KF3_FIELD(kfddde, ub4, dskrprtm_kfddde) /* Disk repair time */ KF3_ARRAY(kfddde, kfdzon, KFDZN_LAST, zones_kfddde) /* Zone information */ |
- dsknum:磁盘号
- dskname:磁盘组名
- fgname:failgroup名
- crestmp:创建时间(hi为高位,lo为低位)
- dskrprtm:repair time
- state:磁盘状态
1 2 3 4 5 6 7 8 9 10 |
#define KFDSTA_INVALID ((kfdsta)0) /* Illegal value */ #define KFDSTA_UNKNOWN ((kfdsta)1) /* ASM disk state not known */ #define KFDSTA_NORMAL ((kfdsta)2) /* Happy disk */ #define KFDSTA_UNUSED ((kfdsta)3) /* Unused State - Open */ #define KFDSTA_DROPPING ((kfdsta)4) /* Disk being dropped from group */ #define KFDSTA_HUNG ((kfdsta)5) /* Disk drop operation hung */ #define KFDSTA_FORCING ((kfdsta)6) /* Disk beinng drop forced */ #define KFDSTA_DROPPED ((kfdsta)7) /* Disk no longer part of group */ #define KFDSTA_ADDING ((kfdsta)8) /* Disk being globally validated */ |
- ddchgfl:标志位
1 2 3 4 5 |
kf3.h:#define KFDDCHFL_FLGUNST ((kfddchfl)0x00) /* Nothing set */ kf3.h:#define KFDDCHFL_RPRTMST ((kfddchfl)0x01) /* dskrprtm_kfddde set*/ kf3.h:#define KFDDCHFL_OFLTMST ((kfddchfl)0x02) /* timer_kfddde set */ kf3.h:#define KFDDCHFL_ASMCV11 ((kfddchfl)0x80) /* ASM compat lvl v11 */ |
Pingback引用通告: 案例:深入解析asm rebalance无法启动 – minnie爸爸的技术博客