行連線的一點內部儲存測試!

warehouse發表於2009-06-24

主要是驗證一下block內部的一個"fb"標誌

The ‘fb’ value gives us flags about the row. ‘H’ means that we have the head of the row. ‘F’ means that we have the first piece of the row. ‘L’ means we also have the last piece of the row. Since this is the first and last piece of the row, the row is not chained. Since this is also the head of the row, the row has not been migrated.

[@more@]

SQL> create table tt(a char(2000),b char(2000),c char(2000) , d char(2000) ,e ch
ar(2000)) tablespace users;

表已建立。

SQL> insert into tt values('a','b','c','d','e');

已建立 1 行。

SQL> commit;

提交完成。
SQL> analyze table tt compute statistics;

表已分析。
SQL> select chain_cnt,blocks,empty_blocks from dba_tables where owner='TEST' and
table_name='TT';

CHAIN_CNT BLOCKS EMPTY_BLOCKS
---------- ---------- ------------
1 5 3

--這裡我們主要到發生了行連結,在block#:22580的dump資訊中注意到
這樣一個資訊:nrid: 0x01005838.0
這個值其實是和block#:22580發生連線的block的rdba,透過下面轉化
得知是block:22584
SQL> select to_number('01005838','xxxxxxxx') from dual;

TO_NUMBER('01005838','XXXXXXXX')
--------------------------------
16799800

SQL> select dbms_utility.data_block_address_file('16799800') from dual;

DBMS_UTILITY.DATA_BLOCK_ADDRESS_FILE('16799800')
------------------------------------------------
4

SQL> select dbms_utility.data_block_address_block('16799800') from dual;

DBMS_UTILITY.DATA_BLOCK_ADDRESS_BLOCK('16799800')
-------------------------------------------------
22584

--=====================================
從block#:22580的block_row_dump:資訊我們看到了fb(flag byte我猜測的fb的意思)
block_row_dump:
tab 0, row 0, @0x178b
tl: 2061 fb: --H-F--N lb: 0x1 cc: 2
--====================================
block#:22584
block_row_dump:
tab 0, row 0, @0x61
tl: 7967 fb: -----LP- lb: 0x1 cc: 4
col 0: [1952]
fb:The 'fb' value gives us flags about the row. 'H' means that we have the head of the row. 'F' means that we have the first piece of the row. 'L' means we also have the last piece of the row. Since this is the first and last piece of the row, the row is not chained. Since this is also the head of the row, the row has not been migrated
明白了F,F,L的意思,N應該是next的意思,P應該是previous或者是prior的意思
SQL> select file_id,block_id,blocks from dba_extents where owner='TEST' and segm
ent_name='TT';

FILE_ID BLOCK_ID BLOCKS
---------- ---------- ----------
4 22577 8
SQL> alter system dump datafile 4 block min 22577 block max 22584;

系統已更改。

SQL>
--=======================
buffer tsn: 4 rdba: 0x01005834 (4/22580)
scn: 0x0000.0035f371 seq: 0x03 flg: 0x04 tail: 0xf3710603
frmt: 0x02 chkval: 0x2cbc type: 0x06=trans data
Hex dump of block: st=0, typ_found=1
Dump of memory from 0x07C32200 to 0x07C34200
...................
Block header dump: 0x01005834
Object id on Block? Y
seg/obj: 0x34ea csc: 0x00.35f371 itc: 2 flg: E typ: 1 - DATA
brn: 0 bdba: 0x1005831 ver: 0x01 opc: 0
inc: 0 exflg: 0

Itl Xid Uba Flag Lck Scn/Fsc
0x01 0x0007.009.00000113 0x008006c7.004d.0b ---- 1 fsc 0x0000.00000000
0x02 0x0000.000.00000000 0x00000000.0000.00 ---- 0 fsc 0x0000.00000000

data_block_dump,data header at 0x7c32264
===============
tsiz: 0x1f98
hsiz: 0x14
pbl: 0x07c32264
bdba: 0x01005834
76543210
flag=--------
ntab=1
nrow=1
frre=-1
fsbo=0x14
fseo=0x178b
avsp=0x1777
tosp=0x1777
0xe:pti[0] nrow=1 offs=0
0x12:pri[0] offs=0x178b
block_row_dump:
tab 0, row 0, @0x178b
tl: 2061 fb: --H-F--N lb: 0x1 cc: 2
nrid: 0x01005838.0
col 0: [2000]
61 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
......................
buffer tsn: 4 rdba: 0x01005835 (4/22581)
scn: 0x0000.0035f371 seq: 0x02 flg: 0x04 tail: 0xf3710602
frmt: 0x02 chkval: 0x87c1 type: 0x06=trans data
Hex dump of block: st=0, typ_found=1
Dump of memory from 0x07C32200 to 0x07C34200
................
Block header dump: 0x01005835
Object id on Block? Y
seg/obj: 0x34ea csc: 0x00.35f371 itc: 2 flg: E typ: 1 - DATA
brn: 0 bdba: 0x1005831 ver: 0x01 opc: 0
inc: 0 exflg: 0

