If this parameter is set to false, DBWn calculates checksums only for the SYSTEM tablespace, but not for user tablespaces.“
Block type: 占用1byte,經常用到的有,1=undo segment header block; 2=undo data block; 5= data segment header block; 6=data block
Unused: 保留的字節,占用4bytes,用來前后兼容。
Tail 包括了SCN中SCN base的低位(low-order)2bytes,然后是block type,還有Sequence number.每當block 被讀的時候,都要檢查Tail與 block header 是否一致,保證了這個block不是損壞的(corrupted)。
2) The Transaction Header:
一共占據48bytes,包括24bytes的控制信息,和一系列的Interested Transaction Slot (ITS)。這些ITS組合在一起稱為Interested Transaction List (ITL)。初始的ITL slot 數量由 INITRANS 決定(index branch block 只有1個slot)。如果有足夠的剩余空間,oracle會根據需要動態的分配這些slot,直到受到空間限制或者達到了MAXTRANS.
Block header dump: 0x00c0007aObject id on Block? Yseg/obj: 0x806d csc: 0x00.68d714 itc: 2 flg: O typ: 1 - DATAfsl: 0 fnx: 0x0 ver: 0x01Itl Xid Uba Flag Lck Scn/Fsc0x01 0x0004.00b.00000fac 0x00801885.008c.56 --U- 1 fsc 0x0000.0068d7160x02 0x0000.000.00000000 0x00000000.0000.00 ---- 0 fsc 0x0000.00000000 |
24bytes的控制信息包括:
Object number(seg/obj): 占用4bytes,指在OBJ$中記錄的segment 的 object number(0x806d=32877)
Cleanout SCN(csc): 占用6bytes,最后一次 full cleanout 的scn
ITL count(itc): 占用1byte,ITL 的slot數量。
Flag: 占用2bytes.O表示這個block在freelist 上。否則flag為“-”
Block type: 占用1byte.1=data; 2=index
ITL freelist slot(fsl): 占用1byte.Index to the first slot on the ITL freelist
Next freelist block(fnx): 占用4byte.Segment freelist中下一個block的RDBA
Version: 1 byte
Unused: 4bytes,用來前后兼容。
每個ITL entry包括以下的內容:
Transaction id(Xid): 8bytes.其中包括rollback segment number, transaction table中的slot number等。
Undo block address(Uba): 8bytes.其中包括rollback segment block的DBA,sequence number等。
Flags: 1nibble.—— = 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——T = transaction was still active at block cleanout SCN
Locks: 3nibbles. 也就是所謂的行級鎖(row-level locks)
SCN or free space credit: 6bytes. 如果這個事務已經clean out,這個值就是SCN;否則,前兩個字節表示由這個事務釋放的此block中的空間數。
3)Data Area
包括14bytes的data header,4bytes/table的table dictionary,2bytes/row的row dictionary.table dictionary主要用于cluster block中,只不過table block中的table dictionary只有一個table.
data_block_dump,data header at 0x552105c===============tsiz: 0x1fa0 ==> total data area sizehsiz: 0x14 ==> data header size (14+ntabs*4 + nrows*2)pbl: 0x0552105c ==> pointer to buffer holding the blockbdba: 0x00c0007a ==> block dba / rdba76543210flag=-------- ==> n=pctfree hit (clusters),f=don’t put on freelist, k=flushable cluster keysntab=1 ==> number of tables (>1 so this is a cluster)nrow=1 ==> number of rowsfrre=-1fsbo=0x14 ==> free space begin offsetfseo=0x1f9b ==> free space end offsetavsp=0x1f83 ==> available space in the blocktosp=0x1f83 ==> total available space when all transactions commit0xe:pti[0] nrow=1 offs=00x12:pri[0] offs=0x1f9bblock_row_dump:tab 0, row 0, @0x1f9b ==> 3bytes row header tl: 5 fb: --H-FL-- lb: 0x1 cc: 1col 0: [ 1] 61 ==> column length(1 byte if length<250; otherwise 3 bytes) and valuesend_of_block_dump |
5. 對于一個沒有插入任何row的block來說,并且假設使用了默認的INITRANS,它的大小應該是:
db_block_size- (cache header+ transaction header +data header + Tail + table dictionary*ntab + row dictionary*row )=8192 - ( 20+48+14+4+4 +0)=8192 - 90 =8102 bytes
原文轉自:http://www.anti-gravitydesign.com