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


SQL Server Database Engine cannot obtain a LOCK resource at this time


SQL Server Database Engine cannot obtain a LOCK resource at this time

Author
Message
mrr_9
mrr_9
Forum Newbie
Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)

Group: General Forum Members
Points: 9 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.Tongue
GilaMonster
GilaMonster
SSC Guru
SSC Guru (228K reputation)SSC Guru (228K reputation)SSC Guru (228K reputation)SSC Guru (228K reputation)SSC Guru (228K reputation)SSC Guru (228K reputation)SSC Guru (228K reputation)SSC Guru (228K reputation)

Group: General Forum Members
Points: 228523 Visits: 46342
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, 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


george sibbald
george sibbald
One Orange Chip
One Orange Chip (25K reputation)One Orange Chip (25K reputation)One Orange Chip (25K reputation)One Orange Chip (25K reputation)One Orange Chip (25K reputation)One Orange Chip (25K reputation)One Orange Chip (25K reputation)One Orange Chip (25K reputation)

Group: General Forum Members
Points: 25100 Visits: 13698
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.

---------------------------------------------------------------------
kris.atherton
kris.atherton
SSC Journeyman
SSC Journeyman (91 reputation)SSC Journeyman (91 reputation)SSC Journeyman (91 reputation)SSC Journeyman (91 reputation)SSC Journeyman (91 reputation)SSC Journeyman (91 reputation)SSC Journeyman (91 reputation)SSC Journeyman (91 reputation)

Group: General Forum Members
Points: 91 Visits: 133
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???!!Crazy

If anyone has experienced this please help??!
george sibbald
george sibbald
One Orange Chip
One Orange Chip (25K reputation)One Orange Chip (25K reputation)One Orange Chip (25K reputation)One Orange Chip (25K reputation)One Orange Chip (25K reputation)One Orange Chip (25K reputation)One Orange Chip (25K reputation)One Orange Chip (25K reputation)

Group: General Forum Members
Points: 25100 Visits: 13698
Kris, any other signs of memory pressure.? Can you allocate more memory to SQL in your environment?

---------------------------------------------------------------------
kris.atherton
kris.atherton
SSC Journeyman
SSC Journeyman (91 reputation)SSC Journeyman (91 reputation)SSC Journeyman (91 reputation)SSC Journeyman (91 reputation)SSC Journeyman (91 reputation)SSC Journeyman (91 reputation)SSC Journeyman (91 reputation)SSC Journeyman (91 reputation)

Group: General Forum Members
Points: 91 Visits: 133
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!
george sibbald
george sibbald
One Orange Chip
One Orange Chip (25K reputation)One Orange Chip (25K reputation)One Orange Chip (25K reputation)One Orange Chip (25K reputation)One Orange Chip (25K reputation)One Orange Chip (25K reputation)One Orange Chip (25K reputation)One Orange Chip (25K reputation)

Group: General Forum Members
Points: 25100 Visits: 13698
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.

---------------------------------------------------------------------
kris.atherton
kris.atherton
SSC Journeyman
SSC Journeyman (91 reputation)SSC Journeyman (91 reputation)SSC Journeyman (91 reputation)SSC Journeyman (91 reputation)SSC Journeyman (91 reputation)SSC Journeyman (91 reputation)SSC Journeyman (91 reputation)SSC Journeyman (91 reputation)

Group: General Forum Members
Points: 91 Visits: 133
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!
Jeganathan.M
Jeganathan.M
Grasshopper
Grasshopper (11 reputation)Grasshopper (11 reputation)Grasshopper (11 reputation)Grasshopper (11 reputation)Grasshopper (11 reputation)Grasshopper (11 reputation)Grasshopper (11 reputation)Grasshopper (11 reputation)

Group: General Forum Members
Points: 11 Visits: 86
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.
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