ORACLE Support使用的 ASM 工具 : KFOD, KFED,AMDU

如果自己搞不定可以找诗檀软件专业ORACLE数据库修复团队成员帮您恢复!

诗檀软件专业数据库修复团队

服务热线 : 13764045638    QQ号:47079569    邮箱:service@parnassusdata.com

 

应用于:

Oracle数据库企业版– 10.2.0.1版本和更高版本

本文档中的信息适用于任何平台。.

 

 

目的

本文是为了教育目的:,以便对ASM工具有大概了解:KFODKFEDAMDU

根据你的情况,Oracle Support可能会要求额外的或其他具体信息。.

Note 1345068.1 – Files for Upload When Creating ASM/Storage Service Requests

 

范围

 ASM工具KFODKFEDAMDU使用的总体概述。

 

 

1. KFOD – 核心文件 OSM 磁盘

KFOD工具是用来模拟从操作系统层面的磁盘发现,在$ GRID_HOME/ bin目录(或者老版本中的ASM_HOME/ bin)中可以找到它。

注意:


1) KFOD
在安装时才使用(由OUIDBCAASMCA使用),以发现磁盘。

 

2)在安装失败的情况下,(例如  $ GRID_HOME/ bin不存在)KFOD可以在stage文件夹中找到: <stage_folder>/grid/stage/ext/bin/

 

这种情况下,你可能需要设置LD_LIBRARY_PATH<stage_folder>/grid/stage/ext/lib


Help screen can be seen using:

 

 

$> kfod help=y

_asm_a/llow_only_raw_disks     KFOD allow only raw devices [_asm_allow_only_raw_disks=TRUE/(FALSE)]
_asm_l/ibraries                       ASM Libraries[_asm_libraries=’lib1′,’lib2′,…]
_asms/id                               ASM Instance[_asmsid=sid]
a/sm_diskstring                      ASM Diskstring [asm_diskstring=’discoverystring’, ‘discoverystring’ …]
d/isks                                    Disks to discover [disks=raw,asm,all]
g/roup                                   Group discover [group=controlfile]
n/ohdr                                   KFOD header suppression [nohdr=TRUE/(FALSE)]
o/p                                        KFOD options type [OP=DISKS/GROUPS/ALL]
p/file                                     ASM parameter file [pfile=’parameterfile’]
s/tatus                                   Include disk header status [status=TRUE/(FALSE)]
v/erbose                                KFOD verbose errors [verbose=TRUE/(FALSE)]

 
用于磁盘发现的常用语句是:

 

kfod status=TRUE asm_diskstring='<your_path_to_ASM_devices>’ disks=ALL

  

