查看: 1583|回复: 0

[Oracle数据库] Oracle ASM Alias Directory

发表于 2017-1-3 12:00:02

Alias Directory
别名目录的ASM文件号为6,它对磁盘组中的所有文件提供了一种层次结构的命名系统。对每个文件创建的系统文件名是基于文件类型,数据库实例与类型特定信息,比如表空间名。当文件创建时如果指定了完整路径名将会生成用户别名。Alias Directory包含所有别名元数据以及每种系统别名,系统目录,用户目录与用户别名。通过别名号进行索引。

别名目录条目包含以下信息:
.Alias name(or directory name)
.Alias incarnation number
.File number
.File incarnation number
.Parent directory
.System flag

Alias Directory在每个磁盘组中的文件号为6(F6)。Alias incarnation number,很像file incarnation number,被用来区分可能重复使用相同别名号的别名或目录。system flag被设置给系统创建的别名与目录,但不对用户创建的别名或目录进行设置。

可以通过查询v$asm_alias视图来获得ASM别名信息。

  1. SQL> select * from v$asm_alias where group_number=3 and file_number<>4294967295;
  2. NAME GROUP_NUMBER FILE_NUMBER FILE_INCARNATION ALIAS_INDEX ALIAS_INCARNATION PARENT_INDEX REFERENCE_INDEX ALIAS_DIRECTORY SYSTEM_CREATED
  3. ---------------------------------------- ------------ ----------- ---------------- ----------- ----------------- ------------ --------------- -------------------- --------------------
  4. SYSAUX.258.930413055 3 258 930413055 106 1 50331754 67108863 N Y
  5. SYSTEM.259.930413057 3 259 930413057 107 1 50331754 67108863 N Y
  6. EXAMPLE.260.930413057 3 260 930413057 108 1 50331754 67108863 N Y
  7. UNDOTBS2.261.930413057 3 261 930413057 109 1 50331754 67108863 N Y
  8. UNDOTBS1.262.930413057 3 262 930413057 110 1 50331754 67108863 N Y
  9. USERS.263.930413057 3 263 930413057 111 1 50331754 67108863 N Y
  10. FILE_TRANSFER.270.930515465 3 270 930515465 112 1 50331754 67108863 N Y
  11. test01.dbf 3 270 930515465 113 1 50331754 67108863 N N
  12. CS.271.931880499 3 271 931880499 114 5 50331754 67108863 N Y
  13. CS_STRIPE_COARSE.272.931882089 3 272 931882089 115 3 50331754 67108863 N Y
  14. NOT_IMPORTANT.273.931882831 3 273 931882831 116 1 50331754 67108863 N Y
  15. current.257.930412709 3 257 930412709 159 3 50331807 67108863 N Y
  16. group_1.264.930413221 3 264 930413221 265 1 50331913 67108863 N Y
  17. group_2.265.930413225 3 265 930413225 266 1 50331913 67108863 N Y
  18. group_3.266.930413227 3 266 930413227 267 1 50331913 67108863 N Y
  19. group_4.267.930413231 3 267 930413231 268 1 50331913 67108863 N Y
  20. TEMP.268.930413239 3 268 930413239 318 1 50331966 67108863 N Y
  21. spfilejyrac.ora 3 256 930411925 60 1 50331701 67108863 N N
  22. FILE_TRANSFER_0_0.269.930515105 3 269 930515105 583 3 50332231 67108863 N Y
  23. SPFILE.256.930411925 3 256 930411925 530 1 50332178 67108863 N Y
  24. tts.dmp 3 269 930515105 2 3 50331648 67108863 N N
  25. 21 rows selected.
复制代码

下面查询的输出将包含目录列表,接下来文件的完整路径名列表。并且假设所有文件是使用ASM文件命名规则所创建,在特定情况下,将假设在别名中(full_path列)将会存在指定的数据库名。查询中的full_path变量引用别名。DIR列指示目录,SYS列指示是否由系统创建。

  1. SQL> col full_path format a64
  2. SQL> col dir format a3
  3. SQL> col sys format a3
  4. SQL> set pagesize 1000
  5. SQL> set linesize 200
  6. SQL> select concat ('+'|| gname, sys_connect_by_path (aname,'/')) full_path, dir, sys
  7. 2 from (
  8. 3 select g.name gname,
  9. 4 a.parent_index pindex,
  10. 5 a.name aname,
  11. 6 a.reference_index rindex,
  12. 7 a.alias_directory dir,
  13. 8 a.system_created sys
  14. 9 from v$asm_alias a, v$asm_diskgroup g
  15. 10 where a.group_number = g.group_number and a.group_number=3)
  16. 11 start with (mod(pindex, power(2, 24))) = 0
  17. 12 connect by prior rindex = pindex
  18. 13 order by dir desc, full_path asc;
  19. FULL_PATH DIR SYS
  20. ---------------------------------------------------------------- --- ---
  21. +DATADG/DB_UNKNOWN Y Y
  22. +DATADG/DB_UNKNOWN/PARAMETERFILE Y Y
  23. +DATADG/JYRAC Y N
  24. +DATADG/JYRAC/CONTROLFILE Y N
  25. +DATADG/JYRAC/DATAFILE Y N
  26. +DATADG/JYRAC/DUMPSET Y Y
  27. +DATADG/JYRAC/ONLINELOG Y N
  28. +DATADG/JYRAC/PARAMETERFILE Y N
  29. +DATADG/JYRAC/TEMPFILE Y N
  30. +DATADG/JYRAC/oradata Y N
  31. +DATADG/JYRAC/temp_files Y N
  32. +DATADG/DB_UNKNOWN/PARAMETERFILE/SPFILE.256.930411925 N Y
  33. +DATADG/JYRAC/CONTROLFILE/current.257.930412709 N Y
  34. +DATADG/JYRAC/DATAFILE/CS.271.931880499 N Y
  35. +DATADG/JYRAC/DATAFILE/CS_STRIPE_COARSE.272.931882089 N Y
  36. +DATADG/JYRAC/DATAFILE/EXAMPLE.260.930413057 N Y
  37. +DATADG/JYRAC/DATAFILE/FILE_TRANSFER.270.930515465 N Y
  38. +DATADG/JYRAC/DATAFILE/NOT_IMPORTANT.273.931882831 N Y
  39. +DATADG/JYRAC/DATAFILE/SYSAUX.258.930413055 N Y
  40. +DATADG/JYRAC/DATAFILE/SYSTEM.259.930413057 N Y
  41. +DATADG/JYRAC/DATAFILE/UNDOTBS1.262.930413057 N Y
  42. +DATADG/JYRAC/DATAFILE/UNDOTBS2.261.930413057 N Y
  43. +DATADG/JYRAC/DATAFILE/USERS.263.930413057 N Y
  44. +DATADG/JYRAC/DATAFILE/test01.dbf N N
  45. +DATADG/JYRAC/DUMPSET/FILE_TRANSFER_0_0.269.930515105 N Y
  46. +DATADG/JYRAC/ONLINELOG/group_1.264.930413221 N Y
  47. +DATADG/JYRAC/ONLINELOG/group_2.265.930413225 N Y
  48. +DATADG/JYRAC/ONLINELOG/group_3.266.930413227 N Y
  49. +DATADG/JYRAC/ONLINELOG/group_4.267.930413231 N Y
  50. +DATADG/JYRAC/TEMPFILE/TEMP.268.930413239 N Y
  51. +DATADG/JYRAC/spfilejyrac.ora N N
  52. +DATADG/tts.dmp N N
  53. 32 rows selected.
复制代码

