从Undo, Redo, DataFile看Oracle中的事务过程
2009-06-12 11:51:00 来源:WEB开发网块头反映了这个块中有多少事务槽,我们要看的就是这个红色的0x2d, (即transaction的UBAREC=45)
*-----------------------------
* Rec #0x2d slt: 0x1b objn: 30387(0x000076b3) objd: 30387 tblspc: 0(0x00000000)<----30387是我们操作对象(undo_test)
* Layer: 11 (Row) opc: 1 rci 0x00
Undo type: Regular undo Begin trans Last buffer split: No
Temp Object: No
Tablespace Undo: No
rdba: 0x00000000
*-----------------------------
uba: 0x0080055f.05c1.2c ctl max scn: 0x0000.0277854e prv tx scn: 0x0000.02778558
KDO undo record:
KTB Redo
op: 0x03 ver: 0x01
op: Z
KDO Op code: URP row dependencies Disabled
xtype: XA bdba: 0x0040c732 hdba: 0x0040c731
itli: 2 ispac: 0 maxfr: 4863
tabn: 0 slot: 0(0x0) flag: 0x2c lock: 0 ckix: 0
ncol: 1 nnew: 1 size: 0
col 0: [ 3] c2 02 18<----前镜像值(123)
6:Dump数据文件,数据文件有没有内容,决定于DBWr进程有没有将data buffer cache写出
SQL> select file_id, block_id from dba_extents where segment_name='UNDO_TEST';<----即表名
FILE_ID BLOCK_ID
---------- ----------
1 50993
SQL> alter system dump datafile 1 block min 50993 block max 50995;
System altered.
Itl Xid Uba Flag Lck Scn/Fsc
0x01 0x000a.011.00005147 0x0080055f.05c1.23 C--- 0 scn 0x0000.027c094a
0x02 0x000a.01b.00005147 0x0080055f.05c1.2d ---- 1 fsc 0x0000.00000000
Itl:记录了该数据块上发生过的transaction。
Xid:xidusn.xidslot.xidsqn
Uba:uba.ubasqn.ubarec
更多精彩
赞助商链接