Link to home
Start Free TrialLog in
Avatar of sherlock1
sherlock1

asked on

Check for deadlocks - best method in SQL server 2012

Hi Experts,

We are running SQL server 2012 on a Windows server running Windows server 2012 standard 64bit in an SQL cluster setup with two server nodes (Both nodes running same O/S  and SQL server version).

We would like to check for deadlocks in the SQL database. Is there a script or method in which you would recommended to do this? and do we need to turn on any flags or enable anything in the SQL server in order to record deadlocks? or in SQL server 2012 is recording deadlocks enabled as standard?

Since there SQL database is reachable on both nodes I presume the deadlocks can be checked from either server node? or would both nodes need to be checked individually?

Users have encountered performance related issues recently in the application that connected to the SQL server and we would like to check for any deadlocks / or at least rule this out as being a cause of the issue if there are not any deadlocks

Thanks
ASKER CERTIFIED SOLUTION
Avatar of EugeneZ
EugeneZ
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of sherlock1
sherlock1

ASKER

Thanks for your replies

Vitor - hmm checking for blocking processes would be good too - maybe that would be of more benefit. and may well be of more use
Thanks for questioning this. So to clarify do deadlocks resolve themselves and its not possible to manually resolve them?
wheres blocking processes must be resolved manually? any further clarification would be great

Eugene - Thanks for the information and those weblinks which are very useful

Are you saying in order to see deadlocks I have to run the below to turn on logging the events? or is this only needed if I want to run SQL traces? and its possible to see deadlocks with other methods without turning these traces on?
Dbcc traceon (1204,-1)
DBCC Traceon (1222,-1)

Thanks
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Recommendation to close this question by accepting the above comments as solution.