Friday, March 9, 2012

Microsoft.SqlServer.Management.Trace.TraceServer - Examples ?

I'm trying to find ANY examples of using the
Microsoft.SqlServer.Management.Trace namespace.
What I'm looking for is an example of being able to create and initialise a
new trace, haing this processed on the Server, and then initializes some
sort of traceReader against this.
e.g the equivalent of:
MyTraceConnection = new Something ("localhost");
MyTrace = new SqlTrace (CaptureTSQL || CaptureLogonEvent ||
CaptureLogoutEvent 0)
MyTrace.Open(MyTraceConnection)
OnTraceEvent (TraceInfo x) {
Console.Writeline ( x.ToString() ) ;
}
Any examples ? There seems to be nothing in MSDN, or SQL2005 info.
Thanks
StevenHello Steven,
I found the following link for your reference:
Trace and Replay Objects: A New API for SQL Server Tracing and Replay
http://msdn.microsoft.com/library/d...-us/dnsql90/htm
l/SQLTrcRpOb.asp
Hope this is helpful.
Best Regards,
Peter Yang
MCSE2000/2003, MCSA, MCDBA
Microsoft Online Partner Support
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
========================================
=============
This posting is provided "AS IS" with no warranties, and confers no rights.
| Reply-To: "Steven Wilmot" <steven-news@.wilmot.me.uk>
| From: "Steven Wilmot" <Steven_W@.newsgroups.nospam>
| Subject: Microsoft.SqlServer.Management.Trace.TraceServer - Examples ?
| Date: Tue, 15 Nov 2005 01:15:01 -0000
| Lines: 26
| Organization: Data Utilities Ltd
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2900.2670
| X-RFC2646: Format=Flowed; Original
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670
| Message-ID: <u8YSyHY6FHA.2040@.TK2MSFTNGP14.phx.gbl>
| Newsgroups: microsoft.public.sqlserver.programming
| NNTP-Posting-Host: wilmot.me.uk 217.169.5.59
| Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP14.phx.gbl
| Xref: TK2MSFTNGXA02.phx.gbl microsoft.public.sqlserver.programming:562129
| X-Tomcat-NG: microsoft.public.sqlserver.programming
|
| I'm trying to find ANY examples of using the
| Microsoft.SqlServer.Management.Trace namespace.
|
| What I'm looking for is an example of being able to create and initialise
a
| new trace, haing this processed on the Server, and then initializes some
| sort of traceReader against this.
|
| e.g the equivalent of:
| MyTraceConnection = new Something ("localhost");
| MyTrace = new SqlTrace (CaptureTSQL || CaptureLogonEvent ||
| CaptureLogoutEvent 0)
| MyTrace.Open(MyTraceConnection)
|
| OnTraceEvent (TraceInfo x) {
| Console.Writeline ( x.ToString() ) ;
| }
|
| --
|
| Any examples ? There seems to be nothing in MSDN, or SQL2005 info.
|
| Thanks
|
| Steven
|
|
||||"Peter Yang [MSFT]" <petery@.online.microsoft.com> wrote in message
news:j2Y1oKb6FHA.1240@.TK2MSFTNGXA02.phx.gbl...
> Hello Steven,
> I found the following link for your reference:
> Trace and Replay Objects: A New API for SQL Server Tracing and Replay
> [url]http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnsql90/htm[/ur
l]
> l/SQLTrcRpOb.asp
> Hope this is helpful.
>
Excellent
It is just a shame that there doesn't seem to be a way to create a TDF file
without using SQL Profiler
(and nothing to suggest who the ServerTraceEvent class should be used)
S.|||Hello Steven,
Thank you for your feedback on this and rest assured it is routed to the
proper channel. Also, it is suggsted that you use template to define events
you want to monitor in this situation. :-)
Regards,
Peter Yang
MCSE2000/2003, MCSA, MCDBA
Microsoft Online Partner Support
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
========================================
=============
This posting is provided "AS IS" with no warranties, and confers no rights.
| Reply-To: "Steven Wilmot" <steven-news@.wilmot.me.uk>
| From: "Steven Wilmot" <Steven_W@.newsgroups.nospam>
| References: <u8YSyHY6FHA.2040@.TK2MSFTNGP14.phx.gbl>
<j2Y1oKb6FHA.1240@.TK2MSFTNGXA02.phx.gbl>
| Subject: Re: Microsoft.SqlServer.Management.Trace.TraceServer - Examples ?
| Date: Tue, 15 Nov 2005 20:35:12 -0000
| Lines: 24
| Organization: Data Utilities Ltd
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2900.2670
| X-RFC2646: Format=Flowed; Original
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670
| Message-ID: <O$dNTQi6FHA.4076@.tk2msftngp13.phx.gbl>
| Newsgroups: microsoft.public.sqlserver.programming
| NNTP-Posting-Host: wilmot.me.uk 217.169.5.59
| Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msftngp13.phx.gbl
| Xref: TK2MSFTNGXA02.phx.gbl microsoft.public.sqlserver.programming:562415
| X-Tomcat-NG: microsoft.public.sqlserver.programming
|
|
| "Peter Yang [MSFT]" <petery@.online.microsoft.com> wrote in message
| news:j2Y1oKb6FHA.1240@.TK2MSFTNGXA02.phx.gbl...
| > Hello Steven,
| >
| > I found the following link for your reference:
| >
| > Trace and Replay Objects: A New API for SQL Server Tracing and Replay
| >
http://msdn.microsoft.com/library/d...-us/dnsql90/htm
| > l/SQLTrcRpOb.asp
| >
| > Hope this is helpful.
| >
|
| Excellent
|
| It is just a shame that there doesn't seem to be a way to create a TDF
file
| without using SQL Profiler
|
| (and nothing to suggest who the ServerTraceEvent class should be used)
|
| S.
|
|
||||"Peter Yang [MSFT]" <petery@.online.microsoft.com> wrote in message
news:csfytqp6FHA.1236@.TK2MSFTNGXA02.phx.gbl...
> Hello Steven,
> Thank you for your feedback on this and rest assured it is routed to the
> proper channel. Also, it is suggsted that you use template to define
> events
> you want to monitor in this situation. :-)
>
Is the format of a TDF file defined anywhere ?|||Hello Steven,
To my knowledge, there is no public document on format of TDF. You shall
use SQL profiler to create a new TDF file you want. Also, you could use the
Send Feedback button from the SQL Server Books Online. Have a great day!
Regards,
Peter Yang
MCSE2000/2003, MCSA, MCDBA
Microsoft Online Partner Support
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
========================================
=============
This posting is provided "AS IS" with no warranties, and confers no rights.
| Reply-To: "Steven Wilmot" <steven-news@.wilmot.me.uk>
| From: "Steven Wilmot" <Steven_W@.newsgroups.nospam>
| References: <u8YSyHY6FHA.2040@.TK2MSFTNGP14.phx.gbl>
<j2Y1oKb6FHA.1240@.TK2MSFTNGXA02.phx.gbl>
<O$dNTQi6FHA.4076@.tk2msftngp13.phx.gbl>
<csfytqp6FHA.1236@.TK2MSFTNGXA02.phx.gbl>
| Subject: Re: Microsoft.SqlServer.Management.Trace.TraceServer - Examples ?
| Date: Wed, 16 Nov 2005 20:30:45 -0000
| Lines: 14
| Organization: Data Utilities Ltd
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2900.2670
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670
| X-RFC2646: Format=Flowed; Original
| Message-ID: <OAbNeyu6FHA.472@.TK2MSFTNGP15.phx.gbl>
| Newsgroups: microsoft.public.sqlserver.programming
| NNTP-Posting-Host: wilmot.me.uk 217.169.5.59
| Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP15.phx.gbl
| Xref: TK2MSFTNGXA02.phx.gbl microsoft.public.sqlserver.programming:562679
| X-Tomcat-NG: microsoft.public.sqlserver.programming
|
|
| "Peter Yang [MSFT]" <petery@.online.microsoft.com> wrote in message
| news:csfytqp6FHA.1236@.TK2MSFTNGXA02.phx.gbl...
| > Hello Steven,
| >
| > Thank you for your feedback on this and rest assured it is routed to the
| > proper channel. Also, it is suggsted that you use template to define
| > events
| > you want to monitor in this situation. :-)
| >
|
| Is the format of a TDF file defined anywhere ?
|
|
||||"Peter Yang [MSFT]" <petery@.online.microsoft.com> wrote in message
news:j2Y1oKb6FHA.1240@.TK2MSFTNGXA02.phx.gbl...
> Hello Steven,
> I found the following link for your reference:
> Trace and Replay Objects: A New API for SQL Server Tracing and Replay
> [url]http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnsql90/htm[/ur
l]
> l/SQLTrcRpOb.asp
> Hope this is helpful.
>
Any idea if there is anything indicating how to use
Microsoft.SqlServer.Management.Smo.ServerTraceEvent
or Microsoft.SqlServer.Management.Smo.ServerTraceEventSet
These would APPEAR to be ideal for creating a TDF, but with no such thing as
a ServerTraceEventSet.WriteToFile()
S.|||Hello Steven,
Based on my research, ServerTraceEventSet is used to specify the currently
selected trace events
Smo.ServerTraceEventset. selectTraceEvents specifies the Trace events to
receive. Events will be sent to the event handler(s) that are registered
with the OnEvent event. There is no method to serialize the set to a TDF
file though.
Best Regards,
Peter Yang
MCSE2000/2003, MCSA, MCDBA
Microsoft Online Partner Support
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
========================================
=============
This posting is provided "AS IS" with no warranties, and confers no rights.
| Reply-To: "Steven Wilmot" <steven-news@.wilmot.me.uk>
| From: "Steven Wilmot" <Steven_W@.newsgroups.nospam>
| References: <u8YSyHY6FHA.2040@.TK2MSFTNGP14.phx.gbl>
<j2Y1oKb6FHA.1240@.TK2MSFTNGXA02.phx.gbl>
| Subject: Re: Microsoft.SqlServer.Management.Trace.TraceServer - Examples ?
| Date: Thu, 17 Nov 2005 11:32:41 -0000
| Lines: 28
| Organization: Data Utilities Ltd
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2900.2670
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670
| X-RFC2646: Format=Flowed; Original
| Message-ID: <OehJdq26FHA.1248@.TK2MSFTNGP14.phx.gbl>
| Newsgroups: microsoft.public.sqlserver.programming
| NNTP-Posting-Host: wilmot.me.uk 217.169.5.59
| Path:
TK2MSFTNGXA02.phx.gbl!TK2MSFTNGXA03.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP1
4.phx.gbl
| Xref: TK2MSFTNGXA02.phx.gbl microsoft.public.sqlserver.programming:562828
| X-Tomcat-NG: microsoft.public.sqlserver.programming
|
|
| "Peter Yang [MSFT]" <petery@.online.microsoft.com> wrote in message
| news:j2Y1oKb6FHA.1240@.TK2MSFTNGXA02.phx.gbl...
| > Hello Steven,
| >
| > I found the following link for your reference:
| >
| > Trace and Replay Objects: A New API for SQL Server Tracing and Replay
| >
http://msdn.microsoft.com/library/d...-us/dnsql90/htm
| > l/SQLTrcRpOb.asp
| >
| > Hope this is helpful.
| >
|
| Any idea if there is anything indicating how to use
|
| Microsoft.SqlServer.Management.Smo.ServerTraceEvent
|
| or Microsoft.SqlServer.Management.Smo.ServerTraceEventSet
|
|
|
| These would APPEAR to be ideal for creating a TDF, but with no such thing
as
| a ServerTraceEventSet.WriteToFile()
|
| S.
|
|
||||"Peter Yang [MSFT]" <petery@.online.microsoft.com> wrote in message
news:xWeu$%23$6FHA.3648@.TK2MSFTNGXA02.phx.gbl...
> Hello Steven,
> Based on my research, ServerTraceEventSet is used to specify the currently
> selected trace events
> Smo.ServerTraceEventset. selectTraceEvents specifies the Trace events to
> receive. Events will be sent to the event handler(s) that are registered
> with the OnEvent event. There is no method to serialize the set to a TDF
> file though.
> Best Regards,
> Peter Yang
> MCSE2000/2003, MCSA, MCDBA
> Microsoft Online Partner Support
> When responding to posts, please "Reply to Group" via your newsreader so
> that others may learn and benefit from your issue.
> ========================================
=============
>
Sorry to be a pain.
ServerTraceSet LOOKS ideal (to register the list of bitflags of events to
receive)
These all seem to be nicely grouped together in a ServerTraceSetEvent.
So, I would expect something such as
TraceServer.InitialiseasTraceReader(string ServerName, ServerTraceSetEvent
WhatToTrace) ;
This is the bit that seems to be missing.|||Hello Steven,
This is a great idea for a future product enhancement. Please rest assured
it is routed to the right channel. Also, you could click "Send feedback"
button in Toolbox of Books Online to send your feedback to product team.
Have a great day!
Regards,
Peter Yang
MCSE2000/2003, MCSA, MCDBA
Microsoft Online Partner Support
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
========================================
=============
This posting is provided "AS IS" with no warranties, and confers no rights.
| Reply-To: "Steven Wilmot" <steven-news@.wilmot.me.uk>
| From: "Steven Wilmot" <Steven_W@.newsgroups.nospam>
| References: <u8YSyHY6FHA.2040@.TK2MSFTNGP14.phx.gbl>
<j2Y1oKb6FHA.1240@.TK2MSFTNGXA02.phx.gbl>
<OehJdq26FHA.1248@.TK2MSFTNGP14.phx.gbl>
<xWeu$#$6FHA.3648@.TK2MSFTNGXA02.phx.gbl>
| Subject: Re: Microsoft.SqlServer.Management.Trace.TraceServer - Examples ?
| Date: Fri, 18 Nov 2005 23:40:18 -0000
| Lines: 40
| Organization: Data Utilities Ltd
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2900.2670
| X-RFC2646: Format=Flowed; Original
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670
| Message-ID: <OD2pslJ7FHA.3440@.TK2MSFTNGP12.phx.gbl>
| Newsgroups: microsoft.public.sqlserver.programming
| NNTP-Posting-Host: wilmot.me.uk 217.169.5.59
| Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP12.phx.gbl
| Xref: TK2MSFTNGXA02.phx.gbl microsoft.public.sqlserver.programming:563233
| X-Tomcat-NG: microsoft.public.sqlserver.programming
|
|
| "Peter Yang [MSFT]" <petery@.online.microsoft.com> wrote in message
| news:xWeu$%23$6FHA.3648@.TK2MSFTNGXA02.phx.gbl...
| > Hello Steven,
| >
| > Based on my research, ServerTraceEventSet is used to specify the
currently
| > selected trace events
| >
| > Smo.ServerTraceEventset. selectTraceEvents specifies the Trace events to
| > receive. Events will be sent to the event handler(s) that are registered
| > with the OnEvent event. There is no method to serialize the set to a TDF
| > file though.
| >
| > Best Regards,
| >
| > Peter Yang
| > MCSE2000/2003, MCSA, MCDBA
| > Microsoft Online Partner Support
| >
| > When responding to posts, please "Reply to Group" via your newsreader so
| > that others may learn and benefit from your issue.
| >
| > ========================================
=============
| >
|
| Sorry to be a pain.
|
| ServerTraceSet LOOKS ideal (to register the list of bitflags of events to
| receive)
|
| These all seem to be nicely grouped together in a ServerTraceSetEvent.
|
| So, I would expect something such as
| TraceServer.InitialiseasTraceReader(string ServerName,
ServerTraceSetEvent
| WhatToTrace) ;
|
| This is the bit that seems to be missing.
|
|
|
|

No comments:

Post a Comment