SQL Server Performance Forum – Threads Archive
How to schedule ProfilerHi Folks,
I want to trace few parameter on a particular database for 15 days between 2pm t0 5pm. Is it possible to schedule the profiler for this particular task? Can some one give me steps to schedule the profiler for 15 days, which should run between 2 to 5? This is for SQL SERVER 2005.
use sql trace sps… refer these links http://vyaskn.tripod.com/server_side_tracing_in_sql_server.htm
As normal start the SQL Server Profiler â€¦ Define your trace â€¦ Use the File | Export | Script Trace Definition â€¦ run the script in the server. Don#%92t forget to put in the filename in the script file. With sp_trace_create inside the script you define time for running the trace. When you are done load the information to analyse database with
SELECT IDENTITY(int, 1, 1) AS FooNumber, *
FROM fn_trace_gettable(‘c:foo.trc’, DEFAULT) Or SELECT IDENTITY(int, 1, 1) AS FooNumber, *
FROM fn_trace_gettable(‘c:foo.trc’, DEFAULT) AS t
INNER JOIN sys.trace_events AS e
ON e.trace_event_ID = t.EventClass Use the EXEC sp_trace_setstatus run and stop the trace.
Use a server side trace and kick it off with a scheduled proc. See:
for details. Michael
MCDBA "The statistics on sanity are that one out of every four persons is suffering from some sort of mental illness. Think of your three best friends — if they’re okay, then it’s you!"