First page Back Continue Last page Graphics
Buffer Cache
Staging area for database operations
User process reads data from disk
Updated (dirty) blocks written by DBWR
- During checkpoint or when cache constrained
LRU algorithm used to age out old blocks
Notes:
The buffer cache is a staging area for most database operations. For example, when a session is created, a user's server process may process the SQL statement:
SELECT * FROM CUSTOMER WHERE CUST_NO = 1
If the required blocks are not already in the buffer cache, the server process (dedicated or shared) will read the block(s) from disk and store them in the buffer cache (from here the server process can return the correct row(s) to the requestor). This process is called a physical I/O and is sometimes the largest bottleneck in the database because of the delay waiting for physical movement of a disk drive. Note that if the block was already in the cache, a logical I/O is performed. A logical I/O requires that a “latch” (lock on a memory area) be taken. While a logical I/O is faster than a physical I/O (and thus the justification for the buffer cache), too many logical I/O’s will also hurt scalability and performance. When you move past the basic of Oracle administration and into tuning, this is one of the issues you’ll tackle.
Blocks that have been updated are eventually written back to disk. This is the job of the database writer background process (DBWR). DBWR will write the blocks to the datafile when a checkpoint occurs, when the buffer cache becomes constrained for available blocks, or when the database is shutdown.