In-depth analysis of Oracle memory

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                                                                                                                                                                                   


 


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值