Database Buffer Cache

The database buffer cache, or simply the buffer cache, is a critical memory area that stores copies of data blocks read from data files. It allows all users connected to a database instance to share access to these cached data blocks.

Buffer States

The database use internal algorithms to manage buffers, which can be in one of three states:

  • Unused: The buffer is available because it has never been used. It’s the easiest for the database to utilize.
  • Clean: This buffer contains a read-consistent version of a data block. It doesn’t require checkpointing and can be reused by the database.
  • Dirty: This buffer holds modified data that hasn’t yet been written to disk. The database must checkpoint this block before it can be reused.

Buffers can be either “pinned” (protected from being removed while in use) or “free” (available for reuse). Multiple sessions cannot modify a pinned buffer simultaneously

Buffer I/O

Logical I/O refers to the reading and writing of buffers in the cache. If a requested buffer isn’t found in memory, the database performs a physical I/O to retrieve it from disk or flash cache, followed by a logical I/O to read the cached buffer.

Buffer Pools

A buffer pool is a collection of buffers, and the database buffer cache can be divided into multiple pools, each managing blocks similarly. Here are the main types:

  • Default Pool: This pool is the location where blocks are normally cached. Unless you manually configure separate pools, the default pool is the only buffer pool. The optional configuration of the other pools has no effect on the default pool.
  • Keep Pool: Designed for frequently accessed blocks that have aged out of the default pool. This pool helps retain objects in memory, minimizing I/O operations.
  • Recycle Pool: Intended for infrequently used blocks, this pool prevents objects from taking up unnecessary space in the cache.

admin

Welcome to the DBA Discovery Hub! As an OCP, I’m here to share articles, tutorials, and tips on Oracle Database Administration. Let’s connect and explore together! Start exploring!

View All Post

One thought on “Database Buffer Cache

Leave a Reply

Your email address will not be published. Required fields are marked *