别名目录内容其实很重要,因为如果说你需要从asm中抽取数据文件,你起码要知道数据库里面的文件名信息吧?知道了以后,你使用amdu来进行数据文件的抽取,将事半功倍。那么asm alias元数据到底在什么地方呢,如下我们来查询磁盘组3的别名AU分布情况。

  1. SQL> select group_number,name,type from v$asm_diskgroup;
  2. GROUP_NUMBER NAME TYPE
  3. ------------ ---------------------------------------- ------------
  4. 1 ARCHDG NORMAL
  5. 2 CRSDG EXTERN
  6. 3 DATADG NORMAL
  7. 4 TESTDG NORMAL
  8. SQL> select group_number, disk_number, state, name,failgroup,path from v$asm_disk where group_number=3;
  9. GROUP_NUMBER DISK_NUMBER STATE NAME FAILGROUP PATH
  10. ------------ ----------- ------------------------------ ---------------------------------------- ------------------------------ ------------------------------
  11. 3 0 NORMAL DATADG_0001 DATADG_0001 /dev/raw/raw11
  12. 3 3 NORMAL DATADG_0000 DATADG_0000 /dev/raw/raw10
  13. 3 1 NORMAL DATADG_0003 DATADG_0003 /dev/raw/raw4
  14. 3 2 NORMAL DATADG_0002 DATADG_0002 /dev/raw/raw3
  15. SQL> select number_kffxp file#, disk_kffxp disk#, count(disk_kffxp) extents
  16. 2 from x$kffxp
  17. 3 where group_kffxp=3
  18. 4 and disk_kffxp <> 65534
  19. 5 and number_kffxp=6
  20. 6 group by number_kffxp, disk_kffxp
  21. 7 order by 1;
  22. FILE# DISK# EXTENTS
  23. ---------- ---------- ----------
  24. 6 1 1
  25. 6 2 1
  26. 6 3 1
复制代码

上面的查询显示别名目录分布在1,2,3号磁盘中,因为磁盘组DATADG是normal冗余,并且故障磁盘组有4个,所以别名目录有3份镜像,下面的查询将会返回别名目录分别存储在1,2,3号磁盘(/dev/raw/raw4,/dev/raw/raw3,/dev/raw/raw10)中的36,38,37号AU中。

  1. SQL> select x.xnum_kffxp "virtual extent",pxn_kffxp "physical extent",x.au_kffxp "au",x.disk_kffxp "disk #",d.name "disk name"
  2. 2 from x$kffxp x, v$asm_disk_stat d
  3. 3 where x.group_kffxp=d.group_number
  4. 4 and x.disk_kffxp=d.disk_number
  5. 5 and x.group_kffxp=3
  6. 6 and x.number_kffxp=6
  7. 7 order by 1,2,3;
  8. virtual extent physical extent au disk # disk name
  9. -------------- --------------- ---------- ---------- ------------------------------------------------------------
  10. 0 0 38 2 DATADG_0002
  11. 0 1 37 3 DATADG_0000
  12. 0 2 36 1 DATADG_0003
复制代码

通过kfed工具来查询别名目录的分布情况
由于1号文件总是开始在0号磁盘2号AU,记住这个位置:0号盘2号AU。这是ASM中定位文件的起点,它的作用,有点相当于磁盘上的引导区,在电脑开机后负责将OS启动起来。1号文件在最少情况下,至少有两个AU。在1号文件中,每个文件占用一个元数据块,存放自身的空间分布信息。每个元数据块大小是4K,一个AU是1M,哪么,每个AU中,可以存储256个文件的空间分布信息。这其中,0号盘2号AU中,全是元文件的信息。再具体一点,0号盘2号AU,第一个元数据块被系统占用,从第二个块开始,到255为止,共255个元数据块,对应索引号1至255的文件。其实,也就是全部的元文件了。也就是说0号盘2号AU,保存了全部元文件的空间分布信息。1号文件的第二个AU,从第一个块开始,保存256号文件。第二个块对应257号文件,等等。每次从ASM中读数据时,Oracle都要先读到1号文件,从中找出要读的目标文件在磁盘上的分布位置,然后再去读取相应的文件的数据。由于别名目录是6号文件,所以要读取0号磁盘(/dev/raw/raw11)的2号AU的6号块

  1. [grid@jyrac1 ~]$ kfed read /dev/raw/raw11 aun=2 blkn=6 | more
  2. kfbh.endian: 1 ; 0x000: 0x01
  3. kfbh.hard: 130 ; 0x001: 0x82
  4. kfbh.type: 4 ; 0x002: KFBTYP_FILEDIR
  5. kfbh.datfmt: 1 ; 0x003: 0x01
  6. kfbh.block.blk: 6 ; 0x004: blk=6
  7. kfbh.block.obj: 1 ; 0x008: file=1
  8. kfbh.check: 893084381 ; 0x00c: 0x353b62dd
  9. kfbh.fcn.base: 0 ; 0x010: 0x00000000
  10. kfbh.fcn.wrap: 0 ; 0x014: 0x00000000
  11. kfbh.spare1: 0 ; 0x018: 0x00000000
  12. kfbh.spare2: 0 ; 0x01c: 0x00000000
  13. kfffdb.node.incarn: 1 ; 0x000: A=1 NUMM=0x0
  14. kfffdb.node.frlist.number: 4294967295 ; 0x004: 0xffffffff
  15. kfffdb.node.frlist.incarn: 0 ; 0x008: A=0 NUMM=0x0
  16. kfffdb.hibytes: 0 ; 0x00c: 0x00000000
  17. kfffdb.lobytes: 1048576 ; 0x010: 0x00100000
  18. kfffdb.xtntcnt: 3 ; 0x014: 0x00000003
  19. kfffdb.xtnteof: 3 ; 0x018: 0x00000003
  20. kfffdb.blkSize: 4096 ; 0x01c: 0x00001000
  21. kfffdb.flags: 1 ; 0x020: O=1 S=0 S=0 D=0 C=0 I=0 R=0 A=0
  22. kfffdb.fileType: 15 ; 0x021: 0x0f
  23. kfffdb.dXrs: 19 ; 0x022: SCHE=0x1 NUMB=0x3
  24. kfffdb.iXrs: 19 ; 0x023: SCHE=0x1 NUMB=0x3
  25. kfffdb.dXsiz[0]: 4294967295 ; 0x024: 0xffffffff
  26. kfffdb.dXsiz[1]: 0 ; 0x028: 0x00000000
  27. kfffdb.dXsiz[2]: 0 ; 0x02c: 0x00000000
  28. kfffdb.iXsiz[0]: 4294967295 ; 0x030: 0xffffffff
  29. kfffdb.iXsiz[1]: 0 ; 0x034: 0x00000000
  30. kfffdb.iXsiz[2]: 0 ; 0x038: 0x00000000
  31. kfffdb.xtntblk: 3 ; 0x03c: 0x0003
  32. kfffdb.break: 60 ; 0x03e: 0x003c
  33. kfffdb.priZn: 0 ; 0x040: KFDZN_COLD
  34. kfffdb.secZn: 0 ; 0x041: KFDZN_COLD
  35. kfffdb.ub2spare: 0 ; 0x042: 0x0000
  36. kfffdb.alias[0]: 4294967295 ; 0x044: 0xffffffff
  37. kfffdb.alias[1]: 4294967295 ; 0x048: 0xffffffff
  38. kfffdb.strpwdth: 0 ; 0x04c: 0x00
  39. kfffdb.strpsz: 0 ; 0x04d: 0x00
  40. kfffdb.usmsz: 0 ; 0x04e: 0x0000
  41. kfffdb.crets.hi: 33042831 ; 0x050: HOUR=0xf DAYS=0xc MNTH=0xc YEAR=0x7e0
  42. kfffdb.crets.lo: 2457465856 ; 0x054: USEC=0x0 MSEC=0x27d SECS=0x27 MINS=0x24
  43. kfffdb.modts.hi: 33042831 ; 0x058: HOUR=0xf DAYS=0xc MNTH=0xc YEAR=0x7e0
  44. kfffdb.modts.lo: 2457465856 ; 0x05c: USEC=0x0 MSEC=0x27d SECS=0x27 MINS=0x24
  45. kfffdb.dasz[0]: 0 ; 0x060: 0x00
  46. kfffdb.dasz[1]: 0 ; 0x061: 0x00
  47. kfffdb.dasz[2]: 0 ; 0x062: 0x00
  48. kfffdb.dasz[3]: 0 ; 0x063: 0x00
  49. kfffdb.permissn: 0 ; 0x064: 0x00
  50. kfffdb.ub1spar1: 0 ; 0x065: 0x00
  51. kfffdb.ub2spar2: 0 ; 0x066: 0x0000
  52. kfffdb.user.entnum: 0 ; 0x068: 0x0000
  53. kfffdb.user.entinc: 0 ; 0x06a: 0x0000
  54. kfffdb.group.entnum: 0 ; 0x06c: 0x0000
  55. kfffdb.group.entinc: 0 ; 0x06e: 0x0000
  56. kfffdb.spare[0]: 0 ; 0x070: 0x00000000
  57. kfffdb.spare[1]: 0 ; 0x074: 0x00000000
  58. kfffdb.spare[2]: 0 ; 0x078: 0x00000000
  59. kfffdb.spare[3]: 0 ; 0x07c: 0x00000000
  60. kfffdb.spare[4]: 0 ; 0x080: 0x00000000
  61. kfffdb.spare[5]: 0 ; 0x084: 0x00000000
  62. kfffdb.spare[6]: 0 ; 0x088: 0x00000000
  63. kfffdb.spare[7]: 0 ; 0x08c: 0x00000000
  64. kfffdb.spare[8]: 0 ; 0x090: 0x00000000
  65. kfffdb.spare[9]: 0 ; 0x094: 0x00000000
  66. kfffdb.spare[10]: 0 ; 0x098: 0x00000000
  67. kfffdb.spare[11]: 0 ; 0x09c: 0x00000000
  68. kfffdb.usm: ; 0x0a0: length=0
  69. kfffde[0].xptr.au: 38 ; 0x4a0: 0x00000026
  70. kfffde[0].xptr.disk: 2 ; 0x4a4: 0x0002
  71. kfffde[0].xptr.flags: 0 ; 0x4a6: L=0 E=0 D=0 S=0
  72. kfffde[0].xptr.chk: 14 ; 0x4a7: 0x0e
  73. kfffde[1].xptr.au: 37 ; 0x4a8: 0x00000025
  74. kfffde[1].xptr.disk: 3 ; 0x4ac: 0x0003
  75. kfffde[1].xptr.flags: 0 ; 0x4ae: L=0 E=0 D=0 S=0
  76. kfffde[1].xptr.chk: 12 ; 0x4af: 0x0c
  77. kfffde[2].xptr.au: 36 ; 0x4b0: 0x00000024
  78. kfffde[2].xptr.disk: 1 ; 0x4b4: 0x0001
  79. kfffde[2].xptr.flags: 0 ; 0x4b6: L=0 E=0 D=0 S=0
  80. kfffde[2].xptr.chk: 15 ; 0x4b7: 0x0f
  81. kfffde[3].xptr.au: 4294967295 ; 0x4b8: 0xffffffff
  82. kfffde[3].xptr.disk: 65535 ; 0x4bc: 0xffff
  83. kfffde[3].xptr.flags: 0 ; 0x4be: L=0 E=0 D=0 S=0
