首次使用bbed前必須要經過鏈接編譯。編譯方法如下:
[oraten@yue lib]$ make -f ins_rdbms.mk $ORACLE_HOME/rdbms/lib/bbed Linking BBED utility (bbed) rm -f /home/app/oraten/product/10.2.0/db_1/rdbms/lib/bbed gcc -o /home/app/oraten/product/10.2.0/db_1/rdbms/lib/bbed -L/home/app/oraten/product/10.2.0/db_1/rdbms/lib/ -L/home/app/oraten/product/10.2.0/db_1/lib/ -L/home/app/oraten/product/10.2.0/db_1/lib/stubs/ /home/app/oraten/product/10.2.0/db_1/lib/s0main.o /home/app/oraten/product/10.2.0/db_1/rdbms/lib/ssbbded.o /home/app/oraten/product/10.2.0/db_1/rdbms/lib/sbbdpt.o `cat /home/app/oraten/product/10.2.0/db_1/lib/ldflags` -lnsslb10 -lncrypt10 -lnsgr10 -lnzjs10 -ln10 -lnnz10 -lnl10 /home/app/oraten/product/10.2.0/db_1/rdbms/lib/defopt.o -ldbtools10 -lclntsh `cat /home/app/oraten/product/10.2.0/db_1/lib/ldflags` -lnsslb10 -lncrypt10 -lnsgr10 -lnzjs10 -ln10 -lnnz10 -lnl10 -lnro10 `cat /home/app/oraten/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 /home/app/oraten/product/10.2.0/db_1/lib/ldflags` -lnsslb10 -lncrypt10 -lnsgr10 -lnzjs10 -ln10 -lnnz10 -lnl10 -lnro10 `cat /home/app/oraten/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 /home/app/oraten/product/10.2.0/db_1/lib/sysliblist` -Wl,-rpath,/home/app/oraten/product/10.2.0/db_1/lib -lm `cat /home/app/oraten/product/10.2.0/db_1/lib/sysliblist` -ldl -lm -L/home/app/oraten/product/10.2.0/db_1/lib [oraten@yue lib]$ ll -rwxr-xr-x 1 oraten dba 706118 9月 30 21:37 bbed編譯完成後,就可以使用了,bbed默認密碼為:blockedit
[oraten@yue bin]$ ./bbed help=yes PASSWORD - Required parameter FILENAME - Database file name BLOCKSIZE - Database block size LISTFILE - List file name MODE - [browse/edit] SPOOL - Spool to logfile [no/yes] CMDFILE - BBED command file name LOGFILE - BBED log file name PARFILE - Parameter file name BIFILE - BBED before-image file name REVERT - Rollback changes from BIFILE [no/yes] SILENT - Hide banner [no/yes] HELP - Show all valid parameters [no/yes]istfile選項用listfile的路徑,listfile中存儲了需要編輯的數據文件的相關信息,如,
Listfile=/home/oracle/bbed/fileunix.log [oracle@jode bbed] cat fileunix.log 1 /home/oracle/oradata/oraten/user01.dbf 216214400 2 /home/oracle/oradata/oraten/system01.dbf 335544320注意,這裡的1 和 2 是在bbed中為各個文件指定的編號,與數據庫中的file#沒有任何關系,但是我們建議將兩者保持一致。我們可以通過如下語句來生成listfile的文件內容select file#||’ ‘||name||’ ‘||bytes from v$datafile;
BBED: Release 2.0.0.0.0 - Limited Production on 星期三 10月 1 20:20:09 2014 Copyright (c) 1982, 2007, Oracle. All rights reserved. ************* !!! For Oracle Internal Use only !!! *************** BBED> help all SET DBA [ dba | file#, block# ] SET FILENAME 'filename' SET FILE file# SET BLOCK [+/-]block# SET OFFSET [ [+/-]byte offset | symbol | *symbol ] SET BLOCKSIZE bytes SET LIST[FILE] 'filename' SET WIDTH character_count SET COUNT bytes_to_display SET IBASE [ HEX | OCT | DEC ] SET OBASE [ HEX | OCT | DEC ] SET MODE [ BROWSE | EDIT ] SET SPOOL [ Y | N ] SHOW [ <SET parameter> | ALL ] INFO MAP[/v] [ DBA | FILENAME | FILE | BLOCK ] DUMP[/v] [ DBA | FILENAME | FILE | BLOCK | OFFSET | COUNT ] PRINT[/x|d|u|o|c] [ DBA | FILE | FILENAME | BLOCK | OFFSET | symbol | *symbol ] EXAMINE[/Nuf] [ DBA | FILE | FILENAME | BLOCK | OFFSET | symbol | *symbol ] </Nuf>: N - a number which specifies a repeat count. u - a letter which specifies a unit size: b - b1, ub1 (byte) h - b2, ub2 (half-word) w - b4, ub4(word) r - Oracle table/index row f - a letter which specifies a display format: x - hexadecimal d - decimal u - unsigned decimal o - octal c - character (native) n - Oracle number t - Oracle date i - Oracle rowid FIND[/x|d|u|o|c] numeric/character string [ TOP | CURR ] COPY [ DBA | FILE | FILENAME | BLOCK ] TO [ DBA | FILE | FILENAME | BLOCK ] MODIFY[/x|d|u|o|c] numeric/character string [ DBA | FILE | FILENAME | BLOCK | OFFSET | symbol | *symbol ] ASSIGN[/x|d|u|o] <target spec>=<source spec> <target spec> : [ DBA | FILE | FILENAME | BLOCK | OFFSET | symbol | *symbol ] <source spec> : [ value | <target spec options> ] SUM [ DBA | FILE | FILENAME | BLOCK ] [ APPLY ] PUSH [ DBA | FILE | FILENAME | BLOCK | OFFSET ] POP [ALL] REVERT [ DBA | FILE | FILENAME | BLOCK ] UNDO HELP [ <bbed command> | ALL ] VERIFY [ DBA | FILE | FILENAME | BLOCK ] CORRUPT [ DBA | FILE | FILENAME | BLOCK ]set dba [dba | file#,block#]
用來設置需要查看和編輯的數據塊,該命令有兩種使用方法,一種是直接指定數據塊的dba,另一中是指定file#( listfile中的文件號)和block#。
BBED> set dba 5,1 DBA 0x01400001 (20971521 5,1) BBED> find /c TBS3 File: /home/app/oraten/oradata/oraten/tbs301.dbf (5) Block: 1 Offsets: 338 to 849 Dba:0x01400001 ------------------------------------------------------------------------ 54425333 00000000 00000000 00000000 00000000 00000000 00000000 00000500 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00001bd5 3c33a9ec 05000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 0000a82a 0b000000 00008e05 4c330100 00001300 0000fd00 00001000 00000200 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000d00 0d000d00 01000000 00000000 00000000 00000200 40010000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 <32 bytes per line> BBED> set dba 0x01400001 DBA 0x01400001 (20971521 5,1) BBED> find /c TBS3 File: /home/app/oraten/oradata/oraten/tbs301.dbf (5) Block: 1 Offsets: 338 to 849 Dba:0x01400001 ------------------------------------------------------------------------ 54425333 00000000 00000000 00000000 00000000 00000000 00000000 00000500 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00001bd5 3c33a9ec 05000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 0000a82a 0b000000 00008e05 4c330100 00001300 0000fd00 00001000 00000200 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000d00 0d000d00 01000000 00000000 00000000 00000200 40010000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 <32 bytes per line>我們知道,在bbed中file#指的是listfile文件中各個數據文件的變化,並不是數據字典中各個數據文件的file#,那麼bbed是如何根據DBA來定位文件和數據塊的那?原來在每個數據文件的頭部的kccfhfno位置存儲著該文件在數據庫中的文件編號。如
BBED> p kcvfhhdr struct kcvfhhdr, 76 bytes @20 ub4 kccfhswv @20 0x00000000 ub4 kccfhcvn @24 0x0a200500 ub4 kccfhdbi @28 0xda0e3a18 text kccfhdbn[0] @32 O text kccfhdbn[1] @33 R text kccfhdbn[2] @34 A text kccfhdbn[3] @35 T text kccfhdbn[4] @36 E text kccfhdbn[5] @37 N text kccfhdbn[6] @38 text kccfhdbn[7] @39 ub4 kccfhcsq @40 0x000006f3 ub4 kccfhfsz @44 0x00000500 s_blkz kccfhbsz @48 0x00 ub2 kccfhfno @52 0x0005 ub2 kccfhtyp @54 0x0003 ub4 kccfhacid @56 0x00000000 ub4 kccfhcks @60 0x00000000 text kccfhtag[0] @64 text kccfhtag[1] @65 text kccfhtag[2] @66 text kccfhtag[3] @67 text kccfhtag[4] @68 text kccfhtag[5] @69 text kccfhtag[6] @70 text kccfhtag[7] @71 text kccfhtag[8] @72 text kccfhtag[9] @73 text kccfhtag[10] @74 text kccfhtag[11] @75 text kccfhtag[12] @76 text kccfhtag[13] @77 text kccfhtag[14] @78 text kccfhtag[15] @79 text kccfhtag[16] @80 text kccfhtag[17] @81 text kccfhtag[18] @82 text kccfhtag[19] @83 text kccfhtag[20] @84 text kccfhtag[21] @85 text kccfhtag[22] @86 text kccfhtag[23] @87 text kccfhtag[24] @88 text kccfhtag[25] @89 text kccfhtag[26] @90 text kccfhtag[27] @91 text kccfhtag[28] @92 text kccfhtag[29] @93 text kccfhtag[30] @94 text kccfhtag[31] @95
Set file name
設定當前編輯的數據文件,文件名稱用單引號括起來BBED> set filename '/home/app/oraten/oradata/oraten/tbs101.dbf' FILENAME /home/app/oraten/oradata/oraten/tbs101.dbf
Set width
設定當前的屏幕寬度,如果沒有設定,默認為80,例如BBED> set width 120 WIDTH 120
Set ibase
設置與bbed交互的數字格式(僅僅是交互格式),默認為10進制,也可以設置為其他,如hex 等BBED> set ibase hex IBASE Hex BBED> set block B BLOCK# 11 BBED> show block BLOCK# 11
Set obase
設置bbed的輸出格式,默認是10,可以設置為其他,如 hexBBED> set block 11 BLOCK# 0x0000000b BBED> set obase dec OBASE Dec BBED> set block 11 BLOCK# 11Set mode
BBED> map File: /home/app/oraten/oradata/oraten/tbs101.dbf (5) Block: 20 Dba:0x01400014 ------------------------------------------------------------ KTB Data Block (Table/Cluster) struct kcbh, 20 bytes @0 struct ktbbh, 72 bytes @20 struct kdbh, 14 bytes @100 struct kdbt[1], 4 bytes @114 sb2 kdbr[2] @118 ub1 freespace[8040] @122 ub1 rowdata[26] @8162 ub4 tailchk @8188 BBED> map /v File: /home/app/oraten/oradata/oraten/tbs101.dbf (5) Block: 20 Dba:0x01400014 ------------------------------------------------------------ KTB Data Block (Table/Cluster) struct kcbh, 20 bytes @0 ub1 type_kcbh @0 ub1 frmt_kcbh @1 ub1 spare1_kcbh @2 ub1 spare2_kcbh @3 ub4 rdba_kcbh @4 ub4 bas_kcbh @8 ub2 wrp_kcbh @12 ub1 seq_kcbh @14 ub1 flg_kcbh @15 ub2 chkval_kcbh @16 ub2 spare3_kcbh @18 struct ktbbh, 72 bytes @20 ub1 ktbbhtyp @20 union ktbbhsid, 4 bytes @24 struct ktbbhcsc, 8 bytes @28 b2 ktbbhict @36 ub1 ktbbhflg @38 ub1 ktbbhfsl @39 ub4 ktbbhfnx @40 struct ktbbhitl[2], 48 bytes @44 struct kdbh, 14 bytes @100 ub1 kdbhflag @100 b1 kdbhntab @101 b2 kdbhnrow @102 sb2 kdbhfrre @104 sb2 kdbhfsbo @106 sb2 kdbhfseo @108 b2 kdbhavsp @110 b2 kdbhtosp @112 struct kdbt[1], 4 bytes @114 b2 kdbtoffs @114 b2 kdbtnrow @116 sb2 kdbr[2] @118 ub1 freespace[8040] @122 ub1 rowdata[26] @8162 ub4 tailchk @8188下面來詳細解釋各個區間的數據內容,
Structure /element
description
Struct kcbh,20 bytes
Block header structure
---- ub1 type_kcbh
Block type
01
Undo segment header
02
Undo data block
03
Save undo header
04
Save undo data bock
05
Data segment header(temp,index,data and so on)
06
KTB managed data block(with ITL)
07
Temp table data block(no ITL)
08
Sort Key
09
Sort Run
10
Segment free list block
11
Data file header
---ub1 frmt_kcb
Block format 1=oracle 7,2 =oracle 8+
---ub1 spare1_kcbh
Not used
---ub1 spare2_kchb
Not used
---ub4 rdba_kcbh
Rdba- relative data block address
---ub4 bas_kcbh
Scn base
----ub2 wrp_kcbh
Scn wrap
----ub1 seq_kcbh
Sequence number,incremented for every change made to the block at the sam scn
----ub1 flg_kcbh
Flag:
Ox01 new block
0x02 delayed logging change advanced scn/seq
0x04 check value saved - block XOR’s to zero
0x08 temporary block
----ub2 chkval_kcbh
Optional block checksun(if db_block_checksum=true)
-----ub2 spare3_kcbh
Not used
Struct ktbbh ,72 bytes
Transaction fixed header structure
------ub1 ktbbhtyp
Block type(1=data,2=index)
------union ktbbhsid,4 bytes
Segment/object id
------struct ktbbhcsc,8 bytes
Scn at last block cleanout
------b2 ktbbhict
Number of itl slots
------ub1 ktbbhflg
0=on the freelist
------ub1 ktbbhfsl
Itl tx freelist slot
------ub4 ktbbhfnx
Dba of next block on freelist
------struct ktbbhitl[2],48 bytes
Itl list index
Struct kdbh,14 bytes
Data header structure
---ub1 kdbhflag
N=pctfree hit(clusters);F=do not put on freelist;K=flushable cluster keys
---b1 kdbhntab
Number of tables(>1 in clusters)
----b2 kdbhnrow
Number of rows( 記錄刪除後,並不會立即在數據塊中清除記錄數據,僅僅是將記錄標記為已刪除,等真正需要已刪除記錄的空間時才會真正刪除記錄,此時kdbhnrow 的值才會發送變化)
-----sb2 kdbhfree
First free row entry index;-1=you have to add one
---sb2 kdbhfsbo
Freespace begin offset
----sb2 kdbhfseo
Freespace end offset
----b2 kdbhavsp
Available space in the block
-----b2 kdbhtosp
Total available space when all TXs commit
Struct kdbt[1],4 bytes
Table directory entry structure
---b2 kdbtoffs
----b2 kdbtnrow
Sb2 kdbr[1](1指記錄的數量)
Row directory, kdbr中的每條記錄存儲的是數據記錄在數據塊中的偏移量,該偏移量是針對kdbh計算的
Ub1 freespace[8030]
Free space
Ub1 rowdata[38](38指記錄占據字節數量)
Row data
Ub4 tailchkdocs
The tial of an oracle 8+ block is a concatenationof the lower order two bytes of the scn base,the block type and the scn sequence number.although the tail check value is generated form three components, oracle treats the final value as a single unsigned integer stored as a word(4 bytes). On litter-endian architecture machines,which include intel the value will stores as low-order byte first..e,g A tail check of 0x97280602 stored on an intl machine would be wirtten to disk as 02062897.
BBED> show all FILE# 5 BLOCK# 20 OFFSET 0 DBA 0x01400014 (20971540 5,20) FILENAME /home/app/oraten/oradata/oraten/tbs101.dbf BIFILE bifile.bbd LISTFILE /home/oraten/filelist.txt BLOCKSIZE 8192 MODE Edit EDIT Unrecoverable IBASE Dec OBASE Dec WIDTH 80 COUNT 512 LOGFILE log.bbd SPOOL No BBED> find /c nnn File: /home/app/oraten/oradata/oraten/tbs101.dbf (5) Block: 20 Offsets: 8169 to 8191 Dba:0x01400014 ------------------------------------------------------------------------ 6e6e6e2c 000202c1 0301622c 000202c1 02016101 06aee7 <32 bytes per line> BBED> dump File: /home/app/oraten/oradata/oraten/tbs101.dbf (5) Block: 20 Offsets: 8169 to 8191 Dba:0x01400014 ------------------------------------------------------------------------ 6e6e6e2c 000202c1 0301622c 000202c1 02016101 06aee7 <32 bytes per line> BBED> dump /v File: /home/app/oraten/oradata/oraten/tbs101.dbf (5) Block: 20 Offsets: 8169 to 8191 Dba:0x01400014 ------------------------------------------------------- 6e6e6e2c 000202c1 0301622c 000202c1 l nnn,......b,.... 02016101 06aee7 l ..a.... <16 bytes per line>PRINT
BBED> show all FILE# 5 BLOCK# 20 OFFSET 0 DBA 0x01400014 (20971540 5,20) FILENAME /home/app/oraten/oradata/oraten/tbs101.dbf BIFILE bifile.bbd LISTFILE /home/oraten/filelist.txt BLOCKSIZE 8192 MODE Edit EDIT Unrecoverable IBASE Dec OBASE Dec WIDTH 80 COUNT 512 LOGFILE log.bbd SPOOL No BBED> p kcbh.type_kcbh -------------- ub1 type_kcbh @0 0x06
BBED> p kdbr (這是第二類用法,即指定數據結構名稱) sb2 kdbr[0] @118 8062 sb2 kdbr[1] @120 8072 BBED> print *kdbr[0] rowdata[0] ---------- ub1 rowdata[0] @8162 0x2c
BBED> print rowdata[7] ---------- ub1 rowdata[7] @8169 0x6e BBED> print /c rowdata[7] ---------- ub1 rowdata[7] @8169 n BBED> print /n rowdata[7] ---------- ub1 rowdata[7] @8169 110我們也可以指定數據結構的名稱,來打印顯示該結構的詳細信息,如
BBED> p kcbh struct kcbh, 20 bytes @0 ub1 type_kcbh @0 0x06 ub1 frmt_kcbh @1 0xa2 ub1 spare1_kcbh @2 0x00 ub1 spare2_kcbh @3 0x00 ub4 rdba_kcbh @4 0x01400014 ub4 bas_kcbh @8 0x0006e7ae ub2 wrp_kcbh @12 0x0000 ub1 seq_kcbh @14 0x01 ub1 flg_kcbh @15 0x06 (KCBHFDLC, KCBHFCKV) ub2 chkval_kcbh @16 0xcc8e ub2 spare3_kcbh @18 0x0000
EXAMPLE
Example命令用來顯示數據塊中的數據,可以直接指定dba offset,也可以直接使用當前的dba offset。我們可以指定example按照不同的格式顯示數據塊數據,其中比較有意義的是我們可以使用example來查看數據記錄。如下所示:SQL> desc scott.ta Name Null? Type ----------------------------------------- -------- ---------------------------- ID NUMBER NAME VARCHAR2(10) RIQI DATE SQL> select * from scott.ta; ID NAME RIQI ---------- ---------- ------------------- 1 nnn 2014-10-07 13:19:00 2 b 2014-10-07 13:19:00 3 ss 2014-10-07 14:00:15 4 lll 2014-10-07 14:03:09使用bbed查看數據塊數據:
BBED> map File: /home/app/oraten/oradata/oraten/tbs101.dbf (5) Block: 21 Dba:0x01400015 ------------------------------------------------------------ KTB Data Block (Table/Cluster) struct kcbh, 20 bytes @0 struct ktbbh, 72 bytes @20 struct kdbh, 14 bytes @100 struct kdbt[1], 4 bytes @114 sb2 kdbr[2] @118 ub1 freespace[8031] @122 ub1 rowdata[35] @8153 ub4 tailchk @8188 BBED> p *kdbr[0] rowdata[18] ----------- ub1 rowdata[18] @8171 0x2c BBED> x /rnct rowdata[18] @8171 ----------- flag@8171: 0x2c (KDRHFL, KDRHFF, KDRHFH) lock@8172: 0x01 cols@8173: 3 col 0[2] @8174: 3 col 1[2] @8177: ss col 2[7] @8180: 2014-10-07 14:00:15 BBED> x /b rowdata[18] @8171 ----------- 0x2c BBED> x /h rowdata[18] @8171 ----------- 0x012c BBED> x /w rowdata[18] @8171 ----------- 0x0203012c BBED> x /l rowdata[18] @8171 ----------- 0x0203012c BBED> set offset 8153 OFFSET 8153 BBED> x /2rnct rowdata[0] @8153 ---------- flag@8153: 0x2c (KDRHFL, KDRHFF, KDRHFH) lock@8154: 0x02 cols@8155: 3 col 0[2] @8156: 4 col 1[3] @8159: lll col 2[7] @8163: 2014-10-07 14:03:09 rowdata[18] @8171 ----------- flag@8171: 0x2c (KDRHFL, KDRHFF, KDRHFH) lock@8172: 0x01 cols@8173: 3 col 0[2] @8174: 3 col 1[2] @8177: ss col 2[7] @8180: 2014-10-07 14:00:15Find
Find命令用來在數據塊中查找數據,可以按照十進制、十六進制、八進制和字符格式進行查找,如
Switch DatatypeBBED> find /c n File: /home/app/oraten/oradata/oraten/tbs101.dbf (5) Block: 20 Offsets: 8151 to 8191 Dba:0x01400014 ------------------------------------------------------------------------ 6e6e6e07 78720a07 0e14012c 000202c1 02036e6e 6e2c0002 02c10301 622c0002 02c10201 61010694 51 <32 bytes per line> BBED> f File: /home/app/oraten/oradata/oraten/tbs101.dbf (5) Block: 20 Offsets: 8152 to 8191 Dba:0x01400014 ------------------------------------------------------------------------ 6e6e0778 720a070e 14012c00 0202c102 036e6e6e 2c000202 c1030162 2c000202 c1020161 01069451 <32 bytes per line> BBED> f File: /home/app/oraten/oradata/oraten/tbs101.dbf (5) Block: 20 Offsets: 8153 to 8191 Dba:0x01400014 ------------------------------------------------------------------------ 6e077872 0a070e14 012c0002 02c10203 6e6e6e2c 000202c1 0301622c 000202c1 02016101 069451 <32 bytes per line>Copy
BBED> help assign ASSIGN[/x|d|u|o] <target spec>=<source spec> <target spec> : [ DBA | FILE | FILENAME | BLOCK | OFFSET | symbol | *symbol ] <source spec> : [ value | <target spec options> ] 使用過程中,我們可以省略源或者目標,省略部分被當前offset所在的數據結構代替。在使用assign命令時,雖然我們可以指定offset,但實際上被賦值的是offset所在位置的數據結構,如: BBED> print kcbh struct kcbh, 20 bytes @0 ub1 type_kcbh @0 0x06 ub1 frmt_kcbh @1 0x02 ub1 spare1_kcbh @2 0x00 ub1 spare2_kcbh @3 0x00 ub4 rdba_kcbh @4 0x01400014 ub4 bas_kcbh @8 0x00075194 ub2 wrp_kcbh @12 0x0000 ub1 seq_kcbh @14 0x01 ub1 flg_kcbh @15 0x06 (KCBHFDLC, KCBHFCKV) ub2 chkval_kcbh @16 0xae67 ub2 spare3_kcbh @18 0x0000 BBED> assign 9=1 ub4 bas_kcbh @8 0x00000001 BBED> print kcbh struct kcbh, 20 bytes @0 ub1 type_kcbh @0 0x06 ub1 frmt_kcbh @1 0x02 ub1 spare1_kcbh @2 0x00 ub1 spare2_kcbh @3 0x00 ub4 rdba_kcbh @4 0x01400014 ub4 bas_kcbh @8 0x00000001 ub2 wrp_kcbh @12 0x0000 ub1 seq_kcbh @14 0x01 ub1 flg_kcbh @15 0x06 (KCBHFDLC, KCBHFCKV) ub2 chkval_kcbh @16 0xae67 ub2 spare3_kcbh @18 0x0000 BBED> assign 9=0x00075194 ub4 bas_kcbh @8 0x00075194 Sum Sum命令被用來檢測和設置數據塊的校驗值, BBED> help sum SUM [ DBA | FILE | FILENAME | BLOCK ] [ APPLY ] Revert Revert命令用來將數據文件恢復到bbed剛打開時的狀態。 Undo Undo命令用來撤銷上次的編輯操作,如果再次undo又會重做上次的編輯。 Verify 用來對數據塊的完整性進行驗證,類似dbv工具。 Corrupt 用來標示數據塊為物理損壞