sitemap

RSS地图

收藏本站

设为首页

Oracle研究中心

当前位置:Oracle研究中心 > 产品DBA > Oracle ASM >

【学习笔记】Oracle 12c新版本中asm元数据与11g的变化

时间:2017-01-08 20:31   来源:Oracle研究中心   作者:网络   点击:

天萃荷净 Oracle研究中心学习笔记:分享一篇关于Oracle数据库12c新发布版本中asm的元数据与11g版本的变化区别。

本站文章除注明转载外,均为本站原创: 转载自love wife & love life —Roger 的Oracle技术博客
本文链接地址: oracle 12c 中asm元数据是否有所变化

oracle 12c 已经发布了几个月了,最近太忙,一直没时间研究12c,今天抽空研究一下12c 中asm的元数据是否有所改变,经过测试发现基本上毫无变化,如下是测试过程:

++++12 c asm instance

[grid@12c_single ~]$ sqlplus "/as sysasm"

SQL*Plus: Release 12.1.0.1.0 Production ON Wed Aug 14 03:30:36 2013

Copyright (c) 1982, 2013, Oracle.  ALL rights reserved.

Connected TO:
Oracle DATABASE 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
WITH the Automatic Storage Management OPTION

SQL> ALTER diskgroup DATA mount;

Diskgroup altered.

SQL> SHOW parameter instance

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
_dummy_instance                      BOOLEAN     TRUE
cluster_database_instances           INTEGER     1
instance_name                        string      +ASM
instance_number                      INTEGER     1
instance_type                        string      ASM
SQL>
SQL> SELECT number_kffxp file#, disk_kffxp disk#, COUNT(disk_kffxp) extents
  2  FROM x$kffxp
  3  WHERE group_kffxp=1
  4        AND disk_kffxp <> 65534
  5  GROUP BY number_kffxp, disk_kffxp;

     FILE#      DISK#    EXTENTS
---------- ---------- ----------
         1          0          1
         1          1          1
         2          0          1
         3          0         21
         3          1         21
         4          0          1
         4          1          1
         5          0          1
         6          1          1
       256          0        386
       256          1        386
       。。。。。
       274          0        130
       274          1        132
       275          0        337
       275          1        335
       276          0         11
       276          1         10

50 ROWS selected.
这里的file 1~file 6其实都是元数据,不多说了,以前写过很多类似的文章了。 通常来讲,我们比较关注的是
file directory和alias directory,以及disk header。

首先我们来看下file directory,先随便找个datafile 来进行说明:

      FILE# NAME                                                                             BYTES/1024/1024
---------- -------------------------------------------------------------------------------- ---------------
         1 +DATA/KILLDB/DATAFILE/system.257.823363955                                                   780
         3 +DATA/KILLDB/DATAFILE/sysaux.256.823363841                                                   770
         4 +DATA/KILLDB/DATAFILE/undotbs1.259.823364125                                                 225
         5 +DATA/KILLDB/DD7C48AA5A4404A2E04325AAE80A403C/DATAFILE/system.270.823364267                  260
         6 +DATA/KILLDB/DATAFILE/users.258.823364123                                                      5
         7 +DATA/KILLDB/DD7C48AA5A4404A2E04325AAE80A403C/DATAFILE/sysaux.269.823364265                  670
        10 +DATA/KILLDB/E3DA76F042E228D7E043136DA8C0825B/DATAFILE/system.274.823409067                  260
        11 +DATA/KILLDB/E3DA76F042E228D7E043136DA8C0825B/DATAFILE/sysaux.275.823409067                  670

8 rows selected.

SQL>
这里我以datafile 6为例进行说明,其asm file number为258.

首先我们定位到file directory:

