How to: Replay a Trace Table (SQL Server Profiler)
Replay is the ability to open a saved trace and replay it again. SQL Server Profiler features a multithreaded playback engine that can simulate user connections and SQL Server Authentication. Replay is useful to troubleshoot an application or process problem. When you identify the problem and implement corrections, run the trace that found the potential problem against the corrected application or process. Then, replay the original trace and compare results.
In addition to any other event classes you want to monitor, specific event classes must be captured to enable replay. These events are captured by default if you use the TSQL_Replay trace template. For more information, see Replay Requirements.
To replay a trace table
Open a trace table that contains the event classes necessary for replay.
On the Replay menu, click Start, and connect to the server instance where you want to replay the trace.
In the Replay Configuration dialog box, on the Basic Replay Options tab, specify Replay server. Click Change to change the server that is displayed in the Replay server box.
Optionally, select one of the following destinations in which to save the replay:
- Save to file, which specifies a file in which to save the replay.
- Save to table, which specifies a database table in which to save the replay.
Choose either Replay the events in the order they were traced or Replay events using multiple threads. The following table explains the difference between these settings.
Replay events in the order they were traced
Replays events in the order they were recorded. This option enables debugging.
Replay events using multiple threads
This option uses multiple threads to replay each event regardless of the sequence. This option optimizes performance.
Select Display replay results to view the replay as it occurs.
Optionally, click the Advanced Replay Options tab to specify the following options:
- To replay all server process IDs (SPIDs), select Replay system SPIDs.
- To limit the replay to processes belonging to a specific SPID, select Replay one SPID only. In the SPID to replay box, type the SPID.
- To replay events that occurred during a specific time period, select Limit replay by date and time. Select a date and time for the Start time and End time to specify the time period to include in the replay.
- To control how SQL Server manages processes during replay, configure Health Monitor Options.