Itl Xid Uba Flag Lck Scn/Fsc
0x01 0x0000.000.00000000 0x00000000.0000.00 ---- 0 fsc 0x0000.00000000
0x02 0x0000.000.00000000 0x00000000.0000.00 ---- 0 fsc 0x0000.00000000

data_block_dump,data header at 0x7c32264
===============
tsiz: 0x1f98
hsiz: 0xe
pbl: 0x07c32264
bdba: 0x01005835
76543210
flag=--------
ntab=0
nrow=0
frre=-1
fsbo=0xe
fseo=0x1f98
avsp=0x1f8a
tosp=0x1f8a
block_row_dump:
end_of_block_dump
buffer tsn: 4 rdba: 0x01005836 (4/22582)
scn: 0x0000.0035f371 seq: 0x02 flg: 0x04 tail: 0xf3710602
frmt: 0x02 chkval: 0x87c2 type: 0x06=trans data
Hex dump of block: st=0, typ_found=1
Dump of memory from 0x07C32200 to 0x07C34200
.................
Block header dump: 0x01005836
Object id on Block? Y
seg/obj: 0x34ea csc: 0x00.35f371 itc: 2 flg: E typ: 1 - DATA
brn: 0 bdba: 0x1005831 ver: 0x01 opc: 0
inc: 0 exflg: 0

Itl Xid Uba Flag Lck Scn/Fsc
0x01 0x0000.000.00000000 0x00000000.0000.00 ---- 0 fsc 0x0000.00000000
0x02 0x0000.000.00000000 0x00000000.0000.00 ---- 0 fsc 0x0000.00000000

data_block_dump,data header at 0x7c32264
===============
tsiz: 0x1f98
hsiz: 0xe
pbl: 0x07c32264
bdba: 0x01005836
76543210
flag=--------
ntab=0
nrow=0
frre=-1
fsbo=0xe
fseo=0x1f98
avsp=0x1f8a
tosp=0x1f8a
block_row_dump:
end_of_block_dump
buffer tsn: 4 rdba: 0x01005837 (4/22583)
scn: 0x0000.0035f371 seq: 0x02 flg: 0x04 tail: 0xf3710602
frmt: 0x02 chkval: 0x87c3 type: 0x06=trans data
Hex dump of block: st=0, typ_found=1
Dump of memory from 0x07C32200 to 0x07C34200
..................
Block header dump: 0x01005837
Object id on Block? Y
seg/obj: 0x34ea csc: 0x00.35f371 itc: 2 flg: E typ: 1 - DATA
brn: 0 bdba: 0x1005831 ver: 0x01 opc: 0
inc: 0 exflg: 0

Itl Xid Uba Flag Lck Scn/Fsc
0x01 0x0000.000.00000000 0x00000000.0000.00 ---- 0 fsc 0x0000.00000000
0x02 0x0000.000.00000000 0x00000000.0000.00 ---- 0 fsc 0x0000.00000000

data_block_dump,data header at 0x7c32264
===============
tsiz: 0x1f98
hsiz: 0xe
pbl: 0x07c32264
bdba: 0x01005837
76543210
flag=--------
ntab=0
nrow=0
frre=-1
fsbo=0xe
fseo=0x1f98
avsp=0x1f8a
tosp=0x1f8a
block_row_dump:
end_of_block_dump
buffer tsn: 4 rdba: 0x01005838 (4/22584)
scn: 0x0000.0035f371 seq: 0x03 flg: 0x04 tail: 0xf3710603
frmt: 0x02 chkval: 0x2854 type: 0x06=trans data
Hex dump of block: st=0, typ_found=1
Dump of memory from 0x07C32200 to 0x07C34200
.....................
Block header dump: 0x01005838
Object id on Block? Y
seg/obj: 0x34ea csc: 0x00.35f371 itc: 3 flg: E typ: 1 - DATA
brn: 0 bdba: 0x1005831 ver: 0x01 opc: 0
inc: 0 exflg: 0

Itl Xid Uba Flag Lck Scn/Fsc
0x01 0x0007.009.00000113 0x008006c7.004d.0a ---- 1 fsc 0x0000.00000000
0x02 0x0000.000.00000000 0x00000000.0000.00 ---- 0 fsc 0x0000.00000000
0x03 0x0000.000.00000000 0x00000000.0000.00 C--- 0 scn 0x0000.00000000

data_block_dump,data header at 0x7c3227c
===============
tsiz: 0x1f80
hsiz: 0x14
pbl: 0x07c3227c
bdba: 0x01005838
76543210
flag=--------
ntab=1
nrow=1
frre=-1
fsbo=0x14
fseo=0x61
avsp=0x4d
tosp=0x4d
0xe:pti[0] nrow=1 offs=0
0x12:pri[0] offs=0x61
block_row_dump:
tab 0, row 0, @0x61
tl: 7967 fb: -----LP- lb: 0x1 cc: 4
col 0: [1952]
20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/19602/viewspace-1023460/,如需轉載,請註明出處,否則將追究法律責任。

相關文章