Kernel Files Editor (KFED )and KFOD ( OSM Discovery utility )
March 10, 2009 2 Comments
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 ; 0×000: 0×01
kfbh.hard: 130 ; 0×001: 0×82
kfbh.type: 1 ; 0×002: KFBTYP_DISKHEAD
kfbh.datfmt: 1 ; 0×003: 0×01
kfbh.block.blk: 0 ; 0×004: T=0 NUMB=0×0
kfbh.block.obj: 2147483648 ; 0×008: TYPE=0×8 NUMB=0×0
kfbh.check: 3111512515 ; 0x00c: 0xb975e9c3
kfbh.fcn.base: 0 ; 0×010: 0×00000000
kfbh.fcn.wrap: 0 ; 0×014: 0×00000000
kfbh.spare1: 0 ; 0×018: 0×00000000
kfbh.spare2: 0 ; 0x01c: 0×0000000
…..
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
Hi Miladin,
came across your blog through Doug Burns’s deadlock series. Very interesseting material.
I guess it was rebranded to ASM to fit the 10g automatic everything stuff.
BTW: the O in OSM actually stands for … Oracle. Who would have thought
regards, Tony
Hi Tony,
I guess now MY SQL soon will be
MY Oracle
Miladin