Quiescing activity before offloading
You can use the MODE(QUIESCE) option of the ARCHIVE LOG command to ensure that activity has stopped before the log is archived.
About this task
With this option, Db2 work is quiesced after a commit point, and the resulting point of consistency is captured in the current active log before it is offloaded. Unlike the QUIESCE utility, ARCHIVE LOG MODE(QUIESCE) does not force all changed buffers to be written to disk and does not record the log RBA in SYSIBM.SYSCOPY. It does record the log RBA in the bootstrap data set.
Consider using MODE(QUIESCE) when planning for offsite recovery. Using MODE(QUIESCE) creates a system-wide point of consistency, which can minimize the number of data inconsistencies when the archive log is used with the most current image copy during recovery.
In a data sharing group, ARCHIVE LOG MODE(QUIESCE) might result in a delay before activity on all members has stopped. If this delay is unacceptable to you, consider using ARCHIVE LOG SCOPE(GROUP) instead. This command causes truncation and offload of the logs for each active member of a data sharing group. Although the resulting archive log data sets do not reflect a point of consistency, all the archive logs are made at nearly the same time and have similar LRSN values in their last log records. When you use this set of archive logs to recover the data sharing group, you can use the ENDLRSN option in the CRESTART statement of the change log inventory utility (DSNJU003) to truncate all the logs in the group to the same point in time.
The MODE(QUIESCE) option suspends all new update activity on Db2 up to the maximum period of time that is specified on the installation panel DSNTIPA. If the time needed to quiesce is less than the time that is specified, the command completes successfully; otherwise, the command fails when the time period expires. This time amount can be overridden when you issue the command, by using the TIME option:
-ARCHIVE LOG MODE(QUIESCE) TIME(60)
The preceding command allows for a quiesce period of up to 60 seconds before archive log processing occurs.
By default, the command is processed asynchronously from the time you submit the command. (To process the command synchronously with other Db2 commands, use the WAIT(YES) option with QUIESCE; the z/OS console is then locked from Db2 command input for the entire QUIESCE period.)
During the quiesce period:
- Jobs and users on Db2 are allowed to go through commit processing, but they are suspended if they try to update any Db2 resource after the commit.
- Jobs and users that only read data can be affected, because they can be waiting for locks that are held by jobs or users that were suspended.
- New tasks can start, but they are not allowed to update data.
As shown in the following example, the DISPLAY THREAD output issues message DSNV400I to indicate that a quiesce is in effect:
DSNV401I - DISPLAY THREAD REPORT FOLLOWS -
DSNV400I - ARCHIVE LOG QUIESCE CURRENTLY ACTIVE
DSNV402I - ACTIVE THREADS -
NAME ST A REQ ID AUTHID PLAN ASID TOKEN
BATCH T * 20 TEPJOB SYSADM MYPLAN 0012 12
DISPLAY ACTIVE REPORT COMPLETE
DSN9022I - DSNVDT '-DISPLAY THREAD' NORMAL COMPLETION
When all updates are quiesced, the quiesce history record in the BSDS is updated with the date and time that the active log data sets were truncated, and with the last-written RBA in the current active log data sets. Db2 truncates the current active log data sets, switches to the next available active log data sets, and issues message DSNJ311E, stating that offload started.
If updates cannot be quiesced before the quiesce period expires, Db2 issues message DSNJ317I, and archive log processing terminates. The current active log data sets are not truncated and not switched to the next available log data sets, and offload is not started.
Regardless of whether the quiesce is successful, all suspended users and jobs are then resumed, and Db2 issues message DSNJ312I, stating that the quiesce is ended and update activity is resumed.
If ARCHIVE LOG is issued when the current active log is the last available active log data set, the command is not processed, and Db2 issues this message:
DSNJ319I - csect-name CURRENT ACTIVE LOG DATA SET IS THE LAST
AVAILABLE ACTIVE LOG DATA SET. ARCHIVE LOG PROCESSING WILL
BE TERMINATED.
If ARCHIVE LOG is issued when another ARCHIVE LOG command is already in progress, the new command is not processed, and Db2 issues this message:
DSNJ318I - ARCHIVE LOG COMMAND ALREADY IN PROGRESS.