[20190124]bbed恢復資料遇到延遲塊清除的問題.txt
[20190124]bbed恢復資料遇到延遲塊清除的問題.txt
--//最近使用bbed做一個恢復測試,遇到一個問題.以前我的測試如果修改刪除flag從0x3c=>0x2c,sum apply後,使用verify提示類似如下:
BBED> verify
DBVERIFY - Verification starting
FILE = /mnt/ramdisk/book/users01.dbf
BLOCK = 523
Block Checking: DBA = 16777739, Block Type = KTB-managed data block
data header at 0x7fddbce4127c
kdbchk: the amount of space used is not equal to block size
used=44 fsc=9 avsp=8020 dtl=8064
Block 523 failed with check code 6110
--//如果偷懶,可以跳過這步.但是如果遇到提交時資料塊不在快取或者更新涉及的塊太多,可能會出現許多塊不做塊清除,oracle執行的是
--//快速塊清除操作.這樣一些塊在下一次touch時才修改對應ITL操以及對應記錄的lock資訊才會更新.
--//對於這樣的塊,恢復時恢復會遇到什麼問題呢?透過例子說明問題.
1.環境:
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
2.建立測試環境:
SCOTT@book> create table t as select rownum id,'test' name from dual connect by level<=2;
Table created.
SCOTT@book> select rowid,t.* from t;
ROWID ID NAME
------------------ ---------- --------------------
AAAWPYAAEAAAAILAAA 1 test
AAAWPYAAEAAAAILAAB 2 test
SCOTT@book> @ rowid AAAWPYAAEAAAAILAAA
OBJECT FILE BLOCK ROW ROWID_DBA DBA TEXT
---------- ---------- ---------- ---------- -------------------- -------------------- ----------------------------------------
91096 4 523 0 0x100020B 4,523 alter system dump datafile 4 block 523 ;
SCOTT@book> delete from t where id=1;
1 row deleted.
SCOTT@book> alter system flush buffer_cache;
System altered.
SCOTT@book> alter system flush buffer_cache;
System altered.
--//注:一定要確定對於資料塊資訊已經重新整理到磁碟.IMU環境有時候奇怪,髒塊有時候也不會寫盤.
SYS@book> @ bh 4 523
HLADDR DBARFIL DBABLK CLASS CLASS_TYPE STATE TCH CR_SCN_BAS CR_SCN_WRP CR_UBA_FIL CR_UBA_BLK CR_UBA_SEQ BA OBJECT_NAME
---------------- ------- ------ ----- ---------- ----- --- ---------- ---------- ---------- ---------- ---------- ---------------- -----------
000000008538CA18 4 523 1 data block free 0 0 0 0 0 0 0000000073D1C000 T
000000008538CA18 4 523 1 data block free 0 0 0 0 0 0 0000000073D22000 T
SCOTT@book> commit ;
Commit complete.
3.使用bbed恢復看看:
BBED> set dba 4,523
DBA 0x0100020b (16777739 4,523)
BBED> x /rnc *kdbr[0]
rowdata[11] @8177
-----------
flag@8177: 0x3c (KDRHFL, KDRHFF, KDRHFD, KDRHFH)
lock@8178: 0x02
cols@8179: 0
--//使用ITL槽2.看看ITL槽2(從0開始)的情況:
BBED> p ktbbh.ktbbhitl[1]
struct ktbbhitl[1], 24 bytes @68
struct ktbitxid, 8 bytes @68
ub2 kxidusn @68 0x000a
ub2 kxidslt @70 0x0013
ub4 kxidsqn @72 0x00005816
struct ktbituba, 8 bytes @76
ub4 kubadba @76 0x00c0028e
ub2 kubaseq @80 0x10d5
ub1 kubarec @82 0x0f
ub2 ktbitflg @84 0x0001 (NONE)
union _ktbitun, 2 bytes @86
sb2 _ktbitfsc @86 9
ub2 _ktbitwrp @86 0x0009
ub4 ktbitbas @88 0x00000000
--//可以發現ktbitflg=0x0001,表示沒有提交.ktbitbas=0x00000000,也就是沒有scn相關資訊寫入.
BBED> assign offset 8177=0x2c;
Warning: contents of previous BIFILE will be lost. Proceed? (Y/N) y
ub1 rowdata[0] @8177 0x2c
BBED> x /rnc *kdbr[0]
rowdata[11] @8177
-----------
flag@8177: 0x2c (KDRHFL, KDRHFF, KDRHFH)
lock@8178: 0x02
cols@8179: 2
col 0[2] @8180: 1
col 1[4] @8183: Test
BBED> sum apply
Check value for File 4, Block 523:
current = 0xdcbe, required = 0xdcbe
BBED> verify
DBVERIFY - Verification starting
FILE = /mnt/ramdisk/book/users01.dbf
BLOCK = 523
Block Checking: DBA = 16777739, Block Type = KTB-managed data block
data header at 0x7fddbce4127c
kdbchk: the amount of space used is not equal to block size
used=44 fsc=9 avsp=8020 dtl=8064
Block 523 failed with check code 6110
--//我以前測試提到過這樣恢復,讀取是沒有問題,雖然verify時包如上的錯誤.
SCOTT@book> alter system flush buffer_cache;
System altered.
SCOTT@book> select rowid,t.* from t;
ROWID ID NAME
------------------ ---------- --------------------
AAAWPZAAEAAAAILAAA 1 Test
AAAWPZAAEAAAAILAAB 2 Test
SCOTT@book> alter system flush buffer_cache;
System altered.
BBED> x /rnc dba 4,523 *kdbr[0]
rowdata[11] @8177
-----------
flag@8177: 0x2c (KDRHFL, KDRHFF, KDRHFH)
lock@8178: 0x00
cols@8179: 2
col 0[2] @8180: 1
col 1[4] @8183: Test
BBED> p dba 4,523 ktbbh.ktbbhitl[1]
struct ktbbhitl[1], 24 bytes @68
struct ktbitxid, 8 bytes @68
ub2 kxidusn @68 0x000a
ub2 kxidslt @70 0x0013
ub4 kxidsqn @72 0x00005816
struct ktbituba, 8 bytes @76
ub4 kubadba @76 0x00c0028e
ub2 kubaseq @80 0x10d5
ub1 kubarec @82 0x0f
ub2 ktbitflg @84 0xa000 (KTBFUPB, KTBFCOM)
union _ktbitun, 2 bytes @86
sb2 _ktbitfsc @86 3
ub2 _ktbitwrp @86 0x0003
ub4 ktbitbas @88 0x1774676a
--//OK,可以發現沒有問題.即使現在還報錯:
BBED> verify dba 4,523
DBVERIFY - Verification starting
FILE = /mnt/ramdisk/book/users01.dbf
BLOCK = 523
Block Checking: DBA = 16777739, Block Type = KTB-managed data block
data header at 0x13efe7c
kdbchk: the amount of space used is not equal to block size
used=44 fsc=0 avsp=8029 dtl=8064
Block 523 failed with check code 6110
--//如果使用system表空間呢?下一篇測試看看.
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/267265/viewspace-2564716/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- [20190124]bbed恢復資料遇到延遲塊清除的問題2.txt
- [20190125]bbed恢復資料遇到延遲塊清除的問題3.txt
- [20180626]延遲塊清除與只讀表.txt
- [20210930]bbed恢復刪除的資料.txt
- [20210401]使用bbed讀取資料塊恢復注意6.txt
- [20150409]只讀表空間與延遲塊清除.txt
- [20220909]bbed關於刪除記錄恢復的問題.txt
- [20190213]學習bbed-恢復刪除的資料.txt
- [20210318]bbed讀取資料塊.txt
- [20190218]延遲約束問題2.txt
- [20210906]bbed讀取資料塊(bbed-wrap.sh).txt
- [20210529]延遲開啟資料庫.txt資料庫
- [20181227]bbed的使用問題.txt
- [20181204]bbed修改問題.txt
- [20180619]bbed verify問題.txt
- [20210831]bbed讀取資料塊6.txt
- [20210323]bbed讀取資料塊5.txt
- [20210318]bbed讀取資料塊2.txt
- [20210319]bbed讀取資料塊3.txt
- [20210303]bbed使用小問題.txt
- Oracle 之利用BBED修改資料塊SCN----沒有備份資料檔案的資料恢復Oracle資料恢復
- 教你如何解決MySQL資料延遲跳動的問題MySql
- [20231020]rename IDL_UB1$後使用bbed的恢復.txt
- [20210930]bbed讀取資料塊7 fffext.sh.txt
- API返回延遲,FPM重啟後恢復之後又重現 問題解決方案API
- [20190124]系統表空間塊ITL的LCK.txt
- [20220223]bbed讀取資料塊mssm與assm 2.txtSSM
- 分析伺服器延遲的問題伺服器
- 深入解析:段頭塊損壞bbed異常恢復
- [20230427]bbed sum apply問題2.txtAPP
- [20190104]bbed手工插入資料.txt
- MySQL主從資料庫同步延遲問題怎麼解決MySql資料庫
- 29、undo_2_1(事務槽、延遲塊清除、構造CR塊、ora-01555)
- [20231103]rename IDL_UB1$後使用bbed的恢復的後遺症.txt
- [20231109]bbed p命令dba引數問題.txt
- SQL Server資料庫恢復常見問題SQLServer資料庫
- 【vsan資料恢復】vsan下虛擬機器磁碟元件出現問題的資料恢復案例資料恢復虛擬機元件
- mysqlbinlog命令恢復資料要注意的問題彙總MySql