复制代码

从kfffde[0].xptr.au=38,kfffde[0].xptr.disk=2,kfffde[1].xptr.au=37,kfffde[1].xptr.disk=3,kfffde[2].xptr.au=36,kfffde[2].xptr.disk=1,可知别名目录存储在1,2,3号磁盘(/dev/raw/raw4,/dev/raw/raw3,/dev/raw/raw10)中的36,38,37号AU中,而且这三个AU存储的内容相同,与之前用查询语句所获得的分布情况完全一致。

下面使用kfed工具来读取别名目录的元数据

  1. [grid@jyrac1 ~]$ kfed read /dev/raw/raw4 aun=36 blkn=0 | more
  2. kfbh.endian: 1 ; 0x000: 0x01
  3. kfbh.hard: 130 ; 0x001: 0x82
  4. kfbh.type: 11 ; 0x002: KFBTYP_ALIASDIR
  5. kfbh.datfmt: 1 ; 0x003: 0x01
  6. kfbh.block.blk: 0 ; 0x004: blk=0
  7. kfbh.block.obj: 6 ; 0x008: file=6
  8. kfbh.check: 2235498606 ; 0x00c: 0x853f006e
  9. kfbh.fcn.base: 3565 ; 0x010: 0x00000ded
  10. kfbh.fcn.wrap: 0 ; 0x014: 0x00000000
  11. kfbh.spare1: 0 ; 0x018: 0x00000000
  12. kfbh.spare2: 0 ; 0x01c: 0x00000000
  13. kffdnd.bnode.incarn: 1 ; 0x000: A=1 NUMM=0x0
  14. kffdnd.bnode.frlist.number: 4294967295 ; 0x004: 0xffffffff
  15. kffdnd.bnode.frlist.incarn: 0 ; 0x008: A=0 NUMM=0x0
  16. kffdnd.overfl.number: 4294967295 ; 0x00c: 0xffffffff
  17. kffdnd.overfl.incarn: 0 ; 0x010: A=0 NUMM=0x0
  18. kffdnd.parent.number: 0 ; 0x014: 0x00000000
  19. kffdnd.parent.incarn: 1 ; 0x018: A=1 NUMM=0x0
  20. kffdnd.fstblk.number: 0 ; 0x01c: 0x00000000
  21. kffdnd.fstblk.incarn: 1 ; 0x020: A=1 NUMM=0x0
  22. kfade[0].entry.incarn: 1 ; 0x024: A=1 NUMM=0x0
  23. kfade[0].entry.hash: 2990280982 ; 0x028: 0xb23c1116
  24. kfade[0].entry.refer.number: 1 ; 0x02c: 0x00000001 --指向下一层的block号
  25. kfade[0].entry.refer.incarn: 1 ; 0x030: A=1 NUMM=0x0 --entry部分内容,表示分支号,hash值和指向下一层block的指针等信息,这部分不需要过多关注
  26. kfade[0].name: JYRAC ; 0x034: length=5 --表示对应的alias元数据名称
  27. kfade[0].fnum: 4294967295 ; 0x064: 0xffffffff --对应文件号,这里为最大值,表示无意义
  28. kfade[0].finc: 4294967295 ; 0x068: 0xffffffff --文件分支号
  29. kfade[0].flags: 8 ; 0x06c: U=0 S=0 S=0 U=1 F=0 --标志信息
  30. --标志信息有以下内容
  31. O - File is original, not snapshot
  32. S - File is striped
  33. S - Strict allocation policy
  34. D - File is damaged
  35. C - File creation is committed
  36. I - File has empty indirect block
  37. R - File has known at-risk value
  38. A - The at-risk value itsefl
  39. kfade[0].ub1spare: 0 ; 0x06d: 0x00
  40. kfade[0].ub2spare: 0 ; 0x06e: 0x0000
  41. kfade[1].entry.incarn: 1 ; 0x070: A=1 NUMM=0x0
  42. kfade[1].entry.hash: 3585957073 ; 0x074: 0xd5bd5cd1
  43. kfade[1].entry.refer.number: 9 ; 0x078: 0x00000009
  44. kfade[1].entry.refer.incarn: 1 ; 0x07c: A=1 NUMM=0x0
  45. kfade[1].name: DB_UNKNOWN ; 0x080: length=10
  46. kfade[1].fnum: 4294967295 ; 0x0b0: 0xffffffff
  47. kfade[1].finc: 4294967295 ; 0x0b4: 0xffffffff
  48. kfade[1].flags: 4 ; 0x0b8: U=0 S=0 S=1 U=0 F=0
  49. kfade[1].ub1spare: 0 ; 0x0b9: 0x00
  50. kfade[1].ub2spare: 0 ; 0x0ba: 0x0000
  51. kfade[2].entry.incarn: 3 ; 0x0bc: A=1 NUMM=0x1
  52. kfade[2].entry.hash: 1585230659 ; 0x0c0: 0x5e7cb343
  53. kfade[2].entry.refer.number: 4294967295 ; 0x0c4: 0xffffffff
  54. kfade[2].entry.refer.incarn: 0 ; 0x0c8: A=0 NUMM=0x0
  55. kfade[2].name: tts.dmp ; 0x0cc: length=7
  56. kfade[2].fnum: 269 ; 0x0fc: 0x0000010d
  57. kfade[2].finc: 930515105 ; 0x100: 0x377688a1
  58. kfade[2].flags: 17 ; 0x104: U=1 S=0 S=0 U=0 F=1
  59. kfade[2].ub1spare: 0 ; 0x105: 0x00
  60. kfade[2].ub2spare: 0 ; 0x106: 0x0000