[oracle@12c_single ~]$ kfed read /dev/asmvg/lvasm1 aun=2 blkn=1| more
kfbh.endian:                          1 ; 0x000: 0x01
kfbh.hard:                          130 ; 0x001: 0x82
kfbh.type:                            4 ; 0x002: KFBTYP_FILEDIR
kfbh.datfmt:                          1 ; 0x003: 0x01
kfbh.block.blk:                       1 ; 0x004: blk=1
kfbh.block.obj:                       1 ; 0x008: file=1
kfbh.check:                  4126565344 ; 0x00c: 0xf5f663e0
kfbh.fcn.base:                      262 ; 0x010: 0x00000106
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:                 2097152 ; 0x010: 0x00200000
kfffdb.xtntcnt:                       2 ; 0x014: 0x00000002
kfffdb.xtnteof:                       2 ; 0x018: 0x00000002
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:                         17 ; 0x022: SCHE=0x1 NUMB=0x1
kfffdb.iXrs:                         17 ; 0x023: SCHE=0x1 NUMB=0x1
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:                       2 ; 0x03c: 0x0002
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:               32989616 ; 0x050: HOUR=0x10 DAYS=0xd MNTH=0x8 YEAR=0x7dd
kfffdb.crets.lo:               75310080 ; 0x054: USEC=0x0 MSEC=0x349 SECS=0x7 MINS=0x1
kfffdb.modts.hi:               32989616 ; 0x058: HOUR=0x10 DAYS=0xd MNTH=0x8 YEAR=0x7dd
kfffdb.modts.lo:               75310080 ; 0x05c: USEC=0x0 MSEC=0x349 SECS=0x7 MINS=0x1
kfffdb.dasz[0]:                       0 ; 0x060: 0x00
kfffdb.dasz[1]:                       0 ; 0x061: 0x00
kfffdb.dasz[2]:                       0 ; 0x062: 0x00
kfffdb.dasz[3]:                       0 ; 0x063: 0x00
kfffdb.permissn:                      0 ; 0x064: 0x00
kfffdb.ub1spar1:                      0 ; 0x065: 0x00
kfffdb.ub2spar2:                      0 ; 0x066: 0x0000
kfffdb.user.entnum:                   0 ; 0x068: 0x0000
kfffdb.user.entinc:                   0 ; 0x06a: 0x0000
kfffdb.group.entnum:                  0 ; 0x06c: 0x0000
kfffdb.group.entinc:                  0 ; 0x06e: 0x0000
kfffdb.paswdblk:                      0 ; 0x070: 0x00000000
kfffdb.spare[0]:                      0 ; 0x074: 0x00000000
kfffdb.spare[1]:                      0 ; 0x078: 0x00000000
kfffdb.spare[2]:                      0 ; 0x07c: 0x00000000
kfffdb.spare[3]:                      0 ; 0x080: 0x00000000
kfffdb.spare[4]:                      0 ; 0x084: 0x00000000
kfffdb.spare[5]:                      0 ; 0x088: 0x00000000
kfffdb.spare[6]:                      0 ; 0x08c: 0x00000000
kfffdb.spare[7]:                      0 ; 0x090: 0x00000000
kfffdb.spare[8]:                      0 ; 0x094: 0x00000000
kfffdb.spare[9]:                      0 ; 0x098: 0x00000000
kfffdb.spare[10]:                     0 ; 0x09c: 0x00000000
kfffdb.usm:                             ; 0x0a0: length=0
kfffde[0].xptr.au:                    2 ; 0x4a0: 0x00000002
kfffde[0].xptr.disk:                  0 ; 0x4a4: 0x0000
kfffde[0].xptr.flags:                 0 ; 0x4a6: L=0 E=0 D=0 S=0
kfffde[0].xptr.chk:                  40 ; 0x4a7: 0x28
kfffde[1].xptr.au:                   25 ; 0x4a8: 0x00000019    +++第25号au
kfffde[1].xptr.disk:                  1 ; 0x4ac: 0x0001
kfffde[1].xptr.flags:                 0 ; 0x4ae: L=0 E=0 D=0 S=0
kfffde[1].xptr.chk:                  50 ; 0x4af: 0x32
kfffde[2].xptr.au:           4294967295 ; 0x4b0: 0xffffffff
kfffde[2].xptr.disk:              65535 ; 0x4b4: 0xffff
kfffde[2].xptr.flags:                 0 ; 0x4b6: L=0 E=0 D=0 S=0
kfffde[2].xptr.chk:                  42 ; 0x4b7: 0x2a
。。。。。。
这里的au 2是元数据用的,那么对于datafile的信息来讲,就在第25号au中,且xptr.disk为1,
那么说明应该是在该diskgroup中 的第2个disk中,如下:

