One active task of the redo log management is the log writer.
The log writer is a
task in the user kernel
thread. When the database
system is started, it is initialized using permanently stored, internal
configuration information. This
configuration information is written to the
log area at
regular intervals at a
savepoint.
· A log queue is assigned to the log writer.
·
The log writer writes the
log pages
that are full, or have to be written as a result of a COMMIT or
ROLLBACK, from the
log queue to the log area. The
log pages are numbered (log sequence number), so that it is possible to check
that all log pages were written, and to ensure the correct working sequence in
the case of a restart or a
recovery. The log writer then
notifies the transactions that were waiting for their redo log entries
to be written.
· Log pages of the log queue that were not full when a write operation was performed remain in the log queue and continue to be filled, and are written to the log area in a subsequent write operation. The log writer is configured so that it always writes one and the same log page to the same physical place.
·
The log writer regularly
checks the state of the log area.
If the log area is full, the log
writer locks the log queue so that all transactions that want to enter redo
log entries into the log queue are stopped.
When the automatic log
backup is active, the log writer ensures that the redo log entries from
the log area are backed up automatically.
When a certain number of log
entries have been written, the administrative information is copied to the log
area, and savepoints are requested, if required. In the case of a restart, this reduces the restart
time.