Automatically Process SQL Server Trace Files

By Bill Graziano on 15 September 2004 | Tags: Profiler & Trace


This is a repost from my weblog. I've been working on a small utility to process SQL Server trace files. If you use scripted traces to generate trace files there's no automated way to get these into a SQL Server table. I wrote a little .NET utility to do it for me that I'm calling ClearTrace. You can download it here. Currently it's a command line utility and is still considered beta. In the future I plan to rewrite it as a service and add better error checking.

ClearTrace should run on an admin workstation and not on the server. It watches trace files based on a filter you specify. It's best to share out the directory where your trace files are stored. After each trace file is completed and the system rolls over to the next trace file, ClearTrace will process the trace. It will be moved to a working directory and renamed with a time stamp appended to the file name. ClearTrace will then load the trace file into a specified table on a specified server. If the table doesn't exists, ClearTrace will create it for you. It can handle an unlimited number of traces each going to its own SQL Server and table. After the trace file is loaded, ClearTrace will move the file to an archive directory. Each trace can specify its own working and archive directories. Each trace can also specify how long to retain the archived trace files before they're deleted.

If you find any problems, please let me know. I'd also be interested in feedback on whether this is a useful application or not. At this point the source code isn't available but I may make it available in the future.


Related Articles

Testing with Profiler Custom Events and Database Snapshots (22 June 2009)

Introduction to SQL Server 2008 Extended Events (19 May 2009)

Integrating Profiler and PerfMon Log Files (6 February 2008)

Examining SQL Server Trace Files (15 May 2006)

Summarizing SQL Server Trace Files (or Read80Trace for SQL Server 2005) (10 April 2006)

Reading a Trace File using C# in SQL Server 2005 (25 October 2004)

PASS 2004 Presentation: Profiler and Trace in SQL Server 2005 (3 October 2004)

Bill Graziano's Advanced Profiler PASS Presentation (13 November 2003)

Other Recent Forum Posts

Cannot Show requested dialogue - Timeout Expired. The Timeout priod elapsed prior to completion of the operation or the server is not responding (5h)

Basic SQL query? (17h)

T-sql - we created Message from app1 and trying to disable from app2 (1d)

SQL select Top 10 records for unique combination of two columns (1d)

SSRS Report Sorting with Grouping Issue (2d)

ORA-01476: divisor is equal to zero (2d)

Create new columns based on min and max values of a record with multiple rows (2d)

Memory Required for Reporting Services 2022 (2d)

- Advertisement -