zoukankan      html  css  js  c++  java
  • 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–

  • 相关阅读:
    Spring的事务 之 9.4 声明式事务 ——跟我学spring3
    我对AOP的理解
    基于JDK动态代理和CGLIB动态代理的实现Spring注解管理事务(@Trasactional)到底有什么区别。
    我对IoC/DI的理解
    Spring对事务管理的支持的发展历程(基础篇)
    Tomcat一个BUG造成CLOSE_WAIT
    用dubbo时遇到的一个序列化的坑
    只写完功能代码仅仅只是开始
    事物隔离级别和乐观锁
    关于ubuntu实机与虚机互相copy
  • 原文地址:https://www.cnblogs.com/buro79xxd/p/1821237.html
Copyright © 2011-2022 走看看