[oracle@12c_single ~]$ kfed read /dev/asmvg/lvasm2 aun=25 blkn=2| more
kfbh.endian:                          1 ; 0x000: 0x01
kfbh.hard:                          130 ; 0x001: 0x82
kfbh.type:                            4 ; 0x002: KFBTYP_FILEDIR
kfbh.datfmt:                          1 ; 0x003: 0x01
kfbh.block.blk:                     258 ; 0x004: blk=258
kfbh.block.obj:                       1 ; 0x008: file=1
kfbh.check:                   436792063 ; 0x00c: 0x1a08eaff
kfbh.fcn.base:                     7145 ; 0x010: 0x00001be9
kfbh.fcn.wrap:                        0 ; 0x014: 0x00000000
kfbh.spare1:                          0 ; 0x018: 0x00000000
kfbh.spare2:                          0 ; 0x01c: 0x00000000
kfffdb.node.incarn:           823364123 ; 0x000: A=1 NUMM=0x1889c50d
kfffdb.node.frlist.number:   4294967295 ; 0x004: 0xffffffff
kfffdb.node.frlist.incarn:            0 ; 0x008: A=0 NUMM=0x0
kfffdb.hibytes:                       0 ; 0x00c: 0x00000000
kfffdb.lobytes:                 5251072 ; 0x010: 0x00502000
kfffdb.xtntcnt:                       6 ; 0x014: 0x00000006
kfffdb.xtnteof:                       6 ; 0x018: 0x00000006
kfffdb.blkSize:                    8192 ; 0x01c: 0x00002000
kfffdb.flags:                        17 ; 0x020: O=1 S=0 S=0 D=0 C=1 I=0 R=0 A=0
kfffdb.fileType:                     12 ; 0x021: 0x0c
kfffdb.dXrs:                         17 ; 0x022: SCHE=0x1 NUMB=0x1
kfffdb.iXrs:                         17 ; 0x023: SCHE=0x1 NUMB=0x1
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:                       6 ; 0x03c: 0x0006
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]:                    108 ; 0x044: 0x0000006c
kfffdb.alias[1]:             4294967295 ; 0x048: 0xffffffff
kfffdb.strpwdth:                      1 ; 0x04c: 0x01
kfffdb.strpsz:                       20 ; 0x04d: 0x14
kfffdb.usmsz:                         0 ; 0x04e: 0x0000
kfffdb.crets.hi:               32989616 ; 0x050: HOUR=0x10 DAYS=0xd MNTH=0x8 YEAR=0x7dd
kfffdb.crets.lo:             1029890048 ; 0x054: USEC=0x0 MSEC=0xb8 SECS=0x16 MINS=0xf
kfffdb.modts.hi:               32989635 ; 0x058: HOUR=0x3 DAYS=0xe MNTH=0x8 YEAR=0x7dd
kfffdb.modts.lo:                      0 ; 0x05c: USEC=0x0 MSEC=0x0 SECS=0x0 MINS=0x0
kfffdb.dasz[0]:                       0 ; 0x060: 0x00
kfffdb.dasz[1]:                       0 ; 0x061: 0x00
kfffdb.dasz[2]:                       0 ; 0x062: 0x00
kfffdb.dasz[3]:                       0 ; 0x063: 0x00
kfffdb.permissn:                      0 ; 0x064: 0x00
kfffdb.ub1spar1:                      0 ; 0x065: 0x00
kfffdb.ub2spar2:                      0 ; 0x066: 0x0000
kfffdb.user.entnum:                   0 ; 0x068: 0x0000
kfffdb.user.entinc:                   0 ; 0x06a: 0x0000
kfffdb.group.entnum:                  0 ; 0x06c: 0x0000
kfffdb.group.entinc:                  0 ; 0x06e: 0x0000
kfffdb.paswdblk:                      0 ; 0x070: 0x00000000
kfffdb.spare[0]:                      0 ; 0x074: 0x00000000
kfffdb.spare[1]:                      0 ; 0x078: 0x00000000
kfffdb.spare[2]:                      0 ; 0x07c: 0x00000000
kfffdb.spare[3]:                      0 ; 0x080: 0x00000000
kfffdb.spare[4]:                      0 ; 0x084: 0x00000000
kfffdb.spare[5]:                      0 ; 0x088: 0x00000000
kfffdb.spare[6]:                      0 ; 0x08c: 0x00000000
kfffdb.spare[7]:                      0 ; 0x090: 0x00000000
kfffdb.spare[8]:                      0 ; 0x094: 0x00000000
kfffdb.spare[9]:                      0 ; 0x098: 0x00000000
kfffdb.spare[10]:                     0 ; 0x09c: 0x00000000
kfffdb.usm:                             ; 0x0a0: length=0
kfffde[0].xptr.au:                  740 ; 0x4a0: 0x000002e4
kfffde[0].xptr.disk:                  0 ; 0x4a4: 0x0000
kfffde[0].xptr.flags:                 0 ; 0x4a6: L=0 E=0 D=0 S=0
kfffde[0].xptr.chk:                 204 ; 0x4a7: 0xcc
kfffde[1].xptr.au:                  737 ; 0x4a8: 0x000002e1
kfffde[1].xptr.disk:                  1 ; 0x4ac: 0x0001
kfffde[1].xptr.flags:                 0 ; 0x4ae: L=0 E=0 D=0 S=0
kfffde[1].xptr.chk:                 200 ; 0x4af: 0xc8
kfffde[2].xptr.au:                  741 ; 0x4b0: 0x000002e5
kfffde[2].xptr.disk:                  0 ; 0x4b4: 0x0000
kfffde[2].xptr.flags:                 0 ; 0x4b6: L=0 E=0 D=0 S=0
kfffde[2].xptr.chk:                 205 ; 0x4b7: 0xcd
kfffde[3].xptr.au:                  738 ; 0x4b8: 0x000002e2
kfffde[3].xptr.disk:                  1 ; 0x4bc: 0x0001
kfffde[3].xptr.flags:                 0 ; 0x4be: L=0 E=0 D=0 S=0
kfffde[3].xptr.chk:                 203 ; 0x4bf: 0xcb
kfffde[4].xptr.au:                  742 ; 0x4c0: 0x000002e6
kfffde[4].xptr.disk:                  0 ; 0x4c4: 0x0000
kfffde[4].xptr.flags:                 0 ; 0x4c6: L=0 E=0 D=0 S=0
kfffde[4].xptr.chk:                 206 ; 0x4c7: 0xce
kfffde[5].xptr.au:                  739 ; 0x4c8: 0x000002e3
kfffde[5].xptr.disk:                  1 ; 0x4cc: 0x0001
kfffde[5].xptr.flags:                 0 ; 0x4ce: L=0 E=0 D=0 S=0
kfffde[5].xptr.chk:                 202 ; 0x4cf: 0xca
kfffde[6].xptr.au:           4294967295 ; 0x4d0: 0xffffffff
kfffde[6].xptr.disk:              65535 ; 0x4d4: 0xffff
kfffde[6].xptr.flags:                 0 ; 0x4d6: L=0 E=0 D=0 S=0
kfffde[6].xptr.chk:                  42 ; 0x4d7: 0x2a
.......
为什么这里是blkn=2呢 ?因为该datafile的asm file number是258,而asm中从第2个au开始(默认au 1m)是从256 号block开始,
那么这里就应该是258-256=2. 所以该文件的信息的au分配信息应该是在第2号block中.
从上面可以看到,该文件分配了6个au,每个au 大小为1m。
那么这个结果是否ok呢? 可以通过查询x$kffxp试图来进行确认,如下:

