You are on page 1of 2

Database Buffer Cache

Biggest Allocation in SGA


Actual data retrieved after Parse execute and fetch is stored in Database Buffer
Cache

It is divided in to:
Compartments called as Buffers. Each compartmenet default size is 8 K. It can be 16
or 32
It depends on parameter DB_BLOCK_SIZE ie defaults to 8kb, can be configured between
2-32 kb.

This database buffer cache has two ends MRU (Most Recently used) and LRU (Least
Recently Used).

Each block has a unique address.


OFBR: OBJECT ID, FILE, BLOCK, ROW

A block is always interested from the MRU end.

Buffer states can be free, clean, pinned, dirty.

Reading operation can be logical or physical.

It scans buffer looking for the requested block. If it is not found in the
database buffer cache then it will perform Physical IO. If the block is found in
database buffer cache then it will be Logical IO.

logical IO happens in memory.

Database buffer cache HIT in case the

Default database buffer cache defined by db_block_size. all blocks (buffer) are of
same size.

database buffer cache have two ends i.e. MRU and LRU end
Data is entered from the MRU end, DML operation. Typically 8k in size. (Insert,
Update, Delete)

Server process reads the block and keep it in a free buffer.


Once the block is read the free buffer status will change to Clean. coz the
content is not modified.
As the data is changed in memory the status of buffer will change to dirty. (dirty
buffers)

dirty because the image on disk is not same as in memory.

If the block is not available in memory, then the server process is instructed to
do a physical I/O. (from Disk) fetch it in the DB buffer cache.
Over the time oracle computes the age of buffer in buffer cache, change in the age
keeps buffer moving from MRU end to LRU end. (Aging Algorithm).
Once the aged buffer reaches the LRU dead end. if the state is clean, the buffer
is discarded. if its dirty, DBWn writes it down to the disk.
Once the data (dirty buffers) is written to disk, the buffer status is changed
back to free.

DB_CACHE_SIZE is the parameter.

size of each buffer is exactly like default blocks i.e. 8K.


DB can hold OLTP, DSS, OLTP+DSS.