checkpoint queue 和 write list

原创 2004年08月01日 15:04:00

在oracle中存在 dirty list(也就是write list)的说法,但是同时又有checkpoint queue 。这两个东西往往让人容易混淆。他们是同一个东西吗?之间关系如何?

在阐述之前,我们先来看一段大师的描述

http://www.ixora.com.au/q+a/0103/07160329.htm

That information is not quite right. It is more accurate to say that there are 10 lists, because there are 5 types of buffers and there is a MAIN and AUXILIARY list for each type. Also, there is no separate hot list. The hot list is a sublist of the main replacement list. Of course, there are separate lists for each working set (LRU latch set) of buffers.

You can see all these structures in BUFFERS dumps. Here is an extract ...

(WS) size: 10000 wsid: 1 state: 0 (WS_REPL_LIST) main_prev: 32aefbc main_next: 32ae51c aux_prev: 32c94a0 aux_next: 32c94a0 curnum: 10000 auxnum: 0 cold: 32a307c hbmax: 5000 hbufs: 5000 (WS_WRITE_LIST) main_prev: 32c94b4 main_next: 32c94b4 aux_prev: 32c94bc aux_next: 32c94bc curnum: 0 auxnum: 0 (WS_PING_LIST) main_prev: 32c94d0 main_next: 32c94d0 aux_prev: 32c94d8 aux_next: 32c94d8 curnum: 0 auxnum: 0 (WS_XOBJ_LIST) main_prev: 32c94ec main_next: 32c94ec aux_prev: 32c94f4 aux_next: 32c94f4 curnum: 0 auxnum: 0 (WS_XRNG_LIST) main_prev: 32c9508 main_next: 32c9508 aux_prev: 32c9510 aux_next: 32c9510 curnum: 0 auxnum: 0


Other than the replacement lists, the other lists are for different types of write buffers. From the bottom up they are buffers that have to be written for a checkpoint range call, a checkpoint object call, a ping, or merely because they are dirty. In each case the main list holds buffers which have yet to be written, and the auxiliary list holds buffers for which a write is pending. The auxiliary replacement list holds unpinned buffers for which a write has been completed, and any other buffers that are immediately reusable. The main replacement list is what is commonly called the LRU list. The operation of the LRU list was explained under the heading The 8i buffer cache in the October issue of Ixora News. You may also be interested in the section on DBWn's new tricks in the September issue.

These 10 lists are mutually exclusive. Each buffer can only be on one of the lists at a time. For completeness it should also be mentioned that dirty buffers are also on a thread checkpoint queue and a file checkpoint queue. These queues are maintained in first modification (low RBA) order and are used to optimize checkpoint processing.

也就是说,在oracle 8 中,buffer cache 中实际存在着5大类lists,加辅助的lists共10小类。其中的4大类(8小类lists)统称write list。他们记录了dirty buffer 的各种状态信息。而通常的LRU list 只有一个大类,实际共两小类lists。也就是 replacement lists 。实际上,在9i开始版本,lists又有所增加,大致是12小类lists,这里就不过多的阐述了。(注意这里都说的是类而不是条数,因为条数实际上和 db_block_lru_latches参数有关,9i中这是隐藏参数)

在4大类的write lists 中,记录了buffer的状态(they are buffers that have to be written for a checkpoint range call, a checkpoint object call, a ping, or merely because they are dirty) 。由于write lists 中的buffer 的状态可能是转换的,也是没有时间顺序的,也就是说,如果按照这个lists写buffer到磁盘,其顺序和buffer变化发生的时间顺序并不是一致的。这也直接造成在oracle 8以前版本中,检查点都是 完全刷新 dirty buffer 的,也就是说检查点发生的时候,所有dirty buffer都要被写入磁盘,而且这个时候是不能有dirty buffer产生的,否则oracle将无法知道是否将所有的检查点时刻之前的dirty buffer 都写入了磁盘。

从oracle 8开始,出现了checkpoint queue 。checkpoint queue 是按照buffer的 low RBA 排序的,也就是说按照buffer 第一次发生变化的时候的时间点排序的。同一个dirty buffer ,既存在与 write lists中(记录着buffer的状态)又存在于checkpoint queue 中,记录着buffer 第一次发生变化的时间顺序。这样dbwr根据checkpoint queue中顺序写出dirty buffer 就一定能保证是按照 buffer 首次发生变化的时间顺序写到磁盘的。这样的一个机制,就支持了oracle的增量检查点的功能的实现。也就是说,当增量检查点发生的时候,只确定写的buffer的结束时间点,在这个检查点过程中,可以继续产生dirty buffer,dbwr也不是一次要把 所有dirty buffer 全部写到磁盘。这样大大地提高了检查点的效率。

实际上,checkpoint queue 与 write list 的配合,更是可以在实现增量检查点的同时模拟异步IO。这个问题就留待以后进行讨论了。

 

关于checkpoint的更多的内容,请参考

http://blog.csdn.net/biti_rainy/archive/2004/07/12/learn_oracle_20040712_1.aspx


 

V$LATCH

SQL> set linesize 80 SQL> desc v$latch Name Null? Type ---------------------------------...
  • EVISWANG
  • EVISWANG
  • 2015-12-22 12:50:43
  • 264

手动模拟获取latch

手动模拟获取latch 随意dump一个latches结构文件: SQL> oradebug dump latches 10 ORA-00074: no process has been s...
  • zhou1862324
  • zhou1862324
  • 2014-06-08 14:40:14
  • 821

buffer pool 和shared pool 详解(一)

1.1 buffer pool原理 Buffer Cache是Oracle SGA中一个重要部分,通常的数据访问和修改都需要通过BufferCache来完成。当一个进程需要访问数据时,首先需要确定数...
  • lovedieya
  • lovedieya
  • 2014-08-02 12:04:45
  • 1283

组合分区与范围分区效率对比测试(3)

1      组合分区与范围分区删除效率对比删除一个owner的数据:exec runstats_pkg.rs_startdelete from comp_big_table where owner ...
  • swordmanwk
  • swordmanwk
  • 2011-04-08 22:07:00
  • 593

如何生存awr报告

首先进入$ORACLE_HOME/rdbms/admin目录 sqlplus / as sysdba @awrrptCurrent Instance~~~~~~~~~~~~~~~~   DB Id  ...
  • haoxiaoyan
  • haoxiaoyan
  • 2018-02-22 11:35:04
  • 144

WR解析报告

WORKLOAD REPOSITORY report for DB Name DB Id Instance Inst num Releas...
  • tao19910610
  • tao19910610
  • 2017-04-12 17:52:57
  • 573

Oracle AWR报告详细分析

Oracle AWR报告详细分析  (文档 ID 1523048....
  • demonson
  • demonson
  • 2018-03-07 17:19:20
  • 177

星球上最详细的AWR解析报告

* 定义:awr报告是oracle 10g下提供的一种性能收集和分析工具,它能提供一个时间段内整个系统资源使用情况的报告,通过这个报告,我们就可以了解一个系统的整个运行情况,这就像一个人全面的体检报告...
  • hanbowu
  • hanbowu
  • 2015-02-09 17:52:32
  • 4856

AWR 报告分析(一)

WORKLOADREPOSITORY report for DB Name DB Id Instance Inst num Releas...
  • zhaojian1988
  • zhaojian1988
  • 2013-05-01 22:28:18
  • 1219
收藏助手
不良信息举报
您举报文章:checkpoint queue 和 write list
举报原因:
原因补充:

(最多只允许输入30个字)