SQL>  SELECT disk_kffxp, AU_kffxp, xnum_kffxp
  2  FROM x$kffxp
  3  WHERE group_kffxp=1
  4  AND number_kffxp=258;

DISK_KFFXP   AU_KFFXP XNUM_KFFXP
---------- ---------- ----------
         0        740          0
         1        737          1
         0        741          2
         1        738          3
         0        742          4
         1        739          5

6 ROWS selected.

SQL>
我们可以看到,完全一致。

接下来,我们继续来看下另外一个重要的asm metadata:alias directory.
从最前面的查询我们知道file 6是alias directory信息,那么也就是说alias directory的au分配信息应该是在
第2号au的第6个block中,我们来看下是否是这样:

[oracle@12c_single ~]$ kfed read /dev/asmvg/lvasm1 aun=2 blkn=6| more
kfbh.endian:                          1 ; 0x000: 0x01
kfbh.hard:                          130 ; 0x001: 0x82
kfbh.type:                            4 ; 0x002: KFBTYP_FILEDIR
kfbh.datfmt:                          1 ; 0x003: 0x01
kfbh.block.blk:                       6 ; 0x004: blk=6
kfbh.block.obj:                       1 ; 0x008: file=1
kfbh.check:                   154755809 ; 0x00c: 0x093962e1
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:                       1 ; 0x014: 0x00000001
kfffdb.xtnteof:                       1 ; 0x018: 0x00000001
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:                         17 ; 0x022: SCHE=0x1 NUMB=0x1
kfffdb.iXrs:                         17 ; 0x023: SCHE=0x1 NUMB=0x1
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:                       1 ; 0x03c: 0x0001
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:               32989616 ; 0x050: HOUR=0x10 DAYS=0xd MNTH=0x8 YEAR=0x7dd
kfffdb.crets.lo:               75343872 ; 0x054: USEC=0x0 MSEC=0x36a SECS=0x7 MINS=0x1
kfffdb.modts.hi:               32989616 ; 0x058: HOUR=0x10 DAYS=0xd MNTH=0x8 YEAR=0x7dd
kfffdb.modts.lo:               75343872 ; 0x05c: USEC=0x0 MSEC=0x36a SECS=0x7 MINS=0x1
kfffdb.dasz[0]:                       0 ; 0x060: 0x00
kfffdb.dasz[1]:                       0 ; 0x061: 0x00
kfffdb.dasz[2]:                       0 ; 0x062: 0x00
kfffdb.dasz[3]:                       0 ; 0x063: 0x00
kfffdb.permissn:                      0 ; 0x064: 0x00
kfffdb.ub1spar1:                      0 ; 0x065: 0x00
kfffdb.ub2spar2:                      0 ; 0x066: 0x0000
kfffdb.user.entnum:                   0 ; 0x068: 0x0000
kfffdb.user.entinc:                   0 ; 0x06a: 0x0000
kfffdb.group.entnum:                  0 ; 0x06c: 0x0000
kfffdb.group.entinc:                  0 ; 0x06e: 0x0000
kfffdb.paswdblk:                      0 ; 0x070: 0x00000000
kfffdb.spare[0]:                      0 ; 0x074: 0x00000000
kfffdb.spare[1]:                      0 ; 0x078: 0x00000000
kfffdb.spare[2]:                      0 ; 0x07c: 0x00000000
kfffdb.spare[3]:                      0 ; 0x080: 0x00000000
kfffdb.spare[4]:                      0 ; 0x084: 0x00000000
kfffdb.spare[5]:                      0 ; 0x088: 0x00000000
kfffdb.spare[6]:                      0 ; 0x08c: 0x00000000
kfffdb.spare[7]:                      0 ; 0x090: 0x00000000
kfffdb.spare[8]:                      0 ; 0x094: 0x00000000
kfffdb.spare[9]:                      0 ; 0x098: 0x00000000
kfffdb.spare[10]:                     0 ; 0x09c: 0x00000000
kfffdb.usm:                             ; 0x0a0: length=0
kfffde[0].xptr.au:                   24 ; 0x4a0: 0x00000018
kfffde[0].xptr.disk:                  1 ; 0x4a4: 0x0001
kfffde[0].xptr.flags:                 0 ; 0x4a6: L=0 E=0 D=0 S=0
kfffde[0].xptr.chk:                  51 ; 0x4a7: 0x33
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
。。。。。。。
可以看到,file 6的元数据应该在第24号au中,且xptr.disk为1. 那么:

