INF: SQLProfiler From Command Line Parameters to Temp File Usage

ID: Q214799


The information in this article applies to:
  • Microsoft SQL Server version 7.0


SUMMARY

The following article describes the different command line parameters, temporary file usage, and other specific processing methods used by the SQLProfiler utility.


MORE INFORMATION

Reseting Client Preferences

The SQLProfiler, Sqltrace.exe utility, supports the command line switch "/clean" to reset client preferences. These include the following:
  • Font size and name.


  • Start minimized.


  • Tabular Data Stream (TDS) Packet size.


The following registry key and all of its children are cleared:

HKEY_CURRENT_USER\SOFTWARE\Microsoft\MSSQLServer\SQLServerProfiler\Client
To reset the SQLProfiler client preferences use the following command line:
c:\mssql7\binn\sqltrace.exe /clean

Command Line Parameters

SQLProfiler supports command line parameters to allow automatic activities. This article details the parameters and their usage.

IMPORTANT: All command line arguments must use the '/' separator. The dash ('-') is not a supported command line separator by SQLProfiler.

Argument Description
S Starts a trace for the specified trace definition created from a File/New operation. Passing an invalid trace name simply opens an empty MDI window.

Example: sqltrace.exe /SSample1 - TSQL
F Opens the specified trace file. If there is another SQLProfiler running, it attempts to send the information to the SQLProfiler session that is already running instead of starting a second SQLProfiler session.

Example: sqltrace.exe /Fc:\temp\test.trc
D Opens the specified trace definition file. If there is another SQLProfiler running, it attempts to send the information to the SQLProfiler session that is already running instead of starting a second SQLProfiler session. The trace definition file can be created from the File/Export menu option.

Example: sqltrace.exe /Dc:\temp\test.tdf

Use of Temporary Files

SQLProfiler takes advantage of temporary files to handle certain trace and replay activities.

  1. When performing a replay you can specify the output file for the selected results. This file is originally created as a temporary file and through a series of steps renamed to the specified file. The original temporary file name is the specified output file extension plus a system generated value + ".tmp".

    For example, ResultsOutput.trc would result in trc##.tmp where the ## is the system generated value. The file will be created in the specified output location.


  2. When handling a trace window there can be "NODES." In short, a node is generally a tree entry that can be expanded. The siblings and node information is controlled by a file named "tre" + a system generated value + ".tmp".

    For example: tre12.tmp

    The file is:

    • Used as a memory mapped file to track the node information.


    • Always created in the specified TEMP location.


    • Can result in a large temporary file. (For example, a 75MB trace can produce a 19MB temporary file. Approximately 25% is a reasonable estimate.)


    When you are running SQLProfiler, make sure that your default temporary location has plenty free space. To locate your default TEMP directory, in the Control Panel dialog box, select the System icon. In the System dialog box, click the Environment tab. The variable is located in the box under User variables for <name>. The default path for Windows NT is the %systemdrive%\TEMP location.


Asynchronous Processing

The SQLProfiler performs most activities on worker threads allowing asynchronous activities to take place. When you open a trace file, the screen is populated by a background thread. If you attempt to go to the end of the file before the file is completely loaded, you are taken to the end of the currently loaded data. One indication that the file is displaying completely is the enabling of the REPLAY button on the window toolbar.

Additional query words:

Keywords : kbSQLServ700
Version : winnt:7.0
Platform : winnt
Issue type : kbinfo


Last Reviewed: April 1, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.