Showing posts with label trace. Show all posts
Showing posts with label trace. Show all posts

Friday, March 30, 2012

Lock:Timeout + urgent

hi,
I am using SQL server 2000.and trying to resolve a deadlock issue.For
this i am looking at SQL profiler.and while turning the trace on, i
select Lock:Timeout event that needs to be traced.When done so, and
executing other requests, there appears an entry which just mentions
spid number, text data field is empty. I would like to know if after
lock times out,then the processes which are waiting for the lock to be
released, are they re tried again.That is if a process is waiting on a
lock,and lock times out,does SQL server tries to retry the same
process again?and if yes then after how much time interval?and is it
possible to set/change this time interval?

Thanks in advance
donThis is always helpful

http://www.sommarskog.se/sqlutil/aba_lockinfo.html

justwantananswer@.rediffmail.com (Don Nelson) wrote in message news:<dbd41fbb.0410210551.1b7f67e9@.posting.google.com>...
> hi,
> I am using SQL server 2000.and trying to resolve a deadlock issue.For
> this i am looking at SQL profiler.and while turning the trace on, i
> select Lock:Timeout event that needs to be traced.When done so, and
> executing other requests, there appears an entry which just mentions
> spid number, text data field is empty. I would like to know if after
> lock times out,then the processes which are waiting for the lock to be
> released, are they re tried again.That is if a process is waiting on a
> lock,and lock times out,does SQL server tries to retry the same
> process again?and if yes then after how much time interval?and is it
> possible to set/change this time interval?
> Thanks in advance
> don

Lock: Timeout - @@LOCK_TIMEOUT

Hi,
Trace file which I have here, contains many Lock: Timeout
events. I don't understand how is it possible when
@.@.LOCK_TIMEOUT is set to -1 for all connections.
Thanks,
OJThis event is generated by a low level system component. Please post the
entire event data column for us to understand the situation.
--
Wei Xiao [MSFT]
SQL Server Storage Engine Development
http://weblogs.asp.net/weix
This posting is provided "AS IS" with no warranties, and confers no rights.
"OJ" <anonymous@.discussions.microsoft.com> wrote in message
news:200b01c4dca6$c0f48a30$a301280a@.phx.gbl...
> Hi,
> Trace file which I have here, contains many Lock: Timeout
> events. I don't understand how is it possible when
> @.@.LOCK_TIMEOUT is set to -1 for all connections.
> Thanks,
> OJ|||I'm not sure how this can help, but here it is (one of
many examples):
row_number=188337
event_class=27
text_Data=NULL
Binary_data=0x000707000DD07C4F23006F01DE541AB4
DatabaseID=14
HostName=PROD1
SPID=73
ObjectID=1333579789
IndexID=30
Mode=3
Also, some of them are caused by SPID lower than 50, and
mode in that case is: 5.
Thanks,
OJ
>--Original Message--
>This event is generated by a low level system component.
Please post the
>entire event data column for us to understand the
situation.
>--
>Wei Xiao [MSFT]
>SQL Server Storage Engine Development
>http://weblogs.asp.net/weix
>This posting is provided "AS IS" with no warranties, and
confers no rights.
>"OJ" <anonymous@.discussions.microsoft.com> wrote in
message
>news:200b01c4dca6$c0f48a30$a301280a@.phx.gbl...
>> Hi,
>> Trace file which I have here, contains many Lock:
Timeout
>> events. I don't understand how is it possible when
>> @.@.LOCK_TIMEOUT is set to -1 for all connections.
>> Thanks,
>> OJ
>
>.
>|||As an optimization, SQL Server internally needs to check if a transaction
can acquire some locks without waiting. When this fails, the lock timeout
event is generated (with a duration of 0) but SQL Server will wait for the
lock instead.
The value of the "Duration" column indicates for how long SQL Server waits
before the timeout. If the value is 0, then this is the internal no-wait
timeout.
--
Wei Xiao [MSFT]
SQL Server Storage Engine Development
http://weblogs.asp.net/weix
This posting is provided "AS IS" with no warranties, and confers no rights.
"OJ" <anonymous@.discussions.microsoft.com> wrote in message
news:193d01c4dd59$34acbc60$a501280a@.phx.gbl...
> I'm not sure how this can help, but here it is (one of
> many examples):
> row_number=188337
> event_class=27
> text_Data=NULL
> Binary_data=0x000707000DD07C4F23006F01DE541AB4
> DatabaseID=14
> HostName=PROD1
> SPID=73
> ObjectID=1333579789
> IndexID=30
> Mode=3
>
> Also, some of them are caused by SPID lower than 50, and
> mode in that case is: 5.
> Thanks,
> OJ
>>--Original Message--
>>This event is generated by a low level system component.
> Please post the
>>entire event data column for us to understand the
> situation.
>>--
>>Wei Xiao [MSFT]
>>SQL Server Storage Engine Development
>>http://weblogs.asp.net/weix
>>This posting is provided "AS IS" with no warranties, and
> confers no rights.
>>"OJ" <anonymous@.discussions.microsoft.com> wrote in
> message
>>news:200b01c4dca6$c0f48a30$a301280a@.phx.gbl...
>> Hi,
>> Trace file which I have here, contains many Lock:
> Timeout
>> events. I don't understand how is it possible when
>> @.@.LOCK_TIMEOUT is set to -1 for all connections.
>> Thanks,
>> OJ
>>
>>.|||Thanks
>--Original Message--
>As an optimization, SQL Server internally needs to check
if a transaction
>can acquire some locks without waiting. When this fails,
the lock timeout
>event is generated (with a duration of 0) but SQL Server
will wait for the
>lock instead.
>The value of the "Duration" column indicates for how long
SQL Server waits
>before the timeout. If the value is 0, then this is the
internal no-wait
>timeout.
>--
>Wei Xiao [MSFT]
>SQL Server Storage Engine Development
>http://weblogs.asp.net/weix
>This posting is provided "AS IS" with no warranties, and
confers no rights.
>"OJ" <anonymous@.discussions.microsoft.com> wrote in
message
>news:193d01c4dd59$34acbc60$a501280a@.phx.gbl...
>> I'm not sure how this can help, but here it is (one of
>> many examples):
>> row_number=188337
>> event_class=27
>> text_Data=NULL
>> Binary_data=0x000707000DD07C4F23006F01DE541AB4
>> DatabaseID=14
>> HostName=PROD1
>> SPID=73
>> ObjectID=1333579789
>> IndexID=30
>> Mode=3
>>
>> Also, some of them are caused by SPID lower than 50, and
>> mode in that case is: 5.
>> Thanks,
>> OJ
>>--Original Message--
>>This event is generated by a low level system component.
>> Please post the
>>entire event data column for us to understand the
>> situation.
>>--
>>Wei Xiao [MSFT]
>>SQL Server Storage Engine Development
>>http://weblogs.asp.net/weix
>>This posting is provided "AS IS" with no warranties, and
>> confers no rights.
>>"OJ" <anonymous@.discussions.microsoft.com> wrote in
>> message
>>news:200b01c4dca6$c0f48a30$a301280a@.phx.gbl...
>> Hi,
>> Trace file which I have here, contains many Lock:
>> Timeout
>> events. I don't understand how is it possible when
>> @.@.LOCK_TIMEOUT is set to -1 for all connections.
>> Thanks,
>> OJ
>>
>>.
>
>.
>sql

Lock: Timeout

I enabled SQL Server Profiler Trace to findout performance issue for one of the application. And I am seeing Lock: Timeout eventclass with duration of 0 on tempdb database with objectID 0. Does this mean anything or need to be worried about?

Because I am seeing this many times in 20 mins trace.

Please check whether you or application is generating static cursor. Static cursors create table in tempdb

Wednesday, March 28, 2012

lock timeout

Hello All-
I've been troubleshooting deadlocks in a third-party app. I ran a trace with the Lock:Deadlock, Lock:Timeout, RPC:Starting, SQL Batch:Starting, and all Error and Warning events. I then imported the output files into a table for analysis. My results show 90,000+ Lock:Timeout events and 20 Lock:Deadlock events for a 5 hour period! The vast majority of the Lock:Timeout events are for index or table resources. The server is running SQL2K, sp3a.
Here's my questions:
-Shouldn't I be seeing corresponding Attention or Exception events for the Lock:Timeouts? I thought SQL Server returned an error 1229 to the client and terminated the statement on a lock timeout. Would I not see this in the trace? Do I really have 90,000+ statements being terminated?
-a small number of the database ids in the Lock:Timeout events are large ids not included in sysdatabases. Where are these coming from? A bug?
-My developers swear that they are not setting a lock_timeout on their connections. Nor can I find a SET LOCK_TIMEOUT statement in the trace output. So why am I getting all these timeouts? I thought SQL Server by default waited indefinitely on a lock.
I confused! Any insight would be greatly appreciated.
thanks-
MargaretUnfortunately that counter is pretty much useless since it includes internal
lightweight timeouts that are normal and always present. You pretty much
have to forget about the majority of them as normal.
--
Andrew J. Kelly SQL MVP
"Margaret" <anonymous@.discussions.microsoft.com> wrote in message
news:57AEA811-A059-4426-B023-5FD611C7D330@.microsoft.com...
> Hello All-
> I've been troubleshooting deadlocks in a third-party app. I ran a trace
with the Lock:Deadlock, Lock:Timeout, RPC:Starting, SQL Batch:Starting, and
all Error and Warning events. I then imported the output files into a table
for analysis. My results show 90,000+ Lock:Timeout events and 20
Lock:Deadlock events for a 5 hour period! The vast majority of the
Lock:Timeout events are for index or table resources. The server is running
SQL2K, sp3a.
> Here's my questions:
> -Shouldn't I be seeing corresponding Attention or Exception events for the
Lock:Timeouts? I thought SQL Server returned an error 1229 to the client
and terminated the statement on a lock timeout. Would I not see this in the
trace? Do I really have 90,000+ statements being terminated?
> -a small number of the database ids in the Lock:Timeout events are large
ids not included in sysdatabases. Where are these coming from? A bug?
> -My developers swear that they are not setting a lock_timeout on their
connections. Nor can I find a SET LOCK_TIMEOUT statement in the trace
output. So why am I getting all these timeouts? I thought SQL Server by
default waited indefinitely on a lock.
> I confused! Any insight would be greatly appreciated.
> thanks-
> Margaret
>