A brief summary of checkpoint queues

Source: Internet
Author: User
Tags backup

1, the Oracle log principle

Redo Stream (redo log stream)

RBA (the redo byte address consists of 4 parts: The log thread number, the log sequence number, the log file block number, and the log file byte offset, which is 10 bytes in length. For example Thread:1 rba:0x000014.00000003.0010)

Ckpt equeue:1. Check for dirty blocks every 3 seconds, 2. Check ckpt equeue head RBA every 3 seconds, write check queue header RBA to control file

Function: (1). Statistics Dirty Data block

(2). RBA sorted in order, brush data to disk in this order

(3). Each RBA points to the next RBA, pointing to the dirty data block address

2, Checkpoint queue (checkpoint is just a database event, it exists the fundamental meaning is to reduce the crash recovery time), in BH There is a CKPTQ item, two-way linked list.

(1) Only the dirty block will be in the checkpoint queue, the CKPTQ of the non dirty block is empty.

(2) when the block is first changed, the block is immediately added to the checkpoint queue. If a dirty block in the checkpoint queue is modified again, it does not change its

The location in the checkpoint queue.

(3) The order of the dirty blocks in the checkpoint queue: according to the 2nd, all dirty blocks are arranged in the order of the first time changed. To be more precise, press

Arrange the Lrba of the pieces.

3, what is RBA? Lrba? Hrba? On DISK RBA?

(1) RBA: It's a redo block address.

(2) Lrba: For the first time, change the order of the corresponding redo block address for this chunk of data

(3) Hrba: Relative to Lrba, later modified RBA

(4) on disk RBA: the RBA of the last redo log file in the disk is the highest redo value.

4. The process of participating in the checkpoint mainly includes LGWR, Dbwn and Ckpt, which are divided into two categories: full checkpoint and incremental checkpoint.

(1) The complete checkpoint mainly includes the following steps:

① first, determine the current (i.e. newest) redo record in the log buffer and extract its RBA and SCN as checkpoint target.

②LGWR empty the log cache and write the redo record to the online log

The ③DBWN process writes a data file in RBA order by examining the dirty blocks of data generated by the checkpoint target (RBA and SCN) before the checkpoint target.

④ Finally, the CKPT process writes the checkpoint target (RBA and SCN) to the header and control file of the data file

(2) conditions that trigger a full checkpoint:

① Execute shutdown Immediate command

② execute ALTER SYSTEM checkpoint command

③LGWR Switch online logs, whether because the log is full or if the ALTER system switch logfile command is executed

④ perform partial tablespace maintenance commands: Alter tablespace ... offline|online|begin backup|end backup|read Write

5, incremental checkpoint does not update the data file header, but only every 3 seconds by the CKPT process to update the control file Lrba and SCN

(1) An incremental checkpoint consists primarily of the following steps

①ckpt every 3 seconds to record the checkpoint position (update control file)

②CKPT periodically triggers DBWR

(2) The meaning of an incremental checkpoint has the following two:

① reduce the workload of dbwn processes when a full checkpoint occurs

② increase the speed of instance recovery

6, CHECKPOINT optimization

(1) From the beginning of the 9I checkpoint optimization greatly simplifies the

Set Fast_start_mttr_target

Larger value: Longer recovery time

Smaller value: Increase IO load

See more highlights of this column: http://www.bianceng.cnhttp://www.bianceng.cn/database/Oracle/

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.