User Guide

SAP AG November 2002
Log Writer [Page 46]
Server Task [Page
16]
Timer Task [Page
16]
Trace Writer Task [Page
16]
User Task [Page
16]
Utility Task [Page
16]
Data Writer
Data writers are user kernel threads (UKT) [Page 14]. Data writer tasks are responsible for
writing data from the data cache [Page
130] to the data volumes [Page 130]. They become
active when a savepoint [Page 149] is performed.
Savepoint writing takes a long time for a large data cache. The data writers also become
active between the end of one and the start of the next savepoint, to write data
asynchronously from the data cache to disk.
The number of data writers is calculated by the system. It depends primarily on the data
cache size (CACHE_SIZE [Page
81]) and the number of data volumes (MAXDATAVOLUMES
[Page 85]).
Log Writer
One active component of redo log management [Page 45] is the log writer.
The log writer is a user kernel thread (UKT) [Page 14]. 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, in particular at a savepoint [Page
149].
A log queue [Page
45] is assigned to the log writer.
The log writer writes the log pages [Page
46] that are full, or have to be written as a result
of a COMMIT [Page 129] or ROLLBACK [Page 147], from the log queue to the log area
[Page 142]. 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 [Page 146] or recovery. The log writer then notifies the transactions that
were waiting for their redo log entries [Page 44] 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 [Page
44] into the log queue are stopped.
When the automatic log backup [Page 126] 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.
User Manual: SAP DB 15