Buffer Cache Hit Ratio

1326 ワード

buffer cache全体のhit ratioを計算します.
-- Calculating the Buffer Cache Hit Ratio

SELECT NAME, VALUE
  FROM V$SYSSTAT
WHERE NAME IN ('db block gets from cache', 'consistent gets from cache', 'physical reads cache');

-- Using the values in the output of the query, calculate the hit ratio for the buffer cache with the following formula:
   1 - (('physical reads cache') / ('consistent gets from cache' + 'db block gets from cache'))

各buffer pool(default,keep,recycle)のhit ratioを計算する:
The data in V$SYSSTAT reflects the logical and physical reads for all buffer pools within one set of statistics. To determine the hit ratio for the buffer pools individually, query the V$BUFFER_POOL_STATISTICS view. This view maintains statistics for each pool on the number of logical reads and writes.
-- The buffer pool hit ratio can be determined using the following formula:
   1 - (physical_reads/(db_block_gets + consistent_gets))

-- The ratio can be calculated with the following query:

SELECT NAME, PHYSICAL_READS, DB_BLOCK_GETS, CONSISTENT_GETS,
      1 - (PHYSICAL_READS / (DB_BLOCK_GETS + CONSISTENT_GETS)) "Hit Ratio"
  FROM V$BUFFER_POOL_STATISTICS;