`

kfed 小工具学习

阅读更多

Oracle10g内含了一个ASM工具kfed,可以用来查看ASM磁盘的物理结构,不过该工具需要我们自己编译一下才能使用。

编译方法很简单:
[root@rac01 ~]# su - oracle
[oracle@rac01 ~]$ cd $ORACLE_HOME/rdbms/lib
[oracle@rac01 ~]$ make -f ins_rdbms.mk ikfed

我们简单看一下便以过程:

[root@rac01 ~]# su - oracle
[oracle@rac01 bin]$ cd $ORACLE_HOME/rdbms/lib

[oracle@rac01 lib]$ make -f ins_rdbms.mk ikfed

Linking KFED utility (kfed)
rm -f /opt/oracle/product/10.2.0/rdbms/lib/kfed
gcc -o /opt/oracle/product/10.2.0/rdbms/lib/kfed ...
mv -f /opt/oracle/product/10.2.0/bin/kfed /opt/oracle/product/10.2.0/bin/kfedO
mv: cannot stat `/opt/oracle/product/10.2.0/bin/kfed': No such file or directory
make: [ikfed] Error 1 (ignored)
mv /opt/oracle/product/10.2.0/rdbms/lib/kfed /opt/oracle/product/10.2.0/bin/kfed
chmod 751 /opt/oracle/product/10.2.0/bin/kfed
[oracle@danaly lib]$ which kfed
~/product/10.2.0/bin/kfed

 

kfed有很多用途,我们可以用-h参数看一下相关帮助:
[oracle@rac01 lib]$ kfed -h
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]
d/ev            ASM device to examine or update [DEV=string]
o/p             KFED operation type [OP=READ/WRITE/MERGE/NEW/FORM/FIND/STRUCT]
p/rovnm         Name for provisioning purposes [PROVNM=string]
te/xt           File name for translated block text [TEXT=string]
ty/pe           ASM metadata block type number [TYPE=number]