[oracle@12c_single ~]$ kfed read /dev/asmvg/lvasm2 aun=24 blkn=1| more
kfbh.endian:                          1 ; 0x000: 0x01
kfbh.hard:                          130 ; 0x001: 0x82
kfbh.type:                           11 ; 0x002: KFBTYP_ALIASDIR
kfbh.datfmt:                          1 ; 0x003: 0x01
kfbh.block.blk:                       1 ; 0x004: blk=1
kfbh.block.obj:                       6 ; 0x008: file=6
kfbh.check:                  1024264220 ; 0x00c: 0x3d0d081c
kfbh.fcn.base:                     7179 ; 0x010: 0x00001c0b
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:        4294967295 ; 0x00c: 0xffffffff
kffdnd.overfl.incarn:                 0 ; 0x010: A=0 NUMM=0x0
kffdnd.parent.number:                 0 ; 0x014: 0x00000000
kffdnd.parent.incarn:                 1 ; 0x018: A=1 NUMM=0x0
kffdnd.fstblk.number:                 1 ; 0x01c: 0x00000001
kffdnd.fstblk.incarn:                 1 ; 0x020: A=1 NUMM=0x0
kfade[0].entry.incarn:                1 ; 0x024: A=1 NUMM=0x0
kfade[0].entry.hash:          710518681 ; 0x028: 0x2a59a799
kfade[0].entry.refer.number:          2 ; 0x02c: 0x00000002
kfade[0].entry.refer.incarn:          1 ; 0x030: A=1 NUMM=0x0
kfade[0].name:                 DATAFILE ; 0x034: length=8
kfade[0].fnum:               4294967295 ; 0x064: 0xffffffff
kfade[0].finc:               4294967295 ; 0x068: 0xffffffff
kfade[0].flags:                       4 ; 0x06c: U=0 S=0 S=1 U=0 F=0
kfade[0].ub1spare:                    0 ; 0x06d: 0x00
kfade[0].ub2spare:                    0 ; 0x06e: 0x0000
kfade[1].entry.incarn:                3 ; 0x070: A=1 NUMM=0x1
kfade[1].entry.hash:         4053320104 ; 0x074: 0xf198c1a8
kfade[1].entry.refer.number:          3 ; 0x078: 0x00000003
kfade[1].entry.refer.incarn:          3 ; 0x07c: A=1 NUMM=0x1
kfade[1].name:              CONTROLFILE ; 0x080: length=11
kfade[1].fnum:               4294967295 ; 0x0b0: 0xffffffff
kfade[1].finc:               4294967295 ; 0x0b4: 0xffffffff
kfade[1].flags:                       4 ; 0x0b8: U=0 S=0 S=1 U=0 F=0
kfade[1].ub1spare:                    0 ; 0x0b9: 0x00
kfade[1].ub2spare:                    0 ; 0x0ba: 0x0000
kfade[2].entry.incarn:                1 ; 0x0bc: A=1 NUMM=0x0
kfade[2].entry.hash:         2803485489 ; 0x0c0: 0xa719cb31
kfade[2].entry.refer.number:          4 ; 0x0c4: 0x00000004
kfade[2].entry.refer.incarn:          1 ; 0x0c8: A=1 NUMM=0x0
kfade[2].name:                ONLINELOG ; 0x0cc: length=9
kfade[2].fnum:               4294967295 ; 0x0fc: 0xffffffff
kfade[2].finc:               4294967295 ; 0x100: 0xffffffff
kfade[2].flags:                       4 ; 0x104: U=0 S=0 S=1 U=0 F=0
kfade[2].ub1spare:                    0 ; 0x105: 0x00
kfade[2].ub2spare:                    0 ; 0x106: 0x0000
kfade[3].entry.incarn:                1 ; 0x108: A=1 NUMM=0x0
kfade[3].entry.hash:         2905271101 ; 0x10c: 0xad2aeb3d
kfade[3].entry.refer.number:          5 ; 0x110: 0x00000005
kfade[3].entry.refer.incarn:          1 ; 0x114: A=1 NUMM=0x0
kfade[3].name:                 TEMPFILE ; 0x118: length=8
kfade[3].fnum:               4294967295 ; 0x148: 0xffffffff
kfade[3].finc:               4294967295 ; 0x14c: 0xffffffff
kfade[3].flags:                       4 ; 0x150: U=0 S=0 S=1 U=0 F=0
kfade[3].ub1spare:                    0 ; 0x151: 0x00
kfade[3].ub2spare:                    0 ; 0x152: 0x0000
kfade[4].entry.incarn:                1 ; 0x154: A=1 NUMM=0x0
kfade[4].entry.hash:         3981589715 ; 0x158: 0xed523cd3
kfade[4].entry.refer.number:          6 ; 0x15c: 0x00000006
kfade[4].entry.refer.incarn:          1 ; 0x160: A=1 NUMM=0x0
kfade[4].name:DD7C48AA5A4404A2E04325AAE80A403C ; 0x164: length=32
kfade[4].fnum:               4294967295 ; 0x194: 0xffffffff
kfade[4].finc:               4294967295 ; 0x198: 0xffffffff
kfade[4].flags:                       4 ; 0x19c: U=0 S=0 S=1 U=0 F=0
kfade[4].ub1spare:                    0 ; 0x19d: 0x00
kfade[4].ub2spare:                    0 ; 0x19e: 0x0000
kfade[5].entry.incarn:                1 ; 0x1a0: A=1 NUMM=0x0
kfade[5].entry.hash:          313789181 ; 0x1a4: 0x12b40afd
kfade[5].entry.refer.number:          8 ; 0x1a8: 0x00000008
kfade[5].entry.refer.incarn:          1 ; 0x1ac: A=1 NUMM=0x0
kfade[5].name:E3D0E88840A25537E043136DA8C0DDEC ; 0x1b0: length=32
kfade[5].fnum:               4294967295 ; 0x1e0: 0xffffffff
kfade[5].finc:               4294967295 ; 0x1e4: 0xffffffff
kfade[5].flags:                       4 ; 0x1e8: U=0 S=0 S=1 U=0 F=0
kfade[5].ub1spare:                    0 ; 0x1e9: 0x00
kfade[5].ub2spare:                    0 ; 0x1ea: 0x0000
kfade[6].entry.incarn:                1 ; 0x1ec: A=1 NUMM=0x0
kfade[6].entry.hash:         3261836913 ; 0x1f0: 0xc26bae71
kfade[6].entry.refer.number:         10 ; 0x1f4: 0x0000000a
kfade[6].entry.refer.incarn:          1 ; 0x1f8: A=1 NUMM=0x0
kfade[6].name:            PARAMETERFILE ; 0x1fc: length=13
kfade[6].fnum:               4294967295 ; 0x22c: 0xffffffff
kfade[6].finc:               4294967295 ; 0x230: 0xffffffff
kfade[6].flags:                       4 ; 0x234: U=0 S=0 S=1 U=0 F=0
kfade[6].ub1spare:                    0 ; 0x235: 0x00
kfade[6].ub2spare:                    0 ; 0x236: 0x0000
kfade[7].entry.incarn:                1 ; 0x238: A=1 NUMM=0x0
kfade[7].entry.hash:         4185518538 ; 0x23c: 0xf979f1ca
kfade[7].entry.refer.number: 4294967295 ; 0x240: 0xffffffff
kfade[7].entry.refer.incarn:          0 ; 0x244: A=0 NUMM=0x0
kfade[7].name:         spfilekilldb.ora ; 0x248: length=16
kfade[7].fnum:                      272 ; 0x278: 0x00000110
kfade[7].finc:                823365931 ; 0x27c: 0x3113912b
kfade[7].flags:                      17 ; 0x280: U=1 S=0 S=0 U=0 F=1
kfade[7].ub1spare:                    0 ; 0x281: 0x00
kfade[7].ub2spare:                    0 ; 0x282: 0x0000
kfade[8].entry.incarn:                1 ; 0x284: A=1 NUMM=0x0
kfade[8].entry.hash:         3018013455 ; 0x288: 0xb3e33b0f
kfade[8].entry.refer.number:         11 ; 0x28c: 0x0000000b
kfade[8].entry.refer.incarn:          1 ; 0x290: A=1 NUMM=0x0
kfade[8].name:E3D1604B5C725A02E043136DA8C03BCA ; 0x294: length=32
kfade[8].fnum:               4294967295 ; 0x2c4: 0xffffffff
kfade[8].finc:               4294967295 ; 0x2c8: 0xffffffff
kfade[8].flags:                       4 ; 0x2cc: U=0 S=0 S=1 U=0 F=0
kfade[8].ub1spare:                    0 ; 0x2cd: 0x00
kfade[8].ub2spare:                    0 ; 0x2ce: 0x0000
kfade[9].entry.incarn:                1 ; 0x2d0: A=1 NUMM=0x0
kfade[9].entry.hash:         1668870450 ; 0x2d4: 0x6378f132
kfade[9].entry.refer.number:         13 ; 0x2d8: 0x0000000d
kfade[9].entry.refer.incarn:          1 ; 0x2dc: A=1 NUMM=0x0
kfade[9].name:E3DA76F042E228D7E043136DA8C0825B ; 0x2e0: length=32
kfade[9].fnum:               4294967295 ; 0x310: 0xffffffff
kfade[9].finc:               4294967295 ; 0x314: 0xffffffff
kfade[9].flags:                       4 ; 0x318: U=0 S=0 S=1 U=0 F=0
kfade[9].ub1spare:                    0 ; 0x319: 0x00
kfade[9].ub2spare:                    0 ; 0x31a: 0x0000
kfade[10].entry.incarn:               0 ; 0x31c: A=0 NUMM=0x0
kfade[10].entry.hash:                 0 ; 0x320: 0x00000000
kfade[10].entry.refer.number:         0 ; 0x324: 0x00000000
kfade[10].entry.refer.incarn:         0 ; 0x328: A=0 NUMM=0x0
kfade[10].name:                         ; 0x32c: length=0
。。。。。。
可以看到,datafile的信息在最前面,我们来看下datafile的详细信息(cdb):

