[IBM i]

Journal management on IBM i

As part of your backup strategy, take care of your journal receivers. It is useful to remove journal receivers from the IBM® MQ libraries for various reasons:
  • To release space; this applies to all journal receivers
  • To improve the performance when starting (STRMQM)
  • To improve the performance of recreating objects (RCRMQMOBJ)

Before deleting a journal receiver, you must take care that you have a backup copy and that you no longer need the journal receiver.

Journal receivers can be removed from the queue manager library after they have been detached from the journals and saved, provided that they are available for restoration if needed for a recovery operation.

The concept of journal management is shown in Figure 1.
Figure 1. Journaling on IBM i
Diagram showing the concept of retaining journal receivers. In this example, the current journal receiver is supported by three previous receivers.

It is important to know how far back in the journals IBM MQ is likely to need to go, in order to determine when a journal receiver that has been backed up can be removed from the queue manager library, and when the backup itself can be discarded.

IBM MQ issues two messages to the queue manager message queue (QMQMMSG in the queue manager library) to help determine this time. These messages are issued when it starts, when it changes a local journal receiver, and you use RCDMQIMG to force a checkpoint. The two messages are:
AMQ7460
Startup recovery point. This message defines the date and time of the startup entry from which IBM MQ replays the journal in the event of a startup recovery pass. If the journal receiver that contains this record is available in the IBM MQ libraries, this message also contains the name of the journal receiver containing the record.
AMQ7462
Oldest media recovery entry. This message defines the date and time of the oldest entry to use to re-create an object from its media image.

The journal receiver identified is the oldest one required. Any other IBM MQ journal receivers with older creation dates are no longer needed. If only stars are displayed, you need to restore backups from the date indicated to determine which is the oldest journal receiver.

When these messages are logged, IBM MQ also writes a user space object to the queue manager library that contains only one entry: the name of the oldest journal receiver that needs to be kept on the system. This user space is called AMQJRNINF, and the data is written in the format:

JJJJJJJJJJLLLLLLLLLLYYYYMMDDHHMMSSmmm
where:
JJJJJJJJJJ
Is the oldest receiver name that IBM MQ still needs.
LLLLLLLLLL
Is the journal receiver library name.
YYYY
Is the year of the oldest journal entry that IBM MQ needs.
MM
Is the month of the oldest journal entry that IBM MQ needs.
DD
Is the day of the oldest journal entry that IBM MQ needs.
HH
Is the hour of the oldest journal entry that IBM MQ needs.
SS
Is the seconds of the oldest journal entry that IBM MQ needs.
mmm
Is the milliseconds of the oldest journal entry that IBM MQ needs.
When the oldest journal receiver has been deleted from the system, this user space contains asterisks (*) for the journal receiver name.
Note: Periodically performing RCDMQMIMG OBJ(*ALL) OBJTYPE(*ALL) DSPJRNDTA(*YES) can save startup time for IBM MQ and reduce the number of local journal receivers you need to save and restore for recovery.

IBM MQ for IBM i does not refer to the journal receivers unless it is performing a recovery pass either for startup, or for recreating an object. If it finds that a journal it requires is not present, it issues message AMQ7432 to the queue manager message queue (QMQMMSG), reporting the time and date of the journal entry it requires to complete the recovery pass.

If this happens, restore all journal receivers that were detached after this date from the backup, to allow the recovery pass to succeed.

Keep the journal receiver that contains the startup entry, and any subsequent journal receivers, available in the queue manager library.

Keep the journal receiver containing the oldest Media Recovery Entry, and any subsequent journal receivers, available at all times, and either present in the queue manager library or backed-up.

When you force a checkpoint:
  • If the journal receiver named in AMQ7460 is not advanced, this indicates that there is an incomplete unit of work that needs to be committed or rolled back.
  • If the journal receiver named in AMQ7462 is not advanced, this indicates that there are one or more damaged objects.