看了盖老师的深入浅出DBA后,做的笔记。伴随db_cache_size的增大,估计的物理读(estd_physical_reads)在逐步减少,我们的选择就于在db_cache_size的设置和physical_reads之间寻找一个边际效率最高点,使用可以接受的内存设置,获得尽量低的物理读。---摘抄自盖老师的大作。
--查看各组件的大小
select x.ksppinm name, y.ksppstvl value, x.ksppdesc describ
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'%pool_size%';
--按照建议调整db_cache大小,size_fator=1的为最合适的
select d.id,
d.NAME,
d.BLOCK_SIZE,
d.SIZE_FOR_ESTIMATE,
d.SIZE_FACTOR,
d.ESTD_PHYSICAL_READ_FACTOR,
d.ESTD_PHYSICAL_READS
from v$db_cache_advice d;
--按照建议调整shared_pool大小,size_fator=1的为最合适的
select shared_pool_size_for_estimate spsfe,shared_pool_size_factor spsf,
estd_lc_size,estd_lc_memory_objects elmo,estd_lc_time_saved elts,
estd_lc_time_saved_factor eltsf,estd_lc_memory_object_hits elmoh
from v$shared_pool_advice;
--按照建议调整PGA大小
select t.PGA_TARGET_FOR_ESTIMATE/1024/1024 pgaMB,
t.PGA_TARGET_FACTOR,t.ESTD_PGA_CACHE_HIT_PERCENTAGE,
t.ESTD_OVERALLOC_COUNT
from v$pga_target_advice t;
--调整PGA大小到合适
ALTERSYSTEMSET pga_aggregate_target = 1018167296SCOPE=BOTH