bbed 之資料修改Ktbbh(Ktbbh資料)

imlihj2007發表於2011-10-18

--1 table and data test
SQL> drop table t1;
Table dropped.
SQL> create table t1(id number,name varchar2(10));
Table created.
SQL> insert into t1 values(1,'lihj');
1 row created.
SQL> insert into t1 values(2,'lihj1');
1 row created.
SQL> commit;
Commit complete.
SQL> select * from t1;
ID NAME
---------- ----------
1 lihj
2 lihj1
-- get the extend info
select * from dba_extents where segment_name='T1' and owner='SCOTT'
SCOTT T1 TABLE USERS 0 4 1665 65536 8 4
--上邊的判斷 沒有找到對應的東東
--但是下面的是資料 也不敢保證
select dbms_rowid.rowid_relative_fno(t.rowid) || '_' ||
dbms_rowid.rowid_block_number(t.rowid),
t.*
from scott.t1 t;
4_1670 1 lihj
4_1670 2 lihj1
--找到了資料塊和對應的事務資訊【記住 你是在修改一事務上的資訊】
rac1-> more test_ora_25559.trc
/u01/app/oracle/admin/test/udump/test_ora_25559.trc
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
ORACLE_HOME = /u01/app/oracle/product/10.2.0/db_1
System name: Linux
Node name: rac1
Release: 2.6.9-89.0.0.0.1.ELhugemem
Version: #1 SMP Tue May 19 04:38:38 EDT 2009
Machine: i686
Instance name: test
Redo thread mounted by this instance: 1
Oracle process number: 22
Unix process pid: 25559, image: (TNS V1-V3)

*** 2011-10-17 23:34:25.092
*** ACTION NAME:() 2011-10-17 23:34:25.090
*** MODULE NAME:(SQL*Plus) 2011-10-17 23:34:25.090
*** SERVICE NAME:(SYS$USERS) 2011-10-17 23:34:25.090
*** SESSION ID:(143.22) 2011-10-17 23:34:25.090
Start dump data blocks tsn: 4 file#: 4 minblk 1670 maxblk 1670
buffer tsn: 4 rdba: 0x01000686 (4/1670)
scn: 0x0000.40004fcc seq: 0x01 flg: 0x06 tail: 0x4fcc0601
frmt: 0x02 chkval: 0xeb0a type: 0x06=trans data
Hex dump of block: st=0, typ_found=1
Dump of memory from 0x0CC0F400 to 0x0CC11400
CC0F400 0000A206 01000686 40004FCC 06010000 [.........O.@....]
CC0F410 0000EB0A 00000001 0000CA29 40004FC4 [........)....O.@]
CC0F420 00000000 00320002 01000681 00290004 [......2.......).]
CC0F430 000000DE 008000A3 001900B3 00002002 [............. ..]
CC0F440 40004FCC 00000000 00000000 00000000 [.O.@............]
CC0F450 00000000 00000000 00000000 00000000 [................]
CC0F460 00000000 00020100 0016FFFF 1F661F7C [............|.f.]
CC0F470 00001F66 1F8A0002 00001F7C 00000000 [f.......|.......]
CC0F480 00000000 00000000 00000000 00000000 [................]
Repeat 501 times
CC113E0 0202012C 630703C1 75686975 012C3261 [,......cuihua2,.]
CC113F0 02C10202 69756307 31617568 4FCC0601 [.....cuihua1...O]
Block header dump: 0x01000686
Object id on Block? Y
seg/obj: 0xca29 csc: 0x00.40004fc4 itc: 2 flg: E typ: 1 - DATA
brn: 0 bdba: 0x1000681 ver: 0x01 opc: 0
inc: 0 exflg: 0

Itl Xid Uba Flag Lck Scn/Fsc
0x01 0x0004.029.000000de 0x008000a3.00b3.19 --U- 2 fsc 0x0000.40004fcc
0x02 0x0000.000.00000000 0x00000000.0000.00 ---- 0 fsc 0x0000.00000000

