DBLense Trace Replay — User Guide

Capture SQL Server Extended Events traces and re-execute them against a target instance using a multi-threaded engine that simulates concurrent user connections.

Overview

DBLense Trace Replay captures SQL Server Extended Events traces and replays them against a target server. It works with both on-premises SQL Server and Azure SQL Managed Instances.

Key Use Cases


Getting Started

  1. Connect to Source Server — The connection dialog appears on startup. Enter the source SQL Server where you want to capture traces.
  2. Set Target Server — Click "Set Target Server" in the header bar to configure the replay destination.

All four authentication modes are supported: Windows, SQL Server, Azure Entra ID (Password), and Azure Entra ID (MFA).


Capture Tab

Creating a New Capture Session

  1. Enter a Session Name (default: DBLenseTraceCapture)
  2. (Optional) Set a Database Filter to capture only events from a specific database
  3. (Optional) Set a Min Duration filter (in microseconds) to skip fast queries
  4. Configure storage target:
    • On-premises: Enter a File Target Path (e.g., C:\Traces\), or leave empty for ring_buffer
    • Azure MI: Use ring_buffer (default) or enter an Azure Blob Storage URL
  5. Click Create & Start to begin capturing

Captured Event Types

EventPurpose
sqlserver.rpc_startingStored procedure calls (start)
sqlserver.rpc_completedStored procedure calls (completed with metrics)
sqlserver.sql_batch_startingAd-hoc SQL batches (start)
sqlserver.sql_batch_completedAd-hoc SQL batches (completed with metrics)
sqlserver.sql_transactionTransaction begin/commit/rollback

Each event captures: session_id, database_name, sql_text, username, client_hostname, duration, cpu_time, logical_reads, physical_reads, writes, row_count.

Stopping and Reading Events

  1. Execute your workload on the source server while capture is running
  2. Click Stop Capture when done
  3. Click Read Events to load captured events into the grid

Reading from Existing Sessions

If you already have an Extended Events session running, select it from the Existing XE Sessions dropdown and click Read From Selected Session.


Replay Tab

Configuration Options

OptionDescriptionDefault
Target DatabaseOverride original database for all events(use original)
Max Concurrent ThreadsNumber of simultaneous connections10
Speed Factor0 = max speed, 1.0 = real-time, 2.0 = double speed0
Command TimeoutSeconds before query times out120
Max ErrorsStop after this many errors (0 = unlimited)100
Dry RunWrap each query in a rolled-back transactionOff
Preserve Session OrderGroup events by SPID and replay in orderOn
Skip System QueriesFilter out sp_reset_connection, SET commands, etc.On

Starting Replay

  1. Ensure you have captured/loaded events
  2. Ensure target server is configured
  3. Configure replay options
  4. Click Start Replay

Live Results

The replay grid shows results in real-time:

Click Export CSV to save all replay results.


Summary Tab

After replay completes:


Azure SQL Managed Instance

The tool automatically detects Azure MI (Engine Edition = 8) and:

Tips for Azure MI


Command-Line Arguments

DBLenseTraceReplay.exe [-s server] [-u user] [-p password] [-e]
ArgDescription
-s, --serverSource server name
-u, --userSQL login username
-p, --passwordSQL login password
-eUse Windows Authentication

Troubleshooting

IssueSolution
"Cannot create event session"Ensure you have ALTER ANY EVENT SESSION permission
No events capturedCheck the database filter; ensure workload is running
Azure MI file target errorUse ring_buffer or Azure Blob Storage URL
High error count during replayCheck target database exists; verify permissions; increase command timeout
Missing events in ring_bufferring_buffer has size limits; increase buffer or use file/blob target

System Requirements

ComponentRequirement
OSWindows 10/11 or Windows Server 2016+
Runtime.NET 8.0 (or self-contained package)
SQL ServerSQL Server 2012+ (for Extended Events)
AzureAzure SQL Managed Instance (fully supported)
PermissionsALTER ANY EVENT SESSION on source; appropriate permissions on target
InstallationNone — single portable .exe