[20210920]bbed的assign命令.txt
[20210920]bbed的assign命令.txt
--//在windows下使用bbed的assign,發現沒有linux下遇到的問題,做一個記錄。
D:\tools\bbed>ver
Microsoft Windows XP [版本 5.1.2600]
BBED> info all
File# Name Size(blks)
----- ---- ----------
7 d:\tools\bbed\tea01.dbf 0
BBED> set dba 7,140
DBA 0x01c0008c (29360268 7,140)
BBED> x /rnccntnnn dba 7,140 *kdbr[0]
rowdata[529] @8150
------------
flag@8150: 0x2c (KDRHFL, KDRHFF, KDRHFH)
lock@8151: 0x00
cols@8152: 8
col 0[3] @8153: 7369
col 1[5] @8157: SMITH
col 2[5] @8163: CLERK
col 3[3] @8169: 7902
col 4[7] @8173: 1980-12-17 00:00:00
col 5[2] @8181: 800
col 6[0] @8184: *NULL*
col 7[2] @8185: 20
BBED> p dba 7,140 kcbh.bas_kcbh
ub4 bas_kcbh @8 0x15055972
BBED> assign 8=0xf5055972
Warning: contents of previous BIFILE will be lost. Proceed? (Y/N) y
ub4 bas_kcbh @8 0xf5055972
--//第1位大於0x8.
BBED> p dba 7,140 kcbh.bas_kcbh
ub4 bas_kcbh @8 0xf5055972
--//可以發現windows下的bbed使用assign沒有任何問題,難道當時在linux測試有什麼細節我沒有注意嗎?
--//重複在linux下的測試如下:
SCOTT@book> @ ver1
PORT_STRING VERSION BANNER
------------------------------ -------------- --------------------------------------------------------------------------------
x86_64/Linux 2.4.xx 11.2.0.4.0 Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
SCOTT@book> create table empx as select * from emp;
Table created.
SCOTT@book> select rowid from empx where rownum=1;
ROWID
------------------
AAAW4gAAEAAAAmjAAA
SCOTT@book> @ rowid AAAW4gAAEAAAAmjAAA
OBJECT FILE BLOCK ROW ROWID_DBA DBA TEXT
---------- ---------- ---------- ---------- -------------------- -------------------- ----------------------------------------
93728 4 2467 0 0x10009A3 4,2467 alter system dump datafile 4 block 2467
SCOTT@book> alter system checkpoint ;
System altered.
--//使用bbed修改:
BBED> set dba 4,2467
DBA 0x010009a3 (16779683 4,2467)
BBED> p /x dba 4,2467 kcbh.wrp_kcbh
ub2 wrp_kcbh @12 0x0003
BBED> p /x dba 4,2467 kcbh.bas_kcbh
ub4 bas_kcbh @8 0x7fa46d5f
BBED> assign 12=2;
Warning: contents of previous BIFILE will be lost. Proceed? (Y/N) y
ub2 wrp_kcbh @12 0x0002
BBED> p /x dba 4,2467 kcbh.wrp_kcbh
ub2 wrp_kcbh @12 0x0002
BBED> assign 8=0x8fa46d5f
BBED-00207: invalid offset specifier (8fa46d5f)
BBED> assign 8=0x6fa46d5f
ub4 bas_kcbh @8 0x6fa46d5f
--//可以發現修改第1位是大於0x8,就出現問題.提示BBED-00207.換另外的方式:
BBED> assign kcbh.bas_kcbh=0x7fa46d5f
ub4 bas_kcbh @8 0x7fa46d5f
BBED> assign kcbh.bas_kcbh=0x8fa46d5f
BBED-00207: invalid offset specifier (8fa46d5f)
--//同樣報錯.
--//0x8fa46d5f = 2409917791
BBED> assign kcbh.bas_kcbh=2409917791
BBED-00207: invalid offset specifier (2409917791)
BBED> assign kcbh.bas_kcbh=409917791
ub4 bas_kcbh @8 0x186ed95f
BBED> assign kcbh.bas_kcbh=0x87146111
BBED-00206: out of range offset (87146111)
BBED> assign kcbh.bas_kcbh=0x8714611a
BBED-00207: invalid offset specifier (8714611a)
--//還可以發現一個奇怪的現象,如果16進位制全部數字不包括a-f,提示是BBED-00206.不是BBED-00207.
BBED> assign kcbh.bas_kcbh=0x7fa46d5f
ub4 bas_kcbh @8 0x7fa46d5f
BBED> assign 8=0x7fa46d5f
ub4 bas_kcbh @8 0x7fa46d5f
--//只要第一位不是0x8,兩種方式都可以正常執行.很明顯這個是bbed的bug.
BBED> assign kcbh.bas_kcbh=-1
BBED-00217: unable to assign: (-1) is out of range (0, 4294967295)
BBED> assign 8=-1
BBED-00217: unable to assign: (-1) is out of range (0, 4294967295)
--//最大值可以是4294967295,4294967295 = 0xffffffff,很明顯前面的值沒有操作這個範圍.
BBED> assign 8=4294967295
BBED-00207: invalid offset specifier (4294967295)
BBED> assign kcbh.bas_kcbh=4294967295
BBED-00207: invalid offset specifier (4294967295)
BBED> assign kcbh.bas_kcbh=0x7fffffff
ub4 bas_kcbh @8 0x7fffffff
BBED> assign 8=0x7ffffffe
ub4 bas_kcbh @8 0x7ffffffe
--//看來是bug確定無疑,如果出現這種情況,修改只能使用modify,而modify必須考慮大小頭問題,這樣就比較麻煩了.
--//比如要修改為0x8fa46d5f,顛倒過來就是 5f6da48f.
BBED> modify /x 5f6da48f offset 8
Warning: contents of previous BIFILE will be lost. Proceed? (Y/N) y
File: /mnt/ramdisk/book/users01.dbf (4)
Block: 2467 Offsets: 8 to 11 Dba:0x010009a3
--------------------------------
5f6da48f
<128 bytes per line>
BBED> p /x dba 4,2467 kcbh.wrp_kcbh
ub2 wrp_kcbh @12 0x0002
BBED> p /x dba 4,2467 kcbh.bas_kcbh
ub4 bas_kcbh @8 0x8fa46d5f
--//modify也有1個缺點.比如修改為0x8fa46d8f,顛倒過來就是 8f6da48f.
BBED> modify /x 8f6da48f offset 8
BBED-00209: invalid number (8f6da48f)
--//如果4位修改第一位也是不能大於0x8,不然也報錯,必須分開修改,
BBED> modify /x 8f6d offset 8
File: /mnt/ramdisk/book/users01.dbf (4)
Block: 2467 Offsets: 8 to 11 Dba:0x010009a3
--------------------------------
8f6da48f
<128 bytes per line>
BBED> modify /x a48f offset 10
File: /mnt/ramdisk/book/users01.dbf (4)
Block: 2467 Offsets: 10 to 13 Dba:0x010009a3
--------------------------------
a48f0200
<128 bytes per line>
BBED> p /x dba 4,2467 kcbh.bas_kcbh
ub4 bas_kcbh @8 0x8fa46d8f
--//或者這樣修改:
BBED> modify /x 8f6da4 offset 8
File: /mnt/ramdisk/book/users01.dbf (4)
Block: 2467 Offsets: 8 to 11 Dba:0x010009a3
--------------------------------
8f6da48f
<128 bytes per line>
BBED> modify /x 8f offset 11
File: /mnt/ramdisk/book/users01.dbf (4)
Block: 2467 Offsets: 11 to 14 Dba:0x010009a3
--------------------------------
8f020002
<128 bytes per line>
BBED> p /x dba 4,2467 kcbh.bas_kcbh
ub4 bas_kcbh @8 0x8fa46d8f
--//總之如果真正遇到這樣的情況處理起來在linux下相對麻煩.
--//收尾還原;
BBED> assign 8=0x7fa46d5f
ub4 bas_kcbh @8 0x7fa46d5f
BBED> assign 12=2
ub2 wrp_kcbh @12 0x0002
BBED> sum
Check value for File 4, Block 2467:
current = 0xfb68, required = 0xfb69
--//嗯,檢查和不對.噢改錯了.
BBED> assign 12=3
ub2 wrp_kcbh @12 0x0003
BBED> sum
Check value for File 4, Block 2467:
current = 0xfb68, required = 0xfb68
--//OK沒有問題.
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/267265/viewspace-2793449/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- [20210304]bbed的assign命令.txt
- [20180628]顯示bbed x命令格式.txt
- [20180627]測試bbed是否支援管道命令.txt
- [20231109]bbed p命令dba引數問題.txt
- [20210218]Select vs Assign – How To Assign PLSQL Variables.txtSQL
- [20181227]bbed的使用問題.txt
- [20181204]bbed修改問題.txt
- [20180619]bbed verify問題.txt
- [20231008]bbed探究lob段.txt
- [20220223]bbed ktbbh.ktbbhict.txt
- 【BBED】Oracle bbed常用命令參考Oracle
- [20210906]bbed讀取資料塊(bbed-wrap.sh).txt
- [20231021]生成bbed的執行指令碼.txt指令碼
- [20190104]bbed手工插入資料.txt
- [20210901]cygwin下使用bbed.txt
- [20230224]bbed設定偏移技巧.txt
- [20210303]bbed使用小問題.txt
- [20210223]bbed itl ktbitflg 2.txt
- [20210930]bbed恢復刪除的資料.txt
- [20190104]bbed手動修改資料.txt
- [20210318]bbed讀取資料塊.txt
- [20210311]如何建立bbed安裝包.txt
- [20231023]生成bbed的執行指令碼(bash shell).txt指令碼
- [20230427]bbed sum apply問題2.txtAPP
- [20180604]在記憶體修改資料(bbed).txt記憶體
- [20210817]如何通過bbed確定undo段.txt
- [20210831]bbed讀取資料塊6.txt
- [20210323]bbed讀取資料塊5.txt
- [20210318]bbed讀取資料塊2.txt
- [20210319]bbed讀取資料塊3.txt
- [20231020]rename IDL_UB1$後使用bbed的恢復.txt
- [20190213]學習bbed-恢復刪除的資料.txt
- [20181122]bbed人為修改事務提交標誌.txt
- [20231026]bbed檢視索引kd_off結構的問題.txt索引
- [20220909]bbed關於刪除記錄恢復的問題.txt
- [20210930]bbed讀取資料塊7 fffext.sh.txt
- [20190124]bbed恢復資料遇到延遲塊清除的問題.txt
- [20231103]rename IDL_UB1$後使用bbed的恢復的後遺症.txt