22 June 2007 10:02
tonyrogerson
Reading large Profiler Trace files
What was I thinking? I double clicked on a profiler trace file, only 5GB and up it started to come in Profiler; I got distracted (the kettle boiled) and came back and realised my machine was strugglging a bit - strange, its a good workstation - 4GB, fast AMD etc...
Oh dear, then it dawned on me what I'd done, I was opening a 5GByte file in Profiler - it's trying to load it all into memory - lol - whoops....
What I should have done is this...
SELECT *
INTO prof
FROM fn_trace_gettable('d:\temp\TraceActivity.trc', default);
GO
I guess the real advice here is this a) shouldn't be done on your live server unless you are using smaller trace files (10's-100'sMBytes depending on how much memory you have and how busy your system is) and b) profile into a table in the first place, in a database (and preferably a different server) so all you need to do is back it up, zip and send; or analyse away. Alas, if you are using server based traces rather than through profiler you have little choice than the file approach.
There was a really useful tool for loading the files and parsing the contents so you can group queries but I can't find it - if anybody knows then please feel free to comment.
Tony.
Filed under: SQL Server