data_block_dump,data header at 0xcc0f464
===============
tsiz: 0x1f98
hsiz: 0x16
pbl: 0x0cc0f464
bdba: 0x01000686
76543210
flag=--------
ntab=1
nrow=2
frre=-1
fsbo=0x16
fseo=0x1f7c
avsp=0x1f66
tosp=0x1f66
0xe:pti[0] nrow=2 offs=0
0x12:pri[0] offs=0x1f8a
0x14:pri[1] offs=0x1f7c
block_row_dump:
tab 0, row 0, @0x1f8a
tl: 14 fb: --H-FL-- lb: 0x1 cc: 2
col 0: [ 2] c1 02
col 1: [ 7] 63 75 69 68 75 61 31
tab 0, row 1, @0x1f7c
tl: 14 fb: --H-FL-- lb: 0x1 cc: 2
col 0: [ 2] c1 03
col 1: [ 7] 63 75 69 68 75 61 32
end_of_block_dump
End dump data blocks tsn: 4 file#: 4 minblk 1670 maxblk 1670
--使用BBED研究相關的SCN資訊
--檢視事務資訊
BBED> set block 1670
BLOCK# 1670

BBED> show
FILE# 4
BLOCK# 1670
OFFSET 0
DBA 0x01000686 (16778886 4,1670)
FILENAME /u01/app/oracle/oradata/test/users01.dbf
BIFILE bifile.bbd
LISTFILE list
BLOCKSIZE 8192
MODE Edit
EDIT Unrecoverable
IBASE Dec
OBASE Dec
WIDTH 80
COUNT 512
LOGFILE log.bbd
SPOOL No

BBED> show kcbh
BBED-00202: invalid parameter (kcbh)

--這個結構 不是很明白 今天試驗到此了
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 0x01000686
ub4 bas_kcbh @8 0x40004fcc
ub2 wrp_kcbh @12 0x0000
ub1 seq_kcbh @14 0x01
ub1 flg_kcbh @15 0x06 (KCBHFDLC, KCBHFCKV)
ub2 chkval_kcbh @16 0xeb0a
ub2 spare3_kcbh @18 0x0000

BBED> p ktbbh
struct ktbbh, 72 bytes @20
ub1 ktbbhtyp @20 0x01 (KDDBTDATA)
union ktbbhsid, 4 bytes @24
ub4 ktbbhsg1 @24 0x0000ca29
ub4 ktbbhod1 @24 0x0000ca29
struct ktbbhcsc, 8 bytes @28
ub4 kscnbas @28 0x40004fc4
ub2 kscnwrp @32 0x0000
b2 ktbbhict @36 2
ub1 ktbbhflg @38 0x32 (NONE)
ub1 ktbbhfsl @39 0x00
ub4 ktbbhfnx @40 0x01000681
struct ktbbhitl[0], 24 bytes @44
struct ktbitxid, 8 bytes @44
ub2 kxidusn @44 0x0004
ub2 kxidslt @46 0x0029
ub4 kxidsqn @48 0x000000de
struct ktbituba, 8 bytes @52
ub4 kubadba @52 0x008000a3 -------------------------
ub2 kubaseq @56 0x00b3
ub1 kubarec @58 0x19
ub2 ktbitflg @60 0x2002 (KTBFUPB)----------------------
union _ktbitun, 2 bytes @62
b2 _ktbitfsc @62 0
ub2 _ktbitwrp @62 0x0000
ub4 ktbitbas @64 0x40004fcc ----------------------
struct ktbbhitl[1], 24 bytes @68
struct ktbitxid, 8 bytes @68
ub2 kxidusn @68 0x0000
ub2 kxidslt @70 0x0000
ub4 kxidsqn @72 0x00000000
struct ktbituba, 8 bytes @76
ub4 kubadba @76 0x00000000
ub2 kubaseq @80 0x0000
ub1 kubarec @82 0x00
ub2 ktbitflg @84 0x0000 (NONE)
union _ktbitun, 2 bytes @86
b2 _ktbitfsc @86 0
ub2 _ktbitwrp @86 0x0000
ub4 ktbitbas @88 0x00000000

[@more@]

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/9879835/viewspace-1055755/,如需轉載,請註明出處,否則將追究法律責任。

相關文章