Log in
::
Register
::
Not logged in
Home
Tags
Articles
Editorials
Stairways
Forums
Scripts
Videos
Blogs
QotD
Books
Ask SSC
SQL Jobs
Training
Authors
About us
Contact us
Newsletters
Write for us
Recent Posts
Recent Posts
Popular Topics
Popular Topics
Home
Search
Members
Calendar
Who's On
Home
»
Article Discussions
»
Article Discussions by Author
»
Discuss Content Posted by Grant Fritchey
»
Set Up And Schedule a Server Side Trace
38 posts, Page 2 of 4
««
1
2
3
4
»
»»
Set Up And Schedule a Server Side Trace
Rate Topic
Display Mode
Topic Options
Author
Message
Grant Fritchey
Grant Fritchey
Posted Thursday, December 02, 2010 7:08 AM
SSChampion
Group: General Forum Members
Last Login: Yesterday @ 9:49 AM
Points: 13,436,
Visits: 25,281
Jack Corbett (12/2/2010)
Great article again Grant. I just prefer to use sys.traces over fn_trace_getinfo. I think it gives an easier to decipher set of information.
Hmm, I'm going to have to play with the stop time because I thought it deleted the trace definition...
I did too. If you get to it before I do (at work, can't play at the moment) please post it.
----------------------------------------------------
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood..." Theodore Roosevelt
The Scary DBA
Author of:
SQL Server 2012 Query Performance Tuning
SQL Server 2008 Query Performance Tuning Distilled
and
SQL Server Execution Plans
Product Evangelist for
Red Gate Software
Post #1029236
Grant Fritchey
Grant Fritchey
Posted Thursday, December 02, 2010 7:15 AM
SSChampion
Group: General Forum Members
Last Login: Yesterday @ 9:49 AM
Points: 13,436,
Visits: 25,281
PAH-440118 (12/2/2010)
What is the command to delete to the trace definition?
Right here in the
Books Online
:
1.Execute sp_trace_setstatus by specifying @status = 0 to stop the trace.
2.Execute sp_trace_setstatus by specifying @status = 2 to close the trace and delete its information from the server.
----------------------------------------------------
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood..." Theodore Roosevelt
The Scary DBA
Author of:
SQL Server 2012 Query Performance Tuning
SQL Server 2008 Query Performance Tuning Distilled
and
SQL Server Execution Plans
Product Evangelist for
Red Gate Software
Post #1029243
CavyPrincess
CavyPrincess
Posted Thursday, December 02, 2010 7:17 AM
Mr or Mrs. 500
Group: General Forum Members
Last Login: 2 days ago @ 7:37 AM
Points: 597,
Visits: 1,439
Grant Fritchey (12/2/2010)
Writing to file is much, much faster than writing to a database, so yes, it does make a difference. Also, is that database on the same server you're monitoring? That can be a problem, adding overhead where none should exist.
But of course it's on the same server :) Since I'm going to change process around anyway, I'll change it to create the flat files and import then into the database afterwards. I was just being lazy to save a step as it hasn't yet caused a problem. I certainly don't want to be the cause of problems, so thank-you for your response.
Cindy
Post #1029245
ALZDBA
ALZDBA
Posted Thursday, December 02, 2010 7:26 AM
SSCertifiable
Group: General Forum Members
Last Login: 2 days ago @ 2:13 PM
Points: 6,866,
Visits: 8,071
I haven't noticed it would not cleanup the trace def in systraces after the end time.
Tested in SQL2000 / SQL2005 / SQL2008R2 CU4 .... ehm .... yes
SQL2008 r1
is missing
So in my instances they get cleaned up.
edited
You can find my setup script in the attachement it was to long to just post in the reply
Johan
Jul 13
Don't drive faster than your guardian angel can fly ...
but keeping both feet on the ground won't get you anywhere
-
How to post Performance Problems
-
How to post data/code to get the best help
-
How to prevent a sore throat after hours of presenting ppt ?
"press F1 for solution", "press
shift
+F1 for urgent solution"
Need a bit of Powershell? How about
this
Who am I ?
Sometimes this is me
but
most of the time this is me
Post Attachments
Start_trace.txt
(
6 views,
18.50 KB
)
Post #1029259
arturopw
arturopw
Posted Thursday, December 02, 2010 7:41 AM
SSC Journeyman
Group: General Forum Members
Last Login: Thursday, May 03, 2012 9:25 AM
Points: 83,
Visits: 231
I just want to say Thanks for this article. When setting up server side trace scripts last week (for the first time) I was annoyed at how cumbersome and error-prone creating the script was. Learning that it can be scripted out from Profiler will save me lots of time and pain next time.
Post #1029274
Grant Fritchey
Grant Fritchey
Posted Thursday, December 02, 2010 7:49 AM
SSChampion
Group: General Forum Members
Last Login: Yesterday @ 9:49 AM
Points: 13,436,
Visits: 25,281
CavyPrincess (12/2/2010)
Grant Fritchey (12/2/2010)
Writing to file is much, much faster than writing to a database, so yes, it does make a difference. Also, is that database on the same server you're monitoring? That can be a problem, adding overhead where none should exist.
But of course it's on the same server :) Since I'm going to change process around anyway, I'll change it to create the flat files and import then into the database afterwards. I was just being lazy to save a step as it hasn't yet caused a problem. I certainly don't want to be the cause of problems, so thank-you for your response.
Cindy
Of course. Happy to help. Also, tracking down Brad McGehee's excellent book will help even more.
----------------------------------------------------
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood..." Theodore Roosevelt
The Scary DBA
Author of:
SQL Server 2012 Query Performance Tuning
SQL Server 2008 Query Performance Tuning Distilled
and
SQL Server Execution Plans
Product Evangelist for
Red Gate Software
Post #1029280
Jack Corbett
Jack Corbett
Posted Thursday, December 02, 2010 1:55 PM
SSChampion
Group: General Forum Members
Last Login: Today @ 3:07 PM
Points: 10,613,
Visits: 11,959
ALZDBA (12/2/2010)
I haven't noticed it would not cleanup the trace def in systraces after the end time.
Tested in SQL2000 / SQL2005 / SQL2008R2 CU4 .... ehm .... yes
SQL2008 r1
is missing
So in my instances they get cleaned up.
edited
You can find my setup script in the attachement it was to long to just post in the reply
I did a quick test on SQL 2008 and the definition was cleaned up when the trace stopped. My test was simpler. I used Profiler to script a trace based on the standard template and set it to run for 5 minutes. After 5 minutes the only trace found in sys.traces is the default trace.
Jack Corbett
Applications Developer
Don't let the good be the enemy of the best. --
Paul Fleming
Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question
How to Post Performance Problems
Crosstabs and Pivots or How to turn rows into columns Part 1
Crosstabs and Pivots or How to turn rows into columns Part 2
Post #1029534
Grant Fritchey
Grant Fritchey
Posted Thursday, December 02, 2010 6:31 PM
SSChampion
Group: General Forum Members
Last Login: Yesterday @ 9:49 AM
Points: 13,436,
Visits: 25,281
Jack Corbett (12/2/2010)
ALZDBA (12/2/2010)
I haven't noticed it would not cleanup the trace def in systraces after the end time.
Tested in SQL2000 / SQL2005 / SQL2008R2 CU4 .... ehm .... yes
SQL2008 r1
is missing
So in my instances they get cleaned up.
edited
You can find my setup script in the attachement it was to long to just post in the reply
I did a quick test on SQL 2008 and the definition was cleaned up when the trace stopped. My test was simpler. I used Profiler to script a trace based on the standard template and set it to run for 5 minutes. After 5 minutes the only trace found in sys.traces is the default trace.
Ha! I was just sitting down to start testing this when I saw your post. Thanks. It's what I thought, but it never hurts to be sure.
----------------------------------------------------
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood..." Theodore Roosevelt
The Scary DBA
Author of:
SQL Server 2012 Query Performance Tuning
SQL Server 2008 Query Performance Tuning Distilled
and
SQL Server Execution Plans
Product Evangelist for
Red Gate Software
Post #1029603
SQLRNNR
SQLRNNR
Posted Thursday, December 02, 2010 10:27 PM
SSCoach
Group: General Forum Members
Last Login: Today @ 3:33 PM
Points: 18,858,
Visits: 12,443
Great Stuff Grant.
Jason
AKA CirqueDeSQLeil
I have given a name to my pain...
MCM SQL Server 2008
SQL RNNR
Posting Performance Based Questions - Gail Shaw
Posting Data Etiquette - Jeff Moden
Hidden RBAR - Jeff Moden
VLFs and the Tran Log - Kimberly Tripp
Post #1029645
Jeff Moden
Jeff Moden
Posted Thursday, December 02, 2010 10:43 PM
SSC-Dedicated
Group: General Forum Members
Last Login: Today @ 11:33 PM
Points: 33,112,
Visits: 27,040
Good stuff as always, Grant! Thanks for taking the time to write articles like this. This one should be in every DBA's quick reference guide.
--Jeff Moden
"
RBAR
is pronounced "ree-bar" and is a "Modenism" for "
R
ow-
B
y-
A
gonizing-
R
ow".
First step towards the paradigm shift of writing Set Based code:
Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column."
For better, quicker answers on T-SQL questions, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/
For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
Post #1029650
« Prev Topic
|
Next Topic »
38 posts, Page 2 of 4
««
1
2
3
4
»
»»
Permissions
You
cannot
post new topics.
You
cannot
post topic replies.
You
cannot
post new polls.
You
cannot
post replies to polls.
You
cannot
edit your own topics.
You
cannot
delete your own topics.
You
cannot
edit other topics.
You
cannot
delete other topics.
You
cannot
edit your own posts.
You
cannot
edit other posts.
You
cannot
delete your own posts.
You
cannot
delete other posts.
You
cannot
post events.
You
cannot
edit your own events.
You
cannot
edit other events.
You
cannot
delete your own events.
You
cannot
delete other events.
You
cannot
send private messages.
You
cannot
send emails.
You
may
read topics.
You
cannot
rate topics.
You
cannot
vote within polls.
You
cannot
upload attachments.
You
may
download attachments.
You
cannot
post HTML code.
You
cannot
edit HTML code.
You
cannot
post IFCode.
You
cannot
post JavaScript.
You
cannot
post EmotIcons.
You
cannot
post or upload images.
Copyright © 2002-2013 Simple Talk Publishing. All Rights Reserved.
Privacy Policy.
Terms of Use.
Report Abuse.