1. Why to use buffer cache???
Buffer cache is an area of memory that contains a lot of data blocks, which are mainly copies of the contents of chunks in the data file.
Reading a block of data from buffer cache generally takes about 100ns, and it takes 10ms to read a block of data from a general storage hard disk, so it's probably calculated that reading blocks from memory is nearly 100,000 times times faster than the hard drive.
Therefore, Oracle read the data block, first in the buffer cache to find, if there is, read-logic read; If the data block does not exist, then a physical read occurs, and the data is read into the buffer cache from the physical file (regardless of the direct read).
In the initialization parameter, the parameter that sets the buffer cache size is Db_cache_size
This parameter supports dynamic modification in 11.2.0.4.0:
bys@ bys3>show parameter Db_cache_size
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
Db_cache_size Big Integer 48M
bys@ bys3>alter system set db_cache_size=40m;
System altered.
bys@ bys3>show parameter Db_cache_size
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
Db_cache_size Big Integer 40M
The features provided by buffer cache include:
1 reduce I/O by caching blocks of data.
2 The function of reading consistency is provided by constructing CR blocks.
3 provides a variety of lock, latch mechanisms to provide multiple processes concurrent access to the same data block functions.
Memory structure diagram of 2.buffer cache
Say great God all use Word drawing, in order to imitate the great God, I also use Word to draw a long time original:
From this buffer cache memory structure diagram, with a word to illustrate
Buffer cache structure is roughly: Buffer pool--->working set--->CBC latch--->hash bucket--->hash chain--->buffer Header--->buffer dba
The following is a general description of the concept of these constructs:--more detailed after