REDO的日志格式
gyj@OCM> update gyj_test set name='BBB' where id=1;
1 row updated.
gyj@OCM> commit;
Commit complete.
REDO RECORD:change vector,CV
REDO RECORD - Thread:1 RBA: 0x000105.0000000f.0010 LEN: 0x0214 VLD: 0x05
SCN: 0x0000.0069f201 SUBSCN: 1 11/15/2013 21:37:46
(LWN RBA: 0x000105.0000000f.0010 LEN: 0002 NST: 0001 SCN: 0x0000.0069f1ff)
-------------------------------------------------------------------------REDO记录头
RBA: 0x000105.0000000f.0010===三部分,序列号+块号+字节==261序列,15块,16字节
LEN: 0x0214:532字节
SCN: 0x0000.0069f201==SCNwrap+SCNbase==6字节=2+4 SUBSCN:1
CHANGE #1 TYP:0 CLS:31 AFN:3 DBA:0x00c000f0 OBJ:4294967295 SCN:0x0000.0069f19c SEQ:1 OP:5.2 ENC:0 RBL:0
ktudh redo: slt: 0x0020 sqn: 0x00003a9e flg: 0x000a siz: 188 fbi: 0
uba: 0x00c01d65.0321.01 pxid: 0x0000.000.00000000
TYP:0--normal
CLS:class==>x$bh.class ,31 undo segment
AFN:3==>(absolutely)绝对文件号
DBA:0x00c000f0 3,===32=10+22 3号文件,240号
OBJ:4294967295 ===》undo
OP:5.2 ===opration code,事务表(回滚段段头)
CHANGE #2 TYP:1 CLS:32 AFN:3 DBA:0x00c01d65 OBJ:4294967295 SCN:0x0000.0069f200 SEQ:1 OP:5.1 ENC:0 RBL:0
ktudb redo: siz: 188 spc: 0 flg: 0x000a seq: 0x0321 rec: 0x01
xid: 0x0008.020.00003a9e
ktubl redo: slt: 32 rci: 0 opc: 11.1 [objn: 17987 objd: 17987 tsn: 5]
Undo type: Regular undo Begin trans Last buffer split: No
Temp Object: No
Tablespace Undo: No
0x00000000 prev ctl uba: 0x00c01d64.0321.22
prev ctl max cmt scn: 0x0000.0069ecb0 prev tx cmt scn: 0x0000.0069ecb6
txn start scn: 0xffff.ffffffff logon user: 32 prev brb: 12590426 prev bcl: 0 BuExt idx: 0 flg2: 0
KDO undo record:
KTB Redo
op: 0x04 ver: 0x01
compat bit: 4 (post-11) padding: 1
op: L itl: xid: 0x0001.004.00002a08 uba: 0x00c01a54.0167.03
flg: C--- lkc: 0 scn: 0x0000.006976ad
Array Update of 1 rows:
tabn: 0 slot: 0(0x0) flag: 0x2c lock: 0 ckix: 0
ncol: 2 nnew: 1 size: 0
KDO Op code: 21 row dependencies Disabled
xtype: XAxtype KDO_KDOM2 flags: 0x00000080 bdba: 0x0140012e hdba: 0x0140012a
itli: 2 ispac: 0 maxfr: 4858
vect = 3
col 1: [ 3] 41 41 41
——————————————————————————————————————————UNDO块
DBA:0x00c01d65===》3号文件,7525号块
OBJ:4294967295 ==》FFFFFFFF UNDO
OP:5.1==>Undo block or undo segment header - KTURDB
objn: 17987==>
gyj@OCM> SELECT OBJECT_NAME FROM dba_objects where object_id=17987;
OBJECT_NAME
--------------------------------------------------------------------------------------------------------------------------------
GYJ_TEST
op: L itl: xid: 0x0001.004.00002a08 uba: 0x00c01a54.0167.03
flg: C--- lkc: 0 scn: 0x0000.006976ad
col 1: [ 3] 41 41 41
gyj@OCM> select dump('AAA',16) from dual;
DUMP('AAA',16)
----------------------
Typ=96 Len=3: 41,41,41
CHANGE #3 TYP:2 CLS:1 AFN:5 DBA:0x0140012e OBJ:17987 SCN:0x0000.0069e62f SEQ:1 OP:11.19 ENC:0 RBL:0
KTB Redo
op: 0x11 ver: 0x01
compat bit: 4 (post-11) padding: 1
op: F xid: 0x0008.020.00003a9e uba: 0x00c01d65.0321.01
Block cleanout record, scn: 0x0000.0069f200 ver: 0x01 opt: 0x02, entries follow...
itli: 1 flg: 2 scn: 0x0000.0069e62f
Array Update of 1 rows:
tabn: 0 slot: 0(0x0) flag: 0x2c lock: 2 ckix: 0
ncol: 2 nnew: 1 size: 0
KDO Op code: 21 row dependencies Disabled
xtype: XAxtype KDO_KDOM2 flags: 0x00000080 bdba: 0x0140012e hdba: 0x0140012a
itli: 2 ispac: 0 maxfr: 4858
vect = 3
col 1: [ 3] 42 42 42
REDO RECORD - Thread:1 RBA: 0x000105.00000010.0034 LEN: 0x0060 VLD: 0x01
SCN: 0x0000.0069f202 SUBSCN: 1 11/15/2013 21:37:46
CHANGE #1 TYP:0 CLS:31 AFN:3 DBA:0x00c000f0 OBJ:4294967295 SCN:0x0000.0069f201 SEQ:1 OP:5.4 ENC:0 RBL:0
ktucm redo: slt: 0x0020 sqn: 0x00003a9e srt: 0 sta: 9 flg: 0x2 ktucf redo: uba: 0x00c01d65.0321.01 ext: 53 spc: 7960 fbi: 0
一条REDO RECORD
update
OPC===>5.2 ---->产生一个事务(UNDO段头块XID)
OPC===>5.1 ---->把修改前的前镜像放到UNDO块(AAA)
OPC===>11.19 --->修改数据UPDATE(BBB)
commit;
一条REDO RECORD
OPC==>5.4 ---->提交
非IMU模式下的REDO日志格式:
REDO RECORD - Thread:1 RBA: 0x00010f.00000039.0010 LEN: 0x021c VLD: 0x05
SCN: 0x0000.006d6ac2 SUBSCN: 1 11/18/2013 20:45:50
(LWN RBA: 0x00010f.00000039.0010 LEN: 0002 NST: 0001 SCN: 0x0000.006d6ac1)
CHANGE #1 TYP:0 CLS:31 AFN:3 DBA:0x00c000f0 OBJ:4294967295 SCN:0x0000.006d6a2e SEQ:1 OP:5.2 ENC:0 RBL:0
ktudh redo: slt: 0x0006 sqn: 0x00003ab8 flg: 0x0012 siz: 188 fbi: 0
uba: 0x00c03730.0336.26 pxid: 0x0000.000.00000000
CHANGE #2 TYP:0 CLS:32 AFN:3 DBA:0x00c03730 OBJ:4294967295 SCN:0x0000.006d6a2d SEQ:9 OP:5.1 ENC:0 RBL:0
ktudb redo: siz: 188 spc: 3340 flg: 0x0012 seq: 0x0336 rec: 0x26
xid: 0x0008.006.00003ab8
ktubl redo: slt: 6 rci: 0 opc: 11.1 [objn: 17987 objd: 17987 tsn: 5]
Undo type: Regular undo Begin trans Last buffer split: No
Temp Object: No
Tablespace Undo: No
0x00000000 prev ctl uba: 0x00c03730.0336.12
prev ctl max cmt scn: 0x0000.006d61ee prev tx cmt scn: 0x0000.006d6208
txn start scn: 0xffff.ffffffff logon user: 32 prev brb: 12597034 prev bcl: 0 BuExt idx: 0 flg2: 0
KDO undo record:
KTB Redo
op: 0x04 ver: 0x01
compat bit: 4 (post-11) padding: 1
op: L itl: xid: 0x0002.01f.0000387f uba: 0x00c017da.020a.13
flg: C--- lkc: 0 scn: 0x0000.006d0746
Array Update of 1 rows:
tabn: 0 slot: 0(0x0) flag: 0x2c lock: 0 ckix: 0
ncol: 2 nnew: 1 size: 0
KDO Op code: 21 row dependencies Disabled
xtype: XAxtype KDO_KDOM2 flags: 0x00000080 bdba: 0x0140012e hdba: 0x0140012a
itli: 2 ispac: 0 maxfr: 4858
vect = 3
col 1: [ 3] 61 61 61
CHANGE #3 TYP:2 CLS:1 AFN:5 DBA:0x0140012e OBJ:17987 SCN:0x0000.006d69f8 SEQ:1 OP:11.19 ENC:0 RBL:0
KTB Redo
op: 0x11 ver: 0x01
compat bit: 4 (post-11) padding: 1
op: F xid: 0x0008.006.00003ab8 uba: 0x00c03730.0336.26
Block cleanout record, scn: 0x0000.006d6ac2 ver: 0x01 opt: 0x02, entries follow...
itli: 1 flg: 2 scn: 0x0000.006d69f8
itli: 2 flg: 2 scn: 0x0000.006d0746
Array Update of 1 rows:
tabn: 0 slot: 0(0x0) flag: 0x2c lock: 2 ckix: 0
ncol: 2 nnew: 1 size: 0
KDO Op code: 21 row dependencies Disabled
xtype: XAxtype KDO_KDOM2 flags: 0x00000080 bdba: 0x0140012e hdba: 0x0140012a
itli: 2 ispac: 0 maxfr: 4858
vect = 3
col 1: [ 3] 41 41 41
REDO RECORD - Thread:1 RBA: 0x00010f.00000042.0010 LEN: 0x0164 VLD: 0x05
SCN: 0x0000.006d6acb SUBSCN: 1 11/18/2013 20:45:59
(LWN RBA: 0x00010f.00000042.0010 LEN: 0001 NST: 0001 SCN: 0x0000.006d6aca)
CHANGE #1 TYP:0 CLS:32 AFN:3 DBA:0x00c03730 OBJ:4294967295 SCN:0x0000.006d6ac2 SEQ:1 OP:5.1 ENC:0 RBL:0
ktudb redo: siz: 120 spc: 3150 flg: 0x0022 seq: 0x0336 rec: 0x27
xid: 0x0008.006.00003ab8
ktubu redo: slt: 6 rci: 38 opc: 11.1 objn: 17987 objd: 17987 tsn: 5
Undo type: Regular undo Undo type: Last buffer split: No
Tablespace Undo: No
0x00000000
KDO undo record:
KTB Redo
op: 0x02 ver: 0x01
compat bit: 4 (post-11) padding: 1
op: C uba: 0x00c03730.0336.26
Array Update of 1 rows:
tabn: 0 slot: 1(0x1) flag: 0x2c lock: 0 ckix: 0
ncol: 2 nnew: 1 size: 0
KDO Op code: 21 row dependencies Disabled
xtype: XAxtype KDO_KDOM2 flags: 0x00000080 bdba: 0x0140012e hdba: 0x0140012a
itli: 2 ispac: 0 maxfr: 4858
vect = 3
col 1: [ 3] 62 62 62
CHANGE #2 TYP:0 CLS:1 AFN:5 DBA:0x0140012e OBJ:17987 SCN:0x0000.006d6ac2 SEQ:1 OP:11.19 ENC:0 RBL:0
KTB Redo
op: 0x02 ver: 0x01
compat bit: 4 (post-11) padding: 1
op: C uba: 0x00c03730.0336.27
Array Update of 1 rows:
tabn: 0 slot: 1(0x1) flag: 0x2c lock: 2 ckix: 0
ncol: 2 nnew: 1 size: 0
KDO Op code: 21 row dependencies Disabled
xtype: XAxtype KDO_KDOM2 flags: 0x00000080 bdba: 0x0140012e hdba: 0x0140012a
itli: 2 ispac: 0 maxfr: 4858
vect = 3
col 1: [ 3] 42 42 42
REDO RECORD - Thread:1 RBA: 0x00010f.00000043.0010 LEN: 0x008c VLD: 0x05
SCN: 0x0000.006d6acd SUBSCN: 1 11/18/2013 20:46:00
(LWN RBA: 0x00010f.00000043.0010 LEN: 0001 NST: 0001 SCN: 0x0000.006d6acc)
CHANGE #1 TYP:0 CLS:31 AFN:3 DBA:0x00c000f0 OBJ:4294967295 SCN:0x0000.006d6ac2 SEQ:1 OP:5.4 ENC:0 RBL:0
ktucm redo: slt: 0x0006 sqn: 0x00003ab8 srt: 0 sta: 9 flg: 0x2 ktucf redo: uba: 0x00c03730.0336.27 ext: 12 spc: 3028 fbi: 0
记录:
第一条:REDO RECORD:
OP:5.2
OP:5.1
OP:11.19
第二条:REDO RECORD
OP:5.1
OP:11.19
第三条:REDO RECORD
OP:5.4
IMU模式下的REDO日志格式:
REDO RECORD - Thread:1 RBA: 0x000119.0000002b.0010 LEN: 0x037c VLD: 0x0d
SCN: 0x0000.006d7b89 SUBSCN: 1 11/18/2013 21:33:47
(LWN RBA: 0x000119.0000002b.0010 LEN: 0002 NST: 0001 SCN: 0x0000.006d7b88)
CHANGE #1 TYP:2 CLS:1 AFN:5 DBA:0x0140012e OBJ:17987 SCN:0x0000.006d79d3 SEQ:1 OP:11.19 ENC:0 RBL:0
KTB Redo
op: 0x11 ver: 0x01
compat bit: 4 (post-11) padding: 1
op: F xid: 0x0005.003.000038bd uba: 0x00c08f73.01ba.08
Block cleanout record, scn: 0x0000.006d7b7f ver: 0x01 opt: 0x02, entries follow...
itli: 1 flg: 2 scn: 0x0000.006d79d3
Array Update of 1 rows:
tabn: 0 slot: 0(0x0) flag: 0x2c lock: 2 ckix: 0
ncol: 2 nnew: 1 size: 0
KDO Op code: 21 row dependencies Disabled
xtype: XAxtype KDO_KDOM2 flags: 0x00000080 bdba: 0x0140012e hdba: 0x0140012a
itli: 2 ispac: 0 maxfr: 4858
vect = 3
col 1: [ 3] 41 41 41
CHANGE #2 TYP:0 CLS:25 AFN:3 DBA:0x00c000c0 OBJ:4294967295 SCN:0x0000.006d7b02 SEQ:2 OP:5.2 ENC:0 RBL:0
ktudh redo: slt: 0x0003 sqn: 0x000038bd flg: 0x0012 siz: 188 fbi: 0
uba: 0x00c08f73.01ba.08 pxid: 0x0000.000.00000000
CHANGE #3 TYP:0 CLS:1 AFN:5 DBA:0x0140012e OBJ:17987 SCN:0x0000.006d7b89 SEQ:1 OP:11.19 ENC:0 RBL:0
KTB Redo
op: 0x02 ver: 0x01
compat bit: 4 (post-11) padding: 1
op: C uba: 0x00c08f73.01ba.09
Array Update of 1 rows:
tabn: 0 slot: 1(0x1) flag: 0x2c lock: 2 ckix: 0
ncol: 2 nnew: 1 size: 0
KDO Op code: 21 row dependencies Disabled
xtype: XAxtype KDO_KDOM2 flags: 0x00000080 bdba: 0x0140012e hdba: 0x0140012a
itli: 2 ispac: 0 maxfr: 4858
vect = 3
col 1: [ 3] 42 42 42
CHANGE #4 TYP:0 CLS:25 AFN:3 DBA:0x00c000c0 OBJ:4294967295 SCN:0x0000.006d7b89 SEQ:1 OP:5.4 ENC:0 RBL:0
ktucm redo: slt: 0x0003 sqn: 0x000038bd srt: 0 sta: 9 flg: 0x2 ktucf redo: uba: 0x00c08f73.01ba.09 ext: 25 spc: 6696 fbi: 0
CHANGE #5 TYP:0 CLS:26 AFN:3 DBA:0x00c08f73 OBJ:4294967295 SCN:0x0000.006d7b02 SEQ:1 OP:5.1 ENC:0 RBL:0
ktudb redo: siz: 188 spc: 7008 flg: 0x0012 seq: 0x01ba rec: 0x08
xid: 0x0005.003.000038bd
ktubl redo: slt: 3 rci: 0 opc: 11.1 [objn: 17987 objd: 17987 tsn: 5]
Undo type: Regular undo Begin trans Last buffer split: No
Temp Object: No
Tablespace Undo: No
0x00000000 prev ctl uba: 0x00c08f73.01ba.07
prev ctl max cmt scn: 0x0000.006d73bb prev tx cmt scn: 0x0000.006d7406
txn start scn: 0x0000.00000000 logon user: 32 prev brb: 0 prev bcl: 0 BuExt idx: 0 flg2: 0
KDO undo record:
KTB Redo
op: 0x04 ver: 0x01
compat bit: 4 (post-11) padding: 1
op: L itl: xid: 0x0008.006.00003ab8 uba: 0x00c03730.0336.27
flg: C--- lkc: 0 scn: 0x0000.006d6acd
Array Update of 1 rows:
tabn: 0 slot: 0(0x0) flag: 0x2c lock: 0 ckix: 0
ncol: 2 nnew: 1 size: 0
KDO Op code: 21 row dependencies Disabled
xtype: XAxtype KDO_KDOM2 flags: 0x00000080 bdba: 0x0140012e hdba: 0x0140012a
itli: 2 ispac: 0 maxfr: 4858
vect = 3
col 1: [ 3] 61 61 61
CHANGE #6 TYP:0 CLS:26 AFN:3 DBA:0x00c08f73 OBJ:4294967295 SCN:0x0000.006d7b89 SEQ:1 OP:5.1 ENC:0 RBL:0
ktudb redo: siz: 120 spc: 6818 flg: 0x0022 seq: 0x01ba rec: 0x09
xid: 0x0005.003.000038bd
ktubu redo: slt: 3 rci: 8 opc: 11.1 objn: 17987 objd: 17987 tsn: 5
Undo type: Regular undo Undo type: Last buffer split: No
Tablespace Undo: No
0x00000000
KDO undo record:
KTB Redo
op: 0x02 ver: 0x01
compat bit: 4 (post-11) padding: 1
op: C uba: 0x00c08f73.01ba.08
Array Update of 1 rows:
tabn: 0 slot: 1(0x1) flag: 0x2c lock: 0 ckix: 0
ncol: 2 nnew: 1 size: 0
KDO Op code: 21 row dependencies Disabled
xtype: XAxtype KDO_KDOM2 flags: 0x00000080 bdba: 0x0140012e hdba: 0x0140012a
itli: 2 ispac: 0 maxfr: 4858
vect = 3
col 1: [ 3] 62 62 62
一条REDO RECORD
OP:11.19 --->>AAA
OP:5.2 ---->事务产生
OP:11.19 ----->>BBB
OP:5.4 ---->COMMIT;
OP:5.1 ---->aaa
OP:5.1 --->bbb
- 第一个问题和第五个合并回答。
IMU--->In Memory Undo,10g新特性,数据库会在shared pool开辟独立的内存区域用于存储Undo信息,
每个新事务都会分配一个IMU buffer(私有的),一个buffer里有很多node,一个node相当于一个block(回滚块)。
IMUt特性:
IMU顾名思义就是在内存中的undo,现在每次更改data block,Oracle 不用去更改这个undo block(也不会生成相应的redo了),而是把undo信息缓存到IMU里去了,只有最后commit或者flush IMU时,这些undo 信息才会批量更新到undo block,并生成redo。可以避免Undo信息以前在Buffer Cache中的读写操作,从而可以进一步的减少Redo生成,同时可以大大减少以前的UNDO SEGMENT的操作。IMU中数据通过暂存、整理与收缩之后也可以写出到回滚段,这样的写出提供了有序、批量写的性能提升。
IMU主要作用:
减少CR块-->在构造CR block时,不用像以前那样从undo block中获取undo record了,而是用IMU里的信息来构造cr block。
减少REDO日志量-->因为减少REDO RECORD数目
减少LATCH-->因为减少REDO RECORD数目
减少LATCH-->一个IMU latch 代替 redo allocation latch 和 redo copy latch,也减少了LATCH争用.
2.在RAC环境中不支持IMU。
开启FLASHBACK DATABASE时会开启打开辅助日志,此时不能用IMU。
事务过大--据说每个IMU Buffer的大小在64~128KB左右,所以仅有特定的小事务可以使用
共享池太小时,ORACLE会自动不使用IMU。
3.11G中默认是开启IMU特性的,开启关闭语句如下:--修改后最好重启使之生效。
alter system set "_in_memory_undo"=false;
alter system set "_in_memory_undo"=true; --关闭IMU后使用此语句改回使用IMU特性。
4.结合实验步骤来说
UPDATE语句产生的REDO日志格式及分析。
实验1语句是:
BYS@ bys3>select * from dept;
DEPTNO DNAME LOC
10 ACCOUNTING NEW YORK
20 RESEARCH DALLAS
40 OPERATIONS BOSTON
11 chedan bj
22 test sh
BYS@ bys3>set time on
20:26:21 BYS@ bys3>update dept set dname='database' where deptno=11;
1 row updated.
20:26:34 BYS@ bys3>update dept set dname='dataoracle' where deptno=22;
1 row updated.
20:27:00 BYS@ bys3>commit;
Commit complete.
这个操作产生的REDO RECORD中change的顺序如下:--操作加提交只产生一条REDO RECORD
CHANGE#1 OP:11.19 --或者OP:11.5都是--UPDATE语句,开始修改数据,
CHANGE#2 OP:5.2 --operation code 向UNDO段头的事务表写事务信息-事务开始
CHANGE#3 OP:11.19 --或者OP:11.5都是--UPDATE语句,开始修改数据,
CHANGE #4 OP:5.4 --提交
CHANGE #5 OP:5.1 --把表内数据修改前值放到UNDO
CHANGE #6 OP:5.1 --把表内数据修改前值放到UNDO
与楼主图中UPDATE语句从第一步到第九步的对应是:
第一步:将更改的数据存放到PGA
第二步:将BUFFER CACHE中旧数据拷贝到共享池的私有IMU buffer
第三步:将PGA中修改后的数据存放到private redo
第四步:修改buffre cache中的数据
注:我实验了做到这一步,执行update语句后迅速(3秒内)的进行DUMP REDO LOGFILE的操作,从DUMP出的文件中,是找不到此事务的REDO日志条目。
做提交操作后:
第五步:从IMU中拷贝修改前值到BUFFER CACHE中构建一个CR块--即使未提交时SMON每3秒也会做此工作
第六步:第四步修改修改buffre cache中的数据产生的redo日志写入log buffe
第七步:第五步操作构造CR块,产生的redo日志写入 log buffe
第八步:由lgwr写出log buffer到redo log file
第九步:dbwr 将脏数据写入data file
上面UPDATE操作DUMP REDO 内容REDO RECORD - Thread:1 RBA: 0x000141.00000027.0010 LEN: 0x031c VLD: 0x0d
SCN: 0x0000.00719188 SUBSCN: 1 01/07/2014 20:27:05
(LWN RBA: 0x000141.00000027.0010 LEN: 0002 NST: 0001 SCN: 0x0000.00719187)
一个REDO RECORD: RECORD头+CHANGE VECTOR组成(一个CV就是一个操作)
以上是日志头,Thread:1 线程号,RAC时会有1,2等
RBA: 0x000141.00000027.0010 将16进制转换为十进制分别是日志文件号、日志块号、在块上第N字节
VLD: 0x0d日志类型--IMU模式时是这个;非IMU时是:VLD: 0x05
SCN: 0x0000.00719188 SUBSCN: 1 01/07/2014 20:27:05
BYS@ bys3>select scn_to_timestamp(to_number('719188','xxxxxxxx')) from dual;
SCN_TO_TIMESTAMP(TO_NUMBER('719188','XXXXXXXX'))
07-JAN-14 08.27.05.000000000 PM
--是此REDO条目产生时的SCN号,转为十进制现转为时间戳为:08.27.05, 插入语句完成是在20:27:00 BYS@ bys3>commit; --这个是在插入语句完成5秒后,此SCN与CHANGE#4提交时SCN一致。
(LWN RBA: 0x000141.00000027.0010 LEN: 0002 NST: 0001 SCN: 0x0000.00719187)
括号中SCN: 0x0000.00719187 比上一行:SCN: 0x0000.00719187 少了1个SCN。
CHANGE #1 TYP:2 CLS:1 AFN:4 DBA:0x010000fd OBJ:22327 SCN:0x0000.007164a1 SEQ:1 OP:11.5 ENC:0 RBL:0
AFN:4,操作是在4号文件做的-dba_data_files.file_id;OBJ:22327--操作的对象的OBJECT_ID。OP:11.5-有的版本是OP:11.19--更新操作
KTB Redo
op: 0x11 ver: 0x01
compat bit: 4 (post-11) padding: 1
op: F xid: 0x0005.002.00000edc uba: 0x00c041cd.02ea.01
Block cleanout record, scn: 0x0000.0071917c ver: 0x01 opt: 0x02, entries follow...
itli: 1 flg: 2 scn: 0x0000.007164a1
KDO Op code: URP row dependencies Disabled -- --URP=UPDATE ROW PIECE。有时会是:KDO Op code:21 row dependencies Disabled
xtype: XA flags: 0x00000000 bdba: 0x010000fd hdba: 0x010000fa
itli: 2 ispac: 0 maxfr: 4858
tabn: 0 slot: 8(0x8) flag: 0x2c lock: 2 ckix: 0
ncol: 3 nnew: 1 size: 2 --ncol: 3 nnew: 1 表示操作的表有3个列,操作了一列,size: 2
--列字符长度增加2:database减去chedan---根据多次update并DUMP的日志来看,这里的size的值应该是:当前CHANGE中的值减去另一个。。
col 1: [ 8] 64 61 74 61 62 61 73 65 --set dname='database' --col 1: [ 8],第二列,8个字符
BYS@ bys3>select dump('database',16),dump('dataoracle',16) from dual;
DUMP('DATABASE',16) DUMP('DATAORACLE',16)
Typ=96 Len=8: 64,61,74,61,62,61,73,65 Typ=96 Len=10: 64,61,74,61,6f,72,61,63,6c,65
CHANGE #2 TYP:0 CLS:25 AFN:3 DBA:0x00c000c0 OBJ:4294967295 SCN:0x0000.00719153 SEQ:1 OP:5.2 ENC:0 RBL:0
ktudh redo: slt: 0x0002 sqn: 0x00000edc flg: 0x000a siz: 164 fbi: 0
uba: 0x00c041cd.02ea.01 pxid: 0x0000.000.00000000
事务信息
TYP:0 普通块 ,CLS:25 class大于16是UNDO块-递增。AFN:3 绝对文件号dba_data_files.file_id--是UNDO的文件号
DBA:0x00c000c0 数据块在内存中地址
OBJ:4294967295 --十进制,转为16进制是FFFFFFFF
SCN:0x0000.00719153 转换为16进制可与操作时对比
OP:5.2 -> operation code 向UNDO段头的事务表写事务信息-事务开始
uba: 0x00c041cd.02ea.01 UNDO块地址
CHANGE #3 TYP:0 CLS:1 AFN:4 DBA:0x010000fdOBJ:22327 SCN:0x0000.00719188 SEQ:1 OP:11.5 ENC:0 RBL:0
KTB Redo --同CHANGE #1的解析
op: 0x02 ver: 0x01
compat bit: 4 (post-11) padding: 1
op: C uba: 0x00c041cd.02ea.02
KDO Op code: URP row dependencies Disabled ---UNDO ROW PIECE
xtype: XA flags: 0x00000000 bdba: 0x010000fd hdba: 0x010000fa
itli: 2 ispac: 0 maxfr: 4858
tabn: 0 slot: 9(0x9) flag: 0x2c lock: 2 ckix: 0
ncol: 3 nnew: 1 size: 6
col 1: [10] 64 61 74 61 6f 72 61 63 6c 65 --第2列,10个字符--此次操作的字符数
BYS@ bys3>select dump('database',16),dump('dataoracle',16) from dual;
DUMP('DATABASE',16) DUMP('DATAORACLE',16)
Typ=96 Len=8: 64,61,74,61,62,61,73,65 Typ=96 Len=10: 64,61,74,61,6f,72,61,63,6c,65
CHANGE #4 TYP:0 CLS:25 AFN:3DBA:0x00c000c0 OBJ:4294967295 SCN:0x0000.00719188 SEQ:1 OP:5.4 ENC:0 RBL:0
ktucm redo: slt: 0x0002 sqn: 0x00000edc srt: 0 sta: 9 flg: 0x2 ktucf redo: uba: 0x00c041cd.02ea.02 ext: 15 spc: 7890 fbi: 0