Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Summary of DBWR,LGWR,CKPT,ARCH trigger conditions

2025-02-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

DBWR write disk data trigger condition:

1) when the process scans the secondary LRU linked list and the main LRU linked list to find the buffer header [free buffer] that can be covered, if the number of buffer header that has been scanned reaches a certain limit (determined by the hidden parameter: _ db_block_max_scan_pct), the DBWR process is triggered. _ db_block_max_scan_pct represents the number of buffer header scanned as a percentage of the total number of buffer header on the entire LRU linked list. At this point, the process of searching for the available buffer header hangs, waiting for the "free buffer wait" event in the v$session_wait, while increasing the value of "dirty buffers inspected" in the v$sysstat. (can query by x$kvit)

2) when DBWR looks for the buffer header that has been updated on the main LRUW linked list and is waiting to be written to the data file, if the number of buffer header found exceeds a certain limit (determined by the hidden parameter: _ db_writer_scan_depth_pct), DBWR will no longer scan down, but go to the secondary LRUW linked list to write the dirty data blocks on it to the data file. _ db_writer_scan_depth_pct represents the number of dirty blocks that have been scanned as a percentage of the total number of buffer header on the entire primary LRUW linked list.

3) if the total number of dirty data blocks on the primary LRUW linked list and secondary LRUW linked list exceeds a certain limit, the DBWR process will also be triggered. This limit is determined by the hidden parameter: _ db_large_dirty_queue.

4) trigger DBWR 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 the offline state.

7) issue a command: alter tablespace... Begin backup, which triggers DBWR when the tablespace is set to the hot backup state.

8) DBWR is triggered when the tablespace is set to read-only.

9) DBWR is triggered when an object is deleted (such as deleting a table).

LGWR write online log file trigger condition:

1) timeout (timeout)

When LGWR is idle, it relies on rdbms ipc message to wait and sleep until the 3-second timeout is up.

If LGWR finds that there is a redo to write out, then LGWR will write out and the log file parallel write wait event will appear.

2) the threshold is reached

As long as a process allocates space in log buffer, the number of Log buffer already used will be counted. If the block is used

If the quantity is greater than or equal to the _ log_io_size parameter setting, then the LGWR write operation will be triggered.

If LGWR is not active at this time, LGWR will be told to perform background write operations.

The default _ log_io_size is equal to the size of 1 log buffer 3, with an upper limit of 1m. The value of 0 shown in X$KSPPSV means the default value.

That is, LGWR will be triggered at the time of Min (1m, 1m, 1pm, 1pm, and 3 log buffer size). Note that the log buffer size here is measured in terms of log block.

This value is usually 512 bytes.

3) submit

When a thing is submitted, a submission flag is recorded in redo stream.

This thing is unrecoverable until the redo is written to disk. Therefore, you must wait for the LGWR write to complete before the transaction returns a success flag to the user. The process notifies LGWR to write and starts hibernation with a log file sync event with a timeout of 1 second.

The implicit parameter _ wait_for_sync of Oracle can be set to false to avoid redo file sync waiting, but the recovery of the transaction will not be guaranteed. Note that a commit in a recursive call (recursive calls) (such as a commit in a procedure) does not need to be synchronized with the redo until the response is returned to the user. Therefore, the recursive call only needs to synchronize the RBA returned to the user for the last Commit operation before the call.

There is a SGA variable to record the log block number that the redo thread needs to synchronize.

If multiple commits occur before the wake-up LGWR, this variable records the highest log block number, and all previous redo will be written to disk.

This is sometimes called group submission (group commit).

4) before DBWR writes

If the high RBA of the data to be written by DBWR exceeds the on-Disk RBA,DBWR of LGWR, post LGWR will perform the write out.

Before Oracle8i, DBWR waits for the log file sync event.

Starting with Oracle8i, DBWR puts these Block into a defer queue and tells LGWR to perform redo writes, and DBWR can continue to write data without waiting.

Trigger condition for CKPT to send CHECKPOINT signal:

1) log_checkpoint_timeout time reached

2) the current redo log has been written to the log_checkpoint_internavl* operating system block size.

3) redo log switch

4) alter system checkpoint

5) time of alter tablespace XXX begin backup,end backup

6) time of alter tablespace, datafile offline,shutdown immediate,direct read

ARCH process log archiving trigger condition: if automatic archiving mode is set, when the log is switched, the LGWR process triggers the ARCH process to archive. This is the most common way. Can be archived manually. Use the command: alter system archive log current to start the ARCH process to archive the current log file. If the ARCH process does not receive a notification from LGWR after 5 minutes, a timeout occurs and ARCH is awakened to check for log files that need to be archived. ARCH determines whether archiving is needed and which log files should be archived by reading the information in the control file. However, the ARCH process does not start during instance recovery or media recovery.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report