最新日誌
- 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;