What is a Buffer hit ? A B
uffer hit count occurs when a database block requested by a client is found already in the database memory pool rather than having to read it from disk.
- The database buffer pool is sized by the -B and -B2 Database Startup parameters:
(4239) Number of Database Buffers (-B)
(17562) Number of Alternate Database Buffers (-B2)
- A database buffer is a temporary storage area in memory used to hold a copy of a database block.
- When the database engine reads a database record, it stores the block read from disk that contains that record in a database buffer.
- When a process needs to read a database record, it requests access to the record.
- The database engine searches the buffer pool for the requested record.
- If the block that holds the record is already stored in a buffer, the engine reads the record from the buffer. This is called a Buffer hit.
- When the database buffer pool is tuned correctly, the engine should achieve a Buffer hit most of the time. The Buffer Hit Ratio is a useful metric for initial Buffer Pool sizing for application requirements.
- If the record is not found in a buffer, the engine must read the database block holding that record from disk into a buffer.
- If an empty buffer is available, the engine reads the block holding that record into that buffer.
- If no empty buffer is available, the engine must replace another buffer to make room for it off the LRU (least recently used) end of the Buffer Pool chain. How does Buffer Flush works?
- If the block that will be evicted has been modified, the engine must write the block to disk to save the changes. This is known as an eviction. While the eviction takes place, the process that requested the record in must wait. For this reason, performance is improved if empty buffers are always available.
The PROMON utility can be used to determine the current buffer hit ratio of the database. For further information refer to Article: