天天看點

Log Switches and Log Sequence Numbers

Log Switches and Log Sequence Numbers

A log switch is the point at which the database stops writing to one redo log file and begins writing to another. Normally, a log switch occurs when the current redo log file is completely filled and writing must continue to the next redo log file. However, you can configure log switches to occur at regular intervals, regardless of whether the current redo log file is completely filled. You can also force log switches manually.

Oracle Database assigns each redo log file a new log sequence number every time a log switch occurs a nd LGWR begins writing to it. When the database archives redo log files, the archived log retains its log sequence number. A redo log file that is cycled back for use is given the next available log sequence number.

--log sequence number 是在如下時刻被配置設定的: 當  log switch occurs時, the next redo log獲得最新的 log sequence number。

舉例:

3組日志 :1;2;3 。

2組的狀态是current,此時2組的 log sequence number是100

日志切換後:

3組的狀态是current,此時3組的 log sequence number是101