我们来读取一下ASM磁盘头看一下ASM磁盘的相关信息:
[oracle@rac01 ~]$ kfed read /dev/oracleasm/disks/VOL1 text=test.txt
[oracle@rac01 ~]$ cat test.txt
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:                  3687055954 ; 0x00c: 0xdbc40252
kfbh.fcn.base:                       40 ; 0x010: 0x00000028
kfbh.fcn.wrap:                        0 ; 0x014: 0x00000000
kfbh.spare1:                          0 ; 0x018: 0x00000000
kfbh.spare2:                          0 ; 0x01c: 0x00000000
kfdhdb.driver.provstr:     ORCLDISKVOL1 ; 0x000: length=12
kfdhdb.driver.reserved[0]:    827084630 ; 0x008: 0x314c4f56
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:                    VOL1 ; 0x028: length=4
kfdhdb.grpname:                DISKGRP1 ; 0x048: length=8
kfdhdb.fgname:                     VOL1 ; 0x068: length=4
kfdhdb.capname:                         ; 0x088: length=0
kfdhdb.crestmp.hi:             32937495 ; 0x0a8: HOUR=0x17 DAYS=0x10 MNTH=0x5 YEAR=0x7da
kfdhdb.crestmp.lo:           1715017728 ; 0x0ac: USEC=0x0 MSEC=0x246 SECS=0x23 MINS=0x19
kfdhdb.mntstmp.hi:             32938742 ; 0x0b0: HOUR=0x16 DAYS=0x17 MNTH=0x6 YEAR=0x7da
kfdhdb.mntstmp.lo:            959532034 ; 0x0b4: USEC=0x2 MSEC=0x53 SECS=0x13 MINS=0xe
kfdhdb.secsize:                     512 ; 0x0b8: 0x0200
kfdhdb.blksize:                    4096 ; 0x0ba: 0x1000
kfdhdb.ausize:                  1048576 ; 0x0bc: 0x00100000
kfdhdb.mfact:                    113792 ; 0x0c0: 0x0001bc80
kfdhdb.dsksize:                    1529 ; 0x0c4: 0x000005f9
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]:            65535 ; 0x0da: 0xffff
kfdhdb.redomirrors[2]:            65535 ; 0x0dc: 0xffff
kfdhdb.redomirrors[3]:            65535 ; 0x0de: 0xffff
kfdhdb.dbcompat:              168820736 ; 0x0e0: 0x0a100000
kfdhdb.grpstmp.hi:             32937495 ; 0x0e4: HOUR=0x17 DAYS=0x10 MNTH=0x5 YEAR=0x7da
kfdhdb.grpstmp.lo:           1714503680 ; 0x0e8: USEC=0x0 MSEC=0x50 SECS=0x23 MINS=0x19
kfdhdb.ub4spare[0]:                   0 ; 0x0ec: 0x00000000
kfdhdb.ub4spare[1]:                   0 ; 0x0f0: 0x00000000
kfdhdb.ub4spare[2]:                   0 ; 0x0f4: 0x00000000
kfdhdb.ub4spare[3]:                   0 ; 0x0f8: 0x00000000
kfdhdb.ub4spare[4]:                   0 ; 0x0fc: 0x00000000
kfdhdb.ub4spare[5]:                   0 ; 0x100: 0x00000000
kfdhdb.ub4spare[6]:                   0 ; 0x104: 0x00000000
kfdhdb.ub4spare[7]:                   0 ; 0x108: 0x00000000
kfdhdb.ub4spare[8]:                   0 ; 0x10c: 0x00000000
kfdhdb.ub4spare[9]:                   0 ; 0x110: 0x00000000
kfdhdb.ub4spare[10]:                  0 ; 0x114: 0x00000000
kfdhdb.ub4spare[11]:                  0 ; 0x118: 0x00000000
kfdhdb.ub4spare[12]:                  0 ; 0x11c: 0x00000000
kfdhdb.ub4spare[13]:                  0 ; 0x120: 0x00000000
kfdhdb.ub4spare[14]:                  0 ; 0x124: 0x00000000
kfdhdb.ub4spare[15]:                  0 ; 0x128: 0x00000000
kfdhdb.ub4spare[16]:                  0 ; 0x12c: 0x00000000
kfdhdb.ub4spare[17]:                  0 ; 0x130: 0x00000000
kfdhdb.ub4spare[18]:                  0 ; 0x134: 0x00000000
kfdhdb.ub4spare[19]:                  0 ; 0x138: 0x00000000
kfdhdb.ub4spare[20]:                  0 ; 0x13c: 0x00000000
kfdhdb.ub4spare[21]:                  0 ; 0x140: 0x00000000
kfdhdb.ub4spare[22]:                  0 ; 0x144: 0x00000000
kfdhdb.ub4spare[23]:                  0 ; 0x148: 0x00000000
kfdhdb.ub4spare[24]:                  0 ; 0x14c: 0x00000000
kfdhdb.ub4spare[25]:                  0 ; 0x150: 0x00000000
kfdhdb.ub4spare[26]:                  0 ; 0x154: 0x00000000
kfdhdb.ub4spare[27]:                  0 ; 0x158: 0x00000000
kfdhdb.ub4spare[28]:                  0 ; 0x15c: 0x00000000
kfdhdb.ub4spare[29]:                  0 ; 0x160: 0x00000000
kfdhdb.ub4spare[30]:                  0 ; 0x164: 0x00000000
kfdhdb.ub4spare[31]:                  0 ; 0x168: 0x00000000
kfdhdb.ub4spare[32]:                  0 ; 0x16c: 0x00000000
kfdhdb.ub4spare[33]:                  0 ; 0x170: 0x00000000
kfdhdb.ub4spare[34]:                  0 ; 0x174: 0x00000000
kfdhdb.ub4spare[35]:                  0 ; 0x178: 0x00000000
kfdhdb.ub4spare[36]:                  0 ; 0x17c: 0x00000000
kfdhdb.ub4spare[37]:                  0 ; 0x180: 0x00000000
kfdhdb.ub4spare[38]:                  0 ; 0x184: 0x00000000
kfdhdb.ub4spare[39]:                  0 ; 0x188: 0x00000000
kfdhdb.ub4spare[40]:                  0 ; 0x18c: 0x00000000
kfdhdb.ub4spare[41]:                  0 ; 0x190: 0x00000000
kfdhdb.ub4spare[42]:                  0 ; 0x194: 0x00000000
kfdhdb.ub4spare[43]:                  0 ; 0x198: 0x00000000
kfdhdb.ub4spare[44]:                  0 ; 0x19c: 0x00000000
kfdhdb.ub4spare[45]:                  0 ; 0x1a0: 0x00000000
kfdhdb.ub4spare[46]:                  0 ; 0x1a4: 0x00000000
kfdhdb.ub4spare[47]:                  0 ; 0x1a8: 0x00000000
kfdhdb.ub4spare[48]:                  0 ; 0x1ac: 0x00000000
kfdhdb.ub4spare[49]:                  0 ; 0x1b0: 0x00000000
kfdhdb.ub4spare[50]:                  0 ; 0x1b4: 0x00000000
kfdhdb.ub4spare[51]:                  0 ; 0x1b8: 0x00000000
kfdhdb.ub4spare[52]:                  0 ; 0x1bc: 0x00000000
kfdhdb.ub4spare[53]:                  0 ; 0x1c0: 0x00000000
kfdhdb.ub4spare[54]:                  0 ; 0x1c4: 0x00000000
kfdhdb.ub4spare[55]:                  0 ; 0x1c8: 0x00000000
kfdhdb.ub4spare[56]:                  0 ; 0x1cc: 0x00000000
kfdhdb.ub4spare[57]:                  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