复制代码

从kfade[0].entry.refer.number=1,说明我们需要读取1号块来查看其它文件的别名目录

  1. [grid@jyrac1 ~]$ kfed read /dev/raw/raw4 aun=36 blkn=1 | more
  2. kfbh.endian: 1 ; 0x000: 0x01
  3. kfbh.hard: 130 ; 0x001: 0x82
  4. kfbh.type: 11 ; 0x002: KFBTYP_ALIASDIR
  5. kfbh.datfmt: 1 ; 0x003: 0x01
  6. kfbh.block.blk: 1 ; 0x004: blk=1
  7. kfbh.block.obj: 6 ; 0x008: file=6
  8. kfbh.check: 3120935190 ; 0x00c: 0xba05b116
  9. kfbh.fcn.base: 3558 ; 0x010: 0x00000de6
  10. kfbh.fcn.wrap: 0 ; 0x014: 0x00000000
  11. kfbh.spare1: 0 ; 0x018: 0x00000000
  12. kfbh.spare2: 0 ; 0x01c: 0x00000000
  13. kffdnd.bnode.incarn: 1 ; 0x000: A=1 NUMM=0x0
  14. kffdnd.bnode.frlist.number: 4294967295 ; 0x004: 0xffffffff
  15. kffdnd.bnode.frlist.incarn: 0 ; 0x008: A=0 NUMM=0x0
  16. kffdnd.overfl.number: 4294967295 ; 0x00c: 0xffffffff
  17. kffdnd.overfl.incarn: 0 ; 0x010: A=0 NUMM=0x0
  18. kffdnd.parent.number: 0 ; 0x014: 0x00000000
  19. kffdnd.parent.incarn: 1 ; 0x018: A=1 NUMM=0x0
  20. kffdnd.fstblk.number: 1 ; 0x01c: 0x00000001
  21. kffdnd.fstblk.incarn: 1 ; 0x020: A=1 NUMM=0x0
  22. kfade[0].entry.incarn: 1 ; 0x024: A=1 NUMM=0x0
  23. kfade[0].entry.hash: 710518681 ; 0x028: 0x2a59a799
  24. kfade[0].entry.refer.number: 2 ; 0x02c: 0x00000002 --指向下一层的block号
  25. kfade[0].entry.refer.incarn: 1 ; 0x030: A=1 NUMM=0x0
  26. kfade[0].name: DATAFILE ; 0x034: length=8 --表示对应的alias元数据名称,datafile指数据文件
  27. kfade[0].fnum: 4294967295 ; 0x064: 0xffffffff
  28. kfade[0].finc: 4294967295 ; 0x068: 0xffffffff
  29. kfade[0].flags: 8 ; 0x06c: U=0 S=0 S=0 U=1 F=0
  30. kfade[0].ub1spare: 0 ; 0x06d: 0x00
  31. kfade[0].ub2spare: 0 ; 0x06e: 0x0000
  32. kfade[1].entry.incarn: 1 ; 0x070: A=1 NUMM=0x0
  33. kfade[1].entry.hash: 4053320104 ; 0x074: 0xf198c1a8
  34. kfade[1].entry.refer.number: 3 ; 0x078: 0x00000003 --指向下一层的block号
  35. kfade[1].entry.refer.incarn: 1 ; 0x07c: A=1 NUMM=0x0
  36. kfade[1].name: CONTROLFILE ; 0x080: length=11 --表示对应的alias元数据名称,controlfile指控制文件
  37. kfade[1].fnum: 4294967295 ; 0x0b0: 0xffffffff
  38. kfade[1].finc: 4294967295 ; 0x0b4: 0xffffffff
  39. kfade[1].flags: 8 ; 0x0b8: U=0 S=0 S=0 U=1 F=0
  40. kfade[1].ub1spare: 0 ; 0x0b9: 0x00
  41. kfade[1].ub2spare: 0 ; 0x0ba: 0x0000
  42. kfade[2].entry.incarn: 1 ; 0x0bc: A=1 NUMM=0x0
  43. kfade[2].entry.hash: 873035404 ; 0x0c0: 0x3409768c
  44. kfade[2].entry.refer.number: 4 ; 0x0c4: 0x00000004
  45. kfade[2].entry.refer.incarn: 1 ; 0x0c8: A=1 NUMM=0x0
  46. kfade[2].name: temp_files ; 0x0cc: length=10 ---表示对应的alias元数据名称,temp_files指临时文件
  47. kfade[2].fnum: 4294967295 ; 0x0fc: 0xffffffff
  48. kfade[2].finc: 4294967295 ; 0x100: 0xffffffff
  49. kfade[2].flags: 8 ; 0x104: U=0 S=0 S=0 U=1 F=0
  50. kfade[2].ub1spare: 0 ; 0x105: 0x00
  51. kfade[2].ub2spare: 0 ; 0x106: 0x0000
  52. kfade[3].entry.incarn: 1 ; 0x108: A=1 NUMM=0x0
  53. kfade[3].entry.hash: 2803485489 ; 0x10c: 0xa719cb31
  54. kfade[3].entry.refer.number: 5 ; 0x110: 0x00000005
  55. kfade[3].entry.refer.incarn: 1 ; 0x114: A=1 NUMM=0x0
  56. kfade[3].name: ONLINELOG ; 0x118: length=9 --表示对应的alias元数据名称,onlinelog指联机重做日志
  57. kfade[3].fnum: 4294967295 ; 0x148: 0xffffffff
  58. kfade[3].finc: 4294967295 ; 0x14c: 0xffffffff
  59. kfade[3].flags: 8 ; 0x150: U=0 S=0 S=0 U=1 F=0
  60. kfade[3].ub1spare: 0 ; 0x151: 0x00
  61. kfade[3].ub2spare: 0 ; 0x152: 0x0000
  62. kfade[4].entry.incarn: 1 ; 0x154: A=1 NUMM=0x0
  63. kfade[4].entry.hash: 2905271101 ; 0x158: 0xad2aeb3d
  64. kfade[4].entry.refer.number: 6 ; 0x15c: 0x00000006
  65. kfade[4].entry.refer.incarn: 1 ; 0x160: A=1 NUMM=0x0
  66. kfade[4].name: TEMPFILE ; 0x164: length=8 --表示对应的alias元数据名称,tempfile指临时文件
  67. kfade[4].fnum: 4294967295 ; 0x194: 0xffffffff
  68. kfade[4].finc: 4294967295 ; 0x198: 0xffffffff
  69. kfade[4].flags: 8 ; 0x19c: U=0 S=0 S=0 U=1 F=0
  70. kfade[4].ub1spare: 0 ; 0x19d: 0x00
  71. kfade[4].ub2spare: 0 ; 0x19e: 0x0000
  72. kfade[5].entry.incarn: 1 ; 0x1a0: A=1 NUMM=0x0
  73. kfade[5].entry.hash: 3261836913 ; 0x1a4: 0xc26bae71
  74. kfade[5].entry.refer.number: 7 ; 0x1a8: 0x00000007
  75. kfade[5].entry.refer.incarn: 1 ; 0x1ac: A=1 NUMM=0x0
  76. kfade[5].name: PARAMETERFILE ; 0x1b0: length=13 --表示对应的alias元数据名称,PARAMETERFILE指参数文件
  77. kfade[5].fnum: 4294967295 ; 0x1e0: 0xffffffff
  78. kfade[5].finc: 4294967295 ; 0x1e4: 0xffffffff
  79. kfade[5].flags: 8 ; 0x1e8: U=0 S=0 S=0 U=1 F=0
  80. kfade[5].ub1spare: 0 ; 0x1e9: 0x00
  81. kfade[5].ub2spare: 0 ; 0x1ea: 0x0000
  82. kfade[6].entry.incarn: 1 ; 0x1ec: A=1 NUMM=0x0
  83. kfade[6].entry.hash: 1858399388 ; 0x1f0: 0x6ec4ec9c
  84. kfade[6].entry.refer.number: 8 ; 0x1f4: 0x00000008
  85. kfade[6].entry.refer.incarn: 1 ; 0x1f8: A=1 NUMM=0x0
  86. kfade[6].name: oradata ; 0x1fc: length=7
  87. kfade[6].fnum: 4294967295 ; 0x22c: 0xffffffff
  88. kfade[6].finc: 4294967295 ; 0x230: 0xffffffff
  89. kfade[6].flags: 8 ; 0x234: U=0 S=0 S=0 U=1 F=0
  90. kfade[6].ub1spare: 0 ; 0x235: 0x00
  91. kfade[6].ub2spare: 0 ; 0x236: 0x0000
  92. kfade[7].entry.incarn: 1 ; 0x238: A=1 NUMM=0x0
  93. kfade[7].entry.hash: 4097001356 ; 0x23c: 0xf433478c
  94. kfade[7].entry.refer.number: 4294967295 ; 0x240: 0xffffffff
  95. kfade[7].entry.refer.incarn: 0 ; 0x244: A=0 NUMM=0x0
  96. kfade[7].name: spfilejyrac.ora ; 0x248: length=15
  97. kfade[7].fnum: 256 ; 0x278: 0x00000100
  98. kfade[7].finc: 930411925 ; 0x27c: 0x3774f595
  99. kfade[7].flags: 17 ; 0x280: U=1 S=0 S=0 U=0 F=1
  100. kfade[7].ub1spare: 0 ; 0x281: 0x00
  101. kfade[7].ub2spare: 0 ; 0x282: 0x0000
  102. kfade[8].entry.incarn: 1 ; 0x284: A=1 NUMM=0x0
  103. kfade[8].entry.hash: 2514510081 ; 0x288: 0x95e06101
  104. kfade[8].entry.refer.number: 11 ; 0x28c: 0x0000000b
  105. kfade[8].entry.refer.incarn: 3 ; 0x290: A=1 NUMM=0x1
  106. kfade[8].name: DUMPSET ; 0x294: length=7
  107. kfade[8].fnum: 4294967295 ; 0x2c4: 0xffffffff
  108. kfade[8].finc: 4294967295 ; 0x2c8: 0xffffffff
  109. kfade[8].flags: 4 ; 0x2cc: U=0 S=0 S=1 U=0 F=0
  110. kfade[8].ub1spare: 0 ; 0x2cd: 0x00
  111. kfade[8].ub2spare: 0 ; 0x2ce: 0x0000
