【Oracle ASM】ASM FILE NUMBER #2 DISK Directory

之前介绍了《深入了解Oracle ASM(二):ASM File number 1 文件目录》 ,  接着我们介绍ASM file number 2 DISK directory。

file number 2 DISK directory存放了已经加入到diskgroup中的DISK信息。虽然很多信息是对AUN=0 blkn=0的重复,但是此处还存放了一些状态信息。如果某个磁盘失败了,则该信息会存放在DISK directory和PST中,但并不直接记录在DISK HEADER。

 

可以通过SQL来获得FILE NUMBER 2的位置信息,当然也可以通过KFED 读FILE NUMBER 1来获得:

 

SQL> SELECT xnum_kffxp "Extent", au_kffxp "AU", disk_kffxp "Disk" from  x$kffxp
  2  WHERE group_kffxp=1 and number_kffxp=2 
  3  and xnum_kffxp <> 2147483648;

    Extent         AU       Disk
---------- ---------- ----------
         0          2          4
         0          3          2
         0          2          8

使用KFED的话 首先确认f1b1

[oracle@mlab2 ~]$ kfed read /oracleasm/asm-disk01 aus=4194304 aun=0 blkn=0|less
kfbh.endian:                          1 ; 0x000: 0x01
kfbh.hard:                          130 ; 0x001: 0x82
kfbh.type:                            1 ; 0x002: KFBTYP_DISKHEAD
kfbh.datfmt:                          1 ; 0x003: 0x01
kfbh.block.blk:                       0 ; 0x004: blk=0
kfbh.block.obj:              2147483648 ; 0x008: disk=0
kfbh.check:                  3107059325 ; 0x00c: 0xb931f67d
kfbh.fcn.base:                        0 ; 0x010: 0x00000000
kfbh.fcn.wrap:                        0 ; 0x014: 0x00000000
kfbh.spare1:                          0 ; 0x018: 0x00000000
kfbh.spare2:                          0 ; 0x01c: 0x00000000
kfdhdb.driver.provstr:         ORCLDISK ; 0x000: length=8
kfdhdb.driver.reserved[0]:            0 ; 0x008: 0x00000000
kfdhdb.driver.reserved[1]:            0 ; 0x00c: 0x00000000
kfdhdb.driver.reserved[2]:            0 ; 0x010: 0x00000000
kfdhdb.driver.reserved[3]:            0 ; 0x014: 0x00000000
kfdhdb.driver.reserved[4]:            0 ; 0x018: 0x00000000
kfdhdb.driver.reserved[5]:            0 ; 0x01c: 0x00000000
kfdhdb.compat:                186646528 ; 0x020: 0x0b200000
kfdhdb.dsknum:                        0 ; 0x024: 0x0000
kfdhdb.grptyp:                        3 ; 0x026: KFDGTP_HIGH
kfdhdb.hdrsts:                        3 ; 0x027: KFDHDR_MEMBER
kfdhdb.dskname:              DATA1_0000 ; 0x028: length=10
kfdhdb.grpname:                   DATA1 ; 0x048: length=5
kfdhdb.fgname:               DATA1_0000 ; 0x068: length=10
kfdhdb.capname:                         ; 0x088: length=0
kfdhdb.crestmp.hi:             32999670 ; 0x0a8: HOUR=0x16 DAYS=0x7 MNTH=0x2 YEAR=0x7de
kfdhdb.crestmp.lo:           1788720128 ; 0x0ac: USEC=0x0 MSEC=0x36d SECS=0x29 MINS=0x1a
kfdhdb.mntstmp.hi:             32999670 ; 0x0b0: HOUR=0x16 DAYS=0x7 MNTH=0x2 YEAR=0x7de
kfdhdb.mntstmp.lo:           1812990976 ; 0x0b4: USEC=0x0 MSEC=0x3 SECS=0x1 MINS=0x1b
kfdhdb.secsize:                     512 ; 0x0b8: 0x0200
kfdhdb.blksize:                    4096 ; 0x0ba: 0x1000
kfdhdb.ausize:                  4194304 ; 0x0bc: 0x00400000
kfdhdb.mfact:                    454272 ; 0x0c0: 0x0006ee80
kfdhdb.dsksize:                   32375 ; 0x0c4: 0x00007e77
kfdhdb.pmcnt:                         2 ; 0x0c8: 0x00000002
kfdhdb.fstlocn:                       1 ; 0x0cc: 0x00000001
kfdhdb.altlocn:                       2 ; 0x0d0: 0x00000002
kfdhdb.f1b1locn:                      2 ; 0x0d4: 0x00000002
kfdhdb.redomirrors[0]:                0 ; 0x0d8: 0x0000
kfdhdb.redomirrors[1]:                0 ; 0x0da: 0x0000

f1b1在AUN=2 ,那么FILE NUMBER 2的FILEDIR在 AUN=2 BLKN=2 

