ITPub博客

首页 > 应用开发 > IT综合 > delay block cleanout临界值测试!

delay block cleanout临界值测试!

原创 IT综合 作者:warehouse 时间:2009-04-04 23:44:10 0 删除 编辑
貌似测的还不够精准,同时没有找到具体介绍10%的相应doc,暂时记录一下。[@more@]

SQL> alter system set sga_target=0;

系统已更改。
SQL> show parameter db_cache

NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
db_cache_advice string ON
db_cache_size big integer 88M
SQL> alter system set db_cache_size=80m;

系统已更改。
SQL> create table tt tablespace users as select * from dba_objects;

表已创建。

SQL> insert into tt select *from tt;

已创建11389行。

SQL> insert into tt select *from tt;

已创建22778行。

SQL> insert into tt select *from tt;

已创建45556行。

SQL> col segment_name format a10
SQL> select segment_name,bytes/1024/1024 m from dba_segments where owner='SYS' a
nd segment_name='TT';

SEGMENT_NA M
---------- ----------
TT 10

SQL> insert into tt select *from tt;

已创建91112行。
SQL> select segment_name,bytes/1024/1024 m from dba_segments where owner='SYS' a
nd segment_name='TT';

SEGMENT_NA M
---------- ----------
TT 19
SQL> create table tt1 tablespace users as select * from tt where 1=2;

表已创建。

SQL> insert into tt1 select * from tt;

已创建182224行。

SQL> select segment_name,bytes/1024/1024 m from dba_segments where owner='SYS' a
nd segment_name='TT1';

SEGMENT_NA M
---------- ----------
TT1 19

SQL> select file_id,extent_id,block_id,blocks from dba_extents where segment_nam
e='TT1' AND owner='SYS';

FILE_ID EXTENT_ID BLOCK_ID BLOCKS
---------- ---------- ---------- ----------
4 0 89 8
4 1 97 8
4 2 105 8
4 3 113 8
4 4 121 8
4 5 129 8
4 6 2361 8
4 7 2385 8
4 8 2393 8
4 9 2401 8
4 10 2409 8

FILE_ID EXTENT_ID BLOCK_ID BLOCKS
---------- ---------- ---------- ----------
4 11 2417 8
4 12 2425 8
4 13 2433 8
4 14 2441 8
4 15 2449 8
4 16 2569 128
4 17 2697 128
4 18 2953 128
4 19 3081 128
4 20 3209 128
4 21 3337 128

FILE_ID EXTENT_ID BLOCK_ID BLOCKS
---------- ---------- ---------- ----------
4 22 3465 128
4 23 3593 128
4 24 3721 128
4 25 3849 128
4 26 3977 128
4 27 4105 128
4 28 4233 128
4 29 4361 128
4 30 4489 128
4 31 4617 128
4 32 4745 128

FILE_ID EXTENT_ID BLOCK_ID BLOCKS
---------- ---------- ---------- ----------
4 33 4873 128

已选择34行。

SQL> analyze table tt1 compute statistics;

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

BLOCKS EMPTY_BLOCKS
---------- ------------
2322 110

SQL> select count(*) from v$transaction;

COUNT(*)
----------
1

SQL> commit;

提交完成。
SQL> alter system dump datafile 4 block min 3720 block max 3724;

系统已更改。
--=================================
Start dump data blocks tsn: 4 file#: 4 minblk 3720 maxblk 3724
buffer tsn: 4 rdba: 0x01000e88 (4/3720)
scn: 0x0000.019cbc07 seq: 0x01 flg: 0x02 tail: 0xbc070601
frmt: 0x02 chkval: 0x0000 type: 0x06=trans data
Hex dump of block: st=0, typ_found=1
................
Block header dump: 0x01000e88
Object id on Block? Y
seg/obj: 0x3032 csc: 0x00.19cb57c itc: 2 flg: E typ: 1 - DATA
brn: 0 bdba: 0x1000e0a ver: 0x01 opc: 0
inc: 0 exflg: 0

Itl Xid Uba Flag Lck Scn/Fsc
0x01 0x000c.021.00000a32 0x01c00121.1a2b.09 --U- 77 fsc 0x0000.019cbc07
0x02 0x0000.000.00000000 0x00000000.0000.00 ---- 0 fsc 0x0000.00000000
................
buffer tsn: 4 rdba: 0x01000e89 (4/3721)
scn: 0x0000.019ca7a5 seq: 0x68 flg: 0x04 tail: 0xa7a52068
frmt: 0x02 chkval: 0xb68a type: 0x20=FIRST LEVEL BITMAP BLOCK
Hex dump of block: st=0, typ_found=1
............
Object id on Block? Y
seg/obj: 0x3032 csc: 0x00.19cb57d itc: 2 flg: E typ: 1 - DATA
brn: 0 bdba: 0x1000e89 ver: 0x01 opc: 0
inc: 0 exflg: 0

Itl Xid Uba Flag Lck Scn/Fsc
0x01 0x000c.021.00000a32 0x01c00133.1a2d.03 ---- 77 fsc 0x0000.00000000
0x02 0x0000.000.00000000 0x00000000.0000.00 ---- 0 fsc 0x0000.00000000
...........
Block header dump: 0x01000e8c
Object id on Block? Y
seg/obj: 0x3032 csc: 0x00.19cb57e itc: 2 flg: E typ: 1 - DATA
brn: 0 bdba: 0x1000e89 ver: 0x01 opc: 0
inc: 0 exflg: 0

Itl Xid Uba Flag Lck Scn/Fsc
0x01 0x000c.021.00000a32 0x01c00133.1a2d.21 ---- 77 fsc 0x0000.00000000
0x02 0x0000.000.00000000 0x00000000.0000.00 ---- 0 fsc 0x0000.00000000

data_block_dump,data header at 0x9bb2264
--=================================
--上面我找到了delay block cleanout的临界值,很多资料
都提到事务使用buffer的10%可以进行fast commit,超过10%进行
delay block cleanout,通过我构造的例子看出:
1、db_cache_size=80m
2、tt1插入数据是19m,当然后面有empty block,这些空块不用去管它,
按照10%来计算的话,从block 3849应该开始delay block cleanout,可通过
dump的结果来看从3721开始就进行了delay block cleanout了,整整差了128个block,
不知道什么原因?莫非还和extent有关?正好相差了一个extent,10%到底被包括在那头?

貌似测的还不够精准。

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/19602/viewspace-1020010/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2007-12-07

  • 博文量
    717
  • 访问量
    5366349