Implementing new parameters for log read

You can now restart reading the log, for the timestamp specified in the Data Partition Facility (DPF) Db2 configuration.

About this task

At times, you might need to restart the Q Capture program from a known point in the log. For example, in a high availability failover scenario you can record information from the Db2 log on one server and then use a command to start capturing data on the backup server after the second server takes over. The system now facilitates this. Two new parameters, Q Capture (asnqcap) LSN and MAXCMTSEQ are implemented to read the log from a new timestamp.

Important:

You can specify a timestamp with the lsn and maxcmtseq parameters and the Q Capture program will start reading from the log record that corresponds to the timestamp. The timestamp must be in 24-hour Coordinated Universal Time (UTC), formerly known as Greenwich Mean Time (GMT), and not local time. The format is yyyy-mm-dd-hh.mm.ss.nnnnnn.

For example, to start reading the log from 1:30:01.000001 p.m. on Sept. 4, 2015, and commit the first transaction that is seen by Q Capture:

lsn=2015-09-04-13.30.01.000001 maxcmtseq=0

To start reading the log from 1:30:01.000001 p.m. on Sept. 4, 2015 when you know that Q Capture has already published up to LSN 00CE:1234:5678:9123:4500:0001:

lsn=2015-09-04-13.30.01.000001 maxcmtseq=00CE:1234:5678:9123:4500:0000:0000:0001

Procedure

  1. Determine the point in the log where you want Q Capture to start reading. You need the values for two command parameters:
    lsn
    The log sequence number (LSN) of the oldest uncommitted transaction that you want to capture.
    maxcmtseq
    The LSN of the most recently committed transaction that was put on the send queue.
  2. You can restart Qcapture either by using the timestamp that you prefer or by using LSN number from the log.
    For example:
    To use the time stamp that you prefer,
    asnqcap capture_server=SRCDB capture_schema=ASN startmode=warmns monitor_interval=8000 lsn=2022-09-02-12.12.03.000000 maxcmtseq=0 
    To use the LSN number from the log, for example, you can consider the LSN number 0000:0000:0562:BBA6:0000:0000:3C87:BDED from the sample log:
    2023-05-22-06.04.59.494680 <handleLogrdInitMsg> ASN7108I  "Q Capture" : "QASN" : "WorkerThread" : At program initialization, the lowest log sequence number of a transaction still to be committed (LSN) is "0000:0000:0562:BBA6:0000:0000:3C87:BDED" and the highest log sequence number of a successfully processed transaction (MAXCMTSEQ) is "646B:3D80:0000:0001:0000:0000:0000:0000 (NODE 0)".