[oracle@12c_single ~]$ kfed read /dev/asmvg/lvasm2 aun=24 blkn=2| more
kfbh.endian:                          1 ; 0x000: 0x01
kfbh.hard:                          130 ; 0x001: 0x82
kfbh.type:                           11 ; 0x002: KFBTYP_ALIASDIR
kfbh.datfmt:                          1 ; 0x003: 0x01
kfbh.block.blk:                       2 ; 0x004: blk=2
kfbh.block.obj:                       6 ; 0x008: file=6
kfbh.check:                  4161348994 ; 0x00c: 0xf8092582
kfbh.fcn.base:                     2063 ; 0x010: 0x0000080f
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:        4294967295 ; 0x00c: 0xffffffff
kffdnd.overfl.incarn:                 0 ; 0x010: A=0 NUMM=0x0
kffdnd.parent.number:                 1 ; 0x014: 0x00000001
kffdnd.parent.incarn:                 1 ; 0x018: A=1 NUMM=0x0
kffdnd.fstblk.number:                 2 ; 0x01c: 0x00000002
kffdnd.fstblk.incarn:                 1 ; 0x020: A=1 NUMM=0x0
kfade[0].entry.incarn:                1 ; 0x024: A=1 NUMM=0x0
kfade[0].entry.hash:         1787583896 ; 0x028: 0x6a8c5d98
kfade[0].entry.refer.number: 4294967295 ; 0x02c: 0xffffffff
kfade[0].entry.refer.incarn:          0 ; 0x030: A=0 NUMM=0x0
kfade[0].name:                   SYSAUX ; 0x034: length=6
kfade[0].fnum:                      256 ; 0x064: 0x00000100
kfade[0].finc:                823363841 ; 0x068: 0x31138901
kfade[0].flags:                      18 ; 0x06c: U=0 S=1 S=0 U=0 F=1
kfade[0].ub1spare:                    0 ; 0x06d: 0x00
kfade[0].ub2spare:                    0 ; 0x06e: 0x0000
kfade[1].entry.incarn:                1 ; 0x070: A=1 NUMM=0x0
kfade[1].entry.hash:         1670094427 ; 0x074: 0x638b9e5b
kfade[1].entry.refer.number: 4294967295 ; 0x078: 0xffffffff
kfade[1].entry.refer.incarn:          0 ; 0x07c: A=0 NUMM=0x0
kfade[1].name:                   SYSTEM ; 0x080: length=6
kfade[1].fnum:                      257 ; 0x0b0: 0x00000101
kfade[1].finc:                823363955 ; 0x0b4: 0x31138973
kfade[1].flags:                      18 ; 0x0b8: U=0 S=1 S=0 U=0 F=1
kfade[1].ub1spare:                    0 ; 0x0b9: 0x00
kfade[1].ub2spare:                    0 ; 0x0ba: 0x0000
kfade[2].entry.incarn:                1 ; 0x0bc: A=1 NUMM=0x0
kfade[2].entry.hash:           85588530 ; 0x0c0: 0x0519fa32
kfade[2].entry.refer.number: 4294967295 ; 0x0c4: 0xffffffff
kfade[2].entry.refer.incarn:          0 ; 0x0c8: A=0 NUMM=0x0
kfade[2].name:                    USERS ; 0x0cc: length=5
kfade[2].fnum:                      258 ; 0x0fc: 0x00000102
kfade[2].finc:                823364123 ; 0x100: 0x31138a1b
kfade[2].flags:                      18 ; 0x104: U=0 S=1 S=0 U=0 F=1
kfade[2].ub1spare:                    0 ; 0x105: 0x00
kfade[2].ub2spare:                    0 ; 0x106: 0x0000
kfade[3].entry.incarn:                1 ; 0x108: A=1 NUMM=0x0
kfade[3].entry.hash:         3427720216 ; 0x10c: 0xcc4edc18
kfade[3].entry.refer.number: 4294967295 ; 0x110: 0xffffffff
kfade[3].entry.refer.incarn:          0 ; 0x114: A=0 NUMM=0x0
kfade[3].name:                 UNDOTBS1 ; 0x118: length=8
kfade[3].fnum:                      259 ; 0x148: 0x00000103
kfade[3].finc:                823364125 ; 0x14c: 0x31138a1d
kfade[3].flags:                      18 ; 0x150: U=0 S=1 S=0 U=0 F=1
kfade[3].ub1spare:                    0 ; 0x151: 0x00
kfade[3].ub2spare:                    0 ; 0x152: 0x0000
kfade[4].entry.incarn:                0 ; 0x154: A=0 NUMM=0x0
kfade[4].entry.hash:                  0 ; 0x158: 0x00000000
kfade[4].entry.refer.number:          0 ; 0x15c: 0x00000000
kfade[4].entry.refer.incarn:          0 ; 0x160: A=0 NUMM=0x0
。。。。。。。
下面我们来看下pdb PDB$SEED的datafile信息,从前面可以看到应该是在第7个block中,如下:

[oracle@12c_single ~]$ kfed read /dev/asmvg/lvasm2 aun=24 blkn=7|more
kfbh.endian:                          1 ; 0x000: 0x01
kfbh.hard:                          130 ; 0x001: 0x82
kfbh.type:                           11 ; 0x002: KFBTYP_ALIASDIR
kfbh.datfmt:                          1 ; 0x003: 0x01
kfbh.block.blk:                       7 ; 0x004: blk=7
kfbh.block.obj:                       6 ; 0x008: file=6
kfbh.check:                  2772306899 ; 0x00c: 0xa53e0bd3
kfbh.fcn.base:                     3747 ; 0x010: 0x00000ea3
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:        4294967295 ; 0x00c: 0xffffffff
kffdnd.overfl.incarn:                 0 ; 0x010: A=0 NUMM=0x0
kffdnd.parent.number:                 6 ; 0x014: 0x00000006
kffdnd.parent.incarn:                 1 ; 0x018: A=1 NUMM=0x0
kffdnd.fstblk.number:                 7 ; 0x01c: 0x00000007
kffdnd.fstblk.incarn:                 1 ; 0x020: A=1 NUMM=0x0
kfade[0].entry.incarn:                1 ; 0x024: A=1 NUMM=0x0
kfade[0].entry.hash:         1199197943 ; 0x028: 0x477a4ef7
kfade[0].entry.refer.number: 4294967295 ; 0x02c: 0xffffffff
kfade[0].entry.refer.incarn:          0 ; 0x030: A=0 NUMM=0x0
kfade[0].name:                   SYSAUX ; 0x034: length=6
kfade[0].fnum:                      269 ; 0x064: 0x0000010d
kfade[0].finc:                823364265 ; 0x068: 0x31138aa9
kfade[0].flags:                      18 ; 0x06c: U=0 S=1 S=0 U=0 F=1
kfade[0].ub1spare:                    0 ; 0x06d: 0x00
kfade[0].ub2spare:                    0 ; 0x06e: 0x0000
kfade[1].entry.incarn:                1 ; 0x070: A=1 NUMM=0x0
kfade[1].entry.hash:           78587076 ; 0x074: 0x04af24c4
kfade[1].entry.refer.number: 4294967295 ; 0x078: 0xffffffff
kfade[1].entry.refer.incarn:          0 ; 0x07c: A=0 NUMM=0x0
kfade[1].name:                   SYSTEM ; 0x080: length=6
kfade[1].fnum:                      270 ; 0x0b0: 0x0000010e
kfade[1].finc:                823364267 ; 0x0b4: 0x31138aab
kfade[1].flags:                      18 ; 0x0b8: U=0 S=1 S=0 U=0 F=1
kfade[1].ub1spare:                    0 ; 0x0b9: 0x00
kfade[1].ub2spare:                    0 ; 0x0ba: 0x0000
kfade[2].entry.incarn:                1 ; 0x0bc: A=1 NUMM=0x0
kfade[2].entry.hash:           71941814 ; 0x0c0: 0x0449beb6
kfade[2].entry.refer.number: 4294967295 ; 0x0c4: 0xffffffff
kfade[2].entry.refer.incarn:          0 ; 0x0c8: A=0 NUMM=0x0
kfade[2].name:       pdbseed_temp01.dbf ; 0x0cc: length=18
kfade[2].fnum:                      271 ; 0x0fc: 0x0000010f
kfade[2].finc:                823364407 ; 0x100: 0x31138b37
kfade[2].flags:                      17 ; 0x104: U=1 S=0 S=0 U=0 F=1
kfade[2].ub1spare:                    0 ; 0x105: 0x00
kfade[2].ub2spare:                    0 ; 0x106: 0x0000
。。。。。
到这里,大家可以发现相比10g和11g而已,12c中,asm的file directory和alias directory没有什么不同。
既然是这样,那么我们用12c 中自带的amdu 来抽取一个datafihttp://www.oracleplus.netle试试看 ?

