Skip to main content
Announcements
Qlik Connect 2025! Join us in Orlando join us for 3 days of immersive learning: REGISTER TODAY

SQL Tlog Truncate Emergency Process

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

SQL Tlog Truncate Emergency Process

Last Update:

Feb 10, 2022 6:34:56 PM

Updated By:

Michael_Litz

Created date:

Feb 10, 2022 6:32:07 PM

Environment

  • Replicate
  • MS SQL Server - 

The information in this article is provided as-is and to be used at own discretion. Depending on tool(s) used, customization(s), and/or other factors ongoing support on the solution below may not be provided by Qlik Support.

Emergency Truncate of SQL Server TLOG

Without going into the many different reasons why a MS SQL Server source DB TLOG is not getting truncated this article will discuss the steps needed manually truncate the log.

If you notice that the source MS SQL endpoint Database is not truncating after a DBA issues the backup/truncate command it is generally because there is an open transaction that prevents the command from archiving all of the TLOG. What you see is that the source Database TLOG is continuing to grow possibly with the undesirable result of running out of disk space.

If this is an emergency you can do the below steps: no need to stop Replicate task:

1) make sure the log reader job is stopped

2) run- EXEC sp_repldone @xactid = NULL, @xact_seqno = NULL, @numtrans = 0, @time = 0, @reset = 1

3) Do a tlog backup

4) run the log reader job again.

This is just an emergency fix to get the log to shrink.

Here are links to other articles discussing why this may happen in the first place.

Qlik Replicate: SQL Server Backup failed while Task was up and caused invalid LSN
https://community.qlik.com/t5/Knowledge/Qlik-Replicate-SQL-Server-Backup-failed-while-Task-was-up-an...

5 Tips for Replicate task configuration with MS SQL server as Source
https://community.qlik.com/t5/Knowledge/5-Tips-for-Replicate-task-configuration-with-MS-SQL-server-a...