复制代码

如果要查看数据文件别名目录,根据kfade[0].entry.refer.number=2与kfade[0].name=DATAFILE,可知在2号块

  1. [grid@jyrac1 ~]$ kfed read /dev/raw/raw4 aun=36 blkn=2 | more
  2. kfbh.endian: 1 ; 0x000: 0x01
  3. kfbh.hard: 130 ; 0x001: 0x82
  4. kfbh.type: 11 ; 0x002: KFBTYP_ALIASDIR
  5. kfbh.datfmt: 1 ; 0x003: 0x01
  6. kfbh.block.blk: 2 ; 0x004: blk=2
  7. kfbh.block.obj: 6 ; 0x008: file=6
  8. kfbh.check: 2753078160 ; 0x00c: 0xa418a390
  9. kfbh.fcn.base: 6551 ; 0x010: 0x00001997
  10. kfbh.fcn.wrap: 0 ; 0x014: 0x00000000
  11. kfbh.spare1: 0 ; 0x018: 0x00000000
  12. kfbh.spare2: 0 ; 0x01c: 0x00000000
  13. kffdnd.bnode.incarn: 1 ; 0x000: A=1 NUMM=0x0
  14. kffdnd.bnode.frlist.number: 4294967295 ; 0x004: 0xffffffff
  15. kffdnd.bnode.frlist.incarn: 0 ; 0x008: A=0 NUMM=0x0
  16. kffdnd.overfl.number: 4294967295 ; 0x00c: 0xffffffff
  17. kffdnd.overfl.incarn: 0 ; 0x010: A=0 NUMM=0x0
  18. kffdnd.parent.number: 1 ; 0x014: 0x00000001
  19. kffdnd.parent.incarn: 1 ; 0x018: A=1 NUMM=0x0
  20. kffdnd.fstblk.number: 2 ; 0x01c: 0x00000002
  21. kffdnd.fstblk.incarn: 1 ; 0x020: A=1 NUMM=0x0
  22. kfade[0].entry.incarn: 1 ; 0x024: A=1 NUMM=0x0
  23. kfade[0].entry.hash: 3486922491 ; 0x028: 0xcfd636fb
  24. kfade[0].entry.refer.number: 4294967295 ; 0x02c: 0xffffffff
  25. kfade[0].entry.refer.incarn: 0 ; 0x030: A=0 NUMM=0x0
  26. kfade[0].name: SYSAUX ; 0x034: length=6
  27. kfade[0].fnum: 258 ; 0x064: 0x00000102
  28. kfade[0].finc: 930413055 ; 0x068: 0x3774f9ff
  29. kfade[0].flags: 18 ; 0x06c: U=0 S=1 S=0 U=0 F=1
  30. kfade[0].ub1spare: 0 ; 0x06d: 0x00
  31. kfade[0].ub2spare: 0 ; 0x06e: 0x0000
  32. kfade[1].entry.incarn: 1 ; 0x070: A=1 NUMM=0x0
  33. kfade[1].entry.hash: 564369944 ; 0x074: 0x21a39a18
  34. kfade[1].entry.refer.number: 4294967295 ; 0x078: 0xffffffff
  35. kfade[1].entry.refer.incarn: 0 ; 0x07c: A=0 NUMM=0x0
  36. kfade[1].name: SYSTEM ; 0x080: length=6
  37. kfade[1].fnum: 259 ; 0x0b0: 0x00000103
  38. kfade[1].finc: 930413057 ; 0x0b4: 0x3774fa01
  39. kfade[1].flags: 18 ; 0x0b8: U=0 S=1 S=0 U=0 F=1
  40. kfade[1].ub1spare: 0 ; 0x0b9: 0x00
  41. kfade[1].ub2spare: 0 ; 0x0ba: 0x0000
  42. kfade[2].entry.incarn: 1 ; 0x0bc: A=1 NUMM=0x0
  43. kfade[2].entry.hash: 75817004 ; 0x0c0: 0x0484e02c
  44. kfade[2].entry.refer.number: 4294967295 ; 0x0c4: 0xffffffff
  45. kfade[2].entry.refer.incarn: 0 ; 0x0c8: A=0 NUMM=0x0
  46. kfade[2].name: EXAMPLE ; 0x0cc: length=7
  47. kfade[2].fnum: 260 ; 0x0fc: 0x00000104
  48. kfade[2].finc: 930413057 ; 0x100: 0x3774fa01
  49. kfade[2].flags: 18 ; 0x104: U=0 S=1 S=0 U=0 F=1
  50. kfade[2].ub1spare: 0 ; 0x105: 0x00
  51. kfade[2].ub2spare: 0 ; 0x106: 0x0000
  52. kfade[3].entry.incarn: 1 ; 0x108: A=1 NUMM=0x0
  53. kfade[3].entry.hash: 3945580605 ; 0x10c: 0xeb2cc83d
  54. kfade[3].entry.refer.number: 4294967295 ; 0x110: 0xffffffff
  55. kfade[3].entry.refer.incarn: 0 ; 0x114: A=0 NUMM=0x0
  56. kfade[3].name: UNDOTBS2 ; 0x118: length=8
  57. kfade[3].fnum: 261 ; 0x148: 0x00000105
  58. kfade[3].finc: 930413057 ; 0x14c: 0x3774fa01
  59. kfade[3].flags: 18 ; 0x150: U=0 S=1 S=0 U=0 F=1
  60. kfade[3].ub1spare: 0 ; 0x151: 0x00
  61. kfade[3].ub2spare: 0 ; 0x152: 0x0000
  62. kfade[4].entry.incarn: 1 ; 0x154: A=1 NUMM=0x0
  63. kfade[4].entry.hash: 1431819651 ; 0x158: 0x5557d583
  64. kfade[4].entry.refer.number: 4294967295 ; 0x15c: 0xffffffff
  65. kfade[4].entry.refer.incarn: 0 ; 0x160: A=0 NUMM=0x0
  66. kfade[4].name: UNDOTBS1 ; 0x164: length=8
  67. kfade[4].fnum: 262 ; 0x194: 0x00000106
  68. kfade[4].finc: 930413057 ; 0x198: 0x3774fa01
  69. kfade[4].flags: 18 ; 0x19c: U=0 S=1 S=0 U=0 F=1
  70. kfade[4].ub1spare: 0 ; 0x19d: 0x00
  71. kfade[4].ub2spare: 0 ; 0x19e: 0x0000
  72. kfade[5].entry.incarn: 1 ; 0x1a0: A=1 NUMM=0x0
  73. kfade[5].entry.hash: 3705183464 ; 0x1a4: 0xdcd89ce8
  74. kfade[5].entry.refer.number: 4294967295 ; 0x1a8: 0xffffffff
  75. kfade[5].entry.refer.incarn: 0 ; 0x1ac: A=0 NUMM=0x0
  76. kfade[5].name: USERS ; 0x1b0: length=5
  77. kfade[5].fnum: 263 ; 0x1e0: 0x00000107
  78. kfade[5].finc: 930413057 ; 0x1e4: 0x3774fa01
  79. kfade[5].flags: 18 ; 0x1e8: U=0 S=1 S=0 U=0 F=1
  80. kfade[5].ub1spare: 0 ; 0x1e9: 0x00
  81. kfade[5].ub2spare: 0 ; 0x1ea: 0x0000
  82. kfade[6].entry.incarn: 1 ; 0x1ec: A=1 NUMM=0x0
  83. kfade[6].entry.hash: 1752863906 ; 0x1f0: 0x687a94a2
  84. kfade[6].entry.refer.number: 4294967295 ; 0x1f4: 0xffffffff
  85. kfade[6].entry.refer.incarn: 0 ; 0x1f8: A=0 NUMM=0x0
  86. kfade[6].name: FILE_TRANSFER ; 0x1fc: length=13
  87. kfade[6].fnum: 270 ; 0x22c: 0x0000010e
  88. kfade[6].finc: 930515465 ; 0x230: 0x37768a09
  89. kfade[6].flags: 18 ; 0x234: U=0 S=1 S=0 U=0 F=1
  90. kfade[6].ub1spare: 0 ; 0x235: 0x00
  91. kfade[6].ub2spare: 0 ; 0x236: 0x0000
  92. kfade[7].entry.incarn: 1 ; 0x238: A=1 NUMM=0x0
  93. kfade[7].entry.hash: 2844469351 ; 0x23c: 0xa98b2867
  94. kfade[7].entry.refer.number: 4294967295 ; 0x240: 0xffffffff
  95. kfade[7].entry.refer.incarn: 0 ; 0x244: A=0 NUMM=0x0
  96. kfade[7].name: test01.dbf ; 0x248: length=10
  97. kfade[7].fnum: 270 ; 0x278: 0x0000010e
  98. kfade[7].finc: 930515465 ; 0x27c: 0x37768a09
  99. kfade[7].flags: 17 ; 0x280: U=1 S=0 S=0 U=0 F=1
  100. kfade[7].ub1spare: 0 ; 0x281: 0x00
  101. kfade[7].ub2spare: 0 ; 0x282: 0x0000
  102. kfade[8].entry.incarn: 5 ; 0x284: A=1 NUMM=0x2
  103. kfade[8].entry.hash: 2512381731 ; 0x288: 0x95bfe723
  104. kfade[8].entry.refer.number: 4294967295 ; 0x28c: 0xffffffff
  105. kfade[8].entry.refer.incarn: 0 ; 0x290: A=0 NUMM=0x0
  106. kfade[8].name: CS ; 0x294: length=2
  107. kfade[8].fnum: 271 ; 0x2c4: 0x0000010f
  108. kfade[8].finc: 931880499 ; 0x2c8: 0x378b5e33
  109. kfade[8].flags: 18 ; 0x2cc: U=0 S=1 S=0 U=0 F=1
  110. kfade[8].ub1spare: 0 ; 0x2cd: 0x00
  111. kfade[8].ub2spare: 0 ; 0x2ce: 0x0000
  112. kfade[9].entry.incarn: 3 ; 0x2d0: A=1 NUMM=0x1
  113. kfade[9].entry.hash: 4011892030 ; 0x2d4: 0xef209d3e
  114. kfade[9].entry.refer.number: 4294967295 ; 0x2d8: 0xffffffff
  115. kfade[9].entry.refer.incarn: 0 ; 0x2dc: A=0 NUMM=0x0
  116. kfade[9].name: CS_STRIPE_COARSE ; 0x2e0: length=16
  117. kfade[9].fnum: 272 ; 0x310: 0x00000110
  118. kfade[9].finc: 931882089 ; 0x314: 0x378b6469
  119. kfade[9].flags: 18 ; 0x318: U=0 S=1 S=0 U=0 F=1
  120. kfade[9].ub1spare: 0 ; 0x319: 0x00
  121. kfade[9].ub2spare: 0 ; 0x31a: 0x0000
  122. kfade[10].entry.incarn: 1 ; 0x31c: A=1 NUMM=0x0
  123. kfade[10].entry.hash: 1365029949 ; 0x320: 0x515cb43d
  124. kfade[10].entry.refer.number:4294967295 ; 0x324: 0xffffffff
  125. kfade[10].entry.refer.incarn: 0 ; 0x328: A=0 NUMM=0x0
  126. kfade[10].name: NOT_IMPORTANT ; 0x32c: length=13
  127. kfade[10].fnum: 273 ; 0x35c: 0x00000111
  128. kfade[10].finc: 931882831 ; 0x360: 0x378b674f
  129. kfade[10].flags: 18 ; 0x364: U=0 S=1 S=0 U=0 F=1
  130. kfade[10].ub1spare: 0 ; 0x365: 0x00
  131. kfade[10].ub2spare: 0 ; 0x366: 0x0000
