SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Researching Deadlocks


Researching Deadlocks

Author
Message
Del Lee
Del Lee
Mr or Mrs. 500
Mr or Mrs. 500 (555 reputation)Mr or Mrs. 500 (555 reputation)Mr or Mrs. 500 (555 reputation)Mr or Mrs. 500 (555 reputation)Mr or Mrs. 500 (555 reputation)Mr or Mrs. 500 (555 reputation)Mr or Mrs. 500 (555 reputation)Mr or Mrs. 500 (555 reputation)

Group: General Forum Members
Points: 555 Visits: 1337
Hi all:

I've seen that you can use trace flags 1204 and 1222 to return information to the error log about deadlocks:

http://msdn.microsoft.com/en-us/library/ms178104%28v=sql.90%29.aspx

I've also seen a comment on these forums that setting any trace flags could potentially introduce performance issues, but then I saw another comment where someone uses 1204 on their (busy) instance 24/7 without issue.

How can I determine if setting these trace flags will significantly affect performance before I turn them on?

Thanks...



Del Lee
Grant Fritchey
Grant Fritchey
SSC Guru
SSC Guru (99K reputation)SSC Guru (99K reputation)SSC Guru (99K reputation)SSC Guru (99K reputation)SSC Guru (99K reputation)SSC Guru (99K reputation)SSC Guru (99K reputation)SSC Guru (99K reputation)

Group: General Forum Members
Points: 99803 Visits: 33014
First, I'd stick to using 1222. It has better information than 1204. Second, yes, these are very lightweight processes. They don't put excessive load on the system. They capture the deadlock graph output from the deadlock into the error log. If they're going to put any kind of load on the system, it's during the writes to the error log. But I've run them for years on systems without ever hitting issues, so I have no trouble recommending their use.

----------------------------------------------------
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 Query Performance Tuning and SQL Server Execution Plans
Product Evangelist for Red Gate Software
Del Lee
Del Lee
Mr or Mrs. 500
Mr or Mrs. 500 (555 reputation)Mr or Mrs. 500 (555 reputation)Mr or Mrs. 500 (555 reputation)Mr or Mrs. 500 (555 reputation)Mr or Mrs. 500 (555 reputation)Mr or Mrs. 500 (555 reputation)Mr or Mrs. 500 (555 reputation)Mr or Mrs. 500 (555 reputation)

Group: General Forum Members
Points: 555 Visits: 1337
Thanks for the recommendation. We have it turned on with no issues today. :-)



Del Lee
jason.spangler
jason.spangler
SSC-Enthusiastic
SSC-Enthusiastic (136 reputation)SSC-Enthusiastic (136 reputation)SSC-Enthusiastic (136 reputation)SSC-Enthusiastic (136 reputation)SSC-Enthusiastic (136 reputation)SSC-Enthusiastic (136 reputation)SSC-Enthusiastic (136 reputation)SSC-Enthusiastic (136 reputation)

Group: General Forum Members
Points: 136 Visits: 308
You can also use SQL Profiler to setup a trace via the GUI, or as a server side trace to capture the deadlock information. With this method, you don't need to set trace flags. Although, if the deadlocks don't occur very often, you may be better off with the trace flags.

This is just another option.

-
Jason
@emtJason
Del Lee
Del Lee
Mr or Mrs. 500
Mr or Mrs. 500 (555 reputation)Mr or Mrs. 500 (555 reputation)Mr or Mrs. 500 (555 reputation)Mr or Mrs. 500 (555 reputation)Mr or Mrs. 500 (555 reputation)Mr or Mrs. 500 (555 reputation)Mr or Mrs. 500 (555 reputation)Mr or Mrs. 500 (555 reputation)

Group: General Forum Members
Points: 555 Visits: 1337
Yes, I was aware of the profiler trace option, but I had already ruled out doing that on a production server.



Del Lee
jason.spangler
jason.spangler
SSC-Enthusiastic
SSC-Enthusiastic (136 reputation)SSC-Enthusiastic (136 reputation)SSC-Enthusiastic (136 reputation)SSC-Enthusiastic (136 reputation)SSC-Enthusiastic (136 reputation)SSC-Enthusiastic (136 reputation)SSC-Enthusiastic (136 reputation)SSC-Enthusiastic (136 reputation)

Group: General Forum Members
Points: 136 Visits: 308
Why rule it out because it's a production server? I would rule out running the Profiler GUI on the production server, but I wouldn't rule out running a server side trace.

-
Jason
@emtJason
Grant Fritchey
Grant Fritchey
SSC Guru
SSC Guru (99K reputation)SSC Guru (99K reputation)SSC Guru (99K reputation)SSC Guru (99K reputation)SSC Guru (99K reputation)SSC Guru (99K reputation)SSC Guru (99K reputation)SSC Guru (99K reputation)

Group: General Forum Members
Points: 99803 Visits: 33014
jason.spangler (8/31/2012)
Why rule it out because it's a production server? I would rule out running the Profiler GUI on the production server, but I wouldn't rule out running a server side trace.

-
Jason
@emtJason


Ditto. It's a great way to capture information. If you were on 2008 or better you could use extended events, but a server-side trace is almost as good.

----------------------------------------------------
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 Query Performance Tuning and SQL Server Execution Plans
Product Evangelist for Red Gate Software
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search