自9i開始,Oracle引入新的初始化參數(shù)db_cache_size;該參數(shù)定義主Block Size(db_block_size定義的塊大小)的default緩沖池的大小;有朋友在Windows2003上測試得出了不同的結(jié)論:
Db_cache_size最小值為一個(gè)粒度(granule)。
粒度(granule):粒度是連續(xù)虛擬內(nèi)存分配的單位,粒度是9i新引入的參數(shù),其大小取決于SGA_MAX_SIZE參數(shù)所定義的SGA總的大小
當(dāng)SGA<128M時(shí),粒度值為4M;
否則粒度值為16M
粒度大小受內(nèi)部隱含參數(shù)_ksmg_granule_size的控制
SQL> show sga Total System Global Area 319888364 bytes其實(shí)這個(gè)granule_size在不同平臺(tái)、不同版本中,Oracle的設(shè)置的缺省值都可能不同,書中提到的是一種通常設(shè)置,具體的我們知道了Oracle的內(nèi)存治理方式就好。Oracle9i的官方文檔如下描述:
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 bytesSQL> 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
數(shù)據(jù)庫裝載完畢。
數(shù)據(jù)庫已經(jīng)打開。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 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.
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列舉如上,供參考。-The End-原文地址:http://www.eygle.com/archives/2007/01/oracle_granule_size.Html
SGAs. Some platform dependencies arise. For example, on 32-bit Windows, the
granule size is 8 M for SGAs larger than 1 GB.
新聞熱點(diǎn)
疑難解答
圖片精選