Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

SQL Server Database Engine cannot obtain a LOCK resource at this time Expand / Collapse
Author
Message
Posted Sunday, October 12, 2008 2:46 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Sunday, October 12, 2008 2:42 AM
Points: 1, Visits: 0
The instance of the SQL Server Database Engine cannot obtain a LOCK resource at this time. Rerun your statement when there are fewer active users. Ask the database administrator to check the lock and memory configuration for this instance, or to check for long-running transactions.

For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.:P
Post #584519
Posted Sunday, October 12, 2008 3:19 AM


SSC-Forever

SSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-Forever

Group: General Forum Members
Last Login: Today @ 7:54 AM
Points: 42,768, Visits: 35,867
What statement were you trying to run? Was that the full error message? Was there any reference to what resource it was trying to lock?


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 #584525
Posted Sunday, October 12, 2008 6:36 AM
SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Yesterday @ 3:52 PM
Points: 5,990, Visits: 12,923
each lock that SQL takes out uses up a small amount of memory (cannot remember how much - something like a few KB). The upper limit of no of locks can be configured to a set value but the default, and usual setting, is to allow SQL to dynamically configure the upper limit depending on memory available. Check to see how yours is set (it listed at the start of the errrorlog or use server properties or sp_configure), but chances are it is dynamic so this message is telling you have run out of memory.

This will be down to the overall workload at that time which is why the error message says try rerunning the query at a quieter time.

As Gail says try and identify what is running at the time and whether any queries can be tuned to take out fewer locks, or hold them for a shorter time. Index defrags on large tables are quite often a culprit here.

Of course you may just need more memory.


---------------------------------------------------------------------

Post #584538
Posted Tuesday, March 3, 2009 10:28 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Thursday, June 5, 2014 8:13 AM
Points: 34, Visits: 121
I'm currently suffering from the same issue. All the performance tuning in the world is still leading to this error message:-
'The instance of the SQL Server Database Engine cannot obtain a LOCK resource at this time. Rerun your statement when there are fewer active users. Ask the database administrator to check the lock and memory configuration for this instance, or to check for long-running transactions'

This has only recently started to affect all the databases' on two differnt SQL instances which suggest it isn't a configuration but maybe a hardware issue. Using both profiler and DMV's I can't find any actual locks???!!

If anyone has experienced this please help??!
Post #667490
Posted Tuesday, March 3, 2009 10:41 AM
SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Yesterday @ 3:52 PM
Points: 5,990, Visits: 12,923
Kris, any other signs of memory pressure.? Can you allocate more memory to SQL in your environment?

---------------------------------------------------------------------

Post #667498
Posted Wednesday, March 4, 2009 8:23 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Thursday, June 5, 2014 8:13 AM
Points: 34, Visits: 121
Thanks for your response.

There was 3.2GB on the box- 2.5G allocated to SQL. The average avaliable mememory was less than 200mb across the day although we'd reduced the number of processes to a minimum- resulting in the above error with almost every query ran against it.

As an MI dept when SPID's hung for too long (hours) we'd kill the proces which would then go into roll back then we tended to reboot the box- this started happening weekly.

This solved the issue in most instances but ( as far as i understand) we were openeing ourseleves up for some sort of data corruption.

I think this finally caught up with us. To fix it I eneded up backing up the master DB. Touch wood this seems to have resolved the Locks.............although i wouldn't recommend managing your datawarehouses like this!
Post #668288
Posted Wednesday, March 4, 2009 8:36 AM
SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Yesterday @ 3:52 PM
Points: 5,990, Visits: 12,923
backing up master db won't affect no of locks held, though it is something you should be doing on a regular basis!

use sp_lock to see how many locks are taken out.

sounds like you have /3gb switch enabled or this is 64 bit? I would look to up the amount of physical RAM you have if possible.

Are these processes hung or just long running? Whilst they remain active they will hold onto their locks (possibly causing blocking) so investigations into what is happening to these connections will be worthwhile.


---------------------------------------------------------------------

Post #668319
Posted Wednesday, March 4, 2009 8:56 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Thursday, June 5, 2014 8:13 AM
Points: 34, Visits: 121
This issue was well beyond sp_lock. It's 32 bit and on it's own box ( not a VM). As i understand it-SQL server takes 80% of server resource which is what is happening in this case- split equally between 2 instances. It turns out only one instance was failing.

I'm not new to SQL server- have monitored locks and performance tuned queries extensively but this was different- more like there weren't locks - just flags/ errors saying there was. I quessed a system table was corrupt in someway- quite a leap I know, but after this fix it appears to have solved our situation..........at least untill we move onto two new box's with higher spec which are on order.

It seems a strange solution I know but if i helps anyone else -great!
Post #668348
Posted Wednesday, September 19, 2012 12:19 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Tuesday, June 10, 2014 4:30 AM
Points: 1, Visits: 52
I had a same error from SQL job in one step which is executing a stored procedure.
And the reason was that at the same time index defragmentation and statstics update job was executing and it had a Schema-M lock on the table.
Post #1361146
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse