QL Trace is a graphical utility used to monitor database activity. The monitoring can be done in real-time or on particular users, applications, or hosts. This utility can be used only with SQL Server 6.5 servers.
The name of the SQL Trace executable file is SQLTRACE.EXE and it is located in the SQL Server BINN directory. By default, the SQL Server 6.5 installation will place a shortcut to SQL Trace in the SQL Server program group. This (or another) shortcut can be used to start the utility or it can be started from the command line. Figure D.1 shows SQL Trace immediately after it is started.
FIG. D.1
When started, SQL Trace will prompt the user to log on.
After successfully connecting to a database, the user is prompted to select which defined filters should be started (see Figure D.2). If no filters are defined, this dialog box does not appear.
FIG. D.2
Filters can begin monitoring a database as soon as the user successfully logs in
to that database.
Filters can now be added, deleted, edited, started, stopped, and paused. In addition, several other utilities can be started from within SQL Trace:
NOTE: When starting an ISQL/w session from within SQL Trace, ISQL/w will attempt to log in with the login information used to connect SQL Trace to a SQL Server database.
The SQL Trace interface is divided into two sections:
Activities that meet a filter's criteria are displayed in the active filter pane. The name of the filter being displayed is shown in the title bar. Later, in the "Setting Up a Filter" section, filters will be explained in more detail.
At the bottom of the SQL Trace window is the filter status pane. This pane is made up of several items that display information about filters defined for the current server. Figure D.3 shows a SQL Trace window with an active filter pane and filter status pane visible.
FIG. D.3
The filter status pane can be toggled between visible and invisible.
The filter status bar tracks the following information about defined filters for the current server:
To create a new filter, follow these steps:
FIG. D.4
Filters can be added or deleted form the New Filter dialog box.
FIG. D.5
SQL and RPC statements that contain a specified string value can be filtered.
SQL Trace is a simple but powerful tool. You can use it for many purposes. You can debug applications more simply by using SQL Trace to monitor SQL statements issued from an application. You can address performance issues by recording a particular user's activity. And you can enhance security by checking for dangerous activity on a server.
© Copyright, Macmillan Computer Publishing. All rights reserved.