- 最后登录
- 2023-8-16
- 在线时间
- 1686 小时
- 威望
- 2135
- 金钱
- 50532
- 注册时间
- 2011-10-12
- 阅读权限
- 200
- 帖子
- 5207
- 精华
- 39
- 积分
- 2135
- UID
- 2
|
6#
发表于 2012-3-30 20:41:19
做一个简单的实验说明该问题,ODM TEST:
SQL> alter database add supplemental log data;
Database altered.
SQL> alter system checkpoint;
System altered.
SQL> alter system switch logfile;
System altered.
SQL> select * from v$Log;
GROUP# THREAD# SEQUENCE# BYTES MEMBERS ARC STATUS FIRST_CHANGE# FIRST_TIM
---------- ---------- ---------- ---------- ---------- --- ---------------- ------------- ---------
1 1 71 52428800 2 NO CURRENT 15989215 30-MAR-12
2 1 70 52428800 2 YES INACTIVE 15988140 30-MAR-12
3 1 69 52428800 2 YES INACTIVE 15981490 30-MAR-12
SQL> create table undo_log (t1 timestamp);
Table created.
SQL> insert into undo_log values(systimestamp);
1 row created.
SQL> commit;
Commit complete.
SQL> select dump(t1,16) from undo_log;
DUMP(T1,16)
---------------------------------------------------------------
Typ=180 Len=11: 78,70,3,1e,9,1c,2e,7,46,59,b8 ==> before image
SQL> update undo_log set t1=systimestamp;
1 row updated.
SQL> commit;
Commit complete.
SQL> select dump(t1,16) from undo_log;
DUMP(T1,16)
-----------------------------------------------------------
Typ=180 Len=11: 78,70,3,1e,9,1e,1,f,d1,f8,f8==> after image
SQL> ALTER SYSTEM DUMP LOGFILE '/s01/oradata/G10R21/onlinelog/o1_mf_1_7ch812dg_.log';
System altered.
SQL> ORADEBUG SETMYPID;
Statement processed.
SQL> ORADEBUG TRACEFILE_NAME
/s01/admin/G10R21/udump/g10r21_ora_3738.trc
可以在TRACE中找到 相关的 REDO RECORD,一条RECORD中可能包含多个change, 每个change包含不同的OP operation,例如undo 、INSERT、UPDATE、DELETE、BLOCK CLEANOUT等。
REDO RECORD - Thread:1 RBA: 0x000047.00000038.0010 LEN: 0x0218 VLD: 0x05
SCN: 0x0000.00f3fa1a SUBSCN: 1 03/30/2012 08:29:03
CHANGE #1 TYP:0 CLS:31 AFN:8 DBA:0x02000059 OBJ:4294967295 SCN:0x0000.00f3f9f8 SEQ: 1 OP:5.2
ktudh redo: slt: 0x0014 sqn: 0x00000ddf flg: 0x0012 siz: 164 fbi: 0
uba: 0x02000b28.0398.05 pxid: 0x0000.000.00000000
CHANGE #2 TYP:0 CLS:32 AFN:8 DBA:0x02000b28 OBJ:4294967295 SCN:0x0000.00f3f9f2 SEQ: 2 OP:5.1
ktudb redo: siz: 164 spc: 7634 flg: 0x0012 seq: 0x0398 rec: 0x05
xid: 0x0008.014.00000ddf
ktubl redo: slt: 20 rci: 0 opc: 11.1 objn: 56418 objd: 56418 tsn: 0
Undo type: Regular undo Begin trans Last buffer split: No
Temp Object: No
Tablespace Undo: No
0x00000000 prev ctl uba: 0x02000b28.0398.03
prev ctl max cmt scn: 0x0000.00f3f73a prev tx cmt scn: 0x0000.00f3f7dd
txn start scn: 0xffff.ffffffff logon user: 0 prev brb: 33557284 prev bcl: 0 KDO undo record:
KTB Redo
op: 0x03 ver: 0x01
op: Z
KDO Op code: URP row dependencies Disabled
xtype: XA flags: 0x00000000 bdba: 0x0043df12 hdba: 0x0043df11
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: [11] 78 70 03 1e 09 1c 2e 07 46 59 b8
CHANGE #2 的 OP 5.1 undo
xid: 0x0008.014.00000ddf
Undo type: Regular undo ==>常规redo
col 0: [11] 78 70 03 1e 09 1c 2e 07 46 59 b8 ==> before image
OBJ:4294967295
DBA:0x02000b28
CHANGE #3 TYP:2 CLS: 1 AFN:1 DBA:0x0043df12 OBJ:56418 SCN:0x0000.00f3fa01 SEQ: 1 OP:11.5
KTB Redo
op: 0x11 ver: 0x01
op: F xid: 0x0008.014.00000ddf uba: 0x02000b28.0398.05
Block cleanout record, scn: 0x0000.00f3fa1a ver: 0x01 opt: 0x02, entries follow...
itli: 1 flg: 2 scn: 0x0000.00f3fa01
KDO Op code: URP row dependencies Disabled
xtype: XA flags: 0x00000000 bdba: 0x0043df12 hdba: 0x0043df11
itli: 2 ispac: 0 maxfr: 4863
tabn: 0 slot: 0(0x0) flag: 0x2c lock: 2 ckix: 0
ncol: 1 nnew: 1 size: 0
col 0: [11] 78 70 03 1e 09 1e 01 0f d1 f8 f8
OP:11.5 UPR update row
同时发生了Block cleanout
col 0: [11] 78 70 03 1e 09 1e 01 0f d1 f8 f8==》AFTER IMAGE
CHANGE #4 MEDIA RECOVERY MARKER SCN:0x0000.00000000 SEQ: 0 OP:5.20
session number = 153
serial number = 52
transaction name = |
|