[oracle@rac01 bin]$ kfod disk=all
--------------------------------------------------------------------------------
 Disk          Size Path     
================================================================================
   1:       1529 Mb ORCL:VOL1
   2:       1529 Mb ORCL:VOL2
   3:       1019 Mb ORCL:VOL3
   4:       1019 Mb ORCL:VOL4
--------------------------------------------------------------------------------
 Disk          Size Path     
================================================================================
   1:        101 Mb /dev/raw/raw1
   2:        101 Mb /dev/raw/raw2
--------------------------------------------------------------------------------
ORACLE_SID ORACLE_HOME                                                         
================================================================================
     +ASM1 /opt/ora10g/product/10.2.0/db_1                          
分享到:
评论

相关推荐

    windows下的kfed

    标题"windows下的kfed"表明,这个压缩包提供了一种在Windows操作系统上实现Oracle ASM KFed功能的方法。描述中提到,这个包可能是由开发者或社区成员创建的,旨在弥补Windows下KFed功能的缺失,它支持Oracle 10g和11...

    asm理论知识

    Kfed是一款强大的工具,用于分析和诊断ASM文件的内部结构。下面通过具体示例来了解如何使用Kfed来获取ASM文件的详细信息。 ##### 1. 查找1号文件的位置 - **命令行操作**:首先通过SQL查询获取磁盘组信息,然后使用...

    KF接线端子封装(三维PCB封装库)AD用PCB封装库

    在电子设计领域,封装是描述电子元器件在PCB板上物理形状和电气连接方式的重要工具。这里的“三维PCB封装库”意味着设计者可以在设计过程中直观地看到元器件的真实立体效果,有助于提高设计质量和效率。 描述部分...

    Oracle数据库非常规恢复方案.pptx

    恢复工具如bbed、kfed、dd和ue可以帮助直接操作数据库文件,但这些工具需要深入的数据库知识和谨慎操作,因为它们可以直接修改数据库的物理结构。此外,第三方工具如DUL(Data Un recover Utility)可以绕过数据库...

    32位 oracle_product_instantclient_11_2_BIN.rar

    32位oracle11.2.0.1 BIN文件夹,数据库管理员版,包含sqlplus,imp,exp,impdp,expdp等完整工具。exe列表:adrci、agtctl、amdu、asmtool、asmtoolg、CreatDep、csscan、dbv、dg4odbc、dg4pwd、dgmgrl、diskmon、...

    oracle自动存储管理结构图

    - `kfed` - `blkid` **3. ASM Metadata Management (元数据管理)** - **定义:** 管理ASM元数据的工具和技术。 - **工具:** - `md_backup` (备份元数据) - `md_restore` (恢复元数据) #### 四、ASM的性能...

    Oracle 10g利用amdu抽取数据文件的方法教程

    接下来,我们讨论KFE(Key File Extraction Device)工具,即KFed,它在Oracle 10g环境中用于访问和操作ASM文件。对于较旧版本的Oracle,可能需要手动编译KFed。编译过程通常在`$ORACLE_HOME/rdbms/lib`目录下进行,...

Global site tag (gtag.js) - Google Analytics