Doc

    Name:    hitrate.sql

    Author:  Mark Gurry

    This script shows the system wide hit ratio. The higher
    the hit ratio, the better use you are making of your buffer
    cache.

#

ttitle 'System Wide 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;