复制代码

从上面信息,我们可以知道sysaux对应是file 258,system对应file 259,EXAMPLE对应file 260,UNDOTBS2 对应file 261等等,与视图中查询的结果完全一致。

同理,controlfile控制文件在3号块。

  1. [grid@jyrac1 ~]$ kfed read /dev/raw/raw4 aun=36 blkn=3 | more
  2. kfbh.endian: 1 ; 0x000: 0x01
  3. kfbh.hard: 130 ; 0x001: 0x82
  4. kfbh.type: 11 ; 0x002: KFBTYP_ALIASDIR
  5. kfbh.datfmt: 1 ; 0x003: 0x01
  6. kfbh.block.blk: 3 ; 0x004: blk=3
  7. kfbh.block.obj: 6 ; 0x008: file=6
  8. kfbh.check: 3091636595 ; 0x00c: 0xb846a173
  9. kfbh.fcn.base: 734 ; 0x010: 0x000002de
  10. kfbh.fcn.wrap: 0 ; 0x014: 0x00000000
  11. kfbh.spare1: 0 ; 0x018: 0x00000000
  12. kfbh.spare2: 0 ; 0x01c: 0x00000000
  13. kffdnd.bnode.incarn: 1 ; 0x000: A=1 NUMM=0x0
  14. kffdnd.bnode.frlist.number: 4294967295 ; 0x004: 0xffffffff
  15. kffdnd.bnode.frlist.incarn: 0 ; 0x008: A=0 NUMM=0x0
  16. kffdnd.overfl.number: 4294967295 ; 0x00c: 0xffffffff
  17. kffdnd.overfl.incarn: 0 ; 0x010: A=0 NUMM=0x0
  18. kffdnd.parent.number: 1 ; 0x014: 0x00000001
  19. kffdnd.parent.incarn: 1 ; 0x018: A=1 NUMM=0x0
  20. kffdnd.fstblk.number: 3 ; 0x01c: 0x00000003
  21. kffdnd.fstblk.incarn: 1 ; 0x020: A=1 NUMM=0x0
  22. kfade[0].entry.incarn: 3 ; 0x024: A=1 NUMM=0x1
  23. kfade[0].entry.hash: 62930150 ; 0x028: 0x03c03ce6
  24. kfade[0].entry.refer.number: 4294967295 ; 0x02c: 0xffffffff
  25. kfade[0].entry.refer.incarn: 0 ; 0x030: A=0 NUMM=0x0
  26. kfade[0].name: current ; 0x034: length=7
  27. kfade[0].fnum: 257 ; 0x064: 0x00000101
  28. kfade[0].finc: 930412709 ; 0x068: 0x3774f8a5
  29. kfade[0].flags: 18 ; 0x06c: U=0 S=1 S=0 U=0 F=1
  30. kfade[0].ub1spare: 0 ; 0x06d: 0x00
  31. kfade[0].ub2spare: 0 ; 0x06e: 0x0000
  32. kfade[1].entry.incarn: 0 ; 0x070: A=0 NUMM=0x0
  33. kfade[1].entry.hash: 0 ; 0x074: 0x00000000
  34. kfade[1].entry.refer.number: 0 ; 0x078: 0x00000000
  35. kfade[1].entry.refer.incarn: 0 ; 0x07c: A=0 NUMM=0x0
  36. kfade[1].name: ; 0x080: length=0
  37. kfade[1].fnum: 0 ; 0x0b0: 0x00000000
  38. kfade[1].finc: 0 ; 0x0b4: 0x00000000
  39. kfade[1].flags: 0 ; 0x0b8: U=0 S=0 S=0 U=0 F=0
  40. kfade[1].ub1spare: 0 ; 0x0b9: 0x00
  41. kfade[1].ub2spare: 0 ; 0x0ba: 0x0000
  42. kfade[2].entry.incarn: 0 ; 0x0bc: A=0 NUMM=0x0
  43. kfade[2].entry.hash: 0 ; 0x0c0: 0x00000000
  44. kfade[2].entry.refer.number: 0 ; 0x0c4: 0x00000000
  45. kfade[2].entry.refer.incarn: 0 ; 0x0c8: A=0 NUMM=0x0
