Replaying Traces

When you create or edit a trace, you can save the trace to replay it later. SQL Server Profiler features a multithreaded playback engine that can simulate user connections and SQL Server Authentication, allowing the user to reproduce the activity captured in the trace. Therefore, replay is useful when troubleshooting an application or process problem. When you have identified the problem and implemented corrections, run the trace that found the potential problem against the corrected application or process, then replay the original trace to compare results.

Trace replay supports debugging using break points and run-to-cursor, which especially improves the analysis of long scripts. For more information, see Single-Stepping Traces.

Replay Requirements

In addition to any other event classes you want to monitor, the following event classes must be captured in a trace to allow the trace to be replayed:

In addition to any other data columns you want to capture, the following data columns must be captured in a trace to allow the trace to be replayed:


Note Use the sample trace definition Sample 6-TSQL for Replay as a template for traces to capture data for replay.


In order to replay a trace against a computer running Microsoft® SQL Server™ (the target), other than the computer originally traced (the source):

Replaying events associated with missing or incorrect logins will result in replay errors, but the replay operation will continue.

In order to replay a trace against a computer running SQL Server (the target), other than the computer originally traced (the source), either:

Replay Options

Before replaying a captured trace, you can specify:

Replay Considerations

SQL Server Profiler cannot replay traces:

Additionally, SQL Server Profiler cannot replay SQL Trace .log files that contain SQL Server 6.5 server-side cursor statements (sp_cursor).

Unexpected results or replay errors can occur when replaying a trace containing the Sessions event classes (Connect, Disconnect, and Existing Connection) if the Binary Data data column is not also captured in the trace. The Binary Data data column, for the Session event classes, contains information required to set ANSI nulls, ANSI padding, cursor close on commit, concat null yields null, and quoted identifier session settings. For more information, see SET.

When replaying a trace containing concurrent connections, SQL Server Profiler creates a thread for each connection. Therefore, system performance of the computer replaying the trace can be affected if the trace contains many concurrent connections. To reduce the effect on system performance, filter the trace by specifying a value(s) for the Application Name, SQL User Name, or another data column captured in the trace, to focus the trace on only those events you need to monitor.

To replay a trace

To set the synchronization level

To set a replay rate

To select an output file

See Also
bcp Utility sp_defaultdb
BULK INSERT UPDATETEXT
Full-text Indexes WRITETEXT
READTEXT  

  


(c) 1988-98 Microsoft Corporation. All Rights Reserved.