Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Apr 7, 2026 3:10:24 AM
Mar 31, 2026 1:34:25 AM
To start replication from a specific point in time on a DB2 LUW source, you will need to identify the LSN (Log Sequence Number) corresponding to your target timestamp and configure it in your Qlik Replicate task.
There are several ways to obtain the LSN depending on your environment and access level.
Ensure the DB2 archive logs covering your target LSN range are still retained and accessible on the server. If those logs have been pruned or moved off the system, Qlik Replicate will not be able to read from that position, and the task will error out.
Run the following on the DB2 server to list active log files with their LSN ranges and timestamps:
db2pd -db <DBNAME> -logs
Sample output:
Log File First LSN Last LSN Timestamp
S0001234.LOG 0x000123456789 0x000123ABCDEF 2026-03-10-11.30.00
Locate the log file whose timestamp range covers your desired start time and note the First LSN for that file. Convert the hex value to decimal before entering it into Replicate (e.g., 0x000123456789 = 1251004137353).
If you know the specific log file number and offset, you can translate it to an LSN using the db2flsn command-line utility:
db2flsn -db <DBNAME> -lsn <log_file_number>/<offset>
This is useful when you already know which log file corresponds to your target time. Convert the resulting hex LSN to decimal before entering it into Replicate.
To retrieve the current active LSN directly from the database:
SELECT CURRENT_LSN FROM SYSIBMADM.SNAPDB;
This returns the LSN at the moment the query is executed. Use this if you want to start replication from approximately "now" with a precise LSN anchor rather than relying on the task default. Convert the hex value to decimal before use.
By design, Qlik Replicate does not support starting CDC from a specific timestamp for a DB2 LUW source endpoint. This is a documented limitation in the Qlik Replicate User Guide.
However, when a DB2 LUW CDC task is first created and started, Replicate internally generates a file named DB2LUW_TIMESTAMP_MAP (a SQLite database) in the task's data folder. This file continuously maps processed LSN values to their corresponding timestamps each time the task runs. As a result, it provides a workaround to approximate a timestamp-based start position — by identifying the LSN that corresponds to the desired point in time and using that LSN to resume the task.
The only prerequisite for this approach is that the DB2 transaction logs covering the target time period must still be available and accessible on the source server.
Once you have your LSN value:
DB2 tools typically display LSN values in hexadecimal. Please ensure you convert to decimal before entering the value in Qlik Replicate; the task will start from an incorrect log position.