[oracle@mlab2 ~]$ kfed read /oracleasm/asm-disk01 aus=4194304 aun=2 blkn=2|less
kfbh.endian:                          1 ; 0x000: 0x01
kfbh.hard:                          130 ; 0x001: 0x82
kfbh.type:                            4 ; 0x002: KFBTYP_FILEDIR
kfbh.datfmt:                          1 ; 0x003: 0x01
kfbh.block.blk:                       2 ; 0x004: blk=2
kfbh.block.obj:                       1 ; 0x008: file=1
kfbh.check:                   523985651 ; 0x00c: 0x1f3b62f3
kfbh.fcn.base:                        0 ; 0x010: 0x00000000
kfbh.fcn.wrap:                        0 ; 0x014: 0x00000000
kfbh.spare1:                          0 ; 0x018: 0x00000000
kfbh.spare2:                          0 ; 0x01c: 0x00000000
kfffdb.node.incarn:                   1 ; 0x000: A=1 NUMM=0x0
kfffdb.node.frlist.number:   4294967295 ; 0x004: 0xffffffff
kfffdb.node.frlist.incarn:            0 ; 0x008: A=0 NUMM=0x0
kfffdb.hibytes:                       0 ; 0x00c: 0x00000000
kfffdb.lobytes:                 1048576 ; 0x010: 0x00100000
kfffdb.xtntcnt:                       3 ; 0x014: 0x00000003
kfffdb.xtnteof:                       3 ; 0x018: 0x00000003
kfffdb.blkSize:                    4096 ; 0x01c: 0x00001000
kfffdb.flags:                         1 ; 0x020: O=1 S=0 S=0 D=0 C=0 I=0 R=0 A=0
kfffdb.fileType:                     15 ; 0x021: 0x0f
kfffdb.dXrs:                         19 ; 0x022: SCHE=0x1 NUMB=0x3
kfffdb.iXrs:                         19 ; 0x023: SCHE=0x1 NUMB=0x3
kfffdb.dXsiz[0]:             4294967295 ; 0x024: 0xffffffff
kfffdb.dXsiz[1]:                      0 ; 0x028: 0x00000000
kfffdb.dXsiz[2]:                      0 ; 0x02c: 0x00000000
kfffdb.iXsiz[0]:             4294967295 ; 0x030: 0xffffffff
kfffdb.iXsiz[1]:                      0 ; 0x034: 0x00000000
kfffdb.iXsiz[2]:                      0 ; 0x038: 0x00000000
kfffdb.xtntblk:                       3 ; 0x03c: 0x0003
kfffdb.break:                        60 ; 0x03e: 0x003c
kfffdb.priZn:                         0 ; 0x040: KFDZN_COLD
kfffdb.secZn:                         0 ; 0x041: KFDZN_COLD
kfffdb.ub2spare:                      0 ; 0x042: 0x0000
kfffdb.alias[0]:             4294967295 ; 0x044: 0xffffffff
kfffdb.alias[1]:             4294967295 ; 0x048: 0xffffffff
kfffdb.strpwdth:                      0 ; 0x04c: 0x00
kfffdb.strpsz:                        0 ; 0x04d: 0x00
kfffdb.usmsz:                         0 ; 0x04e: 0x0000
kfffdb.crets.hi:               32999670 ; 0x050: HOUR=0x16 DAYS=0x7 MNTH=0x2 YEAR=0x7de
kfffdb.crets.lo:             1788966912 ; 0x054: USEC=0x0 MSEC=0x5e SECS=0x2a MINS=0x1a
kfffdb.modts.hi:               32999670 ; 0x058: HOUR=0x16 DAYS=0x7 MNTH=0x2 YEAR=0x7de
kfffdb.modts.lo:             1788966912 ; 0x05c: USEC=0x0 MSEC=0x5e SECS=0x2a MINS=0x1a
...............
kfffde[0].xptr.au:                    2 ; 0x4a0: 0x00000002
kfffde[0].xptr.disk:                  4 ; 0x4a4: 0x0004
kfffde[0].xptr.flags:                 0 ; 0x4a6: L=0 E=0 D=0 S=0
kfffde[0].xptr.chk:                  44 ; 0x4a7: 0x2c
kfffde[1].xptr.au:                    3 ; 0x4a8: 0x00000003
kfffde[1].xptr.disk:                  2 ; 0x4ac: 0x0002
kfffde[1].xptr.flags:                 0 ; 0x4ae: L=0 E=0 D=0 S=0
kfffde[1].xptr.chk:                  43 ; 0x4af: 0x2b
kfffde[2].xptr.au:                    2 ; 0x4b0: 0x00000002
kfffde[2].xptr.disk:                  8 ; 0x4b4: 0x0008
kfffde[2].xptr.flags:                 0 ; 0x4b6: L=0 E=0 D=0 S=0
kfffde[2].xptr.chk:                  32 ; 0x4b7: 0x20

其中一个extent pointer指向Disk 4的 AUN=2 ,

