snippetMinor
How do I analyse a set of SQL Profiler-generated rolling trace files?
Viewed 0 times
generatedhowsqlrollingfilesanalyseprofilertraceset
Problem
I am trying to diagnose an issue with a production SQL Server instance. I have asked the DBA to provide a trace and have been given a set of SQL trace files (1185 files to be precise).
When I open the first file, SQL Profiler detects presence of additional trace files and prompts me to load the one by one - this approach does not scale to 1185 files.
Ultimately, what I want is to import all that trace data into SQL server so I can query it.
Can you recommend an approach or tool that would allow me to do this?
When I open the first file, SQL Profiler detects presence of additional trace files and prompts me to load the one by one - this approach does not scale to 1185 files.
Ultimately, what I want is to import all that trace data into SQL server so I can query it.
Can you recommend an approach or tool that would allow me to do this?
Solution
The following will insert the entire set of files into a table of your choosing. Then you can query. Please do this on a dev instance.
SELECT *
INTO [Database].[schema].[table]
FROM ::fn_trace_gettable('\path\to\tracefile1.trc', default)Code Snippets
SELECT *
INTO [Database].[schema].[table]
FROM ::fn_trace_gettable('\path\to\tracefile1.trc', default)Context
StackExchange Database Administrators Q#28810, answer score: 5
Revisions (0)
No revisions yet.