Journal Buffers and Journal Files

This article contains information about journal buffers and journal files.
idms19
This article contains information about journal buffers and journal files.
Logs Database Activity
Journaling logs database activity on journal files. The following table describes the type of information CA IDMS/DB writes to a journal:
Type of information
Description
Database images
Contain before and after images of modified records and rows
Checkpoints
Describe a transaction event such as a COMMIT or ROLLBACK
For more information on the journal records, see Section19, "Journaling Procedures".
How Do You Use Journal Files?
You use the journal files to recover the database following a system or transaction failure. Typically, journaling occurs for applications that execute under the central version because CA IDMS/DB uses the journals for automatic rollback and warmstart. Journaling is less common for applications that execute in local mode, but may be used for applications that update a large database.
For more information about journaling procedures under the central version and in local mode, see Section19, "Journaling Procedures". Backup and recovery are discussed fully in 21.2, "Backup Procedures".
Journaling Entities
To log information about database activity, CA IDMS/DB requires the following journal entities in a DMCL:
  • A
    journal buffer
    , which allocates space in memory to hold journal pages containing information about database activity. Each DMCL contains only one journal buffer.
  • Journal files
    , to which CA IDMS/DB writes the journal pages.
When CA IDMS/DB Writes a Journal Page
CA IDMS/DB writes a journal page to the active journal file when one of the following conditions exist:
  • The page in the journal buffer is full
  • An update transaction terminates. A transaction terminates when the application program issues a COMMIT, COMMIT WORK, ROLLBACK, ROLLBACK WORK or FINISH statement or similar task-level statement, or when the application program aborts.
  • The journal page contains before images for records or rows on a database page which must be written to the database.
Types of Journal Files
Type
Medium
Disk journal file
Disk
Archive journal file
Sequential tape or disk file (1)
Tape journal file
Sequential tape or disk file (1)
Note:
(1) To be used for manual recovery, journal files on disk must be copied to tape.
Files You Choose Depend on the Runtime Environment
The type of journal files you define to a DMCL depends on whether the DMCL is used under the central version or to journal updates made by a local mode application. The following table displays a typical journaling configuration:
Type of configuration
Description
Under the central version
Define:
2 or more disk journals
1 or more archive journals
In local mode
Define 1 tape journal
A DMCL defined with disk and archive journals can be used in local mode provided journaling is not necessary. Only a DMCL defined with a tape journal file can be used to
journal
in local mode.
Multiple Archive Files
You can define more than one archive journal. When CA IDMS/DB offloads a disk journal, journal images are written to each archive file, thereby reducing the risk of unreadable archive journal files.
Sizing Journal Buffers
What the Journal Buffer Defines
The definition of a journal buffer defines how many pages it contains and how large the pages should be.
Buffer Page Size
The journal buffer page size determines the block size for the disk or tape journal files that are specified for the DMCL. Use the following criteria to select a size for the journal buffer pages:
  • If possible, the page size should be at least twice the size of the longest database record occurrence
  • The page size should approximate an optimal page size for the device type in which non-VSAM disk journal files reside
  • For tape journal files, the buffer page size should be as large as possible
  • For VSAM disk journal files, the journal buffer page size must match the rounded up CI size. IBM rounds up the specified CI size when the defined size is not a supported size. The journal buffer page size must match this rounded up size. The VSAM RECSZ should be 8 bytes less. CA IDMS automatically makes the internal journal block size 8 bytes less than the CI size. 
For more information about valid ranges for each operating system, see the JOURNAL BUFFER statement in Section7, “Physical Database DDL Statements”.
Number of Buffer Pages
The higher the number of buffer pages, the more likely that a journal block is found in memory eliminating the need for a disk access. Because a central version reads journal blocks primarily during rollback operations, increasing the number of journal buffer pages reduces the number of I/Os and the amount of time that is required roll out database changes.
You should minimally allocate five journal buffer pages. If you have the storage, increase this number significantly in a volatile system in which rollbacks occur frequently.
Sizing Journal Files
Disk Journal Attributes
When you define disk journal files consider the following topics:
  • How many disk journal files to define
  • The number of blocks in each disk journal
Number of Disk Journals
For optimal journal processing, you should define at least three disk journal files. When one file is full, CA IDMS/DB can immediately write to another file. While CA IDMS/DB writes to the alternate file, you can offload the full disk journal file to an archive file using the ARCHIVE JOURNAL utility statement. If CA IDMS/DB fills the second file, it can swap to a third file even if the ARCHIVE JOURNAL utility is still offloading the first file.
Batch Update Jobs May Require Added Files
You may need to increase the number of disk journal files when you run a batch program that updates a large volume of data. An added disk journal can prevent a situation in which the offload utility fails to complete its task before the remaining disk journal files fill.
Place Files to Avoid Offload Contention
To reduce contention during offload operations, you should:
  • Place the disk journals on disk packs that do not contain database or dictionary files
  • Assign each disk journal to a different volume and channel
Disk Journal File Size
The size of a disk journal file affects:
  • How often the disk journal gets offloaded to the archive journal and the amount of time that is required to accomplish the offload. A small disk journal size means a greater number of archive tapes to maintain because the last database backup. A large disk journal size means CA IDMS/DB needs more time to offload the disk journal to an archive file.
  • The risk of losing data due to an I/O error on a journal file. A smaller file reduces the potential data loss while a larger one increases it.
  • The amount of time that is required to perform a warmstart following a system failure. If the disk journal files are large, it may take longer for CA IDMS/DB to read through the journal in use at the time of the system failure.
    You can enhance warmstart performance by using the FRAGMENT INTERVAL options of the SYSTEM system generation statement or of the DCMT VARY JOURNAL command.