Oracle asm kfed工具的使用之一

[root@localhost db_1]# su  - oracle
[oracle@localhost ~]$ cd /u01/app/oracle/product/10.2.0/db_1/rdbms/lib
[oracle@localhost lib]$ pwd
/u01/app/oracle/product/10.2.0/db_1/rdbms/lib
[oracle@localhost lib]$ ls -lrt ikfed
ls: ikfed: No such file or directory
[oracle@localhost lib]$ ls -lrt ins_rdbms.mk
-rw-r--r-- 1 oracle oinstall 27275 Apr 20  2010 ins_rdbms.mk
[oracle@localhost lib]$ make -f ins_rdbms.mk ikfed

Linking KFED utility (kfed)
rm -f /u01/app/oracle/product/10.2.0/db_1/rdbms/lib/kfed
gcc -o /u01/app/oracle/product/10.2.0/db_1/rdbms/lib/kfed -L/u01/app/oracle/product/10.2.0/db_1/rdbms/lib/ -L/u01/app/oracle/product/10.2.0/db_1/lib/ -L/u01/app/oracle/product/10.2.0/db_1/lib/stubs/  /u01/app/oracle/product/10.2.0/db_1/lib/s0main.o /u01/app/oracle/product/10.2.0/db_1/rdbms/lib/sskfeded.o /u01/app/oracle/product/10.2.0/db_1/rdbms/lib/skfedpt.o  /u01/app/oracle/product/10.2.0/db_1/rdbms/lib/defopt.o -ldbtools10 -lclntsh  `cat /u01/app/oracle/product/10.2.0/db_1/lib/ldflags`    -lnsslb10 -lncrypt10 -lnsgr10 -lnzjs10 -ln10 -lnnz10 -lnl10 -lnro10 `cat /u01/app/oracle/product/10.2.0/db_1/lib/ldflags`    -lnsslb10 -lncrypt10 -lnsgr10 -lnzjs10 -ln10 -lnnz10 -lnl10 -lclient10 -lnnetd10  -lvsn10 -lcommon10 -lgeneric10 -lmm -lsnls10 -lnls10  -lcore10 -lsnls10 -lnls10 -lcore10 -lsnls10 -lnls10 -lxml10 -lcore10 -lunls10 -lsnls10 -lnls10 -lcore10 -lnls10 `cat /u01/app/oracle/product/10.2.0/db_1/lib/ldflags`    -lnsslb10 -lncrypt10 -lnsgr10 -lnzjs10 -ln10 -lnnz10 -lnl10 -lnro10 `cat /u01/app/oracle/product/10.2.0/db_1/lib/ldflags`    -lnsslb10 -lncrypt10 -lnsgr10 -lnzjs10 -ln10 -lnnz10 -lnl10 -lclient10 -lnnetd10  -lvsn10 -lcommon10 -lgeneric10   -lsnls10 -lnls10  -lcore10 -lsnls10 -lnls10 -lcore10 -lsnls10 -lnls10 -lxml10 -lcore10 -lunls10 -lsnls10 -lnls10 -lcore10 -lnls10 -lclient10 -lnnetd10  -lvsn10 -lcommon10 -lgeneric10 -lsnls10 -lnls10  -lcore10 -lsnls10 -lnls10 -lcore10 -lsnls10 -lnls10 -lxml10 -lcore10 -lunls10 -lsnls10 -lnls10 -lcore10 -lnls10   `cat /u01/app/oracle/product/10.2.0/db_1/lib/sysliblist` -Wl,-rpath,/u01/app/oracle/product/10.2.0/db_1/lib -lm    `cat /u01/app/oracle/product/10.2.0/db_1/lib/sysliblist` -ldl -lm   -L/u01/app/oracle/product/10.2.0/db_1/lib
mv -f /u01/app/oracle/product/10.2.0/db_1/bin/kfed /u01/app/oracle/product/10.2.0/db_1/bin/kfedO
mv: cannot stat `/u01/app/oracle/product/10.2.0/db_1/bin/kfed': No such file or directory
make: [ikfed] Error 1 (ignored)
mv /u01/app/oracle/product/10.2.0/db_1/rdbms/lib/kfed /u01/app/oracle/product/10.2.0/db_1/bin/kfed
chmod 751 /u01/app/oracle/product/10.2.0/db_1/bin/kfed
[oracle@localhost lib]$ which kfed
/u01/app/oracle/product/10.2.0/db_1/bin/kfed
[oracle@localhost 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/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]


[oracle@localhost lib]$ export ORACLE_SID=+ASM
[oracle@localhost lib]$ ps -ef | grep asm
oracle    5072     1  0 23:38 ?        00:00:00 asm_pmon_+ASM
oracle    5074     1  0 23:38 ?        00:00:00 asm_psp0_+ASM
oracle    5076     1  0 23:38 ?        00:00:00 asm_mman_+ASM
oracle    5078     1  0 23:38 ?        00:00:00 asm_dbw0_+ASM
oracle    5080     1  0 23:38 ?        00:00:00 asm_lgwr_+ASM
oracle    5082     1  0 23:38 ?        00:00:00 asm_ckpt_+ASM
oracle    5084     1  0 23:38 ?        00:00:00 asm_smon_+ASM
oracle    5086     1  0 23:38 ?        00:00:00 asm_rbal_+ASM
oracle    5088     1  0 23:38 ?        00:00:00 asm_gmon_+ASM
oracle    5280  5168  0 23:46 pts/1    00:00:00 grep asm
[oracle@localhost lib]$ sqlplus / as sysdba

SQL*Plus: Release 10.2.0.5.0 - Production on Tue Jan 6 23:46:27 2015

Copyright (c) 1982, 2010, Oracle.  All Rights Reserved.


Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> show parameter inst

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
active_instance_count                integer
cluster_database_instances           integer     1
instance_groups                      string
instance_name                        string      +ASM
instance_number                      integer     0
instance_type                        string      asm
open_links_per_instance              integer     4
parallel_instance_group              string
parallel_server_instances            integer     1
SQL> Set pagesize 100
SQL> Set linesize 100
SQL> Col name format a15
SQL> select GROUP_NUMBER,NAME,STATE,TYPE,TOTAL_MB,FREE_MB,USABLE_FILE_MB from v$asm_diskgroup;

GROUP_NUMBER NAME            STATE       TYPE     TOTAL_MB    FREE_MB USABLE_FILE_MB
------------ --------------- ----------- ------ ---------- ---------- --------------
           1 DATADG          MOUNTED     EXTERN      15342      15288          15288

SQL> set pagesize 200
SQL> set linesize 150
SQL> col path format a20;
SQL> col group_name format a10
SQL> col name format a20
SQL> select a.group_number,b.name as group_name,a.name,a.path,a.state,a.total_mb from v$asm_disk a,v$asm_diskgroup b where a.group_number=b.group_number;

GROUP_NUMBER GROUP_NAME NAME                 PATH                 STATE      TOTAL_MB
------------ ---------- -------------------- -------------------- -------- ----------
           1 DATADG     DATADG_0000          /dev/raw/raw1        NORMAL         5114
           1 DATADG     DATADG_0001          /dev/raw/raw2        NORMAL         5114
           1 DATADG     DATADG_0002          /dev/raw/raw3        NORMAL         5114

SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@localhost lib]$ kfed read /dev/raw/raw1 text=/home/oracle/asmdisk_raw1.txt
[oracle@localhost lib]$ 
[oracle@localhost lib]$ kfed read /dev/raw/raw2 text=/home/oracle/asmdisk_raw2.txt
[oracle@localhost lib]$ 
[oracle@localhost lib]$ kfed read /dev/raw/raw3 text=/home/oracle/asmdisk_raw3.txt
[oracle@localhost lib]$ 
[oracle@localhost lib]$ cd /home/oracle
[oracle@localhost ~]$ ls -lrt
total 215832
drwxr-xr-x  2 oracle oinstall      4096 Dec 11  2012 META-INF
-rwxr-xr-x  1 root   root          6464 May 14  2013 oracle_user_setup.sql
-rwxr-xr-x  1 root   root          2977 May 14  2013 oracle_drop_db_permissions.sql
-rw-r--r--  1 oracle oinstall 144608374 May 15  2013 agent.jar
drwxr-xr-x  3 oracle oinstall      4096 May 15  2013 network
drwxr-xr-x  8 oracle oinstall      4096 May 15  2013 av
drwxr-xr-x  7 oracle oinstall      4096 May 15  2013 bin
drwxr-x---  3 oracle oinstall      4096 May 15  2013 oradiag_oracle
drwxr-xr-x  3 oracle oinstall      4096 May 25  2013 11g
-rw-r--r--  1 oracle oinstall      1009 May 25  2013 pfile0526.ora
drwxr-xr-x  2 oracle oinstall      4096 May 25  2013 patch
-rw-r--r--  1 oracle oinstall    214064 May 26  2013 hcheck3.sql
-r--r--r--  1 oracle oinstall        50 Jul 23  2013 readme.txt
-rw-r--r--  1 root   root      75862388 Aug  2  2013 p17036223_80_Linux-x86-64.zip
drwxr-xr-x 18 oracle oinstall      4096 Aug 11  2013 rda
-rw-r--r--  1 oracle oinstall      2076 Dec 28  2013 shrink.sql
-rw-------  1 oracle oinstall      1554 Dec 28  2013 nohup.out
-rw-r--r--  1 oracle oinstall      6609 Jan  6 23:49 asmdisk_raw1.txt
-rw-r--r--  1 oracle oinstall      6609 Jan  6 23:49 asmdisk_raw2.txt
-rw-r--r--  1 oracle oinstall      6609 Jan  6 23:49 asmdisk_raw3.txt



asmdisk_raw1.txt的内容如下:

 

kfbh.endian:                          1 ; 0x000: 0x01    --->字节序:Littleendian = 1;Bigendian = 0
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:                  1222233764 ; 0x00c: 0x48d9cea4
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:             DATADG_0000 ; 0x028: length=11
kfdhdb.grpname:                  DATADG ; 0x048: length=6
kfdhdb.fgname:              DATADG_0000 ; 0x068: length=11
kfdhdb.capname:                         ; 0x088: length=0
kfdhdb.crestmp.hi:             33014999 ; 0x0a8: HOUR=0x17 DAYS=0x6 MNTH=0x1 YEAR=0x7df
kfdhdb.crestmp.lo:           2629775360 ; 0x0ac: USEC=0x0 MSEC=0x3cc SECS=0xb MINS=0x27
kfdhdb.mntstmp.hi:             33014999 ; 0x0b0: HOUR=0x17 DAYS=0x6 MNTH=0x1 YEAR=0x7df
kfdhdb.mntstmp.lo:           2640999424 ; 0x0b4: USEC=0x0 MSEC=0x29d SECS=0x16 MINS=0x27
kfdhdb.secsize:                     512 ; 0x0b8: 0x0200
kfdhdb.blksize:                    4096 ; 0x0ba: 0x1000
kfdhdb.ausize:                  1048576 ; 0x0bc: 0x00100000
kfdhdb.mfact:                    113792 ; 0x0c0: 0x0001bc80
kfdhdb.dsksize:                    5114 ; 0x0c4: 0x000013fa
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]:                0 ; 0x0da: 0x0000
kfdhdb.redomirrors[2]:                0 ; 0x0dc: 0x0000
kfdhdb.redomirrors[3]:                0 ; 0x0de: 0x0000
kfdhdb.dbcompat:              168820736 ; 0x0e0: 0x0a100000
kfdhdb.grpstmp.hi:             33014999 ; 0x0e4: HOUR=0x17 DAYS=0x6 MNTH=0x1 YEAR=0x7df
kfdhdb.grpstmp.lo:           2628680704 ; 0x0e8: USEC=0x0 MSEC=0x39f SECS=0xa MINS=0x27
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


 

郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。