[Oracle]-[architecture-LGWR]-some understandings of LGWR

Source: Internet
Author: User

[Oracle]-[architecture-LGWR]-some understandings of LGWR: LGWR, short for Log Writer, is also a background process. It is mainly responsible for writing the log buffer content to online redo log files or groups on the disk. Before DBWn writes the dirty block to the disk, LGWR writes all redo logs related to buffer modification to the disk's online redo log file (group, then DBWn will wait for LGWR and generate some corresponding wait events (for example, log file prarllel write, which will be discussed separately later ). In short, the purpose of this operation is to restore the possibility of previous operations when a crash occurs, which is also a mechanism for Oracle to maintain transaction integrity. Related Knowledge points: 1. logs written by LGWR are sequential writes. This explains that only one LGWR process can be created on an ipve Server, but not as many as DBWR, otherwise, the sequential write mechanism cannot be guaranteed, and the locks may occur. 2. Each time a user process modifies a memory data block, it constructs a redo entry in the log buffer (redo buffer ), it records the values before and after the modified data block. 3. LGWR can write the redo entry into the online log file in two ways: Background write and synchronous write, or asynchronous write and synchronous write. Background write conditions: (1). LGWR is started every 3 seconds. (2) If the redo entry corresponding to the dirty block is not written into the online log file when DBWR is started, DBWR triggers the LGWR process and waits until the LGWR process is complete. (3) when the number of redo entries reaches 1/3 of the total log buffer, LGWR is triggered. (4) The number of redo entries reaches 1 M. Synchronous write condition: COMMIT. That is, when you execute COMMIT, you must wait for the log buffer to perform the flushing operation (a log file sync wait event may be generated) and write it to the online log file on the disk. Generally, the above 1/3 full condition triggers LGWR and almost forces LGWR to write data in real time. Therefore, when you need to execute COMMIT, there may be no redo entry to write data. 4. 3 seconds to trigger the LGWR rule. In fact, this timeout is DBWR, but because LGWR is always executed before DBWR is called, the effect is also equivalent to that of LGWR.

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.