Library、Latch、Buffer三大关键指标的命中率

902阅读 0评论2009-03-09 lukeunique
分类:Oracle

--oracle数据库系统中Library、Latch、Buffer三大关键指标的命中率统计sql,目标值是100%:
--Library Hit
select round(sum(pinhits)/sum(pins)*100,2) "Library Hit(%)"
from v$librarycache;
--Latch Hit
select round((1-sum(misses)/sum(gets))*100,2) "Latch Hit(%)"
from v$latch;
--Buffer Hit
select round(100*(1-(a.value-b.value-nvl(c.value,0))/d.value),2) "Buffer Hit(%)"
from v$sysstat a,v$sysstat b,v$sysstat c,v$sysstat d
where a.name='physical reads'
and b.name='physical reads direct'
and c.name='physical reads direct (lob)'
and d.name='session logical reads';
上一篇:修改数据库的启动参数,内存设置
下一篇:dbms_stats.gather_table_stats和analyze table的一点细小差别