[oracle@12c_single ~]$ amdu -dis '/dev/asmvg/lvasm*' -nodir -norep -extract data.258 -output users01.dbf
AMDU-00204: Disk N0001 is in currently mounted diskgroup DATA
AMDU-00201: Disk N0001: '/dev/asmvg/lvasm1'

[oracle@12c_single ~]$ dbv file=users01.dbf

DBVERIFY: Release 12.1.0.1.0 - Production on Wed Aug 14 06:51:06 2013

Copyright (c) 1982, 2013, Oracle and/or its affiliates.  All rights reserved.

DBVERIFY - Verification starting : FILE = /home/oracle/users01.dbf

DBVERIFY - Verification complete

Total Pages Examined         : 640
Total Pages Processed (Data) : 15
Total Pages Failing   (Data) : 0
Total Pages Processed (Index): 3
Total Pages Failing   (Index): 0
Total Pages Processed (Other): 593
Total Pages Processed (Seg)  : 0
Total Pages Failing   (Seg)  : 0
Total Pages Empty            : 29
Total Pages Marked Corrupt   : 0
Total Pages Influx           : 0
Total Pages Encrypted        : 0
Highest block SCN            : 857474 (0.857474)
可以看到,amdu抽取的文件完好无损。

说明:本文仅仅是描述了file dir和alias dir,对于其他元数据,会在后面的文章继续进行描述。

--------------------------------------ORACLE-DBA----------------------------------------

最权威、专业的Oracle案例资源汇总之【学习笔记】Oracle 12c新版本中asm元数据与11g的变化

本文由大师惜分飞原创分享,网址:http://www.oracleplus.net/arch/1447.html

Oracle研究中心

关键词:

Oracle ASM

oracle 12c asm