How to schedule Profiler | SQL Server Performance Forums

SQL Server Performance Forum – Threads Archive

How to schedule Profiler

Hi 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
http://msdn2.microsoft.com/en-us/library/ms191006.aspx
Madhu
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, *
INTO fooTable
FROM fn_trace_gettable(‘c:foo.trc’, DEFAULT) Or SELECT IDENTITY(int, 1, 1) AS FooNumber, *
INTO fooTable
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:
http://vyaskn.tripod.com/server_side_tracing_in_sql_server.htm
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!"
]]>