$ export LD_LIBRARY_PATH=/u01/stage/11.2.0.1/grid/stage/ext/lib
$ /u01/stage/11.2.0.1/grid/stage/ext/bin/kfod status=TRUE asm_diskstring=’/dev/rdsk/*’ disk=all dscvgroup=TRUE
——————————————————————————–
Disk Size Header Path Disk Group User Group
================================================================================
1: 10040 Mb MEMBER /dev/rdsk/c0t600144F0E08ACF0000004C2F6FBB0005d0s1  DG oracle oinstall
2: 10040 Mb MEMBER /dev/rdsk/c0t600144F0E08ACF0000004C2F6FBC0006d0s1  DG oracle oinstall
3: 10142 Mb MEMBER /dev/rdsk/c0t600144F0E08ACF0000004C2F6FBE0007d0s1  DG oracle oinstall
4: 10142 Mb MEMBER /dev/rdsk/c0t600144F0E08ACF0000004C2F6FBF0008d0s1  DG oracle oinstall
5:  9734 Mb MEMBER /dev/rdsk/c0t600144F0E08ACF0000004C2F6FC00009d0s1 FRA oracle oinstall
——————————————————————————–

 

 2. KFED – 核心文件元数据编辑器

 

KFED是个有用的工具,ASM磁盘组不能安装时,它可以分析ASM磁盘头信息。

Note 1180491.1 – KFED Tool For Windows OS.

Note 1346190.1 – KFED.PL for diagnosing – ORA-15036 ORA-15042 ORA-15020 ORA-15033

 

注意:


11.1
以上的版本安装时就有KFED可执行; 而在旧版本上,则必须建立KFED

但它不包含在软件的来源中,因此,直到GI安装完成才可用。

如果在GI安装之前你需要使用它,请参考下列文档


Note 1505005.1 – Where to find kfed utility before Oracle Grid Infrastructure is installed

Help screen can be seen using:

$>kfed help=y

as/mlib         ASM Library [asmlib=’lib’]
aun/um        AU number to examine or update [AUNUM=number]
aus/z           Allocation Unit size in bytes [AUSZ=number]
blkn/um       Block number to examine or update [BLKNUM=number]
blks/z          Metadata block size in bytes [BLKSZ=number]
ch/ksum       Update checksum before each write [CHKSUM=YES/NO]
cn/t              Count of AUs to process [CNT=number]
de/v            ASM device to examine or update [DEV=string]
dm/pall        Don’t suppress repeated lines when dumping corrupt blocks [DMPALL=YES/NO]
o/p              KFED operation type [OP=READ/WRITE/MERGE/REPAIR/NEW/FORM/FIND/STRUCT]
p/rovnm       Name for provisioning purposes [PROVNM=string]
s/eek           AU number to seek to [SEEK=number]
te/xt            File name for translated block text [TEXT=string]
ty/pe           ASM metadata block type number [TYPE=number]

 

 读取ASM磁盘头常用的语句是 

 

$> kfed read <your_device>

 

:

 

$> kfed read /dev/raw/raw1


    
   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: T=0 NUMB=0x0
   kfbh.block.obj:                   2147483648 ; 0x008: TYPE=0x8 NUMB=0x0
   kfbh.check:                        2932902794 ; 0x00c: 0xaed08b8a
   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:                 168820736 ; 0x020: 0x0a100000
   kfdhdb.dsknum:                     0 ; 0x024: 0x0000
   kfdhdb.grptyp:                        1 ; 0x026: KFDGTP_EXTERNAL
   kfdhdb.hdrsts:                        3 ; 0x027: KFDHDR_MEMBER
   kfdhdb.dskname:               ASM01_0000 ; 0x028: length=10
   kfdhdb.grpname:               ASM01 ; 0x048: length=5
   kfdhdb.fgname:                 ASM01_0000 ; 0x068: length=10
   kfdhdb.capname:               ; 0x088: length=0
   kfdhdb.crestmp.hi:             32837774 ; 0x0a8: HOUR=0xe DAYS=0x4 MNTH=0x4 YEAR=0x7d4
   kfdhdb.crestmp.lo:             1555722240 ; 0x0ac: USEC=0x0 MSEC=0x29c SECS=0xb MINS=0x17
   kfdhdb.mntstmp.hi:            32837774 ; 0x0b0: HOUR=0xe DAYS=0x4 MNTH=0x4 YEAR=0x7d4
   kfdhdb.mntstmp.lo:            1563864064 ; 0x0b4: USEC=0x0 MSEC=0x1ab SECS=0x13 MINS=0x17
  …
   kfdhdb.ub4spare[60]:         0 ; 0x1d0: 0x00000000
   kfdhdb.acdb.aba.seq:         0 ; 0x1d4: 0x00000000
   kfdhdb.acdb.aba.blk:          0 ; 0x1d8: 0x00000000
   kfdhdb.acdb.ents:              0 ; 0x1dc: 0x0000
   kfdhdb.acdb.ub2spare:        0 ; 0x1de: 0x0000

 

 

注意:

  • 只有当设备是ASM磁盘组的一部分时,KFED会返回到可读输出。否则(如果该设备还没有被添加到磁盘组又或者磁盘不再有效)输出是这样的:

 

KFED-00322: Invalid content encountered during block traversal: [kfbtTraverseBlock][Invalid OSM block type][][0]

 

 

2) 若是非默认的AU大小,应在命令中指定它:

 

$> kfed read <your_device> AUSZ=<au_size>

 

 3. AMDU – ASM 元数据转储工具

 

AMDU是一个实用程序,可以从一个或多个ASM磁盘提取所有可用的元数据,和/或生成个别块的格式化打印输出,该工具不需要安装任何磁盘组。

Oracle Support 可能会要求你提供AMDU输出,尤其是遇到ASM元数据相关的内部错误时。

注意:
11.1
以上的版本安装时就有KFED可执行。虽然该工具是在11g版本上发行,但也可以在ASM10g上使用。

Note 553639.1 – Placeholder for AMDU binaries and using with ASM 10g

磁盘组相关的元数据转储的常用语句是:

$> amdu -diskstring ‘<your_path_to_ASM_disks>’  -dump  ‘<diskgroup>’ 

注意:

每次执行AMDU,就会在当前位置创建一个目录,除非它被-directory参数覆盖。

该目录格式为amdu_YYYY_MM_DD_HH24_MM_SS

默认参数会生成下列文件:

<diskgroup>_0001.img     –  a exact dump of the content of the diskgroup ;size is limited to 2gb but can be more than one file
<diskgroup>.map            –  can be used to find the exact location of the ASM metadata on the disks
report.txt                        –  include details about the disks scanned

REPORT.TXT文件显示,磁盘的盘头信息属于磁盘组,如下所示:

例:

$> amdu -diskstring ‘/dev/raw/raw*’ -dump ‘DG11’

——————————————————————————–

<report.txt content>

—————————– DISK REPORT N0003 —————————
Disk Path: /dev/raw/raw3
Physical Sector Size: 512 bytes
Disk Size: 977 megabytes
Group Name: DG11
Disk Name: DG11_0000
Failure Group Name: DG11_0000

—————————– DISK REPORT N0004 —————————
Disk Path: /dev/raw/raw4
Physical Sector Size: 512 bytes
Disk Size: 978 megabytes
Group Name: DG11
Disk Name: DG11_0001
Failure Group Name: DG11_0001

….

注意:没有Oracle Support的指导,使用上述工具时切勿使用选项,这样可能会损坏你的磁盘。 

参考

NOTE:1345068.1 – Files for Upload When Creating ASM/Storage Service Requests
NOTE:1346190.1 – KFED.PL for diagnosing – ORA-15063 ORA-15042 ORA-15020 ORA-15033
NOTE:553639.1 – Placeholder for AMDU binaries and using with ASM 10g
NOTE:1505005.1 – Where to find kfed utility before Oracle Grid Infrastructure is installed.
NOTE:1180491.1 – KFED Tool For Windows OS.

Comment

*

沪ICP备14014813号-2

沪公网安备 31010802001379号