Write for Us
The Profiler can store the data it captures in a text file or in a SQL Server table. For fastest performance and to use the fewest resources, you should store your data in a text file, not in a SQL Server table, on a computer other than the SQL Server being traced.
If you do decide to store the Profiler data in a SQL Server table, don't store it in a database on the same server you are profiling, as it could negatively affect the performance of the that server. Instead, store the trace in a database on another SQL Server that you have created especially for this purpose. [7.0, 2000, 2005] Updated 1-6-2006
*****
When running the Profiler, do not select more data than you need to collect. The more you collect, the more resources you will use, slowing down performance. This includes only selecting those events and data columns you really need. In addition, if you don't need to collect all events, you can use filters to reduce the amount of events you collect.
For example, one of the best ways to exclude unwanted data from your Profiler traces is to exclude the Enterprise Manager, Profiler, SQL Agent, and Query Analyzer events using the "ApplicationName" Not Like filter, such as:
Of course, you may want to trace these, but in most cases you won't, and getting rid of them will reduce the load placed on your server by Profiler. [7.0, 2000, 2005] Updated 1-6-2006
These SQL Server Profiler event classes can be used to help you find out if SQL Server is running as efficiently as it can. They include:
If you haven't done so already, trace these events on one of your busier databases and see what's going on. You may be surprised. [7.0, 2000, 2005] Updated 1-6-2006
You don't have to run the Profiler from the GUI interface. If you like, you can control it by using a number of available extended stored procedures, such as xp_sqltrace in SQL Server 7.0; or any number of system stored procedures in SQL 2000/2005, such as sp_trace_create. (Note: SQL Server 7.0 uses extended stored procedures and SQL 2000 uses system stored procedures.) One of the advantages of using the Profiler's extended stored procedures instead of the GUI is that you can easily schedule the Profiler to automatically collect data at regular intervals throughout the day. In addition, these procedures use less server resources than does the Profiler tool itself.
For example, say you are wanting to collect trace data to feed the Index Tuning Wizard or Database Engine Tuning Advisor. In order for these tools to do a good job, it is important that the trace file it uses as its data be representative of the types of queries run throughout the day. Given this scenario, you might want to use the SQL Server Agent to schedule the appropriate Profiler extended or system stored procedures to run at regular intervals throughout the day, collecting a good representation of trace data to feed to the Index Tuning Wizard. Check the SQL Server Books Online for a listing of the various Profiler system and extended stored procedures.
Because Profiler traces can be called from extended or stored procedures, you can also include them in your applications, scripts, and stored procedures. If you find that you run a particular trace very often, you might be better off in the long run to create a custom stored procedure that runs the trace for you, instead of using the Profiler GUI each time. [7.0, 2000, 2005] Updated 1-6-2006
Next Page>>