Journal Switches and Journal Numbers

The point at which the database finishes writing to one online transaction journal and begins writing to another is called a journal switch. The JADE database engine supports the switching of auditing to a new journal file regardless of whether there are active transactions (that is, a quietpoint is not required for the switch to occur).

A journal switch is scheduled when the online transaction journal is completely filled and writing should continue to the next online transaction journal. When a transaction journal reaches its configured size, a journal switch is scheduled and processed by a worker thread. You can modify this behavior by using the JournalSwitchInterval parameter in the [PersistentDb] section of the JADE initialization file.

The database engine controls all required prior journals that may be needed should a transaction abort. (The undo processing of a transaction abort may require reverse traversal of multiple journal files.) As there is no forced checkpoint after switching to a new journal, the scope of restart recovery may encompass prior journal content. The JournalRootDirectory parameter in the [PersistentDb] section of the JADE initialization file contains the set of current journal files. As the database engine retains control over a journal file until there are no active transactions traversing it, a journal file is not closed when a switch to a new journal file occurs.

The database assigns the next journal number to the new online transaction journal when a journal switch occurs. All transaction journals (the online journals and all archived, or offline, journals) are uniquely identified by their journal number. During recovery, the database properly applies transaction journal files in ascending journal number order.

When archival recovery is enabled, the [PersistentDb] section JournalCloseAction parameter enables you to specify the action to be taken when a journal is closed and released.

You can support your own disaster recovery automation by using the JournalSwitchInterval parameter in the [PersistentDb] section of the JADE initialization file to specify that a transaction journal switches after a specified number of minutes, in conjunction with the size threshold specified in the JournalMinSize and JournalMaxSize parameters in that section. A time-based switch provides better control on how much processing is contained within a journal rather than only a size-based control mechanism.

The flexibility these parameters provide is shown in the following example.

JournalMinSize=0
JournalMaxSize=100
JournalSwitchInterval=60

The JournalSwitchInterval parameter value of 60 minutes in this example means that when the criterion specified by the JournalMinSize parameter has been met, the switch interval timer is honored. The interval timer is started during database initialization. As the JournalMinSize parameter is set to zero (0) in this example, the criterion is met every interval. If the application never generates 100M bytes of journal data within an hour, the journal will switch every hour.

If you find time-based switching useful but you do not want empty journals generated, set the JournalMinSize parameter to a value other than the zero (0) default. Setting the JournalMinSize parameter to 10 in this example would cause a journal switch attempt to occur every hour but to proceed only if the journal contained at least 10M bytes of journal data.