Share via


Replay a Trace File (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 file

  1. On the File menu, point to Open, and then click Trace File. Select a trace file that contains the event classes necessary for replay.

  2. On the Replay menu, click Start, and connect to the server instance where you want to replay the trace.

  3. In the Replay Configuration dialog box, on the Basic Replay Options tab, specify the Replay server. Click Change to change the server displayed in the Replay server box.

  4. 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.

  5. Choose either Replay the events in the order they were tracedor Replay events using multiple threads. The following table explains the difference between these settings.

    Option Description
    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.
  6. Select Display replay results to view the replay as it occurs.

  7. Optionally click the Advanced Replay Optionstab to configure 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 the replay by date and time. Select a date and time for the Start timeand End timeto specify the time period to include in the replay.

    • To control how SQL Server manages processes during replay, configure Health Monitor Options.

See Also

Permissions Required to Run SQL Server Profiler
Replay Traces
Open a Trace File (SQL Server Profiler)
SQL Server Profiler