doc

    Name:   hitratio.sql

    Author: Mark Gurry


The following script lists the Instance Hit Ratio, that is, the ratio
of blocks found in the buffer cache as a proprtion of those read from 
disk. The closer to 100% the better.

#

ttitle ' The Hit Ratio      '
select 
sum(decode(name, 'consistent gets',value, 0))  "Consis Gets", 
sum(decode(name, 'db block gets',value, 0))  "DB Blk Gets", 
sum(decode(name, 'physical reads',value, 0))  "Phys Reads",
(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 "Hit Ratio" 
from v$sysstat;
