Dear All:
大家虎年快乐!最近遇到一个问题,SQL> alter system set db_cache_size = 4m ;System alteredSQL> show parameter db_cache_size;NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
db_cache_size big integer 8M
SQL> select * from V$SGAINFO where name like '%Granule%'; NAME BYTES RESIZEABLE
-------------------------------- ---------- ----------
Granule Size 4194304 No查看当前实例的粒度Granule size 为4M,在查看文档时,觉得db_cache_size可以设置为粒度的最小值。
那么db_cache_size为什么不能设置成4M呢?
大家虎年快乐!最近遇到一个问题,SQL> alter system set db_cache_size = 4m ;System alteredSQL> show parameter db_cache_size;NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
db_cache_size big integer 8M
SQL> select * from V$SGAINFO where name like '%Granule%'; NAME BYTES RESIZEABLE
-------------------------------- ---------- ----------
Granule Size 4194304 No查看当前实例的粒度Granule size 为4M,在查看文档时,觉得db_cache_size可以设置为粒度的最小值。
那么db_cache_size为什么不能设置成4M呢?
补充一下: 机器的环境为xp ,oracle10g.当前的sga_max_size为164M.SQL> show parameter sga_max_size;NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
sga_max_size big integer 164M
问题就在这了,我已经通过v$sgainfo 查看到当前的granule为4M。
那么在确定granule size为4M时,最小的db_cache_size又是如何决定的呢?
SQL> select * from V$SGAINFO where name like '%Granule%';NAME BYTES RESIZE
------------- ---------- ----
Granule Size 4194304 NoSQL> alter system set db_cache_size = 4m scope=memory;系统已更改。SQL> show parameter db_cache_sizeNAME TYPE VALUE
-------------- ------------- -------
db_cache_size big integer 4M
SQL>select x.ksppinm name,y.ksppstvl value,x.ksppdesc descbtion
from x$ksppi x,x$ksppcv y
where x.inst_id=userenv('Instance')
and y.inst_id=userenv('Instance')
and x.indx=y.indx
and x.ksppinm like '%_ksmg_granule%'
你执行上面的语句多少呢?
oracle什么版本?
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.
可ORACLE只是会把这个4M作为db_cache_size的最小值来处理 实际运行中会根据系统的不同情况进行自动的调整的
1、当前版本为:10.1.0.2.02、运行sql查询结果如下:
_ksmg_granule_size 4194304 granule size in bytes
_ksmg_granule_locking_status 1 granule locking status3、当前未设置SGA_TARGET参数
SQL> show parameter SGA_TARGET;NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
sga_target big integer 0