1. 事务开始
Itl Xid Uba Flag Lck Scn/Fsc
0x01 0x0008.014.0000024e 0x0080028e.00d9.2e C--- 0 scn 0x0000.00164660
0x02 0x0007.001.000001bb 0x0080049a.00cf.2c ---- 1 fsc 0x0000.00000000
lck标识为1,表示该事务锁住了1条记录, fsc变成0x0000.00000000 相应的记录lb指向ITLOx02
block_row_dump:
tab 0, row 0, @0x1f8d
tl: 10 fb: --H-FL-- lb: 0x2 cc: 1
col 0: [ 6] 67 75 6f 6a 6a 65
end_of_block_dump
0x01 0x0008.014.0000024e 0x0080028e.00d9.2e C--- 0 scn 0x0000.00164660
0x02 0x0007.001.000001bb 0x0080049a.00cf.2c ---- 1 fsc 0x0000.00000000
lck标识为1,表示该事务锁住了1条记录, fsc变成0x0000.00000000 相应的记录lb指向ITLOx02
block_row_dump:
tab 0, row 0, @0x1f8d
tl: 10 fb: --H-FL-- lb: 0x2 cc: 1
col 0: [ 6] 67 75 6f 6a 6a 65
end_of_block_dump
2. 提交事务:
Itl Xid Uba Flag Lck Scn/Fsc
0x01 0x0008.014.0000024e 0x0080028e.00d9.2e C--- 0 scn 0x0000.00164660
0x02 0x0007.001.000001bb 0x0080049a.00cf.2c --U- 1 fsc 0x0000.0016a59d
0x01 0x0008.014.0000024e 0x0080028e.00d9.2e C--- 0 scn 0x0000.00164660
0x02 0x0007.001.000001bb 0x0080049a.00cf.2c --U- 1 fsc 0x0000.0016a59d
block_row_dump:
tab 0, row 0, @0x1f8d
tl: 10 fb: --H-FL-- lb: 0x2 cc: 1
col 0: [ 6] 67 75 6f 6a 6a 65
end_of_block_dump
lck标识仍为1,相应记录的lb仍然没有改变.但是flag变为了--U--
flag的标记解释如下:
---- = transaction is active, or committed pending cleanout
C--- = transaction has been committed and locks cleaned out
-B-- = this undo record contains the undo for this ITL entry
--U- = transaction committed (maybe long ago); SCN is an upper bound
tab 0, row 0, @0x1f8d
tl: 10 fb: --H-FL-- lb: 0x2 cc: 1
col 0: [ 6] 67 75 6f 6a 6a 65
end_of_block_dump
lck标识仍为1,相应记录的lb仍然没有改变.但是flag变为了--U--
flag的标记解释如下:
---- = transaction is active, or committed pending cleanout
C--- = transaction has been committed and locks cleaned out
-B-- = this undo record contains the undo for this ITL entry
--U- = transaction committed (maybe long ago); SCN is an upper bound
3. 当该数据块上另外一条记录执行DML操作,并提交,这时ITL表会变成:
Itl Xid Uba Flag Lck Scn/Fsc
0x01 0x0008.00b.0000024f 0x00800290.00d9.29 --U- 1 fsc 0x0000.0016a6eb
0x02 0x0006.021.00000247 0x0080010e.00d6.13 --U- 1 fsc 0x0000.0016a887
4. 当该数据块上另外一条记录执行DML操作,可以看到所有的ITL的flag的都被重置:
Itl Xid Uba Flag Lck Scn/Fsc
0x01 0x0008.00b.0000024f 0x00800290.00d9.29 ---- 1 fsc 0x0000.00000000
0x02 0x0007.001.000001bb 0x0080049a.00cf.2c C--- 0 scn 0x0000.0016a59d
Itl Xid Uba Flag Lck Scn/Fsc
0x01 0x0008.00b.0000024f 0x00800290.00d9.29 --U- 1 fsc 0x0000.0016a6eb
0x02 0x0006.021.00000247 0x0080010e.00d6.13 --U- 1 fsc 0x0000.0016a887
4. 当该数据块上另外一条记录执行DML操作,可以看到所有的ITL的flag的都被重置:
Itl Xid Uba Flag Lck Scn/Fsc
0x01 0x0008.00b.0000024f 0x00800290.00d9.29 ---- 1 fsc 0x0000.00000000
0x02 0x0007.001.000001bb 0x0080049a.00cf.2c C--- 0 scn 0x0000.0016a59d
block_row_dump:
tab 0, row 0, @0x1f82
tl: 11 fb: --H-FL-- lb: 0x1 cc: 1
col 0: [ 7] 67 75 6f 5f 6a 6a 65
end_of_block_dump
tab 0, row 0, @0x1f82
tl: 11 fb: --H-FL-- lb: 0x1 cc: 1
col 0: [ 7] 67 75 6f 5f 6a 6a 65
end_of_block_dump
可以看到0x02的lck被清除,fsc变为scn.
结论与问题:事务提交后ITL相应的记录并不清除,当有其他DML操作找不到可用的Slot时,
才会清除.
才会清除.
本文转自 anranran 51CTO博客,原文链接:http://blog.51cto.com/guojuanjun/347319