RelationalDBDesign RelationalDBDesign 


Data Blocks  «Prev 

Oracle Block buffers

Database Buffer Cache

The database buffer cache holds copies of the data blocks read from the data files. The term data block is used to describe a block containing table data, index data, clustered data. Basically it is a block that contains data. All user processes concurrently connected to the instance share access to the database buffer cache. The database buffer cache is logically segmented into multiple sets which reduces contention on multiprocessor systems.
This area of the SGA contains only the buffers themselves and not their control structures. For each buffer there is a corresponding buffer header in the variable area of the SGA. From Oracle8 release onwards the buffer cache contains three buffer pools for different type of data usage. They are
  1. DEFAULT,
  2. KEEP, and
  3. RECYCLE.

These three buffer pools have separate allocations of buffers and LRU lists that manage buffers.
  1. The RECYCLE buffer pool is used to store blocks that are virtually never used after the initial read. This pool eliminates the data blocks from the memory when they are no longer needed. This is more like a work area for the blocks.
  2. The KEEP pool is for the allocation of buffers for
    1. objects that are accessed with medium frequency or
    2. for those which a consistent response time is desirable.
    This buffer pool retains the schema objects data block in memory.
  3. The DEFAULT buffer pool contains data blocks from schema objects that are not assigned to any buffer pool as well as for the schema objects that are explicitly assigned to the DEFAULT pool.

The database block buffers act as the holding area for data used by the user and DBWR processes. Any data that gets to the user from the database files, or data that goes into the database files from the user or other processes, passes through the database block buffers unless direct insert or direct read is used for data loading, sorting, or hashing operations.
The database block buffers in releases prior to Oracle9i had to be of uniform size, 2, 4, 8, 16, or for 64 bit OS, the 32 kilobytes in size.
From Oracle9i onwards, the database has a default database cache block size, but other sizes (2K, 4K, 8K, 16K, or 32K) can also be specified.
Based on the tablespace size, appropriate Cache is employed to retrieve and manage the buffers in the SGA.
In the RAC database system, the database block buffers from each of the participating instance, through the process of cache fusion, are merged to form a logical database block buffer area that becomes many times larger than could be supported in a single instance.

We set our db_block_size to 64K and populate our database with rows. Our average row length is 80 bytes.

We request a row, causing Oracle to read a 64K block into the data buffer.

For this buffer, we read our 80 byte row.

[1] Cache Fusion and Inter-Instance database buffer transfers are fully covered in a later module, Cache Fusion and Inter-Instance Coordination.