复制代码

从上面信息,你可以知道目前数据库的controlfile名称为:current.257.930412709

同理,onlinelog联机重做日志在5号块

  1. [grid@jyrac1 ~]$ kfed read /dev/raw/raw4 aun=36 blkn=5 | more
  2. kfbh.endian: 1 ; 0x000: 0x01
  3. kfbh.hard: 130 ; 0x001: 0x82
  4. kfbh.type: 11 ; 0x002: KFBTYP_ALIASDIR
  5. kfbh.datfmt: 1 ; 0x003: 0x01
  6. kfbh.block.blk: 5 ; 0x004: blk=5
  7. kfbh.block.obj: 6 ; 0x008: file=6
  8. kfbh.check: 1209488605 ; 0x00c: 0x481754dd
  9. kfbh.fcn.base: 3491 ; 0x010: 0x00000da3
  10. kfbh.fcn.wrap: 0 ; 0x014: 0x00000000
  11. kfbh.spare1: 0 ; 0x018: 0x00000000
  12. kfbh.spare2: 0 ; 0x01c: 0x00000000
  13. kffdnd.bnode.incarn: 1 ; 0x000: A=1 NUMM=0x0
  14. kffdnd.bnode.frlist.number: 4294967295 ; 0x004: 0xffffffff
  15. kffdnd.bnode.frlist.incarn: 0 ; 0x008: A=0 NUMM=0x0
  16. kffdnd.overfl.number: 4294967295 ; 0x00c: 0xffffffff
  17. kffdnd.overfl.incarn: 0 ; 0x010: A=0 NUMM=0x0
  18. kffdnd.parent.number: 1 ; 0x014: 0x00000001
  19. kffdnd.parent.incarn: 1 ; 0x018: A=1 NUMM=0x0
  20. kffdnd.fstblk.number: 5 ; 0x01c: 0x00000005
  21. kffdnd.fstblk.incarn: 1 ; 0x020: A=1 NUMM=0x0
  22. kfade[0].entry.incarn: 1 ; 0x024: A=1 NUMM=0x0
  23. kfade[0].entry.hash: 2375841806 ; 0x028: 0x8d9c780e
  24. kfade[0].entry.refer.number: 4294967295 ; 0x02c: 0xffffffff
  25. kfade[0].entry.refer.incarn: 0 ; 0x030: A=0 NUMM=0x0
  26. kfade[0].name: group_1 ; 0x034: length=7
  27. kfade[0].fnum: 264 ; 0x064: 0x00000108
  28. kfade[0].finc: 930413221 ; 0x068: 0x3774faa5
  29. kfade[0].flags: 18 ; 0x06c: U=0 S=1 S=0 U=0 F=1
  30. kfade[0].ub1spare: 0 ; 0x06d: 0x00
  31. kfade[0].ub2spare: 0 ; 0x06e: 0x0000
  32. kfade[1].entry.incarn: 1 ; 0x070: A=1 NUMM=0x0
  33. kfade[1].entry.hash: 1478106543 ; 0x074: 0x581a1daf
  34. kfade[1].entry.refer.number: 4294967295 ; 0x078: 0xffffffff
  35. kfade[1].entry.refer.incarn: 0 ; 0x07c: A=0 NUMM=0x0
  36. kfade[1].name: group_2 ; 0x080: length=7
  37. kfade[1].fnum: 265 ; 0x0b0: 0x00000109
  38. kfade[1].finc: 930413225 ; 0x0b4: 0x3774faa9
  39. kfade[1].flags: 18 ; 0x0b8: U=0 S=1 S=0 U=0 F=1
  40. kfade[1].ub1spare: 0 ; 0x0b9: 0x00
  41. kfade[1].ub2spare: 0 ; 0x0ba: 0x0000
  42. kfade[2].entry.incarn: 1 ; 0x0bc: A=1 NUMM=0x0
  43. kfade[2].entry.hash: 429163817 ; 0x0c0: 0x19948529
  44. kfade[2].entry.refer.number: 4294967295 ; 0x0c4: 0xffffffff
  45. kfade[2].entry.refer.incarn: 0 ; 0x0c8: A=0 NUMM=0x0
  46. kfade[2].name: group_3 ; 0x0cc: length=7
  47. kfade[2].fnum: 266 ; 0x0fc: 0x0000010a
  48. kfade[2].finc: 930413227 ; 0x100: 0x3774faab
  49. kfade[2].flags: 18 ; 0x104: U=0 S=1 S=0 U=0 F=1
  50. kfade[2].ub1spare: 0 ; 0x105: 0x00
  51. kfade[2].ub2spare: 0 ; 0x106: 0x0000
  52. kfade[3].entry.incarn: 1 ; 0x108: A=1 NUMM=0x0
  53. kfade[3].entry.hash: 2232040441 ; 0x10c: 0x850a3bf9
  54. kfade[3].entry.refer.number: 4294967295 ; 0x110: 0xffffffff
  55. kfade[3].entry.refer.incarn: 0 ; 0x114: A=0 NUMM=0x0
  56. kfade[3].name: group_4 ; 0x118: length=7
  57. kfade[3].fnum: 267 ; 0x148: 0x0000010b
  58. kfade[3].finc: 930413231 ; 0x14c: 0x3774faaf
  59. kfade[3].flags: 18 ; 0x150: U=0 S=1 S=0 U=0 F=1
  60. kfade[3].ub1spare: 0 ; 0x151: 0x00
  61. kfade[3].ub2spare: 0 ; 0x152: 0x0000
