why Buffer Cache Hit Ratio < 0

zhanglei_itput發表於2009-06-12

  最近一直再研究Buffer Cache Hit Ratio 。有個問題到現在都沒有搞清楚,why Buffer Cache Hit Ratio < 0。

    相關解釋:
    It is possible for both the 'buffer hit ratio' to be negative.  In the case of the buffer hit ration, the buffer cache is too small and the data in is being aged out before it can be used so it must be retrieved again.  This is a form. of thrashing which degrades performance immensely.

Performance Tuning Guide 10g Release 2 (10.2)
B14211-03

Calculating the Buffer Cache Hit Ratio
The buffer cache hit ratio calculates how often a requested block has been found in the buffer cache without requiring disk access. This ratio is computed using data selected from the dynamic performance view V$SYSSTAT.

consistent gets from cache: Number of times a consistent read was requested for a block from the buffer cache.
db block gets from cache: Number of times a CURRENT block was requested from the buffer cache.
physical reads cache: Total number of data blocks read from disk into buffer cache.

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 Hit Ratios
The data in V$SYSSTAT reflects the logical and physical reads for all buffer pools (by setting
  the BUFFER_POOL_KEEP or BUFFER_POOL_RECYCLE init.ora parameters)
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;

在什麼情況下用V$SYSSTAT?什麼情況下用V$BUFFER_POOL_STATISTICS?為什麼Buffer Pool Hit Ratios<0?

參考文獻:
  Subject:  STATISTIC "cache hit ratio" - Reference Note
  Doc ID:  33883.1 Type:  REFERENCE
  Modified Date :  12-FEB-2004 Status:  PUBLISHED

  三思筆記
  http://junsansi.itpub.net/post/29894/291051


 

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/9252210/viewspace-606087/,如需轉載,請註明出處,否則將追究法律責任。

相關文章