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 2008
»
SQL Server 2008 - General
»
How to solve blocking issue
How to solve blocking issue
Rate Topic
Display Mode
Topic Options
Author
Message
New persopn
New persopn
Posted Monday, December 10, 2012 7:42 AM
Valued Member
Group: General Forum Members
Last Login: Tuesday, May 14, 2013 12:56 AM
Points: 56,
Visits: 163
after finding blocking spid.
How to solve that problem.
deadlock and blocking both are same are different.
Post #1394625
sgmunson
sgmunson
Posted Monday, December 10, 2012 7:46 AM
UDP Broadcaster
Group: General Forum Members
Last Login: Wednesday, May 15, 2013 8:20 AM
Points: 1,446,
Visits: 1,883
You can always kill one spid or the other, but you should know the impact of that first. As to what you meant by "deadlock and blocking both are same are different.", I have no idea what you're trying to say.
Steve
(aka sgmunson)
Weight Loss Tips
Post #1394629
New persopn
New persopn
Posted Monday, December 10, 2012 7:49 AM
Valued Member
Group: General Forum Members
Last Login: Tuesday, May 14, 2013 12:56 AM
Points: 56,
Visits: 163
Here for blocking we need to kill the sp id.
how to solve the deadlock issue.
Post #1394630
sgmunson
sgmunson
Posted Monday, December 10, 2012 8:06 AM
UDP Broadcaster
Group: General Forum Members
Last Login: Wednesday, May 15, 2013 8:20 AM
Points: 1,446,
Visits: 1,883
Deadlock is a condition where two or more queries go after resources that the others are using, and in at least 2 cases, an "other query" needs an exclusive lock and can't get it because it's already in use, and because the other query holds an exclusive on something the 1st query needs, neither query can EVER succeed. It's your basic "catch 22" situation. Read the following page, and it does a far better job of describing it than I can:
http://msdn.microsoft.com/en-us/library/ms178104(v=sql.105).aspx
Solving such a problem is often a performance related problem. Get the queries that deadlock to run faster, and there's less opportunity for this to occur. Also, running queries that don't actually need an exclusive lock with query hints that provide one or in ways that cause one can be things to look for and eliminate, if possible. It's not always possible. As SQL Server detects deadlock and randomly chooses a victim, another way to solve the problem is to reschedule things, if that's an option.
Steve
(aka sgmunson)
Weight Loss Tips
Post #1394642
Jeff Moden
Jeff Moden
Posted Monday, December 10, 2012 8:45 AM
SSC-Dedicated
Group: General Forum Members
Last Login: Yesterday @ 7:36 PM
Points: 32,931,
Visits: 26,820
sgmunson (12/10/2012)
You can always kill one spid or the other, but you should know the impact of that first. As to what you meant by "deadlock and blocking both are same are different.", I have no idea what you're trying to say.
Don't do it. Killing a SPID may leave it in a never ending rollback that will consume the better part of an entire CPU. Far better to find the person causing the blocking and have them cancel whatever they're running.
--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 #1394663
Jeff Moden
Jeff Moden
Posted Monday, December 10, 2012 8:47 AM
SSC-Dedicated
Group: General Forum Members
Last Login: Yesterday @ 7:36 PM
Points: 32,931,
Visits: 26,820
gantavasu (12/10/2012)
Here for blocking we need to kill the sp id.
how to solve the deadlock issue.
It's normally not a simple thing and it's far too complex to explain on a forum post. Please do the following... From SSMS, press the {f1} key and search for DEADLOCKS.
--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 #1394665
GilaMonster
GilaMonster
Posted Monday, December 10, 2012 10:36 AM
SSC-Dedicated
Group: General Forum Members
Last Login: Yesterday @ 3:18 PM
Points: 37,744,
Visits: 30,025
http://www.simple-talk.com/books/sql-books/troubleshooting-sql-server-a-guide-for-the-accidental-dba/
Chapters 6 and 7
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 #1394708
sgmunson
sgmunson
Posted Monday, December 10, 2012 10:58 AM
UDP Broadcaster
Group: General Forum Members
Last Login: Wednesday, May 15, 2013 8:20 AM
Points: 1,446,
Visits: 1,883
Jeff Moden (12/10/2012)
sgmunson (12/10/2012)
You can always kill one spid or the other, but you should know the impact of that first. As to what you meant by "deadlock and blocking both are same are different.", I have no idea what you're trying to say.
Don't do it. Killing a SPID may leave it in a never ending rollback that will consume the better part of an entire CPU. Far better to find the person causing the blocking and have them cancel whatever they're running.
Thanks for the correction. I was not aware of that particular gotcha, and it's always good to learn BEFORE it bites you as opposed to after.
Steve
(aka sgmunson)
Weight Loss Tips
Post #1394714
TheSQLGuru
TheSQLGuru
Posted Tuesday, December 11, 2012 6:52 AM
Hall of Fame
Group: General Forum Members
Last Login: Yesterday @ 6:52 PM
Points: 3,582,
Visits: 5,132
Here is a 3-part blog post about deadlocking from Bart Duncan: http://blogs.msdn.com/b/bartd/archive/2006/09/09/deadlock-troubleshooting_2c00_-part-1.aspx
Best,
Kevin G. Boles
SQL Server Consultant
SQL MVP 2007-2012
TheSQLGuru at GMail
Post #1395097
« Prev Topic
|
Next Topic »
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.