update一条语句的来龙去脉(五)

2014-11-24 14:31:50 · 作者: · 浏览: 4
bled
xtype: XA flags: 0x00000000 bdba: 0x01c0296e hdba: 0x01c0296a
itli: 2 ispac: 0 maxfr: 4858
tabn: 0 slot: 0(0x0) flag: 0x2c lock: 0 ckix: 0
ncol: 8 nnew: 1 size: -1
col 1: [ 3] 41 4d 59
End dump data blocks tsn: 10 file#: 9 minblk 37599 maxblk 37599
原镜像数据也是41 4d 59为amy
3)查看原镜像数据块如下:
。。。。。。。。。。。。。。。。。
Start dump data blocks tsn: 8 file#:7 minblk 10606 maxblk 10606
Block dump from cache:
Dump of buffer cache at level 4 for tsn=8 rdba=29370734
BH (0x777e2e10) file#: 7 rdba: 0x01c0296e (7/10606) class: 1 ba: 0x77554000
set: 3 pool: 3 bsz: 8192 bsi: 0 sflg: 2 pwc: 0,0
dbwrid: 0 obj: 89716 objn: 89179 tsn: 8 afn: 7 hint: f
hash: [0x7c22e880,0x7c22e880] lru: [0x777e3038,0x777e2dc8]
ckptq: [NULL] fileq: [NULL] objq: [0x777e3408,0x796cea90] objaq: [0x777e3418,0x796cea80]
st: XCURRENT md: NULL fpin: 'kduwh01: kdusru' tch: 1
flags: block_written_once redo_since_read
LRBA: [0x0.0.0] LSCN: [0x0.0] HSCN: [0xffff.ffffffff] HSUB: [1]
Block dump from disk:
buffer tsn: 8 rdba: 0x01c0296e (7/10606)
scn: 0x0000.0050c823 seq: 0x01 flg: 0x04 tail: 0xc8230601
frmt: 0x02 chkval: 0x9ef8 type: 0x06=trans data
Hex dump of block: st=0, typ_found=1
。。。。。。。。。。。。。。。。。。。。
Block header dump: 0x01c0296e
Object id on Block Y
seg/obj: 0x15e74 csc: 0x00.50c823 itc: 2 flg: E typ: 1 - DATA
brn: 0 bdba: 0x1c02968 ver: 0x01 opc: 0
inc: 0 exflg: 0
Itl Xid Uba Flag Lck Scn/Fsc
0x01 0x0014.017.00001085 0x024092b6.005b.01 C--- 0 scn 0x0000.00505633
0x02 0x0014.01f.000010bc 0x024092df.005b.01 ---- 1 fsc 0x0000.00000000
bdba: 0x01c0296e
note:bdba,xid这和前面的一致
另外注意这个flag:
Flag – Transaction flag
---- = Uncommitted
-B-- = The UBA (Undo Block Address) contains undo for this ITL
--U- = Committed by fast commits & delayed block cleanout has not occurred
---T = Transaction active at block cleanout SCN
-C-U- = Block cleaned by delayed block cleanout, and rollback segment info is overwritten.
。。。。。。。。。。。
block_row_dump:
tab 0, row 0, @0x1d42
tl: 36 fb: --H-FL-- lb: 0x2 cc: 8
col 0: [ 2] c2 4c
col 1: [ 4] 52 68 79 73
col 2: [ 5] 43 4c 45 52 4b
col 3: [ 3] c2 50 03
col 4: [ 7] 77 b4 0c 11 01 01 01
col 5: [ 2] c2 09
col 6: *NULL*
col 7: [ 2] c1 15
tab 0, row 1, @0x1d89
注意:这里的lb代表锁定状态正是指向了itl为0x02。
总结一下:
当我更新一条数据的时候,
1、首次查看该数据是否在buffer cache中,如果没有则从数据文件读入buffer cache
2、更新操作时首先在undo分配事务槽,并记录redo信息
2、在buffer cache中创建数据的前镜像,并记录redo信息
3、修改值,需要记录redo信息
4、提交之后再redo中记录信息,并标记undo中的数据为非激活状态,flag标记进行相应改变。