Buffer Cache Management
Oracle creates server processes to handle requests from connected user processes. A server process communicates with the user process and interacts with Oracle to carry out requests from the associated user process. For example, if a user queries some data not already in the database buffers of the SGA, then the associated server process reads the proper data blocks from the datafiles into the SGA. –<<10gR2 Concept>>

First, Buffer Cache Management Process
Oracle Server Process scan Cache Buffer Chain (Cache Buffer Chain latch) to see if the block(s) has been cached in Hash Chain, if the cached block(s) can be found, the position of the block’s BH(s) will be move on LRU List (Cache Buffer LRU Chain latch), if not exist then scan disk.
Beford scanning disk, Server Process need to scan LRU List for a free buffer(s) to store the BH of target Block(s), in the mean time, Server Process will move all the Dirty Buffer Block(s) (flag=dirty) from LRU List to Write List(Cache Buffer LRU Chain latch) (If Server Process couldn’t find free buffer after scaned 40% of LRU List, Server Process will call DBWn to write dirty data to release buffer①)
To store block(s) after Server Process has enough buffer (Cache Buffer Chain latch & Cache Buffer LRU Chain latch), if the block cann’t make the rule of Consistent Read, Server Process need to create before image(s).
When the block(s) in Buffer Cache became dirty, the block(s) must on LRU List, also Server Process will add the block(s) on Checkpoint Queue List as well(if there are 25% dirty block of Checkpoint Queue List Server Process will call DBWn to write those Dirty Block to Data File②x$kvit.kvittag=’kcbldq’ is 25%)
DBWn scan 25% of LRU, and move those Dirty Buffer to Write List③ (?or to Checkpoint Queue List?)
Second, the 5 lists
LRU List:
LRU Auxiliary List
Write List (Dirty List)
Write Auxiliary List
Checkpoint Queue List
Reference
①:The threshold for calling DBWn to write those Dirty Block to Data File
select kvittag,kvitval,kvitdsc from x$kvit where kvittag=’kcbfsp’;
KVITTAG KVITVAL KVITDSC
——- ———- —————————————————————-
kcbfsp 40 Max percentage of LRU list foreground can scan for free
②:The threshold for calling DBWn to write Dirty Block is 25%
select kvittag,kvitval,kvitdsc from x$kvit where kvittag=’kcbldq’;
KVITTAG KVITVAL KVITDSC
——- ———- —————————————————————-
kcbldq 25 large dirty queue if kcbclw reaches this
③: DBWn scan 25% of LRU, and move those Dirty Buffer to Dirty List
select kvittag,kvitval,kvitdsc from x$kvit where kvittag=’kcbdsp’;
KVITTAG KVITVAL KVITDSC
——- ———- —————————————————————-
kcbdsp 25 Max percentage of LRU list dbwriter can scan for dirty
If you'd like to check all the Queues that I mentioned in this note, please go for alter session set events 'immediate trace name buffers level 10';
to myself:check《Internal基础03-checkpoint》for details
–EOF–
作者:Buro#79xxd
出处:http://www.cnblogs.com/buro79xxd/
文章版权归本人所有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。
分类:
Oracle_Internal
标签:
Buffer_Cache
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 如何编写易于单元测试的代码
· 10年+ .NET Coder 心语,封装的思维:从隐藏、稳定开始理解其本质意义
· .NET Core 中如何实现缓存的预热?
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义
· 地球OL攻略 —— 某应届生求职总结
· 提示词工程——AI应用必不可少的技术
· Open-Sora 2.0 重磅开源!
· 周边上新:园子的第一款马克杯温暖上架