您的位置:首页 > 数据库 > Oracle

In-depth analysis of Oracle memory

2014-08-28 13:52 501 查看

1. The structure of Oracle memory

.


PGA (Process Global Area)

SGA (System Global Area)

2. Database buffer cache

Organization of the Database Buffer Cache

The write list : holds dirty buffers, which contain data that has been modified but has not yet been written to disk

The least recently used(LRU) list : holds free buffers, pinned buffers, and dirty buffers that have not yet been moved to the write list.

When an Oracle Database process accesses a buffer, the process moves the buffer to the most recently used (MRU) end of the LRU list.

MRU end ---> LRU list <--- LUR end

The first time an Oracle Database user process requires a particular piece of data, it searches for the data in the database buffer cache.

---- If the process finds the data already in the cache (a cache hit), it can read the data directly from memory.

---- If the process cannot find the data in the cache (a cache miss), it must copy the data block from a datafile on disk into a buffer in the cache.

Before reading a data block into the cache, the process searched the LRU list, starting at the LRU end of the list. The process searches either until it finds a free buffer or until it has searched the threshold limit of buffers.

---- If the user process finds a dirty buffer, it moves the buffer to the write list and continues to search. When the process finds a free buffer, it reads the data block from disk into the buffer and moves the buffer to the MRU end.

---- If the user process searches the threshold limit, the process stops searching the LRU list and signals DBW process to write some of the dirty buffers to disk.

Touch Count

Each buffer has an associated touch count, which might be increased if a buffer is accessed.

Buffers with a high touch count should stay in the buffer cache, while buffers with a low touch count should age out in order to make room for other buffers.

The LRU Algorithm and Full Table Scans

When the user process is performing a full table scan, it reads the blocks of the table into buffers and puts them on the LRU end (instead of the MRU end). This is because a fully scanned table usually is needed only briefly, so the blocks should
be moved out quickly to leave more frequently used blocks in the cache.

3. Different pools in the buffer cache

Keep pool

Recycle pool

Default pool

x$kcbwbpd
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