Home > Troubleshooting > Kernel Files Editor (KFED )and KFOD ( OSM Discovery utility )

Kernel Files Editor (KFED )and KFOD ( OSM Discovery utility )

A friend of mine had a problem with ASM instance when disks got corruped and crashed…I mention to him that he can use  KFED&KFOD utilities to get usefull information..

KFED – Kernel Files Editor

Let’s get some info for this utility:

strace -d kfed -e read=all -e write=all
pid 648 stopped, [SIGTRAP]
open(“/oracle/product/11.1.0.6/asm/rdbms/mesg/kfedus.msb”, O_RDONLY [wait(0x57f) = 648]
pid 648 stopped, [SIGTRAP]
and check $ORACLE_HOME/rdbms/mesg  file kfedus.msg
 

/ NAME
/   kfedus.msg
/   Error messages for Kernel Files Editor (KFED).  so I got correct name …

or get the help how to use it from strings command:
 

Allocation Unit size in bytes [AUSZ=number]
Metadata block size in bytes [BLKSZ=number]
AU number to examine or update [AUNUM=number]
Block number to examine or update [BLKNUM=number]
Count of AUs to process [CNT=number]
ASM metadata block type number [TYPE=number]
Update checksum before each write [CHKSUM=YES/NO]
KFED operation type [OP=READ/WRITE/MERGE/NEW/FORM/FIND/STRUCT]
ASM device to examine or update [DEV=string]
File name for translated block text [TEXT=string]
Name for provisioning purposes [PROVNM=string]
AU number to seek to [SEEK=number]

and like everyone else ( seek for help -h  )
 

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]
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]
Examples:
This command will check disk header for disks in this group:

 -sh-3.2$ kfed read /dev/oracleasm/disks/REDO

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:                  3111512515 ; 0x00c: 0xb975e9c3
kfbh.fcn.base:                        0 ; 0x010: 0x00000000
kfbh.fcn.wrap:                        0 ; 0x014: 0x00000000
kfbh.spare1:                          0 ; 0x018: 0x00000000
kfbh.spare2:                          0 ; 0x01c: 0x0000000
 …..

or for specific AU
$ kfed read /dev/asmdisk20 aunum=2 blknum=0 text=disk20_dd.txt
you can also dump blocks i aliases directory:
 

To get information query x$kffxp ( ASM allocation table ).Alias is stored in file number 6:
 

select DISK_KFFXP,AU_KFFXP,PXN_KFFXP,XNUM_KFFXP,LXN_KFFXP
from x$kffxp
where GROUP_KFFXP=1
and NUMBER_KFFXP=6;

I did only read option only since currently I do not have test environment to play with but other options are also there too..
 

Now let’s check KFOD.As a name suggest it is used to discover disk from the operating system level.Name should be ASM Discovery utility…not OSM…  I guess O stand for Operating …

 

kfod -h
_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          Disks in diskgroup [group=’diskgroup’]
n/ohdr          KFOD header suppression [nohdr=TRUE/(FALSE)]
o/p             KFOD options type [OP=DISKS/GROUPS/INSTS/VERSION/CLIENTS/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)]

Examples:

-sh-3.2$ kfod
——————————————————————————–
ORACLE_SID ORACLE_HOME
================================================================================
     +ASM1 /oracle/product/11.1.0.6/asm
     +ASM2 /oracle/product/11.1.0.6/asm
    
-sh-3.2$ kfod disks=all
——————————————————————————–
 Disk          Size Path
================================================================================
   1:     804732 Mb ORCL:DATA
   2:     836403 Mb ORCL:REDO
——————————————————————————–
ORACLE_SID ORACLE_HOME
================================================================================
     +ASM1 /oracle/product/11.1.0.6/asm
     +ASM2 /oracle/product/11.1.0.6/asm 

or

 kfod asm_diskstring=’ORCL:*’ disks=all

About these ads
Categories: Troubleshooting
  1. May 19, 2009 at 7:10 pm

    Hi Miladin,

    came across your blog through Doug Burns’s deadlock series. Very interesseting material.
    BTW: the O in OSM actually stands for … Oracle. Who would have thought :-) I guess it was rebranded to ASM to fit the 10g automatic everything stuff.

    regards, Tony

  2. May 19, 2009 at 8:04 pm

    Hi Tony,

    I guess now MY SQL soon will be
    MY Oracle :)

    Miladin

  1. December 2, 2010 at 6:58 am
  2. February 23, 2012 at 4:59 am
  3. February 23, 2012 at 3:54 pm

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 47 other followers

%d bloggers like this: