February 4, 2008 at 9:05 pm
A very simple way of scheduling profiler to run and stop at certain date time would be via the command prompt. I'm basically looking for a technical solution (quick and dirty, that is), not reasoning why i'm doing it this way.
My question is very simple, as M$ allows an input argument to be specified for trace stop time with "/M", but i just cant seem to get it working.
The code i'm running in command prompt is as below.
profiler90 /S (local) /O c:\trace.trc /E /M "02-06-08 03:30:00"
"02-06-08 03:30:00" = feb, 06 2008 3.30AM
When checking the launched profiler properties, it doesnt check the trace stop date time and will continue to trace all activities on the server. I've been scratching my head here figuring what's wrong. I was kind of expecting the trace to run from the moment i ran the command and stops automatically at feb, 06 2008 3.30AM, but it doesnt.
By the way, profiler90 doesnt allow scripting as its predecessor, profiler.
Thanks in advance for helping out there.
Best regards,
Simon
Simon Liew
Microsoft Certified Master: SQL Server 2008
February 8, 2008 at 1:53 am
Hi Simon,
Use Sql Agent and two jobs, one to start and one to stop at the times you want.
Build your trace in profiler and then do (after starting the trace) File-->Export-->Script Trace Definition-->For Sql...
If you modify it so save @TraceID into a table, you can do this to stop it:
sp_trace_setstatus, @TraceID, 0
to stop it and then
sp_trace_setstatus, @TraceID, 2
to close and remove teh definition.
Ed
February 8, 2008 at 4:16 pm
There is a option in profiler to specify when to stop tracing data. Can't you use that to stop your profiler activities.
Cheers,
Sugeshkumar Rajendran
SQL Server MVP
http://sugeshkr.blogspot.com
May 16, 2008 at 9:55 am
Sugesh Kumar (2/8/2008)
There is a option in profiler to specify when to stop tracing data. Can't you use that to stop your profiler activities.
The problem I encounter is that the profiler90.exe "stop time" parameter doesn't seem to work. I've tried several permutations of the documentation's [ /M "MM-DD-YY hh:mm:ss" ] parameter, but when profiler kicks off, it ignores the input parm and defaults to 1 hour from start-time.
I'm not sure the SQL Agent solution will work for me, either, since I'm trying to trace traffic on Analysis Services and not a database; I don't believe the stored procedures will help me with AS2005. It'd be great if I could find a way to automate/schedule the process.
Kurt Giambastiani
May 16, 2008 at 9:57 am
The command string I'm using is:
profiler90.exe /E /A localhost /T "AS2005UserTrace" /O "C:\AATemp\L01_2008_0516.trc" /R /Z 500 /M "05-16-08 10:00:00"
Profiler kicks off just fine, using every parameter except the /M parm.
k
May 16, 2008 at 6:08 pm
kgiambas is right, the thing with profiler90 is that the /M parameter which is supposed to be the end time for the profiler to stop doest seem to work. any hint to make it work would be great.
Cheers,
Simon
Simon Liew
Microsoft Certified Master: SQL Server 2008
July 10, 2008 at 4:02 am
HI all
After many attempt to run profiler90.exe i have found the good format for
stop time .
Profiler90.exe works fine with /M parameter
it seems that you will use msql date format like that :
profile90.exe /M"2008-07-10 20:00:00.000" /S.....
So the good date fomat is the same like getdate() output.
Regards
Muchesa
July 10, 2008 at 9:13 am
muchessa (7/10/2008)
HI allProfiler90.exe works fine with /M parameter
it seems that you will use msql date format like that :
profile90.exe /M"2008-07-10 20:00:00.000" /S.....
Brilliant, Muchessa! Thank you SO much!:D
k
July 10, 2008 at 5:41 pm
It worked brilliantly Muchesa, thanks!
Simon Liew
Microsoft Certified Master: SQL Server 2008
Viewing 9 posts - 1 through 8 (of 8 total)
You must be logged in to reply to this topic. Login to reply