Buffer Hit Ratio % -- Whats the right query ?
Whats the right query to track Buffer Hit % ;
Using this :
prompt BUFFER HIT RATIO %
prompt ===============
select 100 * ((a.value+b.value)-c.value) / (a.value+b.value) "Buffer Hit Ratio"
from v$sysstat a, v$sysstat b, v$sysstat c
where
a.statistic# = 38
and
b.statistic# = 39
and
c.statistic# = 40;
Buffer Hit Ratio
----------------
99.9678438
However, using this :
Select
Round((Sum(Decode(name, 'consistent gets',value,0)) +
Sum(Decode(name, 'db block gets',value,0)) -
Sum(Decode(name, 'physical reads',value,0))) /
(Sum(Decode(name, 'consistent gets',value,0)) +
Sum(Decode(name, 'db block gets',value,0)) ) * 100, 4)
from V$sysstat;
Comes up as : 67.7069 %
So which is the right one ?
Thanks.