eygle.com   eygle.com
eygle.com  
 

« ITPUB年会印象-相会朋友们 | Blog首页 | Oracle11g数据库的认证体系结构 »

关于《深入浅出Oracle》中granule的补充

作者:eygle |【转载时请务必以超链接形式标明文章和作者信息及本声明
链接:

在《深入浅出Oracle》一书的P110页,关于Oracle的Granule我有这样一段描述:

自9i开始,Oracle引入新的初始化参数db_cache_size;该参数定义主Block Size(db_block_size定义的块大小)的default缓冲池的大小;
Db_cache_size最小值为一个粒度(granule)。
粒度(granule):粒度是连续虚拟内存分配的单位,粒度是9i新引入的参数,其大小取决于SGA_MAX_SIZE参数所定义的SGA总的大小
当SGA<128M时,粒度值为4M;
否则粒度值为16M
粒度大小受内部隐含参数_ksmg_granule_size的控制

有朋友在Windows2003上测试得出了不同的结论:

SQL> show sga

Total System Global Area 319888364 bytes
Fixed Size 453612 bytes
Variable Size 310378496 bytes
Database Buffers 8388608 bytes
Redo Buffers 667648 bytes
SQL> set linesize 120
SQL> col name for a30
SQL> col value for a20
SQL> col describ for a60
SQL> SELECT x.ksppinm NAME, y.ksppstvl VALUE, x.ksppdesc describ
2 FROM SYS.x$ksppi x, SYS.x$ksppcv y
3 WHERE x.inst_id = USERENV ('Instance')
4 AND y.inst_id = USERENV ('Instance')
5 AND x.indx = y.indx
6 AND x.ksppinm LIKE '%&par%'
7 /
Enter value for par: _ksmg_granule_size
old 6: AND x.ksppinm LIKE '%&par%'
new 6: AND x.ksppinm LIKE '%_ksmg_granule_size%'

NAME VALUE DESCRIB
------------------------------ -------------------- ---------------------------
_ksmg_granule_size 8388608 granule size in bytes

SQL> alter system set sga_max_size=100M scope=spfile;

System altered.

SQL> startup force
ORACLE instance started.

Total System Global Area 114367248 bytes
Fixed Size 453392 bytes
Variable Size 109051904 bytes
Database Buffers 4194304 bytes
Redo Buffers 667648 bytes
数据库装载完毕。
数据库已经打开。

SQL> SELECT x.ksppinm NAME, y.ksppstvl VALUE, x.ksppdesc describ
2 FROM SYS.x$ksppi x, SYS.x$ksppcv y
3 WHERE x.inst_id = USERENV ('Instance')
4 AND y.inst_id = USERENV ('Instance')
5 AND x.indx = y.indx
6 AND x.ksppinm LIKE '%&par%'
7 /
输入 par 的值: _ksmg_granule_size
原值 6: AND x.ksppinm LIKE '%&par%'
新值 6: AND x.ksppinm LIKE '%_ksmg_granule_size%'

NAME VALUE DESCRIB
------------------------------ -------------------- ----------------------------
_ksmg_granule_size 4194304 granule size in bytes

其实这个granule_size在不同平台、不同版本中,Oracle的设置的缺省值都可能不同,书中提到的是一种通常设置,具体的我们知道了Oracle的内存管理方式就好。

Oracle9i的官方文档如下描述:

Granule size is determined by total SGA size. On most platforms, the size of a granule is 4 MB if the total SGA size is less than 128 MB, and it is 16 MB for larger SGAs. There may be some platform dependency, for example, on 32-bit Windows NT, the granule size is 8 MB for SGAs larger than 128 MB.

Oracle10gR2文档如下描述:

Granule size is determined by total SGA size. On most platforms, the size of a granule is 4 MB if the total SGA size is less than 1 GB, and granule size is 16MB for larger
SGAs. Some platform dependencies arise. For example, on 32-bit Windows, the
granule size is 8 M for SGAs larger than 1 GB.

列举如上,供参考。

-The End-

By eygle on 2007-01-22 11:17 | Comments (2) | Posted to Books | FAQ | Edit |Pageviews:

相关文章 随机文章
  • 《深度解析Oracle》之《循序渐进Oracle》
  • 年会纪事之三:Piner的新书出版
  • China-Pub的年度技术图书评选活动
  • 《循序渐进Oracle》之后写什么?
  • 经典图书推荐系列-之六
  • Statspack之十三-Enqueue
    超级女声6进5,我的预测
    Oracle数据库以44.4%再占市场首位
    高级复制的整体规划也很重要
    Oracle10gR2 ASM 值得信赖么?
    网上相关主题:
    Google

    留言 (2)

    eygle,真的佩服
    我上周自己看书发现的问题,今天只是记录一下,怕自己忘了
    这么快都被你发现了
    多谢!

    Posted by: oracle114 at January 22, 2007 12:21 PM

    有疑问的地方,俺有责任澄清一下的。

    谢谢你读书这么认真:)

    Posted by: eygle at January 22, 2007 2:33 PM

    发表留言:



    Remember Me?
    (输入验证码后方可评论,谢谢支持)



    CopyRight © 2004 eygle.com, All rights reserved.