--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';
阅读(813) | 评论(0) | 转发(0) |