set linesize 80;
set pagesize 100;

spool cache_03.rslt;

/* ************************************************ */
/*                                                  */
/* format the report:                               */
/*        Buffer cache Hit Ratio                    */
/*                                                  */
/* name:    @/home/oracons/sql/cache_03.sql         */
/* date:    12-MAY-95                               */
/* creator: Rick Kupcunas (Oracle)                  */
/*                                                  */
/* ************************************************ */

/* ******************* */
/* Show Cache Hitratio */
/* ******************* */

set echo off;

select  'Cache hitratio:'				" ",
         to_char(a.value + b.value, '999,999,999,999')        "LOG READS", 
         to_char(c.value, '999,999,999,999')                  "PHY READS",
         to_char(d.value, '999,999,999,999')                  "PHY WRITES",
         to_char((100 * 
           (a.value + b.value - c.value) / (a.value + b.value)), '99.99')||'%' 
                                  "RATIO"
from sys.v_$sysstat a,
     sys.v_$sysstat b,
     sys.v_$sysstat c,
     sys.v_$sysstat d
where a.statistic# = 37 and
      b.statistic# = 38 and
      c.statistic# = 39 and
      d.statistic# = 40;

set echo on;

/* ******************* */
/* Show DB STatistics  */
/* ******************* */

set echo off;

select STATISTIC#,
       substr(NAME, 1, 30),
       to_char(CLASS, '9,999')		  "CLASS",           
       to_char(value, '999,999,999,999')  "VALUE"
   from sys.v_$sysstat
   order by 1 asc;

spool off;

commit;
