--
-- THIS VIEW ALLOWS YOU TO QUICKLY CALCULATE THE HIT RATIO FRO EACH DIVISION OF THE BUFFER CACHE.
-- THIS INCLUDES THE DEFAULT POOLS (EACH BLOCK SIZE), KEEP, AND RECYCLE.
-- 

CREATE OR REPLACE FORCE VIEW SYSTEM.BUFFER_POOL_HITS
/* ©2004 by Edward Stoever,  */
(NAME, BLOCK_SIZE, HIT_RATIO)
AS 
SELECT NAME, TO_CHAR (block_size / 1024) || 'k' AS "BLOCK_SIZE",
       1 - (physical_reads / (db_block_gets + consistent_gets)) AS "HIT_RATIO"
  FROM v$buffer_pool_statistics
 WHERE db_block_gets + consistent_gets > 0;


CREATE PUBLIC SYNONYM BUFFER_POOL_HITS FOR SYSTEM.BUFFER_POOL_HITS;