Microsoft® SQL Server® 2012 Bible

(Ben Green) #1

923


Chapter 38: Using Profi ler and SQL Trace


38


FIGURE 38-2
The Trace Properties Events Selection page enables you to select the events tracked by
Profi ler.

Depending on the events, different data becomes relevant to the trace. The data columns
automatically offer the appropriate data. Although the SPID data column appears optional,
it’s only fooling you — it’s mandatory. A useful data column to capture is StartDate,
which is required if the trace will be correlated with Perfmon data later (explained in the
“Integrating Performance Monitor Data” section).

Filtering Events
Profiler can capture so much information that it can fill a drive with data. Fortunately, the
Profiler Trace Filter can narrow the scope of your search to the data of interest.

The filter uses a combination of equal and like operators, depending on the data types
captured. A frustrating aspect of the filter is that it works only against collected data, and
the data collected for some columns may not be what was expected. For example, if you want
to filter the trace to only those batches that reference a specific table or column, filtering by
object name won’t work. Defining a like filter using wildcards on the text data column,
however, causes Profiler to select only those batches that include that column name.

The Exclude system IDs check box sets the filter to select only user objects.

c38.indd 923c38.indd 923 7/31/2012 10:04:19 AM7/31/2012 10:04:19 AM


http://www.it-ebooks.info
Free download pdf