KTB Redo

来源:互联网 发布:刷爱奇艺vip会员软件 编辑:程序博客网 时间:2024/05/22 09:01

Oracle Internals

 

KTB Redo

KTB Redo records modifications to the transaction header of a block. The inverse operations are recorded in the undo segment。

译文:KTB重做记录是对(数据)块上的事务头(上的事务槽们)进行修改。它的逆操作记录在undo段上。

注释:KTB 不知道是什么的简称,有谁知道的说下哈!

             这两话的大概意思是KTB重做记录(操作)就是给事务槽上填写(或说修改)一个(新)事务的信息(即事务槽上的各个字段的内容)。这样原先在这个事务槽上的那个老的事务的信息就被覆盖了。所以,这个老的事务的信息就被记录到这个新的事务(槽)里的uba字段对应的undo块的undo记录上(这个就是第二句话所谓的逆操作)。由此可以看出,KTB Redo records 中的redo(重做)就是体现在被记录的老的事务上,因为事务回滚时这个老的事务要被用到,这就是所谓的redo(重做)。

           这个老的事务的信息就被记录到这个新的事务(槽)里的uba字段对应的undo块的undo记录上,那这个老事务在undo记录里的内容是怎么样的呢?

我们随便dump出一个undo块的值,找到一个undo记录,里面包含有rci:0x00和op:L这两个内容的,例如下面的这样的:

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

* Rec #0x2a slt: 0x08  objn: 24636(0x0000603c)  objd: 24636  tblspc: 6(0x00000006)

*       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: 0x00c0008d.00de.29 ctl max scn: 0x0000.00400a3b prv tx scn: 0x0000.00400a45

txn start scn: scn: 0x0000.004015b5 logon user: 59

 prev brb: 12583049 prev bcl: 0

KDO undo record:

KTB Redo

op: 0x04  ver: 0x01

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

op: L itl: xid:  0x0003.00e.000002e4 uba: 0x00c00407.0122.08

                      flg: C---    lkc:  0     scn: 0x0000.003f86e4

KDO Op code: URP row dependencies Disabled

  xtype: XA flags: 0x00000000  bdba: 0x020000ce  hdba: 0x020000ca

itli: 1  ispac: 0  maxfr: 4858

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

ncol: 2 nnew: 1 size: -6

col  1: [ 7]  58 49 41 4f 4b 55 4e

-- col  1: [ 7]  58 49 41 4f 4b 55 4e

我们从上面,摘录出这个老的事务的KTB redo records:

KTB Redo

op: 0x04  ver: 0x01

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

op: L itl: xid:  0x0003.00e.000002e4 uba: 0x00c00407.0122.08

                      flg: C---    lkc:  0     scn: 0x0000.003f86e4

这里黑色部分就是同一个事务槽被覆盖的上一次的那个事务(即老的事务)的信息。

 

另外要说的一点是,KTB Redo records  不仅出现在undo记录(行)里,也会出现在redo记录(行)里。

 

 

Each KTB Redo record has an operation type. Known codes include:

 Numeric CodeAlphanumeric Code0x1F0x2C0x3Z0x4L0x5R0x11F

Type 1 Operation (F)

The following is an example of a type 1 operation (F)

  KTB Redo   op: 0x01 ver: 0x01   op: F xid: 0x0006.010.000001b1 uba: 0x008004f1.0151.0b  op: 0x01 ver: 0x01 

op Hexadecimal representation of operation code

The alphanumeric value of the operation code is output on the following line of the symbolic dump

  op: F xid: 0x0006.010.000001b1 uba: 0x008004f1.0151.0b 

op Alphanumeric representation of undo operation code

xid Transaction ID. Format is usn#.slot#.wrap# Components are:

 usn#Undo segment numberslot#Slot number in undo segmentwrap#Sequence number

uba Undo block address. Format is dba.seq#.rec# Components are:

 dbaData block address of undo blockseq#Sequence number of undo blockrec#Record number within undo block

Type 5 Operation (R)

The following is an example of a type 5 operation (R)

 KTB Redo op: 0x05 ver: 0x01 op: R itc: 2  Itl Xid Uba Flag Lck Scn/Fsc 0x01 0x0009.020.000001e1 0x008002fc.0193.01 ---- 1 fsc 0x0000.00000000 0x02 0x0009.000.000001e2 0x008002fb.0193.01 ---- 363 fsc 0x0000.00000000
  op: R itc: 2 

op: Operation code R

itc: Number (count) of ITL entries - in this case 2

ITL entries include the following columns

Itl ITL Slot number

Xid Transaction ID

Uba Undo byte address

Flag Flag - values currently unknown

Lck Number of rows locked by ITL entry

Scn/Fsc SCN or First SCN - context dependent

原创粉丝点击