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


Head blocker - Sleeping process with select command on empty table


Head blocker - Sleeping process with select command on empty table

Author
Message
Marcin Deg
Marcin Deg
Forum Newbie
Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)

Group: General Forum Members
Points: 7 Visits: 6
Hi,
I have problem with troubleshoot blocking issue on SQL 2008 (10.0.5500), witch happens 5 to 10 times per day.
For example, simple query 'select name from table' on empty table with status sleeping, with wait info: LCK_M_ caused blocking other processes.
SQL Server engine issue?
Any ideas?
John Mitchell-245523
John Mitchell-245523
SSC Guru
SSC Guru (79K reputation)SSC Guru (79K reputation)SSC Guru (79K reputation)SSC Guru (79K reputation)SSC Guru (79K reputation)SSC Guru (79K reputation)SSC Guru (79K reputation)SSC Guru (79K reputation)

Group: General Forum Members
Points: 79698 Visits: 17892
How do you know that process is the head blocker? If it's waiting for a lock then something else must be blocking it. Do you have sp_whoisactive?

John
GilaMonster
GilaMonster
SSC Guru
SSC Guru (546K reputation)SSC Guru (546K reputation)SSC Guru (546K reputation)SSC Guru (546K reputation)SSC Guru (546K reputation)SSC Guru (546K reputation)SSC Guru (546K reputation)SSC Guru (546K reputation)

Group: General Forum Members
Points: 546346 Visits: 47729
No, it won't be an engine bug.
Uncommitted transaction most likely. Exclusive locks are held until the transaction commits. Look at the open transactions, and make sure that you commit/rollback any transactions that are started.

Edit: And yes, if it is waiting for locks, it's not the head blocker. The head blocker will be running, runnable or waiting for something that's not a lock.

Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
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


Marcin Deg
Marcin Deg
Forum Newbie
Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)

Group: General Forum Members
Points: 7 Visits: 6
You are right, there is no wait on that session, wrong description.
Other sessions are blocked by - LCK_M_S
Query : (@P1 int)SELECT COUNT('A') FROM [dbo].[WTR9] T0 WHERE T0.[DocEntry] = (@P1)
Table is empty.
dbcc opentran - No active open transactions.
sp_whoisactive result:

GilaMonster
GilaMonster
SSC Guru
SSC Guru (546K reputation)SSC Guru (546K reputation)SSC Guru (546K reputation)SSC Guru (546K reputation)SSC Guru (546K reputation)SSC Guru (546K reputation)SSC Guru (546K reputation)SSC Guru (546K reputation)

Group: General Forum Members
Points: 546346 Visits: 47729
That session has an open transaction. The column 'open tran count' shows 1, so open transaction, holding locks until commit/rollback. That's why it's blocking other sessions.

Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
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


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