undo transaction slot被覆盖引起ORA(9)

commit cleanouts                                                          0

commit cleanouts successfully completed                                  0

redo KB read for transport                                                0

file io wait time                                                    40974

gc cr blocks served                                                      0

transaction tables consistent reads - undo records applied              310

transaction tables consistent read rollbacks                              1

cleanouts only - consistent read gets                                    0

cleanouts and rollbacks - consistent read gets                            1

immediate (CR) block cleanout applications                                1

deferred (CURRENT) block cleanout applications                            0

针对上述测试结果的分析:

Undo header 事务表中的每个slot被覆盖多达10次,session 2还能正常返回scott.tabnow1表修改前的记录,就是利用了undo事务表的回滚机制,为了实现这个回滚:当新的事务开始使用某个undo事务表槽之前会将事务表TRN CTL部分的scn与uba两个值作为ctl max scn、uba字段保存到新事务所拥有的undo block里,也会将这个事务表槽中的scn与dba两个值作为prv tx scn、prev brb字段保存到新事务所拥有的undo block里,例如session 1 中事务使用的uba为8/16  Rec #0x19:

*-----------------------------

* Rec #0x19  slt: 0x1e  objn: 90344(0x000160e8)  objd: 90344  tblspc: 8(0x00000008)

*      Layer:  11 (Row)  opc: 1  rci 0x00

Undo type:  Regular undo    Begin trans    Last buffer split:  No

Temp Object:  No

Tablespace Undo:  No

rdba: 0x00000000Ext idx: 0

flg2: 0

*-----------------------------

uba: 0x02000010.187e.18 ctl max scn: 0x0000.00ae9095 prv tx scn: 0x0000.00ae909b

txn start scn: scn: 0x0000.00ae90b2 logon user: 0

prev brb: 33554460 prev bcl: 0

KDO undo record:

KTB Redo

op: 0x04  ver: 0x01

compat bit: 4 (post-11) padding: 1

op: L  itl: xid:  0x0002.004.0000111f uba: 0x0200001a.177b.09

flg: C---    lkc:  0    scn: 0x0000.00ad9579

KDO Op code: URP row dependencies Disabled

xtype: XA flags: 0x00000000  bdba: 0x010006f3  hdba: 0x010006f2

itli: 2  ispac: 0  maxfr: 4858

tabn: 0 slot: 0(0x0) flag: 0x2c lock: 0 ckix: 0

ncol: 3 nnew: 1 size: 2

col  0: [ 9]  58 53 24 4e 55 4c 4c 4c 4c

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/31adee041cbfddebdb0c76723168ed2c.html