DBLense SQL Server Log Reader — User Guide

Read and analyze SQL Server transaction logs from online databases, .ldf log files, and backup files. Generate undo/redo recovery scripts, perform point-in-time analysis, and audit data changes with a visual timeline.

Overview

DBLense SQL Server Log Reader uses the undocumented fn_dblog and fn_dump_dblog functions to read transaction log records directly from SQL Server. This gives you visibility into every INSERT, UPDATE, DELETE, and DDL operation recorded in the transaction log.

The tool supports on-premises SQL Server 2016+ and Azure SQL Managed Instance.

Key Use Cases


Getting Started

  1. Connect to SQL Server — Click the Connect button and enter your server details. Supports Windows, SQL, and Azure Entra ID authentication.
  2. Select a Database — Choose the database whose transaction log you want to read from the database dropdown.
  3. Choose Log Source — Select “Online Database” to read the active transaction log, or “Log/Backup File” to read an offline .ldf or .bak file.
  4. Read Log — Click Read Log to begin reading. Log entries appear in the Log Entries tab with automatic transaction grouping.

Log Sources

SourceFunctionDescription
Online Databasefn_dblog(NULL, NULL)Reads the active transaction log of the selected database. Shows only uncommitted and recent committed transactions still in the log.
Log File (.ldf)fn_dump_dblogReads a detached transaction log file. Requires sysadmin privileges. The file path must be accessible to the SQL Server service account.
Backup File (.bak)fn_dump_dblogReads transaction log records from a full or log backup. Useful for analyzing historical changes from backup files.

Log Entries Tab

The primary view showing individual log records:

Operation Color Coding

OperationColorExamples
INSERTGreenLOP_INSERT_ROWS
UPDATEOrangeLOP_MODIFY_ROW, LOP_MODIFY_COLUMNS
DELETERedLOP_DELETE_ROWS
DDLBlueLOP_CREATE_TABLE, LOP_ALTER_TABLE

Transactions Tab

Groups log entries by transaction for a higher-level view:


Timeline Tab

Visual timeline of transaction activity:


Recovery Tab

Generate and export recovery scripts:

Point-in-Time Recovery

Enter a target date/time and table name to generate a recovery script that undoes all committed transactions after that point. The generated script includes:

Transaction Recovery

Select a transaction from the dropdown and generate an Undo script (reverse the transaction) or Redo script (replay the transaction).

Export Buttons


Filtering

FilterDescription
Time RangeFrom/To date pickers to narrow log entries by time window
Table NameShow only entries affecting a specific table
Login NameShow only entries from a specific login
Transaction IDShow only entries belonging to a specific transaction
Operation TypesToggle Inserts, Updates, Deletes, and DDL operations on/off
Search TextFree-text search across all log entry fields

Export Options

FormatDescription
CSVComma-separated values with all log entry columns. Opens in Excel, Google Sheets, etc.
SQL ScriptT-SQL recovery script (.sql file) with undo/redo/point-in-time operations
HTML ReportDark-themed HTML report with summary cards and detailed entry/transaction tables. Capped at 5,000 rows for performance.

Command-Line Arguments

DBLenseLogReader.exe [-s server] [-u user] [-p password] [-e]
ArgDescription
-s, --serverSQL Server name to connect to on startup
-u, --userSQL login username (implies SQL Auth)
-p, --passwordSQL login password
-eUse Windows Authentication (default)

Troubleshooting

IssueSolution
"fn_dblog access denied"Ensure you have VIEW SERVER STATE permission. Some environments require sysadmin.
"fn_dump_dblog failed"Requires sysadmin role. Verify the file path is accessible to the SQL Server service account.
No log entries returnedThe transaction log may have been truncated. Active transactions and recent committed transactions are visible in SIMPLE recovery model; switch to FULL recovery model for complete history.
Empty table/login columnsSome log operations (e.g., LOP_BEGIN_XACT, LOP_COMMIT_XACT) don’t have associated table or login metadata.
Large log takes long to readUse time-range filters before reading to limit the scope. The progress bar shows reading status.
Recovery script errorsReview the generated script before executing. Table or column changes since the logged operation may require manual adjustments.

System Requirements

ComponentRequirement
OSWindows 10/11 or Windows Server 2016+
Runtime.NET 8.0 (or self-contained package)
SQL ServerSQL Server 2016+ (for fn_dblog / fn_dump_dblog)
AzureAzure SQL Managed Instance (online log only)
PermissionsVIEW SERVER STATE (online log), sysadmin (offline files via fn_dump_dblog)
Recovery ModelFULL recommended for comprehensive log history
InstallationNone — single portable .exe