复制代码

从上面信息,你可以知道目前数据库的联机重做日志文件名称为:group_1.264.930413221,group_2.265.930413225,group_3.266.930413227,group_4.267.930413231

同理,找到spfile的alias信息为:SPFILE.256.930411925,当知道数据库文件的alias名称之后,如果利用amdu从asm diskgroup中抽取某个文件,那么就很容易了,而且如果你后面需要用来恢复,甚至你连文件名都不用改,如下例子抽取上述的spfile:

  1. [grid@jyrac1 ~]$ amdu -dis '/dev/raw/raw*' -extract datadg.256 -output spfile.256.930411925
  2. amdu_2016_12_29_21_15_43/
  3. AMDU-00204: Disk N0003 is in currently mounted diskgroup DATADG
  4. AMDU-00201: Disk N0003: '/dev/raw/raw11'
  5. AMDU-00204: Disk N0009 is in currently mounted diskgroup DATADG
  6. AMDU-00201: Disk N0009: '/dev/raw/raw4'
  7. AMDU-00204: Disk N0008 is in currently mounted diskgroup DATADG
  8. AMDU-00201: Disk N0008: '/dev/raw/raw3'
  9. [grid@jyrac1 ~]$ cat spfile.256.930411925
  10. jyrac1.__db_cache_size=1795162112 jyrac2.__db_cache_size=1795162112
  11. jyrac2.__java_pool_size=16777216
  12. jyrac1.__java_pool_size=16777216
  13. jyrac2.__large_pool_size=33554432
  14. jyrac1.__large_pool_size=33554432
  15. jyrac1.__oracle_base='/u01/app/oracle'#ORACLE_BASE set from environment
  16. jyrac2.__oracle_base='/u01/app/oracle'#ORACLE_BASE set from environment
  17. jyrac2.__pga_aggregate_target=838860800
  18. jyrac1.__pga_aggregate_target=838860800
  19. jyrac2.__sga_target=2516582400
  20. jyrac1.__sga_target=2516582400
  21. jyrac2.__shared_io_pool_size=0
  22. jyrac1.__shared_io_pool_size=0
  23. jyrac1.__shared_pool_size=587202560
  24. jyrac2.__shared_pool_size=637534208
  25. jyrac2.__streams_pool_size=0
  26. jyrac1.__streams_pool_size=0
  27. *.audit_file_dest='/u01/app/oracle/admin/jyrac/adump'
  28. *.audit_trail='db'
  29. *.cluster_database=true
  30. *.compatible='11.2.0.4.0'
  31. *.control_files='+DATADG/jyrac/controlfile/current.257.930412709'
  32. *.db_block_size=8192
  33. *.db_create_file_dest='+DATADG'
  34. *.db_domain=''
  35. *.db_name='jyrac'
  36. *.diagnostic_dest='/u01/app/oracle'
  37. *.dispatchers='(PROTOCOL=TCP) (SERVICE=jyracXDB)'
  38. jyrac1.dispatchers='(PROTOCOL=TCP) (SERVICE=jyrac1XDB)'
  39. jyrac2.dispatchers='(PROTOCOL=TCP) (SERVICE=jyrac2XDB)'
  40. jyrac2.instance_number=2
  41. jyrac1.instance_number=1
  42. *.job_queue_processes=1000
  43. JYRAC1.listener_networks='((NAME=network1)(LOCAL_LISTENER=10.138.130.152:1521)(REMOTE_LISTENER=10.138.130.155:1521))','((NAME=network2)(LOCAL_LISTENER=10.138.130.152:1521)(REMOTE_LISTENER=10.138.130.156:1521))','((NAME=network3)(LOCAL_LISTENER=10.138.130.152:1521)(REMOTE_LISTENER=10.138.130.157:1521))'
  44. JYRAC2.listener_networks='((NAME=network1)(LOCAL_LISTENER=10.138.130.154:1521)(REMOTE_LISTENER=10.138.130.155:1521))','((NAME=network2)(LOCAL_LISTENER=10.138.130.154:1521)(REMOTE_LISTENER=10.138.130.156:1521))','((NAME=network3)(LOCAL_LISTENER=10.138.130.154:1521)(REMOTE_LISTENER=10.138.130.157:1521))'
  45. jyrac2.listener_networks='((NAME=network1)(LOCAL_LISTENER=10.138.130.154:1521)(REMOTE_LISTENER=10.138.130.155:1521))','((NAME=network2)(LOCAL_LISTENER=10.138.130.154:1521)(REMOTE_LISTENER=10.138.130.156:1521))','((NAME=network3)(LOCAL_LISTENER=10.138.130.154:1521)(REMOTE_LISTENER=10.138.130.157:1521))'
  46. jyrac1.listener_networks='((NAME=network1)(LOCAL_LISTENER=10.138.130.153:1521)(REMOTE_LISTENER=10.138.130.155:1521))','((NAME=network2)(LOCAL_LISTENER=10.138.130.153:1521)(REMOTE_LISTENER=10.138.130.156:1521))','((NAME=network3)(LOCAL_LISTENER=10.138.130.153:1521)(REMOTE_LISTENER=10.138.130.157:1521))'
  47. *.log_archive_dest_1='location=+archdg/jyrac/'
  48. *.open_cursors=300
  49. *.pga_aggregate_target=836763648
  50. *.processes=150
  51. *.remote_listener='jyrac-scan:1521'
  52. *.remote_login_passwordfile='exclusive'
  53. *.sga_target=2510290944
  54. jyrac2.thread=2
  55. jyrac1.thread=1
  56. jyrac1.undo_tablespace='UNDOTBS1'
  57. jyrac2.undo_tablespace='UNDOTBS2'
复制代码

小结:
别名目录用来跟踪ASM磁盘组中的所有别名,可以通过查询v$asm_alias来查看现有文件的别名。



回复

使用道具 举报