Friday, March 30, 2012

scheduling SQL Profiler

Hi all,
Is that possible to schedule a SQL Profiler session (without to keep a
windows session) ? If yes, how ?
Thank's.
Arnaud
You can use PSSDIAG utility to run profiler and it has scheduling capability
http://support.microsoft.com/default...b;en-us;830232
To learn how to use this tool
http://msdn.microsoft.com/library/de...v_12072004.asp
Yih-Yoon Lee
My blog http://www.mssql-tools.com/blog
E-mail: yihyoon.online@.gmail.com
/* remove .online to send me e-mail */
Arnaud Demol wrote:
> Hi all,
> Is that possible to schedule a SQL Profiler session (without to keep a
> windows session) ? If yes, how ?
> Thank's.
> Arnaud
|||Arnaud Demol wrote:
> Hi all,
> Is that possible to schedule a SQL Profiler session (without to keep a
> windows session) ? If yes, how ?
> Thank's.
> Arnaud
You'll have to create a server-side trace to do this and avoid the
Profiler client. You can create the trace from Profiler and script it
out from the File Script Trace menu option. Once you have the trace
script, read about sp-trace_setstatus in BOL because you'll need to
learn how to stop a trace as well. You can then create a job in the SQL
Server Agent to execute the trace whenever you want. Stopping it is a
manual process since you'll need to know the trace handle in order to do
it. You could create a second job from the first one once you get the
handle for the trace.
You'll also need to make sure you set Profiler up to have the server
manage the trace and save the results to a file before you script out
the T-SQL.
You'll also need to look up sp_trace_gettable which allows you to read
trace files and optionally import them into a table in the database.
It will take some work to get it done, but once you understand the
process, you should have no trouble doing this on the regular basis.
David Gugick
Imceda Software
www.imceda.com
|||Sure...you can do that. They are called server side traces.
The specifics of how to run these depend upon what version
of SQL Server you are using.
With SQL Server 2000, You can start by using Profiler to
create a trace file which has your events, filters, etc.
that you want to trace. You will want to setup this trace to
be saved to a file. After you specify what you want to
trace, you can go up to the menu in Profiler to File and
select Script Trace to create a trace file definition. You
can then control and schedule the trace using the system
stored procedures that using the naming convention
sp_trace_xxxxx. You can find more information on these
stored procedures in books online. You can also find more
information in the following article:
http://support.microsoft.com/?id=822853
Towards the end of the article, there are links for
additional information.
If you are using SQL Server 7, the extended stored
procedures for controlling the traces are named
xp_trace_xxxxx.
Another difference between the two versions is that in SQL
Server 7, you can have server side traces saved directly to
a table (in 2000 you can't). But you would want to save to a
file anyway as it decreased the overhead for SQL Server.
-Sue
On Thu, 20 Jan 2005 04:15:02 -0800, Arnaud Demol <Arnaud
Demol@.discussions.microsoft.com> wrote:

>Hi all,
>Is that possible to schedule a SQL Profiler session (without to keep a
>windows session) ? If yes, how ?
>Thank's.
>Arnaud
sql

No comments:

Post a Comment