MAC-PAC Homecontact ussupport login 
Documentation > MAC-PAC Reference and Help > Technical Support > Key Concepts and Procedures > Recovery Management > Journaling Facility

Journaling Facility

 

 

The Journaling Facility consists of four components used to record file updates:  the journal, the journal receiver, system-generated journal entries, and user-generated journal entries.

·     The journal is an object through which the changes to the data base files are recorded.  Only changes to physical files are recorded in the journal; however, the changes are recorded whether they are made to the physical file or to a logical file built over the physical file.  The journal records before and after record images, or just before images, depending on which option is specified when journaling is initiated for a file.

Updates recorded by the journal are stored in another type of object called a journal receiver.  The journal is used to keep track of journal receivers as well as the files being journaled.

·     The journal receiver is an object that contains the journal entries used to record data base file updates.  These entries include the after image of each record, (optionally) the before image of each changed record, other system-generated entries, and user-generated entries.  Each journal entry is numbered sequentially.  This number can then be referenced in commands used to process the journal entries. 

The journal and journal receiver can be created in an auxiliary storage pool.  This can reduce the recovery time to restore the data library.  More information about auxiliary storage pools can be found in the IBM Control Program Facility documentation.

The journal entries consist of two parts.  The first part contains data about the journal entry, including the associated file.  This part also contains the unique number of the job that accessed the file.  The job number is used in the recovery system to roll back changes made within the job.  The second part of the journal entry contains the before or after image of the updated record.

·     A system-generated journal entry is one that is written by the operating system to record a file operation.  These entries are made at four levels:  system level, journal level, file level, and record level.  A system-level entry records operations affecting the entire system, such as IMPL.  A journal-level entry records operations on the journal, such as saving or deleting a receiver.  A file-level entry records operations on the file, such as opens and closes.  The record-level entry records updates, adds and deletes to a specific data base record.  These entries are processed in the roll forward and rollback programs.

·     A user-generated entry is one that is written by a user application via the SNDJRNE command.  These entries contain a user-specified code that can be referenced when requesting entries from a journal receiver, which are then written to a data base file.  These journal entries are used in the recovery system to mark the start and end of batch update processes.

The Journaling Facility provides four basic operations to perform recovery:  send journal entry (SNDJRNE), display journal (DSPJRN), remove journal change (RMVJRNCHG), and apply journal change (APYJRNCHG).

·     The send journal entry command allows user applications to write entries in a journal receiver.  The entries have a user-specified code that can be referenced in the DSPJRN command.  The send journal entry command provides a method of marking the start and end of batch processes that cannot be processed effectively under commitment control.

·     The display journal command is used to create images of journal entries in a data base file.  Created files can then be processed by application programs.  The display journal command contains many parameters, which can be used to select journal entries that meet specific criteria.  In the Recovery Management Facility, this select function is used to retrieve the user entries from a journal to check for failures in batch update processes.  Once a failure has been detected, this command is then used to retrieve the updates that need to be rolled back or rolled forward in order to correct corrupted files.

·     The remove journal change command is used to roll back updates to a data base file.  This is accomplished by applying the before image of an update transaction, deleting a record created in an add transaction, or restoring a record removed in a delete transaction.  The remove journal change command provides the ability to process journal entries by sequence number.  This means that specific updates can be rolled back once the sequence numbers of the associated journal entries are known.

·     The apply journal change command is used to re-apply changes to a data base file once a prior backup has been restored.  This is accomplished by applying the after image of an update transaction, removing records deleted previously, and restoring records that were added.  The apply journal change command provides the ability to process journal entries by sequence number.  This makes it possible to create a program that can perform a roll forward much more easily than a manual procedure would allow.

A more detailed description of Journaling can be found in the IBM Control Program Facility documentation.