set echo off
set verify off
column bhr format 999
column mydate heading 'YYYY-MM-DD HH24'
set pages 10000

select 
   to_char(snap_time,'yyyy-mm-dd HH24') mydate,
   new.name buffer_pool_name,
  (((new.consistent_gets-old.consistent_gets)+(new.db_block_gets-old.db_block_gets))-(new.physical_reads-old.physical_reads)) 
  /((new.consistent_gets-old.consistent_gets)+(new.db_block_gets-old.db_block_gets))*100 bhr
from perfstat.stats$buffer_pool_statistics old,
     perfstat.stats$buffer_pool_statistics new,
     perfstat.stats$snapshot sn
where snap_time > sysdate - &&1
      and new.name=old.name
      and new.snap_id=sn.snap_id
      and old.snap_id=sn.snap_id-1
order by 1 asc
/
