Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us at Qlik Connect 2026 in Orlando, April 13–15: Register Here!

Qlik Replicate and Qlik Talend Cloud: How to get LSN for DB2 LUW source

No ratings
cancel
Showing results for 
Search instead for 
Did you mean: 
shashi_holla
Support
Support

Qlik Replicate and Qlik Talend Cloud: How to get LSN for DB2 LUW source

Last Update:

Apr 7, 2026 3:10:24 AM

Updated By:

Sonja_Bauernfeind

Created date:

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.

Prerequisite

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.

How to obtain the LSN

Option One: db2pd (Recommended)

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).

Option Two: db2flsn Utility

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.

Option Three: SQL Query (Current LSN)

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.

Option Four: Let Qlik Replicate log it for you

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.

Configuring the LSN in Qlik Replicate

Once you have your LSN value:

  1. Open your task and click the Run drop-down > Advanced Run Options
  2. Under Tables are already loaded. Start processing changes from:, select Source change position (e.g. SCN or LSN):
  3. Enter the LSN in decimal format (e.g., 1251004137353)

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.

 

Environment

  • Qlik Replicate
  • Qlik Talend Cloud
Labels (1)
Version history
Last update:
Tuesday
Updated by: