SQL> set serveroutput on
SQL> exec show_space('T9');
Free Blocks.............................1
Total Blocks............................8
Total Bytes.............................65536
Unused Blocks...........................6
Unused Bytes............................49152
Last Used Ext FileId....................3
Last Used Ext BlockId...................121
Last Used Block.........................2
PL/SQL procedure successfully completed.
SQL> alter system dump datafile 3 block 122;
System altered.
SQL> select * from v$tablespace;
TS# NAME INC
---------- ------------------------------ ---
0 SYSTEM YES
1 UNDOTBS1 YES
8 USERS YES
18 TEMP1
引用oracle document 的解释:“DB_BLOCK_CHECKSUM determines whether DBWn and the direct loader will calculate a checksum (a number calculated from all the bytes stored in the block) and store it in the cache header of every data block when writing it to disk. Checksums are verified when a block is read-only if this parameter is true and the last write of the block stored a checksum. In addition, Oracle gives every log block a checksum before writing it to the current log.
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
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中的空间数。
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