Buffer Cache Experiment 1: Diagram of memory structure

Source: Internet
Author: User
Tags hash integer

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.