很奇怪,今天查询db_cache_size的时候发现value为0,后来查了下一些共享区,居然也是0。
SQL> show parameter db_cache_size
NAME TYPE VALUE
------------------------------------ --------------------------------- ------------------------------
db_cache_size big integer 0
SQL> show parameter shared_pool_size
NAME TYPE VALUE
------------------------------------ --------------------------------- ------------------------------
shared_pool_size big integer 0
SQL> show parameter pool
NAME TYPE VALUE
------------------------------------ --------------------------------- ------------------------------
buffer_pool_keep string
buffer_pool_recycle string
global_context_pool_size string
java_pool_size big integer 0
large_pool_size big integer 0
olap_page_pool_size big integer 0
shared_pool_reserved_size big integer 22649241
shared_pool_size big integer 0
streams_pool_size big integer 0
后来通过wh62592855的博客http://blog.csdn.net/wh62592855/article/details/4873859了解到是因为设置了sga_target的缘故。
REFERENCES上说明的db_cache_size这个参数,其中有一句话如下:
Default value | If SGA_TARGET is set: If the parameter is not specified, then the default is0 (internally determined by the Oracle Database). If the parameter is specified, then the user-specified value indicates a minimum value for the memory pool. If |
因为使用了10G的ASSM自动共享内存管理,所以oracle会自动分配给各池空间,因此其值为0。
查看系统在某个时刻这些参数到底被自动地调整到了什么值
select x.ksppinm name,y.ksppstvl value,x.ksppdesc describ
from sys.x$ksppi x,sys.x$ksppcv y
where x.inst_id=userenv('Instance') and y.inst_id=userenv('Instance') and x.indx=y.indx and x.ksppinm like '%pool_size%';
NAME VALUE DESCRIB
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
_NUMA_pool_size Not specified aggregate size in bytes of NUMA pool
__shared_pool_size 452984832 Actual size in bytes of shared pool
shared_pool_size 0 size in bytes of shared pool
__large_pool_size 16777216 Actual size in bytes of large pool
large_pool_size 0size in bytes of large pool
__java_pool_size 16777216 Actual size in bytes of java pool
java_pool_size 0 size in bytes of java pool
__streams_pool_size 0 Actual size in bytes of streams pool
streams_pool_size 0 size in bytes of the streams pool
_io_shared_pool_size 4194304 Size of I/O buffer pool from SGA
_backup_io_pool_size 1048576memory to reserve from the large pool
global_context_pool_size Global Application Context Pool Size in Bytes
olap_page_pool_size 0 size of the olap page pool in bytes
select x.ksppinm name,y.ksppstvl value,x.ksppdesc describ
from sys.x$ksppi x,sys.x$ksppcv y
where x.inst_id=userenv('Instance') and y.inst_id=userenv('Instance') and x.indx=y.indx and x.ksppinm like '%db_cache_size%';
NAME VALUEDESCRIB
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
__db_cache_size 1644167168 Actual size of DEFAULT buffer pool for standard block size buffers
db_cache_size 0Size of DEFAULT buffer pool for standard block size buffers
*由两个下划线开头的参数决定了当前SGA的分配,也是动态内存管理调整的参数。这些参数的更改会被记录到SPFILE文件中,在下一次数据库启动时仍然有效。
通过ORACLE 10G新增加的动态视图v$sga_dynamic_components,可以看各个动态组件调整的时间和调整类型等信息。
COMPONENT
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
CURRENT_SIZE MIN_SIZE LAST_OPER_TYPE LAST_OPER_MODE LOT
------------ ---------- --------------------------------------- --------------------------- ---------------------------------------------------------
shared pool
452984832 452984832 STATIC
large pool
16777216 16777216 STATIC
java pool
16777216 16777216 STATIC
streams pool
0 0 STATIC
DEFAULT buffer cache
1644167168 1644167168 INITIALIZING
KEEP buffer cache
0 0 STATIC
RECYCLE buffer cache
0 0 STATIC
DEFAULT 2K buffer cache
0 0 STATIC
DEFAULT 4K buffer cache
0 0 STATIC
DEFAULT 8K buffer cache
0 0 STATIC
DEFAULT 16K buffer cache
0 0 STATIC
DEFAULT 32K buffer cache
0 0 STATIC
ASM Buffer Cache
0 0 STATIC