Background documentationLog Area Locate this document in the navigation structure

 

The log volumes of a database form the log area. The database system stores the redo log entries (after images) in the log area.

The general database parameter MaxLogVolumes specifies the maximum number of log volumes you can configure for a database. More information: Database Administration, General Database Parameters

Log Partitions

You can combine multiple log volumes to form a log partition: A log partition can consist of one or multiple log volumes and, if applicable, the related mirrored log volumes.

When creating a log volume, you assign it to a log partition. If you do not assign the first log volume to a partition, the system automatically assigns it to the first log partition. You cannot subsequently move log volumes from one log partition to another.

In contrast to the data area, distributing the log volumes of a log partition among multiple physical hard disks does not improve performance, because the log area is written to sequentially. We recommend that you select the same size for all the log partitions.

To configure the maximum number of log partitions, use the special database parameter MaxLogWriterTasks. More information: Database Administration, Special Database Parameters

How Does the System Write Redo Log Entries?

The system distributes the redo log entries among all the log partitions, and within the log partitions among all the log volumes.

The redo log entries are written to the log volumes by the log writer tasks. The system uses one log writer task for each log partition, which means that log partitions are written in parallel. If the log partitions are on different hard disks, you can thus improve the performance.

This graphic is explained in the accompanying text.

Log Partitions

LOG FULL Situation

The system overwrites the log partitions cyclically. However, redo log entries in the log area can only be overwritten once they have been backed up.

If you do not perform any log backups, the database system will at some stage have filled up one of the log partitions with redo log entries, and the database comes to a stand-still. Therefore regularly perform log backups or activate automatic log backup.

Note Note

When a log partition is full, you have to perform a log backup. Adding a new log volume does not help: The current write position is usually not the place at which the system adds the new log volume.

End of the note.

This graphic is explained in the accompanying text.

Log partition is full (LOG FULL situation), and the system cannot use a new log volume yet

Log Segments

The system uses log segments for automatic log backup. After as many redo log entries as were configured in the log segment size were written to the log area, the system starts a log backup (otherwise after the time specified).

You configure the size of the log segments with the general database parameter AutoLogBackupSize. It is unrelated to the size of the individual log volumes, but may not exceed the total of all log volumes. Make sure that enough space remains in the log area when a log segment is being backed up to receive any new redo log entries that are written during the backup.

More information: Database Administration, General Database Parameters

Overwrite Mode

You can also set the overwrite mode for the log area, so that the database system overwrites the log area without first performing log backups. Note, however, that this will interrupt the backup history, and you will no longer be able to restore the database to its most recent state: If a hard disk is damaged, you can lose data.

Recommendation Recommendation

Only activate overwrite mode in special situations, and only for as long as is absolutely necessary.

End of the recommendation.
Mirroring

For the security of your data, we recommend that you mirror the log area. If hardware-based mirroring is not possible, the database system can mirror the log area.

Log Settings

Name

Description

Log mode

Specifies whether the database system supports software-based mirroring.

  • Log area not mirrored: System default value

  • Log area mirrored (software-based): Only use this setting if hardware-based mirroring is not possible. Software-based mirroring reduces the performance of your database system.

    In software-based mirroring, the database system writes redo log entries to two log areas in parallel (primary and secondary log area). The database system can only overwrite the log areas when the log entries in the primary log area have been backed up.

Overwrite mode for the log area

Specifies whether the database system can overwrite redo log entries in the log area even if they have not been backed up.

  • Overwrite mode is off:

    The database system can only overwrite the log area once the corresponding redo log entries have been backed up. We therefore recommend that you activate the automatic log backup function or perform interactive backups regularly.

  • Overwrite mode on:

    The database system cyclically overwrites the log area without first backing up the redo log entries. This results in gaps in the backup history. This, in turn, means that you can only restore your database up to the time of the last data backup.

If overwrite mode is on and you switch it off, you then have to execute a complete data backup.

Redo log management

Specifies whether the database system writes redo log entries.

  • Redo log management is on:

    System default value

  • Redo log management is off:

    In rare cases, it may make sense to switch off redo log management, for example during a big load job. Note that this interrupts the log backup history. If you have to restore the database after an error, no redo log entries are available for this period of time. Thus you lose the data since the last data backup.

If redo log management is off and you switch it on, you then must perform a complete data backup.