MSSQLWIKI

Karthick P.K on SQL Server

My “c:\” Drive gets full when I open the profiler trace

Posted by Karthick P.K on July 16, 2011

Profiler filling up space of my system drive…….

When you run the profiler trace (GUI) or open the saved profiler trace file your System Drive gets out of space

SQL Server profile uses ‘TMP’ Environment variable for storing the .Trc and trace replay files

$29BC399D487DBB17 

By default TMP directory points to your system drive, so when we open a large profiler trace file or capture trace in GUI mode system drive gets full.

We can workaround this by changing the TMP environment variable. Changing TMP environment variable system wide can cause other issues so I would recommend changing TMP temporarily for the process

1. Open command prompt

SET TMP=G:\TMP

$130609A642FEC889

2. Open the profiler from command prompt

>Profiler90.exe         –>SQL Server2005

>Profiler.exe             –>SQL Server2008

>Mysavedtracefile.trc –>Open a saved tracefile

$4C3BC270A299D0A3

This would make profiler use G:\TMP  for saving temporary data. So your c:\ would never get full.

5 Responses to “My “c:\” Drive gets full when I open the profiler trace”

  1. Sylvester said

    Nice article. This was exactly what I need. However, my temp files are still writing to my C drive. Any other ideas. I have tried
    http://msdn.microsoft.com/en-us/library/ms174203.aspx
    and your article and it’s still increasing the size of my c drive..

  2. Sylvester said

    I finally used process monitor from SysInternals to see what directory it was writing to. It was actually writing to my local user directory. So, I followed the directions in the below link, but changed the User variables instead of the System variables and my temp files started getting copied to the appropriate directory after that.

    • Jay Nagda said

      What exactly you did when you mentioned that you changed the user variables instead of system variables?

      • Max N said

        I had the same problem. Here is how I solved it:
        Right Click (my) Computer > Properties > (left panel) Advanced system settings
        In System Properties window, click Advanced tab > Environment Variables (bottom)
        Change User variables:
        TEMP (the value for this to a drive which has enough space)
        TMP (the value for this to a drive which has enough space)

        Change System variables:
        TEMP (the value for this to a drive which has enough space)
        TMP (the value for this to a drive which has enough space)

        I then logged off and then logged back on and opened the trace file (in my case, trace table).

        After I was done using the trace file, I reverted all these changes to what it was before.

  3. […] My “c:” Drive gets full when I open the profiler trace […]

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

 
%d bloggers like this: