Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Researching Deadlocks Expand / Collapse
Author
Message
Posted Wednesday, August 29, 2012 7:07 AM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Yesterday @ 1:19 PM
Points: 239, Visits: 384
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
Post #1351590
Posted Wednesday, August 29, 2012 9:09 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Today @ 3:17 AM
Points: 14,204, Visits: 28,531
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
Post #1351687
Posted Thursday, August 30, 2012 6:59 AM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Yesterday @ 1:19 PM
Points: 239, Visits: 384
Thanks for the recommendation. We have it turned on with no issues today.



Del Lee
Post #1352174
Posted Friday, August 31, 2012 6:53 AM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Monday, May 20, 2013 11:01 AM
Points: 62, 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
Post #1352772
Posted Friday, August 31, 2012 6:56 AM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Yesterday @ 1:19 PM
Points: 239, Visits: 384
Yes, I was aware of the profiler trace option, but I had already ruled out doing that on a production server.



Del Lee
Post #1352776
Posted Friday, August 31, 2012 7:08 AM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Monday, May 20, 2013 11:01 AM
Points: 62, 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
Post #1352785
Posted Friday, August 31, 2012 7:16 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Today @ 3:17 AM
Points: 14,204, Visits: 28,531
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
Post #1352790
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse