SQL> connect test/test@test
已連接
SQL> create table test (a number);
表已創建
SQL> insert into test values(
已創建
SQL> select segment_name
t_name like
SEGMENT_NAME HEADER_FILE HEADER_BLOCK
TEST
SQL> alter system dump datafile
系統已更改
DUMP出數據頭文件查看itl(interested transaction list)
***
Start dump data blocks tsn:
buffer tsn:
scn:
frmt:
Block header dump:
Object id on Block? Y
seg/obj:
fsl:
Itl Xid Uba Flag Lck Scn/Fsc
/*這裡可以看到xid=
uba=
lck=
根據Xid的結構得到
根據uba的結構得到
*/
data_block_dump
===============
以下省略
根據
SQL> select a
_rollback_segs b where a
SEGMENT_NAME HEADER_FILE HEADER_BLOCK
RBS
然後dump rbs頭查看trans table
Start dump data blocks tsn:
buffer tsn:
scn:
frmt:
Extent Control Header
Extent Header:: spare
last map
Highwater::
#blocks in seg
#blocks below:
mapblk
Unlocked
Map Header:: next
Extent Map
TRN CTL:: seq:
mgc:
uba:
Version:
FREE BLOCK POOL::
uba:
uba:
uba:
uba:
uba:
TRN TBL::
index state cflags wrap# uel scn dba parent
以下省略
根據從xid中得到的
去找到事務表中記載的undo塊的地址dba=
接下來我們來看一下undo頭的地址rdba:
所以我們去dump
***
Start dump data blocks tsn:
buffer tsn:
scn:
frmt:
********************************************************************************
UNDO BLK:
xid:
Rec Offset Rec Offset Rec Offset Rec Offset Rec Offset
*
* Rec #
* Layer:
Undo type: Regular undo Begin trans Last buffer split: No
Temp Object: No
Tablespace Undo: No
rdba:
*
uba:
KDO undo record:
KTB Redo
op:
op: L itl: scn:
flg: C
KDO Op code: DRP xtype: XA bdba:
itli:
tabn:
根據KDO Op code: DRP
我們知道當發生insert的時候undo segment裡僅記載了記錄的rowid
SQL> select rowid from test;
ROWID
AAAGSHAABAAAIo
Translate the value: AAAGSHAABAAAIo
Data Object number = AAAGSH
File = AAB
Block = AAAIo
ROW = AAC
然後根據公式轉換
得到data object number=
file=
block=
row=
From:http://tw.wingwit.com/Article/program/Oracle/201311/18476.html