最新日志
- Oracle AWR速查(转)
- oracle数据文件大小限制
- How to use full bandwidth
- Linux /dev/shm tmfs
- Linux cp +nohup
- dbms_stats收集统计信息manu
该作者的其他文章
博主推荐
相关日志
随机阅读
首页推荐
对“推广广告”提建议
内存优化(各子内存块命中率计算)
2009-11-15 19:39:24| 分类: OraDailySql | 标签:内存命中率 |字号大中小 订阅
instance= memory + background process
memory= sga +pga
sga=shared_pool + db_buffer_cache+log_buffer
shared_pool=libary_cache+dictionary_cache
---A 数据缓冲区的命中率--- should be more than 90%
select 1 -
sum(case when name like '%physical reads%' then value else 0 end) /
(sum(case when name like '%db block gets%' then value else 0 end ) +
sum(case when name like '%consistent gets%' then value else 0 end))
as hit_ratio
from v$sysstat;
---B 共享池命中率---should be more than 60%
select s.used,p.VALUE sharedpool_usage_ratio from (select sum(bytes) used from v$sgastat where pool ='shared pool' and name <>'free memory') s,v$parameter p where p.NAME='shared_pool_size';
-----------------1、共享池命中率(sql,pl/sql内存命中率,库缓存命中率)
select ((sum(pinhits)/sum(pins))) pinhitratio,sum(reloads) misses ,((sum(pins)/(sum(pins)+sum(reloads)))) relhitratio from v$librarycache
-----------------2、数据字典命中率
select 1- sum(getmisses)/(sum(gets)+sum(getmisses)) hitratio from v$rowcache;
---C pga命中率
-----------------1、workarea_size_policy=auto
select * from v$pgastat where name like 'cache hit percentage';
-----------------2、workarea_size_policy=manul
select name,value from V$sysstat where name like '%sort%';
select * From v$sga;
select * from v$sgainfo;
select * from v$sga_dynamic_components;