Oracle Dbwr,lgwr,ckpt,arch Trigger Condition Summary

Source: Internet
Author: User

I. DBWR write disk data trigger conditions

1. When the process scans the secondary LRU list and the primary LRU list to find the buffer header[free buffer that can be overwritten, if the number of buffer headers that have been scanned reaches a certain limit (by the hidden parameter: _db_block_max_scan_  PCT decision), the DBWR process is triggered. _db_block_max_scan_pct indicates that the number of buffer headers that have been scanned represents the percentage of the total number of buffer headers on the entire LRU list. At this point, the search for a process that can use the buffer header is suspended, and in v$session_wait it is displayed as waiting for the "Free buffer Wait" event while increasing the value of "dirty buffers inspected" in V$sysstat. (Can query by X$kvit)

This part of the content in my blog also has a description:

Oracle Buffer Cache principle

              http://blog.csdn.net/ Tianlesoftware/archive/2011/06/28/6573438.aspx


2. When DBWR finds a buffer header on the main Lruw linked list that is waiting to be written to the data file after it has been updated, the number of buffer headers found exceeds a certain limit (by the hidden parameter: _db_writer_scan_depth_ PCT decision), DBWR no longer continues to scan, and goes to the secondary Lruw list to write the dirty blocks on the data file. _db_writer_scan_depth_pct indicates that the number of dirty blocks scanned is a percentage of the total number of buffer headers on the main Lruw linked list.
3. If the total number of dirty blocks on the primary LRUW linked list and the secondary LRUW list exceeds a certain limit, the DBWR process will also be triggered. The limit is determined by the hidden parameter: _db_large_dirty_queue.
4. DBWR is triggered when an incremental checkpoint (incremental checkpoint) or a full checkpoint (complete checkpoint) occurs.
5. Start DBWR every three seconds.
6. DBWR is triggered when the tablespace is set to an offline (offline) state.
7. Issue the command: Alter TABLESPACE. Begin backup, which triggers DBWR when the tablespace is set to a hot backup state.
8. DBWR is triggered when the tablespace is set to a read-only state.
9. Deleting an object (such as deleting a table) triggers DBWR.

Two. LGWR write online log file trigger conditions

1. Timeout (timeout)

When the LGWR is idle, it relies on the RDBMS IPC message to wait, in hibernation, until the 3-second time-out expires. If LGWR discovers that redo needs to be written out, LGWR will perform a write-out operation, and the log file parallel write wait event will appear.

2. Threshold value reached
As long as a process allocates space in log buffer, the number of log buffer already in use will be computed. If the number of blocks used is greater than or equal to the _log_io_size parameter setting, the LGWR write operation is triggered.
If LGWR is not active at this time, LGWR will be notified to perform a background write operation.
The default _log_io_size is equal to 1/3 log buffer size, the upper value is 1M, this parameter is displayed in the X$KSPPSV value of 0, meaning the default value. That is, LGWR will be triggered at min (1M,1/3 log buffer size).

Note that the log buffer size here is measured in log block. This value is typically bytes.

3. Submit
When a thing is submitted, a commit flag is recorded in the redo stream.
This thing is not recoverable until these redo are written to disk. Therefore, before the transaction returns a successful flag to the user, it must wait for the LGWR write to complete. The process notifies LGWR to write and begins hibernation with the log file Sync event, with a time-out of 1 seconds.
The implicit parameter of Oracle _wait_for_sync parameter can be set to false to avoid waiting for redo file sync, but it will not guarantee the recoverability of the transaction. Note that the commit in a recursive call (recursive calls) (such as a commit in a procedure) You do not need to synchronize redo until you need to return a response to the user. So recursive calls only need to be synchronized back to the RBA of the last commit operation before the user calls.
There is an SGA variable to record the log block number that the redo thread needs to synchronize.
If multiple commits occur before waking LGWR, this variable records the highest log block number, and all previous redo will be written to disk. This is sometimes referred to as group commit.

4. Before DBWR writes
If the DBWR is going to write a high RBA of data over LGWR On-disk RBA,DBWR will post LGWR to execute the write.
Before Oracle8i, DBWR will wait for the log file sync event.
Starting with oracle8i, DBWR put these blocks into a defer queue, while notifying LGWR to execute redo write-out, DBWR can continue to execute without waiting for the data to be written out.

Three. Trigger conditions for CKPT sending checkpoint signals

1. Log_checkpoint_timeout Time reached
2. The current redo log has been written enough log_checkpoint_internavl* the operating system block size
3. Redo Log Switch
4. Alter system checkpoint
5. Alter tablespace XXX begin backup,end Backup
6. Alter Tablespace, datafile offline, shutdown immediate, direct read;

Four. Arch process log Archive trigger conditions

1. If the auto-archive mode is set, the LGWR process triggers the arch process to archive when the log is switched. This is the most common way.

2. Can be archived by hand. Using the command: Alter system archive Log current indicates the start of the arch process, thus archiving the currently logged file.

3. If the arch process does not receive a notification of LGWR after 5 minutes, a timeout occurs, and arch is awakened to check for the existence of a log file that needs to be archived. Arch reads the information in the control file to determine whether it needs to be archived and which log files should be archived. However, the arch process does not start during instance recovery or media recovery.

Reprinted from: http://space.itpub.net/23071790/viewspace-692142

Oracle Dbwr,lgwr,ckpt,arch Trigger Condition Summary

Related Article

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.