[php]
When a user issues a COMMIT statement, LGWR puts a commit record
in the redo log buffer and writes it to disk immediately, along with the
transaction's redo entries. The corresponding changes to data blocks are
deferred until it is more efficient to write them. This is called a fast commit
mechanism. The atomic write of the redo entry containing the
transaction's commit record is the single event that determines the
transaction has committed. Oracle returns a success code to the
committing transaction, although the data buffers have not yet been
written to disk.
.
[/php]
概念上交代的东西感觉也不是很清楚
1 a commit record 指什么,scn?
2 transaction's redo entries指什么?我觉得至少应该包括了xid
做了一个简单的试验:
[php]
SQL> connect xys/manager
已连接。
SQL> insert into tt values(3 , 'abc');
已创建 1 行。
SQL> select dbms_flashback.get_system_change_number from dual;
GET_SYSTEM_CHANGE_NUMBER
------------------------
582806
SQL> commit;
提交完成。
SQL> select group# ,sequence# , status , first_change# from v$log;
GROUP#SEQUENCE# STATUS FIRST_CHANGE#
---------- ---------- ---------------- -------------
4 26 INACTIVE
582340
5 27 CURRENT
582768
6
0 UNUSED
0
SQL> alter system dump logfile 'E:\ORACLE\PRODUCT\10.2.0\ORADATA\TEST\REDO05.LOG
';
系统已更改。
SQL> select dbms_flashback.get_system_change_number from dual;
GET_SYSTEM_CHANGE_NUMBER
------------------------
582885
SQL> select *from tt;
ID NAME
---------- ----------
1 abcde
2 abcde
3 abc
.
[/php]
dump文件的内容如下,其中这段内容和我的试验应该是有关系的,单独拿出来了,可能还有有关系的,至少我没有看出来,大家看看,谁能对下面这段和试验相关的dump做个解释?
[php]
CHANGE #3 TYP:2 CLS: 1 AFN:4 DBA:0x01000067 OBJ:12166 SCN:0x0000.0008e45e SEQ:1 OP:11.2
KTB Redo
op: 0x11ver: 0x01
op: Fxid:0x0001.01e.000000c0uba: 0x00804648.002f.17
Block cleanout record, scn:0x0000.0008e47f ver: 0x01 opt: 0x02, entries follow...
itli: 1flg: 2scn: 0x0000.0008e32f
itli: 2flg: 2scn: 0x0000.0008e45e
KDO Op code: IRP row dependencies Disabled
xtype: XA flags: 0x00000000bdba: 0x01000067hdba: 0x01000063
itli: 1ispac: 0maxfr: 4858
tabn: 0 slot: 2(0x2) size/delt: 10
fb: --H-FL-- lb: 0x1cc: 2
null: --
col0: [ 2]c1 04
col1: [ 3]61 62 63
.
[/php]
完整的dump内容:
[php]
Dump file e:\oracle\product\10.2.0\admin\test\udump\test_ora_1684.trc
Wed May 30 13:44:33 2007
ORACLE V10.2.0.1.0 - Production vsnsta=0
vsnsql=14 vsnxtr=3
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
Windows XP Version V5.1 Service Pack 2
CPU
: 1 - type 586
Process Affinity: 0x00000000
Memory (Avail/Total): Ph:555M/1270M, Ph+PgF:2154M/3030M, VA:1464M/2047M
Instance name: test
Redo thread mounted by this instance: 1
Oracle process number: 18
Windows thread id: 1684, image: ORACLE.EXE (SHAD)
*** 2007-05-30 13:44:33.515
*** ACTION NAME
) 2007-05-30 13:44:33.468
*** MODULE NAME
SQL*Plus) 2007-05-30 13:44:33.468
*** SERVICE NAME
SYS$USERS) 2007-05-30 13:44:33.468
*** SESSION ID
153.15) 2007-05-30 13:44:33.468
DUMP OF REDO FROM FILE 'E:\ORACLE\PRODUCT\10.2.0\ORADATA\TEST\REDO05.LOG'
Opcodes *.*
RBAs: 0x000000.00000000.0000 thru 0xffffffff.ffffffff.ffff
SCNs: scn: 0x0000.00000000 thru scn: 0xffff.ffffffff
Times: creation thru eternity
FILE HEADER:
Compatibility Vsn = 169869568=0xa200100
Db ID=1921230414=0x7283a64e, Db Name='TEST'
Activation ID=1921250382=0x7283f44e
Control Seq=388=0x184, File size=8192=0x2000
File Number=5, Blksiz=512, File Type=2 LOG
descrip:"Thread 0001, Seq# 0000000027, SCN 0x00000008e470-0xffffffffffff"
thread: 1 nab: 0xffffffff seq: 0x0000001b hws: 0x1 eot: 1 dis: 0
resetlogs count: 0x252381ce scn: 0x0000.00000001 (1)
resetlogs terminal rcv count: 0x0 scn: 0x0000.00000000
prev resetlogs count: 0x0 scn: 0x0000.00000000
prev resetlogs terminal rcv count: 0x0 scn: 0x0000.00000000
Lowscn: 0x0000.0008e470 (582768) 05/30/2007 13:41:25
Next scn: 0xffff.ffffffff 01/01/1988 00:00:00
Enabled scn: 0x0000.00000001 (1) 05/20/2007 14:53:13
Thread closed scn: 0x0000.0008e470 (582768) 05/30/2007 13:41:25
Disk cksum: 0x4160 Calc cksum: 0x4160
Terminal recovery stop scn: 0x0000.00000000
Terminal recovery01/01/1988 00:00:00
Most recent redo scn: 0x0000.00000000
Largest LWN: 0 blocks
End-of-redo stream : No
Unprotected mode
Miscellaneous flags: 0x0
Thread internal enable indicator: thr: 0, seq: 0 scn: 0x0000.00000000
REDO RECORD - Thread:1 RBA: 0x00001b.00000002.0010 LEN: 0x0070 VLD: 0x06
SCN: 0x0000.0008e473 SUBSCN:1 05/30/2007 13:41:36
CHANGE #1 MEDIA RECOVERY MARKER SCN:0x0000.00000000 SEQ:0 OP:23.1
Block Written - afn: 2 rdba: 0x00800089 BFT
1024,8388745) non-BFT
2,137)
scn: 0x0000.0008e45e seq: 0x01 flg:0x04
REDO RECORD - Thread:1 RBA: 0x00001b.00000003.0010 LEN: 0x01d4 VLD: 0x05
SCN: 0x0000.0008e47f SUBSCN:1 05/30/2007 13:42:12
CHANGE #1 TYP:0 CLS:17 AFN:2 DBA:0x00800009 OBJ:4294967295 SCN:0x0000.0008e31e SEQ:1 OP:5.2
ktudh redo: slt: 0x001e sqn: 0x000000c0 flg: 0x0012 siz: 128 fbi: 0
uba: 0x00804648.002f.17pxid:0x0000.000.00000000
CHANGE #2 TYP:0 CLS:18 AFN:2 DBA:0x00804648 OBJ:4294967295 SCN:0x0000.0008e31d SEQ:3 OP:5.1
ktudb redo: siz: 128 spc: 5510 flg: 0x0012 seq: 0x002f rec: 0x17
xid:0x0001.01e.000000c0
ktubl redo: slt: 30 rci: 0 opc: 11.1 objn: 12166 objd: 12166 tsn: 4
Undo type:Regular undoBegin transLast buffer split:No
Temp Object:No
Tablespace Undo:No
0x00000000prev ctl uba: 0x00804648.002f.14
prev ctl max cmt scn:0x0000.0008d5c8prev tx cmt scn:0x0000.0008d5d2
txn start scn:0xffff.fffffffflogon user: 30prev brb: 8406591prev bcl: 0 KDO undo record:
KTB Redo
op: 0x04ver: 0x01
op: Litl: xid:0x0002.006.000000bf uba: 0x00804a6f.0038.33
flg: C---lkc:0 scn: 0x0000.0008e32f
KDO Op code: DRP row dependencies Disabled
xtype: XA flags: 0x00000000bdba: 0x01000067hdba: 0x01000063
itli: 1ispac: 0maxfr: 4858
tabn: 0 slot: 2(0x2)
CHANGE #3 TYP:2 CLS: 1 AFN:4 DBA:0x01000067 OBJ:12166 SCN:0x0000.0008e45e SEQ:1 OP:11.2
KTB Redo
op: 0x11ver: 0x01
op: Fxid:0x0001.01e.000000c0uba: 0x00804648.002f.17
Block cleanout record, scn:0x0000.0008e47f ver: 0x01 opt: 0x02, entries follow...
itli: 1flg: 2scn: 0x0000.0008e32f
itli: 2flg: 2scn: 0x0000.0008e45e
KDO Op code: IRP row dependencies Disabled
xtype: XA flags: 0x00000000bdba: 0x01000067hdba: 0x01000063
itli: 1ispac: 0maxfr: 4858
tabn: 0 slot: 2(0x2) size/delt: 10
fb: --H-FL-- lb: 0x1cc: 2
null: --
col0: [ 2]c1 04
col1: [ 3]61 62 63
REDO RECORD - Thread:1 RBA: 0x00001b.00000004.0010 LEN: 0x008c VLD: 0x05
SCN: 0x0000.0008e49f SUBSCN:1 05/30/2007 13:43:43
CHANGE #1 TYP:0 CLS:17 AFN:2 DBA:0x00800009 OBJ:4294967295 SCN:0x0000.0008e47f SEQ:1 OP:5.4
ktucm redo: slt: 0x001e sqn: 0x000000c0 srt: 0 sta: 9 flg: 0x2
ktucf redo: uba: 0x00804648.002f.17 ext: 3 spc: 5380 fbi: 0
END OF REDO DUMP
----- Redo read statistics for thread 1 -----
Read rate (ASYNC): 1Kb in 0.75s => 0.00 Mb/sec
Total physical reads: 4096Kb
Longest record: 0Kb, moves: 0/3 (0%)
Change moves: 0/5 (0%), moved: 0Mb
Longest LWN: 0Kb, moves: 0/3 (0%), moved: 0Mb
Last redo scn: 0x0000.0008e49f (582815)
----------------------------------------------
.
[/php]
|