Create trace problem

  • I am trying to create a trace using the following where @outputfilename is "\\mycomputer\mysharedfolder\tracefilename"

    exec @rc = sp_trace_create @TraceID output, 0, @OutputFileName, @MaxFileSize, @EndTime

    The problem is that it does not create the file in that location and yet the trace is running on the serve

    I have given full permission to "everyone" on that folder.

    If I create a file named "tracefilename.trc" manually and then run the trace, it gives me a message that the file already exists.

    Any ideas???

    Thanks.

  • Sounds like you already have a trace running that's outputting to your desired filename.

    What are the results of: select * from sys.traces

  • Did you remember to turn the trace on? sp_trace_setstatus needs to be run to turn it on. Till you do that, it won't create any files.

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • The trace is running but it does not create the file.

  • When you run this: select * from sys.traces

    What is in "path" ?

  • It is working and it is now creating the files. I have not made any changes since yesterday and this morning it is working and i have no clue why. But now when I try to open the trace file it gives me a message "There was a problem sending the command to the program". It is trying to open the file thru ATL/MFC Trace Tool. Any ideas?

    Thanks for your time.

  • I'm not familiar with that tool. I use SQL profiler to open the .trc file

  • Thanks.

  • Can you please post the script I want to see a sample so I can modify the file size

  • You can try stopping and closing the trace. Then try again. I am not sure what your whole trace setup looks like, but you need to add events, columns, filters, etc. Here is an article that goes into the basics of tracing with SQL commands:

    SQL Performance Trace

    Microsoft's articles are really good as well.

    Jason

    Webmaster at SQL Optimizations School

Viewing 10 posts - 1 through 9 (of 9 total)

You must be logged in to reply to this topic. Login to reply