When lgwr is idle, it depends on the rdbms rpc message wait event and is in sleep state until three seconds. If lgwr finds that redo information needs to be written, then lgwr will execute the write operation, and the log file parallel write wait event will appear.
Summarize the trigger conditions for redo writing:
1, Timeout every three seconds(Timeout):
When lgwr is idle, it depends on the rdbms rpc message wait event and is in sleep state until three seconds. If lgwr finds that redo information needs to be written, then lgwr will execute the write operation, and the log file parallel write wait event will appear.
2.Threshold reached:
Redo log buffer is 1/3 full;
Redo log buffer has 1 MB of dirty data;
It is very important to set the parameter _ log_io_size, which is generally 1/3 of the size of log_buffer.
3.User submission:
When a transaction is submitted, a commit flag is recorded in the redo stream. Before these redo logs are written to the disk, the transaction cannot be restored. Therefore, before the success mark is returned for transaction, the lgwr write must be completed. The process notifies lgwr to write and starts to sleep with the log file sync event. The timeout value is 1 second.
4.InDbwnBefore writing:
If the High RBA of the data to be written by dbwr exceeds the on-disk RBA of lgwr, dbwr notifies lgwr to perform the write operation. Before Oracle8i, dbwr will wait for the log file sync event. Starting from Oracle8i, dbwr puts these blocks (the High RBA of the block to be written exceeds the on-disk RBA of lgwr) into the defer queue and notifies lgwr to execute redo writing.
Note: The log buffer space wait event indicates that the log buffer space is insufficient.