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
»
SQL Server 2005
»
Administering
»
Deadlocks
48 posts, Page 1 of 5
1
2
3
4
5
»
»»
Deadlocks
Rate Topic
Display Mode
Topic Options
Author
Message
Suresh B.
Suresh B.
Posted Tuesday, July 08, 2008 8:36 AM
Ten Centuries
Group: General Forum Members
Last Login: 2 days ago @ 4:49 AM
Points: 1,075,
Visits: 5,119
Is it possible to have 0 deadlocks in a busy multiuer system?
Is it normal to have around 10 deadlocks daily?
Please share your experiences.
Post #530084
MannySingh
MannySingh
Posted Tuesday, July 08, 2008 9:39 AM
SSChasing Mays
Group: General Forum Members
Last Login: Wednesday, April 24, 2013 1:10 PM
Points: 646,
Visits: 729
What do you mean by 0 Deadlocks...
According to my MEAN Knowledge, if it is NO (0) deadlocks.. yes it is always possible and Good to have NO Deadlocks...on a SQL Server system.
This means your system is not highly transactional Or is very well maintained:::: i.e. Database is normalized and All Queries are using proper HINTS and your server settings are optimized.
Correct me if i am WRONG.
if you see a deadlock that is in place for a long time, make sure, it is not running a HUGE Query.. then kill the SPID associated with it...
(Before taking this step.. make sure the SPID is not performing any Data Changes in the DB)
Maninder
www.dbanation.com
Post #530141
sqlservercenter-793614
sqlservercenter-793614
Posted Tuesday, July 08, 2008 9:43 AM
Grasshopper
Group: General Forum Members
Last Login: Friday, October 03, 2008 2:04 PM
Points: 23,
Visits: 92
if a deadlock block your system too long time,then delete it.
MCDBA, MCITP (DB Dev, DB Admin), MCSE,MCTS, OCA 10g
Post #530147
GilaMonster
GilaMonster
Posted Tuesday, July 08, 2008 10:11 AM
SSC-Dedicated
Group: General Forum Members
Last Login: Today @ 1:17 PM
Points: 37,740,
Visits: 30,016
Mani Singh (7/8/2008)
if you see a deadlock that is in place for a long time, make sure, it is not running a HUGE Query.. then kill the SPID associated with it...
(Before taking this step.. make sure the SPID is not performing any Data Changes in the DB)
sqlservercenter (7/8/2008)
if a deadlock block your system too long time,then delete it.
You don't ever have to worry about killing processes involved in a deadlock. SQL has a deadlock detector built in, if it detects an unresolvable locking condition (a deadlock) it will pick one of the processes involved and automatically kill it.
Gail Shaw
Microsoft Certified Master: SQL Server 2008, MVP
SQL In The Wild
: Discussions on DB performance with occasional diversions into recoverability
We walk in the dark places no others will enter
We stand on the bridge and no one may pass
Post #530174
GilaMonster
GilaMonster
Posted Tuesday, July 08, 2008 10:14 AM
SSC-Dedicated
Group: General Forum Members
Last Login: Today @ 1:17 PM
Points: 37,740,
Visits: 30,016
Suresh B. (7/8/2008)
Is it possible to have 0 deadlocks in a busy multiuer system?
Is it normal to have around 10 deadlocks daily?
It is not normal to have 10 deadlocks a day on any system, 0 is what you want and it is not impossible to achieve.
If you have frequent deadlocks then you either have badly written SQL code, poor indexes or both.
Enable traceflag 1204 OR 1222 to get the deadlock graph written into the error log. That should help you locate the queries involved in the deadlock.
Gail Shaw
Microsoft Certified Master: SQL Server 2008, MVP
SQL In The Wild
: Discussions on DB performance with occasional diversions into recoverability
We walk in the dark places no others will enter
We stand on the bridge and no one may pass
Post #530181
MannySingh
MannySingh
Posted Tuesday, July 08, 2008 10:15 AM
SSChasing Mays
Group: General Forum Members
Last Login: Wednesday, April 24, 2013 1:10 PM
Points: 646,
Visits: 729
Check the ISOLATION LEVELS for more info.
Maninder
www.dbanation.com
Post #530184
Suresh B.
Suresh B.
Posted Tuesday, July 08, 2008 10:48 PM
Ten Centuries
Group: General Forum Members
Last Login: 2 days ago @ 4:49 AM
Points: 1,075,
Visits: 5,119
Mani Singh (7/8/2008)
(0) deadlocks.. yes it is always possible
... is very well maintained:::: i.e. Database is normalized...
GilaMonster (7/8/2008)
It is not normal to have 10 deadlocks a day on any system, 0 is what you want and it is not impossible to achieve.
If you have frequent deadlocks then you either have badly written SQL code, poor indexes or both.
This is what I was looking for.
Thanks Gail Shaw and Mani Singh.
Post #530481
Anders Pedersen
Anders Pedersen
Posted Wednesday, July 09, 2008 7:04 AM
Ten Centuries
Group: General Forum Members
Last Login: Today @ 1:27 PM
Points: 1,200,
Visits: 645
When I started in my current job, they had upwards of 120 deadlocks a day..... If I had know that before I accepted the job..... Let's just say it was very indicative of some issues.
I have gotten it down to about 6-7 per day at this point, and those that are left are trapped, since I started trapping them for a couple of stored procedures they have not affected the client. Unfortunatly rewriting the code so they do not happen is just about impossible at this point. But I am looking into it =)
THe main thing that solved the problem here was actually to put an index on a lookup table.... Go figure!
Post #530738
MannySingh
MannySingh
Posted Wednesday, July 09, 2008 7:50 AM
SSChasing Mays
Group: General Forum Members
Last Login: Wednesday, April 24, 2013 1:10 PM
Points: 646,
Visits: 729
Adding to Anders.
My Current job, there is a Application "Maximo" which deals with SHOP Floor Order Entry system. There are 100 People in the Steel Mill loggin into the application through CITRIX, which come down the Database and they generate Huge amount of Deadlocks/locking/blocking Scenarios Daily.. I have check them to use HINTS in their SQL Reports and Application CODE. Also WOrked aound ISOLATION LEVELS.. and SEPRATED their READONLY Data from READ/WRITE using FileGroups and also Seprated their REPORTs to USE, a logged shipped version of Database.. which gets updated twice daily... This is SQL server 2000 SP4.
Maninder
www.dbanation.com
Post #530815
Jeff Moden
Jeff Moden
Posted Wednesday, July 09, 2008 7:59 AM
SSC-Dedicated
Group: General Forum Members
Last Login: Today @ 1:24 PM
Points: 32,913,
Visits: 26,806
I'm with Gail... but a bit more stringent on the subject. If you have any deadlocks, something is wrong in the code somewhere and you need to fix it. Finding the cause can sometimes be a bit troubling but everytime you have a deadlock, there's a rollback which takes time and that also possibly means some lost data. Finding and repairing code that causes deadlocks should be a top priority for every DBA.
--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 #530832
« Prev Topic
|
Next Topic »
48 posts, Page 1 of 5
1
2
3
4
5
»
»»
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.