运维联盟俱乐部

 找回密码
 立即注册
查看: 1998|回复: 0

[技术专题] kfod,kfed,amdu工具得使用

[复制链接]
  • TA的每日心情
    开心
    2023-8-9 11:05
  • 发表于 2020-5-29 11:15:49 | 显示全部楼层 |阅读模式
    1. KFOD - Kernel Files OSM Disk
    KFOD utility is used to simulate the disk discovery from the operating system level and it can be found in $GRID_HOME/bin directory (or ASM_HOME/bin in older releases).
    Note:
    1) KFOD is used at installation time as well (by OUI,DBCA or ASMCA) in order to perform disk discovery.
    2) In case of a failed installation (e.g no $GRID_HOME/bin existing yet) KFOD can be found under your stage folder: <stage_folder>/grid/stage/ext/bin/
    In such cases you might need to set LD_LIBRARY_PATH to <stage_folder>/grid/stage/ext/lib.

    Help screen can be seen using:

    1. gt; kfod help=y
    2. _asm_a/llow_only_raw_disks KFOD allow only raw devices [_asm_allow_only_raw_disks=TRUE/(FALSE)]
    3. _asm_l/ibraries ASM Libraries[_asm_libraries='lib1','lib2',...]
    4. _asms/id ASM Instance[_asmsid=sid]
    5. a/sm_diskstring ASM Diskstring [asm_diskstring='discoverystring', 'discoverystring' ...]
    6. d/isks Disks to discover [disks=raw,asm,all]
    7. g/roup Group discover [group=controlfile]
    8. n/ohdr KFOD header suppression [nohdr=TRUE/(FALSE)]
    9. o/p KFOD options type [OP=DISKS/GROUPS/ALL]
    10. p/file ASM parameter file [pfile='parameterfile']
    11. s/tatus Include disk header status [status=TRUE/(FALSE)]
    12. v/erbose KFOD verbose errors [verbose=TRUE/(FALSE)]
    复制代码
    The usual syntax used for disk discovery is:
    1. kfod status=TRUE asm_diskstring='<your_path_to_ASM_devices>' disks=ALL
    复制代码
    EXAMPLE
    1. $ export LD_LIBRARY_PATH=/u01/stage/11.2.0.1/grid/stage/ext/lib
    2. $ /u01/stage/11.2.0.1/grid/stage/ext/bin/kfod status=TRUE asm_diskstring='/dev/rdsk/*' disk=all dscvgroup=TRUE
    3. --------------------------------------------------------------------------------
    4. Disk Size Header Path Disk Group User Group
    5. ================================================================================
    6. 1: 10040 Mb MEMBER /dev/rdsk/c0t600144F0E08ACF0000004C2F6FBB0005d0s1 DG oracle oinstall
    7. 2: 10040 Mb MEMBER /dev/rdsk/c0t600144F0E08ACF0000004C2F6FBC0006d0s1 DG oracle oinstall
    8. 3: 10142 Mb MEMBER /dev/rdsk/c0t600144F0E08ACF0000004C2F6FBE0007d0s1 DG oracle oinstall
    9. 4: 10142 Mb MEMBER /dev/rdsk/c0t600144F0E08ACF0000004C2F6FBF0008d0s1 DG oracle oinstall
    10. 5: 9734 Mb MEMBER /dev/rdsk/c0t600144F0E08ACF0000004C2F6FC00009d0s1 FRA oracle oinstall
    复制代码
    2. KFED - Kernel Files metadata EDitor
    KFED is a useful tool which allows to analyze ASM disk header information when ASM diskgroups can not be mounted.
    Note 1346190.1 - KFED.PL for diagnosing - ORA-15036 ORA-15042 ORA-15020 ORA-15033
    NOTE:
    KFED executable comes with installation from 11.1 onwards; for the older version you must build it.
    But it is not included the source of the software, therefore it is not available until GI installation completes.
    If you need to use it before GI being installed, please refer
    Note 1505005.1 - Where to find kfed utility before Oracle Grid Infrastructure is installed

    Help screen can be seen using:
    1. gt;kfed help=y
    2. as/mlib ASM Library [asmlib='lib']
    3. aun/um AU number to examine or update [AUNUM=number]
    4. aus/z Allocation Unit size in bytes [AUSZ=number]
    5. blkn/um Block number to examine or update [BLKNUM=number]
    6. blks/z Metadata block size in bytes [BLKSZ=number]
    7. ch/ksum Update checksum before each write [CHKSUM=YES/NO]
    8. cn/t Count of AUs to process [CNT=number]
    9. de/v ASM device to examine or update [DEV=string]
    10. dm/pall Don't suppress repeated lines when dumping corrupt blocks [DMPALL=YES/NO]
    11. o/p KFED operation type [OP=READ/WRITE/MERGE/REPAIR/NEW/FORM/FIND/STRUCT]
    12. p/rovnm Name for provisioning purposes [PROVNM=string]
    13. s/eek AU number to seek to [SEEK=number]
    14. te/xt File name for translated block text [TEXT=string]
    15. ty/pe ASM metadata block type number [TYPE=number]
    复制代码

    The usual syntax used for reading ASM disk header is:
    1. gt; kfed read <your_device>
    复制代码
    EXAMPLE:
    1. gt; kfed read /dev/raw/raw1
    2. kfbh.endian: 1 ; 0x000: 0x01
    3. kfbh.hard: 130 ; 0x001: 0x82
    4. kfbh.type: 1 ; 0x002: KFBTYP_DISKHEAD
    5. kfbh.datfmt: 1 ; 0x003: 0x01
    6. kfbh.block.blk: 0 ; 0x004: T=0 NUMB=0x0
    7. kfbh.block.obj: 2147483648 ; 0x008: TYPE=0x8 NUMB=0x0
    8. kfbh.check: 2932902794 ; 0x00c: 0xaed08b8a
    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. kfdhdb.driver.provstr: ORCLDISK ; 0x000: length=8
    14. kfdhdb.driver.reserved[0]: 0 ; 0x008: 0x00000000
    15. kfdhdb.driver.reserved[1]: 0 ; 0x00c: 0x00000000
    16. kfdhdb.driver.reserved[2]: 0 ; 0x010: 0x00000000
    17. kfdhdb.driver.reserved[3]: 0 ; 0x014: 0x00000000
    18. kfdhdb.driver.reserved[4]: 0 ; 0x018: 0x00000000
    19. kfdhdb.driver.reserved[5]: 0 ; 0x01c: 0x00000000
    20. kfdhdb.compat: 168820736 ; 0x020: 0x0a100000
    21. kfdhdb.dsknum: 0 ; 0x024: 0x0000
    22. kfdhdb.grptyp: 1 ; 0x026: KFDGTP_EXTERNAL
    23. kfdhdb.hdrsts: 3 ; 0x027: KFDHDR_MEMBER
    24. kfdhdb.dskname: ASM01_0000 ; 0x028: length=10
    25. kfdhdb.grpname: ASM01 ; 0x048: length=5
    26. kfdhdb.fgname: ASM01_0000 ; 0x068: length=10
    27. kfdhdb.capname: ; 0x088: length=0
    28. kfdhdb.crestmp.hi: 32837774 ; 0x0a8: HOUR=0xe DAYS=0x4 MNTH=0x4 YEAR=0x7d4
    29. kfdhdb.crestmp.lo: 1555722240 ; 0x0ac: USEC=0x0 MSEC=0x29c SECS=0xb MINS=0x17
    30. kfdhdb.mntstmp.hi: 32837774 ; 0x0b0: HOUR=0xe DAYS=0x4 MNTH=0x4 YEAR=0x7d4
    31. kfdhdb.mntstmp.lo: 1563864064 ; 0x0b4: USEC=0x0 MSEC=0x1ab SECS=0x13 MINS=0x17
    32. kfdhdb.ub4spare[60]: 0 ; 0x1d0: 0x00000000
    33. kfdhdb.acdb.aba.seq: 0 ; 0x1d4: 0x00000000
    34. kfdhdb.acdb.aba.blk: 0 ; 0x1d8: 0x00000000
    35. kfdhdb.acdb.ents: 0 ; 0x1dc: 0x0000
    36. kfdhdb.acdb.ub2spare: 0 ; 0x1de: 0x0000
    复制代码
    NOTES:
    1) KFED returns a readable output only when devices are/were part of an ASM diskgroup.
    Otherwise (if the device hasn't been added to a diskgroup yet or the disk is not valid anymore) the output looks like:
    KFED-00322: Invalid content encountered during block traversal: [kfbtTraverseBlock][Invalid OSM block type][][0]
    2) In case of a non-default AU size, you should specify it in the command:
    $> kfed read <your_device> AUSZ=<au_size>

    3. AMDU - ASM Metadata Dump Utility
    AMDU is an utility to extract all the available metadata from one or more ASM disks and/or generate formatted printouts of individual blocks.The utility does not require that any diskgroup to be mounted.
    Oracle Support may ask you to provide AMDU output, especially when facing internal errors related to the ASM metadata
    NOTE:
    AMDU executable comes with installation from 11.1 onwards. Although this tool was released with 11g, it can be used with ASM 10g as well.
    Note 553639.1 - Placeholder for AMDU binaries and using with ASM 10g

    The usual syntax used for dumping metadata related to a diskgroup is:
    1. gt; amdu -diskstring '<your_path_to_ASM_disks>' -dump '<diskgroup>'
    2. NOTE:
    3. Every time AMDU is executed a directory is created on the current location, unless it is override by parameter -directory.
    4. The directory will have the format amdu_YYYY_MM_DD_HH24_MM_SS
    5. The default command will generate following files:
    6. <diskgroup>_0001.img - a exact dump of the content of the diskgroup ;size is limited to 2gb but can be more than one file
    7. <diskgroup>.map - can be used to find the exact location of the ASM metadata on the disks
    8. report.txt - include details about the disks scanned
    复制代码

    The report.txt file shows the header info of the disks belonging to diskgroup, like below:

    EXAMPLE:
    1. gt; amdu -diskstring '/dev/raw/raw*' -dump 'DG11'
    2. --------------------------------------------------------------------------------
    3. <report.txt content>
    4. ----------------------------- DISK REPORT N0003 ---------------------------
    5. Disk Path: /dev/raw/raw3
    6. Physical Sector Size: 512 bytes
    7. Disk Size: 977 megabytes
    8. Group Name: DG11
    9. Disk Name: DG11_0000
    10. Failure Group Name: DG11_0000
    11. ----------------------------- DISK REPORT N0004 ---------------------------
    12. Disk Path: /dev/raw/raw4
    13. Physical Sector Size: 512 bytes
    14. Disk Size: 978 megabytes
    15. Group Name: DG11
    16. Disk Name: DG11_0001
    17. Failure Group Name: DG11_0001
    18. ....
    复制代码

    回复

    使用道具 举报

    您需要登录后才可以回帖 登录 | 立即注册

    本版积分规则

    运维联盟俱乐部 ( 冀ICP备19036648号 )

    GMT+8, 2024-5-17 09:41 , Processed in 0.047507 second(s), 21 queries , Gzip On.

    Powered by Discuz! X3.4

    © 2001-2023 Discuz! Team.

    快速回复 返回顶部 返回列表