What’s the Point of Oracle Checkpoints?

作者: Maclean Liu , post on November 24th, 2010 , English Version
【本站文章除注明转载外,均为本站原创编译】
转载请注明:文章转载自: Oracle Clinic – Maclean Liu的个人技术博客 [http://www.oracledatabase12g.com/]
本文标题: What’s the Point of Oracle Checkpoints?
本文永久地址: http://www.oracledatabase12g.com/archives/what-point-of-oracle-checkpoints.html

Buffer Cache Basics

The buffer cache component structures are:

  • Buffers
    • Each buffer may hold an image of one data block at any one time
  • Buffer headers
    • Store metadata about contents of the buffers
    • Act as cache management structures
  • Buffer pools
    • Collection of buffers used for the same purpose and managed accordingly
  • Working set
    • All or part of a buffer pool
    • Assigned to a DBWn process

Buffer Management

  • Cached buffers managed by doubly linked lists:
  • REPL
    • Buffers containing block images being used
  • REPL-AUX
    • Buffers ready to be used for I/O or CR build
  • WRITE and CKPT-Q
    • Dirty Buffers requiring I/O
  • WRITE-AUX
    • Dirty Buffers with I/O in progress
  • Touch count is used to decide the initial insertion location in the REPL chain
  • AUX lists avoid wasteful scanning

Redo and the Buffer Cache

  • Block modification dirties the buffer containing the block image and generates redo
  • A buffer becomes dirty at a particular RBA which is a point in the redo stream
  • Redo written by LGWR makes the corresponding part of the redo log file “active”
  • Dirty block images written by DBWn makes the corresponding part of the redo log file “inactive”
  • Redo is always written prior to the corresponding block images
  • Size of active redo in the log file influences instance and crash recovery time
  • Trade-off between performance and recovery time

Buffer Cache I/O

  • Servers look for an available buffer on REPL-AUX then read a data block into selected buffer
    • Buffer gets moved from REPL-AUX to REPL
    • If block is modified, buffer is added to CKPT-Q
    • Servers move dirty buffers to WRITE during free buffer search
  • DBWn writes dirty buffer contents to database
    • Buffer gets moved from WRITE to WRITE-AUX
    • Once block written:
      • Buffer is moved back to REPL-AUX
      • Buffer taken off CKPT-Q
  • DBWn writes upon request
    • Make free buffers
    • Checkpoint

Parallel Query Checkpoint

  • Writes block images to the database for all dirty buffers belonging to objects accessed by the query from all instances
  • Statistics updated:
    • DBWR checkpoint buffers written
    • DBWR checkpoints
  • Caused by:
    • Parallel Query
    • Parallel Query component of PDML or PDDL
    • Mandatory for consistency

Log Switch Checkpoint

  • Writes the contents of “some” dirty buffers to the database
  • Statistics updated:
    • DBWR checkpoints
    • DBWR checkpoint buffers written
    • background checkpoints started
    • background checkpoints completed
  • Controlfile and datafile headers are updated
    • CHECKPOINT_CHANGE#


© 2010, www.oracledatabase12g.com. 版权所有.文章允许转载,但必须以链接方式注明源地址,否则追究法律责任.

相关文章 | Related posts:

  1. Know more about Buffer Cache and Latch
  2. Automatic Checkpoint Tuning
  3. Know more about redo log buffer and latches
  4. Oracle内部视图:X$BH
  5. 11g Release 2 enhanced Tablespace Point In Time Recovery
  6. The Log_buffer Default Size Cannot Be Reduced In 10g R2
  7. OCP-8i DBA:Oracle Architectural Components
  8. CI Locks Causing System Hangs
  9. Script:List Buffer Cache Details

Leave a Reply

  

  

  

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>