设为首页 加入收藏

TOP

非IMU模式下一条update语句产生REDORECORD条数的探究(一)
2014-11-24 07:45:21 来源: 作者: 【 】 浏览:11
Tags:IMU 模式 update 语句 产生 REDORECORD 探究

注意:每个实验前最好做下日志切换,更详细方法dump redo 文件的方法及本篇DUMP的TRACE文件见下载附件:本篇TRACE等附件下载,或者另一篇博客 :非IMU模式下DML语句产生的REDO日志内容格式解读

实验1:

BYS@ bys3>select * from dept;
DEPTNO DNAME LOC
---------- -------------- -------------
10 database NEW YORK
20 database DALLAS
40 OPERATIONS BOSTON
11 database bj
22 test sh
update dept set dname='oracle' where deptno<40;
4 rows updated.

这个更新语句会产生四条REDO RECORD,因为对四条记录改为oracle
#############################

实验2:

BYS@ bys3>select * from dept;
DEPTNO DNAME LOC
---------- -------------- -------------
10 ACCOUNTING NEW YORK
20 RESEARCH DALLAS
40 OPERATIONS BOSTON
11 database bj
22 test sh
BYS@ bys3>update dept set dname='database' where deptno<22;
3 rows updated.
这个更新语句中,已经有一条是database,这次更新了三条语句,但是只有两条REDO RECORD,
有一个REDO RECORD的CHANGE #1不一样:这个REDO RECORD只有CHANGE #1,CHANGE #2,CHANGE #1中就把这两个值放入UNDO,详见后面日志。
##########################################

实验3:

BYS@ bys3>select * from dept;
DEPTNO DNAME LOC
---------- -------------- -------------
10 oracle NEW YORK
20 oracle DALLAS
40 OPERATIONS BOSTON
11 oracle bj
22 oracle sh
BYS@ bys3>set time on
09:47:59 BYS@ bys3>update dept set dname='oracle' where deptno=10;
1 row updated.
将一行中oracle--UPDATE为oracle,一条REDO RECORD
####################

实验4:

10:08:32 BYS@ bys3>select * from dept;
DEPTNO DNAME LOC
---------- -------------- -------------
10 oracle NEW YORK
20 oracle DALLAS
40 OPERATIONS BOSTON
11 oracle bj
22 oracle sh
10:08:57 BYS@ bys3>update dept set dname='oracle' where deptno<40;
4 rows updated.

更新了四行,这四行原值oracle,更新为oracle,只有一条一条REDO RECORD

##################

附dump 每次操作的redo日志

实验1的:

REDO RECORD - Thread:1 RBA: 0x00013b.00000029.0010 LEN: 0x01e4 VLD: 0x05
SCN: 0x0000.00704cb2 SUBSCN: 1 01/06/2014 22:04:42
(LWN RBA: 0x00013b.00000029.0010 LEN: 0003 NST: 0001 SCN: 0x0000.00704cb1)
CHANGE #1 TYP:0 CLS:33 AFN:3 DBA:0x00c00100 OBJ:4294967295 SCN:0x0000.00704c81 SEQ:1 OP:5.2 ENC:0 RBL:0
ktudh redo: slt: 0x0015 sqn: 0x00000e9f flg: 0x0012 siz: 164 fbi: 0
uba: 0x00c02e0e.0247.2a pxid: 0x0000.000.00000000
CHANGE #2 TYP:0 CLS:34 AFN:3 DBA:0x00c02e0e OBJ:4294967295 SCN:0x0000.00704c80 SEQ:3 OP:5.1 ENC:0 RBL:0
ktudb redo: siz: 164 spc: 3160 flg: 0x0012 seq: 0x0247 rec: 0x2a
xid: 0x0009.015.00000e9f
ktubl redo: slt: 21 rci: 0 opc: 11.1 [objn: 22327 objd: 22327 tsn: 4]
Undo type: Regular undo Begin trans Last buffer split: No
Temp Object: No
Tablespace Undo: No
0x00000000 prev ctl uba: 0x00c02e0e.0247.27
prev ctl max cmt scn: 0x0000.007049b5 prev tx cmt scn: 0x0000.007049e3
txn start scn: 0xffff.ffffffff logon user: 32 prev brb: 12591203 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.00f.00000e9c uba: 0x00c01cbf.0250.0f
flg: C--- lkc: 0 scn: 0x0000.00702fe2
KDO Op code: URP row dependencies Disabled
xtype: XA flags: 0x00000000 bdba: 0x010000fd hdba: 0x010000fa
itli: 1 ispac: 0 maxfr: 4858
tabn: 0 slot: 2(0x2) flag: 0x2c lock: 0 ckix: 0
ncol: 3 nnew: 1 size: 2
col 1: [ 8] 64 61 74 61 62 61 73 65
CHANGE #3 TYP:2 CLS:1 AFN:4 DBA:0x010000fd OBJ:22327 SCN:0x0000.00703bc4 SEQ:1 OP:11.5 ENC:0 RBL:0
KTB Redo
op: 0x11 ver: 0x01
compat bit: 4 (post-11) padding: 1
op: F xid: 0x0009.015.00000e9f uba: 0x00c02e0e.0247.2a
Block cleanout record, scn: 0x0000.00704cb2 ver: 0x01 opt: 0x02, entries follow...
itli: 2 flg: 2 scn: 0x0000.00703bc4
KDO Op code: URP row dependencies Disabled
xtype: XA flags: 0x00000000 bdba: 0x010000fd hdba: 0x010000fa
itli: 1 i

首页 上一页 1 2 3 4 5 6 下一页 尾页 1/6/6
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇asm磁盘头丢失,损坏 下一篇xtrabackup迁移单独一张INNODB表

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容:

·“我用Java 8”已成 (2025-12-26 11:19:54)
·下载 IntelliJ IDEA (2025-12-26 11:19:52)
·Java是什么?(通俗 (2025-12-26 11:19:49)
·雾里看花:真正意义 (2025-12-26 10:54:36)
·C++——模板(超详细 (2025-12-26 10:54:34)