I'm having problems with a database.

  1. I can run basic queries, albeit much slower than normal.

  2. When I attempt to view the hierarchy trees for tables, views, or procedures in SSMS Object Explorer, I get lock request time out period exceeded.

  3. My SSRS reports that run on objects in this database are no longer completing.

  4. Jobs associated with procedures stored on this database also do not run.

I tried using sp_who2 to find and kill all connections on the database, however this has not solved the problem.

What is going on here? How can I resolve this?

migrated from stackoverflow.com Aug 29 '12 at 9:10

This question came from our site for professional and enthusiast programmers.

  • Also see: stackoverflow.com/questions/12167570/…; not sure if that counts as a duplicate or not. – LittleBobbyTables Aug 28 '12 at 21:17
  • Based on your comment to my answer below, I think you need to provide a lot more information. How is the server sized, have you watched it's performance counters, is it swapping to disk or otherwise resource starved in some way. Be sure to actually check the above and not just assume anything. Further, does this happen when you connect while remoted into the desktop? Is the problem only occuring when accessing from a single location? What is the network weather like for that server (and your connection to it)? – NotMe Aug 28 '12 at 21:36
  • 3
    Sounds like you have open transactions that are blocking the read access to the tables. – a_horse_with_no_name Aug 28 '12 at 22:04
up vote 8 down vote accepted

It was being caused by a perpetual rollback of a transaction. Had to eventually restart my server cluster

  • 1
    Restarting the service solved it for me. – HerrimanCoder Dec 13 '16 at 0:36

Excluding Harware consideration, perhaps you need to run the script to check what are the activity withholding the SQL Session, one of the common scenario is not to use an Implicit transactions Option in SQL Server Management Studio.

  • Hi turbot, can you go into more detail about what you are suggesting? – Lloyd Banks Aug 28 '12 at 21:45
  • It looks that while this isnt fully explained it might be a better answer, perpetual rollback of transactions that dont roll back, and are only enabled due to implicit transactions. – ConstantineK Jul 31 '13 at 17:21
  • looking back the question I couldn't say it must be perpetual rollback of a transaction. Judging the locking request time out period exceed i would say running implicit transaction option would give better clue of the causes. – Turbot Aug 1 '13 at 3:18
  • Tools / Options / Query Execution / SQL Server / ANSI / SET IMPLICIT TRANSACTIONS – JedatKinports May 21 at 6:48

There are so many things this could be that all I can offer are a few questions to help guide you towards an answer.

  1. Is the DB on a server dedicated to just running SQL Server? If not, other processes might be interferring by stealing precious processor time.

  2. Is the DB server essentially out of memory? SQL Server will attempt to allocate every single byte it can, but if it's at capacity and your queries require more data to be loaded then it has to fallback to using virtual memory, which radically increases the amount of time even simple queries might take.

  3. Is the DB server's network bandwidth to small to handle transferring the data in a timely manner?


At the end of the day, it sounds like the machine you are hosting SQL Server on is under sized for what you are trying to do. It's entirely possible that you have finally reached those hardware limits where performance is dropping off radically. If this is the case (the above questions will help you determine that) then you'll want to move the DB to a server that is properly sized for the amount of data (and queries) you are trying to process.

This could mean using faster processors, faster drives, or just installing more RAM.

  • It's not a hardware issue. The server cluster hosts multiple databases. This is the only database having problems – Lloyd Banks Aug 28 '12 at 21:26
  • @LloydBanks: That doesn't mean this isn't a hardware problem. If I have 2 databases, one that's 20GB in size with a high transaction rate and another that's 1GB with a lower transaction rate then I'd expect the 1GB db to be swapped to virtual memory; which would increase query times. If the 20GB db was being hit hard enough, this could lead to connectivity issues with the smaller one. – NotMe Aug 28 '12 at 21:34

I got this problem when I began an explicit transaction in which I created a table in tempdb from a script running in another database (not tempdb). When I committed the transaction, the commit didn't seem to release the lock on the table I had created in tempdb.

Thanks to this page, I USEd tempdb and executed DBCC OPENTRAN and got the SPID of the connection to tempdb that was causing the lock. Then I KILL <SPID number> to kill it.

Not very graceful, and I lost all the information in the table I had created in tempdb, but that was OK in my case.

Your Answer

 
discard

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.