how to automate profiler

  • I am Term.Serv into a SQL box, and started profiler.  I did set the Profiler stop time to be 2 days from now.   But, as soon as my term.serv connection closes, the profiler stops running.

    Is there a way, to automate profiler running ?  thanks for your help. 

  • check sp_trace_create

    Shas3

  • SQL 2K Profiler has a script option so you can create and script out the trace. Then put it in a job. I don't know if the older versions of Profiler have the script option.

    MG

    "There are two ways of constructing a software design. One way is to make it so simple that there are obviously no deficiencies. And the other way is to make it so complicated that there are no obvious deficiencies."
    Tony Hoare

    "If you think it's expensive to hire a professional to do the job, wait until you hire an amateur." Red Adair.

  • You should set off your Profiler and then disconnect instead of logging off in terminal services.  When you log off your session closes and anything you are doing stops too.  Just pick disconnect.  However, this will hold a session open and could potentially cause others to not be able to TS into the box.

  • I would do MG's method but make sure to read about those procs from BOL as Shas3 recommended. First make a proc to save the profile as a file or table and then you can make a DTS package to collect data from different servers if you have multiple servers.

    One thing to remind is that if you have high traffic, you don't want to run profile all the time, you can run 1min duration every 10min or so. In order to do that, read about "exec sp_trace_setstatus" proc.

    As you know, depends on filter, it can hurt server very badly if you are not careful about that.

Viewing 5 posts - 1 through 4 (of 4 total)

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