[oracle@mlab2 ~]$ kfed read /oracleasm/asm-disk05 aus=4194304 aun=2 blkn=0|less
kfbh.endian:                          1 ; 0x000: 0x01
kfbh.hard:                          130 ; 0x001: 0x82
kfbh.type:                            6 ; 0x002: KFBTYP_DISKDIR
kfbh.datfmt:                          1 ; 0x003: 0x01
kfbh.block.blk:                       0 ; 0x004: blk=0
kfbh.block.obj:                       2 ; 0x008: file=2
kfbh.check:                  4277763909 ; 0x00c: 0xfef97f45
kfbh.fcn.base:                      692 ; 0x010: 0x000002b4
kfbh.fcn.wrap:                        0 ; 0x014: 0x00000000
kfbh.spare1:                          0 ; 0x018: 0x00000000
kfbh.spare2:                          0 ; 0x01c: 0x00000000
kffdnd.bnode.incarn:                  1 ; 0x000: A=1 NUMM=0x0
kffdnd.bnode.frlist.number:  4294967295 ; 0x004: 0xffffffff
kffdnd.bnode.frlist.incarn:           0 ; 0x008: A=0 NUMM=0x0
kffdnd.overfl.number:                 1 ; 0x00c: 0x00000001
kffdnd.overfl.incarn:                 1 ; 0x010: A=1 NUMM=0x0
kffdnd.parent.number:                 0 ; 0x014: 0x00000000
kffdnd.parent.incarn:                 1 ; 0x018: A=1 NUMM=0x0
kffdnd.fstblk.number:                 0 ; 0x01c: 0x00000000
kffdnd.fstblk.incarn:                 1 ; 0x020: A=1 NUMM=0x0
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:           DATA1_0000 ; 0x038: length=10
kfddde[0].fgname:            DATA1_0000 ; 0x058: length=10
kfddde[0].crestmp.hi:          32999670 ; 0x078: HOUR=0x16 DAYS=0x7 MNTH=0x2 YEAR=0x7de
kfddde[0].crestmp.lo:        1788720128 ; 0x07c: USEC=0x0 MSEC=0x36d SECS=0x29 MINS=0x1a
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:                   32375 ; 0x08c: 0x00007e77
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].zones[0].start:             0 ; 0x0a4: 0x00000000
kfddde[0].zones[0].size:          32375 ; 0x0a8: 0x00007e77
kfddde[0].zones[0].used:              9 ; 0x0ac: 0x00000009
kfddde[0].zones[0].spare:             0 ; 0x0b0: 0x00000000
kfddde[0].zones[0].classes[0].imbal[0]:7 ; 0x0b4: 0x00000007
kfddde[0].zones[0].classes[0].imbal[1]:0 ; 0x0b8: 0x00000000
kfddde[0].zones[0].classes[0].imbal[2]:0 ; 0x0bc: 0x00000000
kfddde[0].zones[0].classes[0].imbal[3]:0 ; 0x0c0: 0x00000000
kfddde[0].zones[0].classes[1].imbal[0]:0 ; 0x0c4: 0x00000000
kfddde[0].zones[0].classes[1].imbal[1]:0 ; 0x0c8: 0x00000000
kfddde[0].zones[0].classes[1].imbal[2]:0 ; 0x0cc: 0x00000000
kfddde[0].zones[0].classes[1].imbal[3]:0 ; 0x0d0: 0x00000000
kfddde[0].zones[0].classes[2].imbal[0]:0 ; 0x0d4: 0x00000000
kfddde[0].zones[0].classes[2].imbal[1]:0 ; 0x0d8: 0x00000000


KFBTYP_DISKDIR即DISK DIRECTORY的block type, 其他一些结构:

  • kfddde[0].entry.incarn  Common entry fields
  • kfddde[0].dsknum   Disk number [KEY]
  • kfddde[0].state  Disk state ,其中:

KFDSTA_INVALID     0)   Illegal value
KFDSTA_UNKNOWN     1)   OSM disk state not known
KFDSTA_NORMAL      2)   Happy disk
KFDSTA_UNUSED      3)   Unused State – Open
KFDSTA_DROPPING    4)   Disk being dropped from group
KFDSTA_HUNG        5)   Disk drop operation hung
KFDSTA_FORCING     6)   Disk beinng drop forced
KFDSTA_DROPPED     7)   Disk no longer part of group
KFDSTA_ADDING      8)   Disk being globally validated

  • kfddde[0].ddchgfl   Bit flags for chngs
  • kfddde[1].dskname: OSM disk name
  • kfddde[1].fgname  Fail group name
  • kfddde[1].crestmp.hi /lo:  Create timestamp
  • kfddde[1].failstmp.hi/lo :  Failure timestamp
  • kfddde[1].timer:  Failure timer
  • kfddde[1].size: Resize target(AUs)
  • kfddde[1].srRloc.super.hiStart/loStart  Relative loc in SR
  • kfddde[1].dskrprtm  :Disk repair time
  • kfddde[0].zones[0].start /size/used/spare :  Zone information

Comments

  1. someone says

    写得有点烂.

Comment

*

沪ICP备14014813号-2

沪公网安备 31010802001379号