Showing posts with label time. Show all posts
Showing posts with label time. Show all posts

Friday, March 30, 2012

Lock_timeout

Hello there,
Is there any way to set a default lock time out for the server with out using the sentence SET LOCK_TIMEOUT 20 ?
Could you explain me step by step ?
Thanks !Please Check sp_configure locks execute this first check the locks space allocated, Increase the locks by executing sp_configure locks 100000 then execute the Store Procedure you will not get the problem.|||Please try with this procedure
Execute sp_configure locks
check the locks allocated
now increase the locks by exec
Execute sp_configure locks 100000
then execute your request you will not get the error|||Thanks !|||I want to eliminate automatically every lock after 10 seconds and I did this:

USE master
go
EXEC sp_configure 'locks', 10000
go
RECONFIGURE WITH OVERRIDE
go

Is this correct ? Do I have to restart sql server ?

Thanks|||If you want to make the locks "go away", why not just ignore them and deal with the consequences later? You can set the transaction isolation level down, and the server will just ignore the locks held by other processes.

This is very dangerous, but it is less dangerous than simply trying to break the existing locks since it only puts your process at risk instead of the whole server.

-PatP|||I want to eliminate automatically every lock after 10 seconds and I did this:

USE master
go
EXEC sp_configure 'locks', 10000
go
RECONFIGURE WITH OVERRIDE
go

Is this correct ? Do I have to restart sql server ?

Thanks

Yes, Exactly

Lock_timeout

Hello,

in EM (SQL7) i got the following errormessage, when i click on
current activity:

"Error: 1222 lock request time out period exceeded"

I run the sp_who /sp_who2, but nothing is blocked.

I set the lock_timeout th 5000, but it does not help.

Does anyone have an idea ?

best regards

Martinnetwork traffic is an idea
try to change for instance from tcp/ip to netbeui, or vice versa as the protocol you use to connect to the db server
see what happens.

also try to run a performance monitor to the db server.

check for cpu usage and latches.

if avg.latch wait time is high, ie. over 1000 and total latch wait time is also high i.e. over 100 for instance, then you probably experience sql server locks (watch for lock timeout /second)...

this can mean that the server is small, the app is poor, problem with your net h/w...

but this is some place to start with...

Cheers.|||Thanks for help Arounis,

network traffic is not possible, because i can log on to the server an got
the same error message.

For remember: I only get the error message, when i click on current activity in EM. No User told me that a problem still exits.

Checking avg.latch time and total latch time results:

520 constant for avg latch time

0 - 16 for total latch time.

You don't think that the problem occours about a "user - transaction" ?

Martin|||Try seeing if there is a locked resource which doesn't have a corresponding entry in sysprocesses

select *
from master..syslocks a
left join master..sysprocesses b on a.spid = b.spid
where b.spid is null

You shouldn't get any results.
Don't know what to tell you if you get any results.|||Thanks Wilso_s, but i get no results.

One more detail i detected, is that i can't access the
tempdb in EM. EM hangs up.

This short KB artikel Q308518 describes problems with
tempdb, but there is no workaround.

Maybe a restart will help ?

Thnx

lock/ deadlock questions

I got 4 deadlocks in 15 minutes yesterday. The first three happened in a 1
second time frame and the last 1 happened 15 minutes later. From looking in
the SQL error log it what appear that they all got hosed by the same spid.
Ive been reading up on Locking this morning and how it affects Deadlocks and
have some questions. Im pretty clueless about Locking from what Im finding
out so please be gentle. According to BOL-Update Locks:
--start
Update Locks
Update (U) locks prevent a common form of deadlock. A typical update pattern
consists of a transaction reading a record, acquiring a shared (S) lock on
the resource (page or row), and then modifying the row, which requires lock
conversion to an exclusive (X) lock. If two transactions acquire shared-mode
locks on a resource and then attempt to update data concurrently, one
transaction attempts the lock conversion to an exclusive (X) lock. The
shared-mode-to-exclusive lock conversion must wait because the exclusive
lock for one transaction is not compatible with the shared-mode lock of the
other transaction; a lock wait occurs. The second transaction attempts to
acquire an exclusive (X) lock for its update. Because both transactions are
converting to exclusive (X) locks, and they are each waiting for the other
transaction to release its shared-mode lock, a deadlock occurs.
To avoid this potential deadlock problem, update (U) locks are used. Only
one transaction can obtain an update (U) lock to a resource at a time. If a
transaction modifies a resource, the update (U) lock is converted to an
exclusive (X) lock. Otherwise, the lock is converted to a shared-mode lock.
--finish
But then in Deadlocks, Avoiding it also says (Gauranteed Deadlock picture):
Transaction 1 Transaction 2
Begin Trans Begin Trans
Update Supplier Update Part
Update Part Update Supplier
Commit Trans Commit Trans
So my questions are:
Do the Begin Trans above actually mean having BEGIN TRANS inside your Proc?
Also, shouldnt these type of Deadlocks not occur since becuase of Update
Locks saving the day?
--
SQL2K SP3
TIA, ChrisROn Sat, 18 Dec 2004 08:26:53 -0800, "ChrisR" <bla@.noemail.com> wrote:
>But then in Deadlocks, Avoiding it also says (Gauranteed Deadlock picture):
>Transaction 1 Transaction 2
>Begin Trans Begin Trans
>Update Supplier Update Part
>Update Part Update Supplier
>Commit Trans Commit Trans
>So my questions are:
>Do the Begin Trans above actually mean having BEGIN TRANS inside your Proc?
>Also, shouldnt these type of Deadlocks not occur since becuase of Update
>Locks saving the day?
Yes, actually use BEGIN TRANS, that gives you a multi-statement atomic
transaction. Of course, multi-statement transactions are exactly what
get tangled most often in deadlocks, but you do want atomic
transactions, right?
The #1 way to get deadlocks is as illustrated - get the same things in
a different order. If you get them in the SAME order, you avoid
deadlocks. You may occassionally get them anyway from obscure effects
of larger statements that maybe get internally deadlocked over index
pages or other things that are normally invisible, but the rule is:
define a fixed order for getting multiple resources, and you eliminate
about 98% of deadlock problems.
These internal lock types are things you shouldn't ever have to worry
about, IMHO.
J.|||Are deadlocks possible without specifying a transaction?
> >Connection 1 Connection 2
> >Update Supplier Update Part
> >Update Part Update Supplier
"JXStern" <JXSternChangeX2R@.gte.net> wrote in message
news:esq8s0hlo06qr3e3nr4e9rv6688jg8f8c7@.4ax.com...
> On Sat, 18 Dec 2004 08:26:53 -0800, "ChrisR" <bla@.noemail.com> wrote:
> >But then in Deadlocks, Avoiding it also says (Gauranteed Deadlock
picture):
> >
> >Transaction 1 Transaction 2
> >Begin Trans Begin Trans
> >Update Supplier Update Part
> >Update Part Update Supplier
> >Commit Trans Commit Trans
> >
> >So my questions are:
> >
> >Do the Begin Trans above actually mean having BEGIN TRANS inside your
Proc?
> >Also, shouldnt these type of Deadlocks not occur since becuase of Update
> >Locks saving the day?
> Yes, actually use BEGIN TRANS, that gives you a multi-statement atomic
> transaction. Of course, multi-statement transactions are exactly what
> get tangled most often in deadlocks, but you do want atomic
> transactions, right?
> The #1 way to get deadlocks is as illustrated - get the same things in
> a different order. If you get them in the SAME order, you avoid
> deadlocks. You may occassionally get them anyway from obscure effects
> of larger statements that maybe get internally deadlocked over index
> pages or other things that are normally invisible, but the rule is:
> define a fixed order for getting multiple resources, and you eliminate
> about 98% of deadlock problems.
> These internal lock types are things you shouldn't ever have to worry
> about, IMHO.
> J.
>|||Yes - transactions can also be declared above the stored proc, either in
TSQL that calls the stored proc or by a client transaction monitor such as
COM+.
Regards,
Greg Linwood
SQL Server MVP
"ChrisR" <bla@.noemail.com> wrote in message
news:ueoyI6S5EHA.2180@.TK2MSFTNGP12.phx.gbl...
> Are deadlocks possible without specifying a transaction?
>> >Connection 1 Connection 2
>> >Update Supplier Update Part
>> >Update Part Update Supplier
>
>
>
> "JXStern" <JXSternChangeX2R@.gte.net> wrote in message
> news:esq8s0hlo06qr3e3nr4e9rv6688jg8f8c7@.4ax.com...
>> On Sat, 18 Dec 2004 08:26:53 -0800, "ChrisR" <bla@.noemail.com> wrote:
>> >But then in Deadlocks, Avoiding it also says (Gauranteed Deadlock
> picture):
>> >
>> >Transaction 1 Transaction 2
>> >Begin Trans Begin Trans
>> >Update Supplier Update Part
>> >Update Part Update Supplier
>> >Commit Trans Commit Trans
>> >
>> >So my questions are:
>> >
>> >Do the Begin Trans above actually mean having BEGIN TRANS inside your
> Proc?
>> >Also, shouldnt these type of Deadlocks not occur since becuase of Update
>> >Locks saving the day?
>> Yes, actually use BEGIN TRANS, that gives you a multi-statement atomic
>> transaction. Of course, multi-statement transactions are exactly what
>> get tangled most often in deadlocks, but you do want atomic
>> transactions, right?
>> The #1 way to get deadlocks is as illustrated - get the same things in
>> a different order. If you get them in the SAME order, you avoid
>> deadlocks. You may occassionally get them anyway from obscure effects
>> of larger statements that maybe get internally deadlocked over index
>> pages or other things that are normally invisible, but the rule is:
>> define a fixed order for getting multiple resources, and you eliminate
>> about 98% of deadlock problems.
>> These internal lock types are things you shouldn't ever have to worry
>> about, IMHO.
>> J.
>|||I may have phrased my question wrong. Say these two guys aren't in a
transaction:
> >> >Connection 1 Connection 2
> >> >Update Supplier Update Part
> >> >Update Part Update Supplier
> >
Is it still possible to have a deadlock?
"Greg Linwood" <g_linwoodQhotmail.com> wrote in message
news:#gY2YAZ5EHA.4028@.TK2MSFTNGP15.phx.gbl...
> Yes - transactions can also be declared above the stored proc, either in
> TSQL that calls the stored proc or by a client transaction monitor such as
> COM+.
> Regards,
> Greg Linwood
> SQL Server MVP
> "ChrisR" <bla@.noemail.com> wrote in message
> news:ueoyI6S5EHA.2180@.TK2MSFTNGP12.phx.gbl...
> > Are deadlocks possible without specifying a transaction?
> >
> >> >Connection 1 Connection 2
> >> >Update Supplier Update Part
> >> >Update Part Update Supplier
> >
> >
> >
> >
> >
> >
> > "JXStern" <JXSternChangeX2R@.gte.net> wrote in message
> > news:esq8s0hlo06qr3e3nr4e9rv6688jg8f8c7@.4ax.com...
> >> On Sat, 18 Dec 2004 08:26:53 -0800, "ChrisR" <bla@.noemail.com> wrote:
> >> >But then in Deadlocks, Avoiding it also says (Gauranteed Deadlock
> > picture):
> >> >
> >> >Transaction 1 Transaction 2
> >> >Begin Trans Begin Trans
> >> >Update Supplier Update Part
> >> >Update Part Update Supplier
> >> >Commit Trans Commit Trans
> >> >
> >> >So my questions are:
> >> >
> >> >Do the Begin Trans above actually mean having BEGIN TRANS inside your
> > Proc?
> >> >Also, shouldnt these type of Deadlocks not occur since becuase of
Update
> >> >Locks saving the day?
> >>
> >> Yes, actually use BEGIN TRANS, that gives you a multi-statement atomic
> >> transaction. Of course, multi-statement transactions are exactly what
> >> get tangled most often in deadlocks, but you do want atomic
> >> transactions, right?
> >>
> >> The #1 way to get deadlocks is as illustrated - get the same things in
> >> a different order. If you get them in the SAME order, you avoid
> >> deadlocks. You may occassionally get them anyway from obscure effects
> >> of larger statements that maybe get internally deadlocked over index
> >> pages or other things that are normally invisible, but the rule is:
> >> define a fixed order for getting multiple resources, and you eliminate
> >> about 98% of deadlock problems.
> >>
> >> These internal lock types are things you shouldn't ever have to worry
> >> about, IMHO.
> >>
> >> J.
> >>
> >
> >
>|||On Sat, 18 Dec 2004 10:22:53 -0800, "ChrisR" <bla@.noemail.com> wrote:
>Are deadlocks possible without specifying a transaction?
>> >Connection 1 Connection 2
>> >Update Supplier Update Part
>> >Update Part Update Supplier
In theory, this should eliminate deadlock problems.
But note that instead, you have "race" problems, where first #1
updates the supplier, then #2 updates the part, then #1 tries to
update the part but doesn't know what #2 already updated it, yada
yada.
And on occassion there have been SQLServer bugs with parallelism that
caused deadlocks from even single statements, just to spice up your
life a little!
J.|||ChrisR wrote:
> I may have phrased my question wrong. Say these two guys aren't in a
> transaction:
>> Connection 1 Connection 2
>> Update Supplier Update Part
>> Update Part Update Supplier
> Is it still possible to have a deadlock?
>
See Autocommit Transactions in BOL. That should explain what you are
asking. From a tool like QA, the answer is no. You won't see a deadlock
since each statement is atomic. This assumes you have autocommit
transactions turned on (the default). If you have implicit transactions
on (see SET IMPLICIT_TRANSACTIONS in BOL), a transaction is
automatically started for you on the first statement. In that case, you
would have a deadlock possibility. If these were executed from an
application, it would depend on the properties of the connection and how
the library handles this case.
--
David Gugick
Imceda Software
www.imceda.com|||Also, don't confuse an UPDATE statement with an UPDATE LOCK. In the
example, the normal Share to Exclusive lock conversion will happen, if the
two statements were written thus, a deadlock could be avoided:
Connection 1 Connection 2
-- --
--
UPDATE Supplier WITH (UPDLOCK) UPDATE Part WITH (UPDLOCK)
UPDATE Part WITH(UPDLOCK) UPDATE Supplier WITH (UPDLOCK)
If you coded this update within a stored procedure, you could gain further
control by accessing the resources in the same order, thus, further reducing
the chances for deadlocking.
Sincerely,
Anthony Thomas
"David Gugick" <davidg-nospam@.imceda.com> wrote in message
news:eLNZbff5EHA.3376@.TK2MSFTNGP12.phx.gbl...
ChrisR wrote:
> I may have phrased my question wrong. Say these two guys aren't in a
> transaction:
>> Connection 1 Connection 2
>> Update Supplier Update Part
>> Update Part Update Supplier
> Is it still possible to have a deadlock?
>
See Autocommit Transactions in BOL. That should explain what you are
asking. From a tool like QA, the answer is no. You won't see a deadlock
since each statement is atomic. This assumes you have autocommit
transactions turned on (the default). If you have implicit transactions
on (see SET IMPLICIT_TRANSACTIONS in BOL), a transaction is
automatically started for you on the first statement. In that case, you
would have a deadlock possibility. If these were executed from an
application, it would depend on the properties of the connection and how
the library handles this case.
--
David Gugick
Imceda Software
www.imceda.com|||Conceptually no, but if you really want to get to the bottom of your
deadlock source, I suggest you trace the deadlock graph to the error log
usiny DBCC TRACEON (1204, 2605, -1) so we can give you a concise answer to
what's actually going on in your db when a deadlock occurs.
JXStern's given you some good advice - there are the wel documented deadlock
scenarios such as cyclical deadlocking (what you're describing), conversion
deadlocking (update lock escalation conflicts) but also other types which
occur deeper within the DB such as parallelism deadlocks. Examples of the
single statement deadlocking he referred to includes Update Supplier, where
Supplier has multiple indexes. The same update statement might update the
various indexes on the table in conflicting orders and cause an internal
deadlock. This happens and is fairly common. If you log & post your deadlock
trace graph, you'll get the full picture about what's going on when you
experience your deadlocks.
Regards,
Greg Linwood
SQL Server MVP
"ChrisR" <bla@.noemail.com> wrote in message
news:ugSJ4Ue5EHA.3616@.TK2MSFTNGP11.phx.gbl...
>I may have phrased my question wrong. Say these two guys aren't in a
> transaction:
>> >> >Connection 1 Connection 2
>> >> >Update Supplier Update Part
>> >> >Update Part Update Supplier
>> >
> Is it still possible to have a deadlock?
>
> "Greg Linwood" <g_linwoodQhotmail.com> wrote in message
> news:#gY2YAZ5EHA.4028@.TK2MSFTNGP15.phx.gbl...
>> Yes - transactions can also be declared above the stored proc, either in
>> TSQL that calls the stored proc or by a client transaction monitor such
>> as
>> COM+.
>> Regards,
>> Greg Linwood
>> SQL Server MVP
>> "ChrisR" <bla@.noemail.com> wrote in message
>> news:ueoyI6S5EHA.2180@.TK2MSFTNGP12.phx.gbl...
>> > Are deadlocks possible without specifying a transaction?
>> >
>> >> >Connection 1 Connection 2
>> >> >Update Supplier Update Part
>> >> >Update Part Update Supplier
>> >
>> >
>> >
>> >
>> >
>> >
>> > "JXStern" <JXSternChangeX2R@.gte.net> wrote in message
>> > news:esq8s0hlo06qr3e3nr4e9rv6688jg8f8c7@.4ax.com...
>> >> On Sat, 18 Dec 2004 08:26:53 -0800, "ChrisR" <bla@.noemail.com> wrote:
>> >> >But then in Deadlocks, Avoiding it also says (Gauranteed Deadlock
>> > picture):
>> >> >
>> >> >Transaction 1 Transaction 2
>> >> >Begin Trans Begin Trans
>> >> >Update Supplier Update Part
>> >> >Update Part Update Supplier
>> >> >Commit Trans Commit Trans
>> >> >
>> >> >So my questions are:
>> >> >
>> >> >Do the Begin Trans above actually mean having BEGIN TRANS inside your
>> > Proc?
>> >> >Also, shouldnt these type of Deadlocks not occur since becuase of
> Update
>> >> >Locks saving the day?
>> >>
>> >> Yes, actually use BEGIN TRANS, that gives you a multi-statement atomic
>> >> transaction. Of course, multi-statement transactions are exactly what
>> >> get tangled most often in deadlocks, but you do want atomic
>> >> transactions, right?
>> >>
>> >> The #1 way to get deadlocks is as illustrated - get the same things in
>> >> a different order. If you get them in the SAME order, you avoid
>> >> deadlocks. You may occassionally get them anyway from obscure effects
>> >> of larger statements that maybe get internally deadlocked over index
>> >> pages or other things that are normally invisible, but the rule is:
>> >> define a fixed order for getting multiple resources, and you eliminate
>> >> about 98% of deadlock problems.
>> >>
>> >> These internal lock types are things you shouldn't ever have to worry
>> >> about, IMHO.
>> >>
>> >> J.
>> >>
>> >
>> >
>>
>|||The send to error log trace flag is 3605 not 2605.
Sincerely,
Anthony Thomas
"Greg Linwood" <g_linwoodQhotmail.com> wrote in message
news:uCZgY5o5EHA.2156@.TK2MSFTNGP10.phx.gbl...
Conceptually no, but if you really want to get to the bottom of your
deadlock source, I suggest you trace the deadlock graph to the error log
usiny DBCC TRACEON (1204, 2605, -1) so we can give you a concise answer to
what's actually going on in your db when a deadlock occurs.
JXStern's given you some good advice - there are the wel documented deadlock
scenarios such as cyclical deadlocking (what you're describing), conversion
deadlocking (update lock escalation conflicts) but also other types which
occur deeper within the DB such as parallelism deadlocks. Examples of the
single statement deadlocking he referred to includes Update Supplier, where
Supplier has multiple indexes. The same update statement might update the
various indexes on the table in conflicting orders and cause an internal
deadlock. This happens and is fairly common. If you log & post your deadlock
trace graph, you'll get the full picture about what's going on when you
experience your deadlocks.
Regards,
Greg Linwood
SQL Server MVP
"ChrisR" <bla@.noemail.com> wrote in message
news:ugSJ4Ue5EHA.3616@.TK2MSFTNGP11.phx.gbl...
>I may have phrased my question wrong. Say these two guys aren't in a
> transaction:
>> >> >Connection 1 Connection 2
>> >> >Update Supplier Update Part
>> >> >Update Part Update Supplier
>> >
> Is it still possible to have a deadlock?
>
> "Greg Linwood" <g_linwoodQhotmail.com> wrote in message
> news:#gY2YAZ5EHA.4028@.TK2MSFTNGP15.phx.gbl...
>> Yes - transactions can also be declared above the stored proc, either in
>> TSQL that calls the stored proc or by a client transaction monitor such
>> as
>> COM+.
>> Regards,
>> Greg Linwood
>> SQL Server MVP
>> "ChrisR" <bla@.noemail.com> wrote in message
>> news:ueoyI6S5EHA.2180@.TK2MSFTNGP12.phx.gbl...
>> > Are deadlocks possible without specifying a transaction?
>> >
>> >> >Connection 1 Connection 2
>> >> >Update Supplier Update Part
>> >> >Update Part Update Supplier
>> >
>> >
>> >
>> >
>> >
>> >
>> > "JXStern" <JXSternChangeX2R@.gte.net> wrote in message
>> > news:esq8s0hlo06qr3e3nr4e9rv6688jg8f8c7@.4ax.com...
>> >> On Sat, 18 Dec 2004 08:26:53 -0800, "ChrisR" <bla@.noemail.com> wrote:
>> >> >But then in Deadlocks, Avoiding it also says (Gauranteed Deadlock
>> > picture):
>> >> >
>> >> >Transaction 1 Transaction 2
>> >> >Begin Trans Begin Trans
>> >> >Update Supplier Update Part
>> >> >Update Part Update Supplier
>> >> >Commit Trans Commit Trans
>> >> >
>> >> >So my questions are:
>> >> >
>> >> >Do the Begin Trans above actually mean having BEGIN TRANS inside your
>> > Proc?
>> >> >Also, shouldnt these type of Deadlocks not occur since becuase of
> Update
>> >> >Locks saving the day?
>> >>
>> >> Yes, actually use BEGIN TRANS, that gives you a multi-statement atomic
>> >> transaction. Of course, multi-statement transactions are exactly what
>> >> get tangled most often in deadlocks, but you do want atomic
>> >> transactions, right?
>> >>
>> >> The #1 way to get deadlocks is as illustrated - get the same things in
>> >> a different order. If you get them in the SAME order, you avoid
>> >> deadlocks. You may occassionally get them anyway from obscure effects
>> >> of larger statements that maybe get internally deadlocked over index
>> >> pages or other things that are normally invisible, but the rule is:
>> >> define a fixed order for getting multiple resources, and you eliminate
>> >> about 98% of deadlock problems.
>> >>
>> >> These internal lock types are things you shouldn't ever have to worry
>> >> about, IMHO.
>> >>
>> >> J.
>> >>
>> >
>> >
>>
>|||Thanks for picking that typo up!
Cheers,
Greg Linwood
SQL Server MVP
"AnthonyThomas" <Anthony.Thomas@.CommerceBank.com> wrote in message
news:ek9x4sp5EHA.2012@.TK2MSFTNGP15.phx.gbl...
> The send to error log trace flag is 3605 not 2605.
> Sincerely,
>
> Anthony Thomas
>
> --
> "Greg Linwood" <g_linwoodQhotmail.com> wrote in message
> news:uCZgY5o5EHA.2156@.TK2MSFTNGP10.phx.gbl...
> Conceptually no, but if you really want to get to the bottom of your
> deadlock source, I suggest you trace the deadlock graph to the error log
> usiny DBCC TRACEON (1204, 2605, -1) so we can give you a concise answer to
> what's actually going on in your db when a deadlock occurs.
> JXStern's given you some good advice - there are the wel documented
> deadlock
> scenarios such as cyclical deadlocking (what you're describing),
> conversion
> deadlocking (update lock escalation conflicts) but also other types which
> occur deeper within the DB such as parallelism deadlocks. Examples of the
> single statement deadlocking he referred to includes Update Supplier,
> where
> Supplier has multiple indexes. The same update statement might update the
> various indexes on the table in conflicting orders and cause an internal
> deadlock. This happens and is fairly common. If you log & post your
> deadlock
> trace graph, you'll get the full picture about what's going on when you
> experience your deadlocks.
> Regards,
> Greg Linwood
> SQL Server MVP
> "ChrisR" <bla@.noemail.com> wrote in message
> news:ugSJ4Ue5EHA.3616@.TK2MSFTNGP11.phx.gbl...
>>I may have phrased my question wrong. Say these two guys aren't in a
>> transaction:
>> >> >Connection 1 Connection 2
>> >> >Update Supplier Update Part
>> >> >Update Part Update Supplier
>> >
>> Is it still possible to have a deadlock?
>>
>> "Greg Linwood" <g_linwoodQhotmail.com> wrote in message
>> news:#gY2YAZ5EHA.4028@.TK2MSFTNGP15.phx.gbl...
>> Yes - transactions can also be declared above the stored proc, either in
>> TSQL that calls the stored proc or by a client transaction monitor such
>> as
>> COM+.
>> Regards,
>> Greg Linwood
>> SQL Server MVP
>> "ChrisR" <bla@.noemail.com> wrote in message
>> news:ueoyI6S5EHA.2180@.TK2MSFTNGP12.phx.gbl...
>> > Are deadlocks possible without specifying a transaction?
>> >
>> >> >Connection 1 Connection 2
>> >> >Update Supplier Update Part
>> >> >Update Part Update Supplier
>> >
>> >
>> >
>> >
>> >
>> >
>> > "JXStern" <JXSternChangeX2R@.gte.net> wrote in message
>> > news:esq8s0hlo06qr3e3nr4e9rv6688jg8f8c7@.4ax.com...
>> >> On Sat, 18 Dec 2004 08:26:53 -0800, "ChrisR" <bla@.noemail.com> wrote:
>> >> >But then in Deadlocks, Avoiding it also says (Gauranteed Deadlock
>> > picture):
>> >> >
>> >> >Transaction 1 Transaction 2
>> >> >Begin Trans Begin Trans
>> >> >Update Supplier Update Part
>> >> >Update Part Update Supplier
>> >> >Commit Trans Commit Trans
>> >> >
>> >> >So my questions are:
>> >> >
>> >> >Do the Begin Trans above actually mean having BEGIN TRANS inside
>> >> >your
>> > Proc?
>> >> >Also, shouldnt these type of Deadlocks not occur since becuase of
>> Update
>> >> >Locks saving the day?
>> >>
>> >> Yes, actually use BEGIN TRANS, that gives you a multi-statement
>> >> atomic
>> >> transaction. Of course, multi-statement transactions are exactly
>> >> what
>> >> get tangled most often in deadlocks, but you do want atomic
>> >> transactions, right?
>> >>
>> >> The #1 way to get deadlocks is as illustrated - get the same things
>> >> in
>> >> a different order. If you get them in the SAME order, you avoid
>> >> deadlocks. You may occassionally get them anyway from obscure
>> >> effects
>> >> of larger statements that maybe get internally deadlocked over index
>> >> pages or other things that are normally invisible, but the rule is:
>> >> define a fixed order for getting multiple resources, and you
>> >> eliminate
>> >> about 98% of deadlock problems.
>> >>
>> >> These internal lock types are things you shouldn't ever have to worry
>> >> about, IMHO.
>> >>
>> >> J.
>> >>
>> >
>> >
>>
>>
>

lock/ deadlock questions

I got 4 deadlocks in 15 minutes yesterday. The first three happened in a 1
second time frame and the last 1 happened 15 minutes later. From looking in
the SQL error log it what appear that they all got hosed by the same spid.
Ive been reading up on Locking this morning and how it affects Deadlocks and
have some questions. Im pretty clueless about Locking from what Im finding
out so please be gentle. According to BOL-Update Locks:
--start
Update Locks
Update (U) locks prevent a common form of deadlock. A typical update pattern
consists of a transaction reading a record, acquiring a shared (S) lock on
the resource (page or row), and then modifying the row, which requires lock
conversion to an exclusive (X) lock. If two transactions acquire shared-mode
locks on a resource and then attempt to update data concurrently, one
transaction attempts the lock conversion to an exclusive (X) lock. The
shared-mode-to-exclusive lock conversion must wait because the exclusive
lock for one transaction is not compatible with the shared-mode lock of the
other transaction; a lock wait occurs. The second transaction attempts to
acquire an exclusive (X) lock for its update. Because both transactions are
converting to exclusive (X) locks, and they are each waiting for the other
transaction to release its shared-mode lock, a deadlock occurs.
To avoid this potential deadlock problem, update (U) locks are used. Only
one transaction can obtain an update (U) lock to a resource at a time. If a
transaction modifies a resource, the update (U) lock is converted to an
exclusive (X) lock. Otherwise, the lock is converted to a shared-mode lock.
--finish
But then in Deadlocks, Avoiding it also says (Gauranteed Deadlock picture):
Transaction 1 Transaction 2
Begin Trans Begin Trans
Update Supplier Update Part
Update Part Update Supplier
Commit Trans Commit Trans
So my questions are:
Do the Begin Trans above actually mean having BEGIN TRANS inside your Proc?
Also, shouldnt these type of Deadlocks not occur since becuase of Update
Locks saving the day?
SQL2K SP3
TIA, ChrisR
On Sat, 18 Dec 2004 08:26:53 -0800, "ChrisR" <bla@.noemail.com> wrote:
>But then in Deadlocks, Avoiding it also says (Gauranteed Deadlock picture):
>Transaction 1 Transaction 2
>Begin Trans Begin Trans
>Update Supplier Update Part
>Update Part Update Supplier
>Commit Trans Commit Trans
>So my questions are:
>Do the Begin Trans above actually mean having BEGIN TRANS inside your Proc?
>Also, shouldnt these type of Deadlocks not occur since becuase of Update
>Locks saving the day?
Yes, actually use BEGIN TRANS, that gives you a multi-statement atomic
transaction. Of course, multi-statement transactions are exactly what
get tangled most often in deadlocks, but you do want atomic
transactions, right?
The #1 way to get deadlocks is as illustrated - get the same things in
a different order. If you get them in the SAME order, you avoid
deadlocks. You may occassionally get them anyway from obscure effects
of larger statements that maybe get internally deadlocked over index
pages or other things that are normally invisible, but the rule is:
define a fixed order for getting multiple resources, and you eliminate
about 98% of deadlock problems.
These internal lock types are things you shouldn't ever have to worry
about, IMHO.
J.
|||Are deadlocks possible without specifying a transaction?
[vbcol=seagreen]
"JXStern" <JXSternChangeX2R@.gte.net> wrote in message
news:esq8s0hlo06qr3e3nr4e9rv6688jg8f8c7@.4ax.com... [vbcol=seagreen]
> On Sat, 18 Dec 2004 08:26:53 -0800, "ChrisR" <bla@.noemail.com> wrote:
picture):[vbcol=seagreen]
Proc?
> Yes, actually use BEGIN TRANS, that gives you a multi-statement atomic
> transaction. Of course, multi-statement transactions are exactly what
> get tangled most often in deadlocks, but you do want atomic
> transactions, right?
> The #1 way to get deadlocks is as illustrated - get the same things in
> a different order. If you get them in the SAME order, you avoid
> deadlocks. You may occassionally get them anyway from obscure effects
> of larger statements that maybe get internally deadlocked over index
> pages or other things that are normally invisible, but the rule is:
> define a fixed order for getting multiple resources, and you eliminate
> about 98% of deadlock problems.
> These internal lock types are things you shouldn't ever have to worry
> about, IMHO.
> J.
>
|||Yes - transactions can also be declared above the stored proc, either in
TSQL that calls the stored proc or by a client transaction monitor such as
COM+.
Regards,
Greg Linwood
SQL Server MVP
"ChrisR" <bla@.noemail.com> wrote in message
news:ueoyI6S5EHA.2180@.TK2MSFTNGP12.phx.gbl...
> Are deadlocks possible without specifying a transaction?
>
>
>
> "JXStern" <JXSternChangeX2R@.gte.net> wrote in message
> news:esq8s0hlo06qr3e3nr4e9rv6688jg8f8c7@.4ax.com...
> picture):
> Proc?
>
|||I may have phrased my question wrong. Say these two guys aren't in a
transaction:
[vbcol=seagreen]
Is it still possible to have a deadlock?
"Greg Linwood" <g_linwoodQhotmail.com> wrote in message
news:#gY2YAZ5EHA.4028@.TK2MSFTNGP15.phx.gbl...[vbcol=seagreen]
> Yes - transactions can also be declared above the stored proc, either in
> TSQL that calls the stored proc or by a client transaction monitor such as
> COM+.
> Regards,
> Greg Linwood
> SQL Server MVP
> "ChrisR" <bla@.noemail.com> wrote in message
> news:ueoyI6S5EHA.2180@.TK2MSFTNGP12.phx.gbl...
Update
>
|||On Sat, 18 Dec 2004 10:22:53 -0800, "ChrisR" <bla@.noemail.com> wrote:[vbcol=seagreen]
>Are deadlocks possible without specifying a transaction?
In theory, this should eliminate deadlock problems.
But note that instead, you have "race" problems, where first #1
updates the supplier, then #2 updates the part, then #1 tries to
update the part but doesn't know what #2 already updated it, yada
yada.
And on occassion there have been SQLServer bugs with parallelism that
caused deadlocks from even single statements, just to spice up your
life a little!
J.
|||ChrisR wrote:
> I may have phrased my question wrong. Say these two guys aren't in a
> transaction:
>
> Is it still possible to have a deadlock?
>
See Autocommit Transactions in BOL. That should explain what you are
asking. From a tool like QA, the answer is no. You won't see a deadlock
since each statement is atomic. This assumes you have autocommit
transactions turned on (the default). If you have implicit transactions
on (see SET IMPLICIT_TRANSACTIONS in BOL), a transaction is
automatically started for you on the first statement. In that case, you
would have a deadlock possibility. If these were executed from an
application, it would depend on the properties of the connection and how
the library handles this case.
David Gugick
Imceda Software
www.imceda.com
|||Conceptually no, but if you really want to get to the bottom of your
deadlock source, I suggest you trace the deadlock graph to the error log
usiny DBCC TRACEON (1204, 2605, -1) so we can give you a concise answer to
what's actually going on in your db when a deadlock occurs.
JXStern's given you some good advice - there are the wel documented deadlock
scenarios such as cyclical deadlocking (what you're describing), conversion
deadlocking (update lock escalation conflicts) but also other types which
occur deeper within the DB such as parallelism deadlocks. Examples of the
single statement deadlocking he referred to includes Update Supplier, where
Supplier has multiple indexes. The same update statement might update the
various indexes on the table in conflicting orders and cause an internal
deadlock. This happens and is fairly common. If you log & post your deadlock
trace graph, you'll get the full picture about what's going on when you
experience your deadlocks.
Regards,
Greg Linwood
SQL Server MVP
"ChrisR" <bla@.noemail.com> wrote in message
news:ugSJ4Ue5EHA.3616@.TK2MSFTNGP11.phx.gbl...
>I may have phrased my question wrong. Say these two guys aren't in a
> transaction:
>
> Is it still possible to have a deadlock?
>
> "Greg Linwood" <g_linwoodQhotmail.com> wrote in message
> news:#gY2YAZ5EHA.4028@.TK2MSFTNGP15.phx.gbl...
> Update
>
|||Thanks for picking that typo up!
Cheers,
Greg Linwood
SQL Server MVP
"AnthonyThomas" <Anthony.Thomas@.CommerceBank.com> wrote in message
news:ek9x4sp5EHA.2012@.TK2MSFTNGP15.phx.gbl...
> The send to error log trace flag is 3605 not 2605.
> Sincerely,
>
> Anthony Thomas
>
> --
> "Greg Linwood" <g_linwoodQhotmail.com> wrote in message
> news:uCZgY5o5EHA.2156@.TK2MSFTNGP10.phx.gbl...
> Conceptually no, but if you really want to get to the bottom of your
> deadlock source, I suggest you trace the deadlock graph to the error log
> usiny DBCC TRACEON (1204, 2605, -1) so we can give you a concise answer to
> what's actually going on in your db when a deadlock occurs.
> JXStern's given you some good advice - there are the wel documented
> deadlock
> scenarios such as cyclical deadlocking (what you're describing),
> conversion
> deadlocking (update lock escalation conflicts) but also other types which
> occur deeper within the DB such as parallelism deadlocks. Examples of the
> single statement deadlocking he referred to includes Update Supplier,
> where
> Supplier has multiple indexes. The same update statement might update the
> various indexes on the table in conflicting orders and cause an internal
> deadlock. This happens and is fairly common. If you log & post your
> deadlock
> trace graph, you'll get the full picture about what's going on when you
> experience your deadlocks.
> Regards,
> Greg Linwood
> SQL Server MVP
> "ChrisR" <bla@.noemail.com> wrote in message
> news:ugSJ4Ue5EHA.3616@.TK2MSFTNGP11.phx.gbl...
>

Wednesday, March 28, 2012

Lock Timeout

I am getting this error on a 2000 server:
"Server: Msg 1222, Level 16, State 54, Line 15
Lock request time out period exceeded."
when I run the following query
"SET ROWCOUNT 10000
declare @.counter bigint
-- Also try 5000, 10000 etc
set @.counter = 0
WHILE 1 = 1
BEGIN
set @.counter = @.counter + 1
print '@.counter = ' + cast(@.counter as varchar(10))
delete from dbname..tabname
where process_dt = CONVERT(SMALLDATETIME,'10/13/2005')
IF @.@.ROWCOUNT = 0
BREAK
END
SET ROWCOUNT 0"
I checked in my Query Analyzer options and I've got lock timeout set to 120
seconds. But the above query fails instantly, so it's not even waiting the
120 seconds. What gives? Any tips would be much appreciated.
Nevermind. I figured it out.
"CLM" wrote:

> I am getting this error on a 2000 server:
> "Server: Msg 1222, Level 16, State 54, Line 15
> Lock request time out period exceeded."
> when I run the following query
> "SET ROWCOUNT 10000
> declare @.counter bigint
> -- Also try 5000, 10000 etc
> set @.counter = 0
> WHILE 1 = 1
> BEGIN
> set @.counter = @.counter + 1
> print '@.counter = ' + cast(@.counter as varchar(10))
> delete from dbname..tabname
> where process_dt = CONVERT(SMALLDATETIME,'10/13/2005')
> IF @.@.ROWCOUNT = 0
> BREAK
> END
> SET ROWCOUNT 0"
> I checked in my Query Analyzer options and I've got lock timeout set to 120
> seconds. But the above query fails instantly, so it's not even waiting the
> 120 seconds. What gives? Any tips would be much appreciated.
>

Lock Timeout

I am getting this error on a 2000 server:
"Server: Msg 1222, Level 16, State 54, Line 15
Lock request time out period exceeded."
when I run the following query
"SET ROWCOUNT 10000
declare @.counter bigint
-- Also try 5000, 10000 etc
set @.counter = 0
WHILE 1 = 1
BEGIN
set @.counter = @.counter + 1
print '@.counter = ' + cast(@.counter as varchar(10))
delete from dbname..tabname
where process_dt = CONVERT(SMALLDATETIME,'10/13/2005')
IF @.@.ROWCOUNT = 0
BREAK
END
SET ROWCOUNT 0"
I checked in my Query Analyzer options and I've got lock timeout set to 120
seconds. But the above query fails instantly, so it's not even waiting the
120 seconds. What gives? Any tips would be much appreciated.Nevermind. I figured it out.
"CLM" wrote:

> I am getting this error on a 2000 server:
> "Server: Msg 1222, Level 16, State 54, Line 15
> Lock request time out period exceeded."
> when I run the following query
> "SET ROWCOUNT 10000
> declare @.counter bigint
> -- Also try 5000, 10000 etc
> set @.counter = 0
> WHILE 1 = 1
> BEGIN
> set @.counter = @.counter + 1
> print '@.counter = ' + cast(@.counter as varchar(10))
> delete from dbname..tabname
> where process_dt = CONVERT(SMALLDATETIME,'10/13/2005')
> IF @.@.ROWCOUNT = 0
> BREAK
> END
> SET ROWCOUNT 0"
> I checked in my Query Analyzer options and I've got lock timeout set to 12
0
> seconds. But the above query fails instantly, so it's not even waiting th
e
> 120 seconds. What gives? Any tips would be much appreciated.
>

Lock Timeout

I am getting this error on a 2000 server:
"Server: Msg 1222, Level 16, State 54, Line 15
Lock request time out period exceeded."
when I run the following query
"SET ROWCOUNT 10000
declare @.counter bigint
-- Also try 5000, 10000 etc
set @.counter = 0
WHILE 1 = 1
BEGIN
set @.counter = @.counter + 1
print '@.counter = ' + cast(@.counter as varchar(10))
delete from dbname..tabname
where process_dt = CONVERT(SMALLDATETIME,'10/13/2005')
IF @.@.ROWCOUNT = 0
BREAK
END
SET ROWCOUNT 0"
I checked in my Query Analyzer options and I've got lock timeout set to 120
seconds. But the above query fails instantly, so it's not even waiting the
120 seconds. What gives? Any tips would be much appreciated.Nevermind. I figured it out.
"CLM" wrote:
> I am getting this error on a 2000 server:
> "Server: Msg 1222, Level 16, State 54, Line 15
> Lock request time out period exceeded."
> when I run the following query
> "SET ROWCOUNT 10000
> declare @.counter bigint
> -- Also try 5000, 10000 etc
> set @.counter = 0
> WHILE 1 = 1
> BEGIN
> set @.counter = @.counter + 1
> print '@.counter = ' + cast(@.counter as varchar(10))
> delete from dbname..tabname
> where process_dt = CONVERT(SMALLDATETIME,'10/13/2005')
> IF @.@.ROWCOUNT = 0
> BREAK
> END
> SET ROWCOUNT 0"
> I checked in my Query Analyzer options and I've got lock timeout set to 120
> seconds. But the above query fails instantly, so it's not even waiting the
> 120 seconds. What gives? Any tips would be much appreciated.
>

Lock Requests/Sec question

In PerfMon during time of simultaneous INSERTS and SELECTS ... the Lock
Requests/Sec is around 2000 and the times for the execution of the INSERTS
and SELECTS are around 16MS which is perfomance for the client requests.
Suddenly, the Locks Request will drop to around 125 at the same time as the
INSERTS and SELECTS increase to 4000 MS...too long for client SELECTS.
Is one causing the other?
Thanks,
Don
i've included the past thread below in case there's info that would help.
Looking for suggestions about what I might look for..
During periods of time when no INSERTS are taking place, SELECT statement
durations are around 16-30ms for hundreds of requests per minute.
When there is a batch of INSERTS that are sent to the table via SP that
number in the many thousands..for a while both INSERTS and SELECTS coexist at
around the same duration of 16-30 ms..watching this with Profiler.
Then, for some reason..some SELECT and few INSERTS will go up to the 4000 -
5000 ms range. Then things will quiet down, then go back up to 4000ms. These
don't have to be on the same table and frequently are not...INSERTS are going
to 1 table while the majority are going to another table in the same DB. This
happens on all the servers we have so it's not specific to one server. They
all have the same hardware and software.
I've looked for deadlocks and there are none. I've set some of the common
things in PERFMON such as CACHE BUFFER HIT RATIO. Looks ok. There's 4GB of
RAM on the server and there's 1GB available.
The MDF has it's own separate drive and the LDF has it's own drive.
It's almost looks like theres some sort of contention between the INSERT and
the SELECT, but since it's in separate tables...i have no idea what to look
for.
any help appreciated.
The servers were recently upgraded from SQL 7 .. I'm not sure if this was
happening under SQL 7. I don't think so. I've updated statistics on all
servers and recreated the clustered indexes.
SQL 2000 with SP4.
thanks,
Don
Was this post helpful to you?
Reply | Print post TopTop
Tom Moreau 2/13/2006 4:49 PM PST
Try updating stats with FULLSCAN. Also, trace the Lock Escalation event.
--
Tom
----
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Columnist, SQL Server Professional
Toronto, ON Canada
www.pinpub.com
..
"donsql22222" <donsql22222@.discussions.microsoft.com> wrote in message
news:776E5217-2EDB-40FF-BFA6-E8A3E1ADF980@.microsoft.com...
Looking for suggestions about what I might look for..
During periods of time when no INSERTS are taking place, SELECT statement
durations are around 16-30ms for hundreds of requests per minute.
When there is a batch of INSERTS that are sent to the table via SP that
number in the many thousands..for a while both INSERTS and SELECTS coexist
at
around the same duration of 16-30 ms..watching this with Profiler.
Then, for some reason..some SELECT and few INSERTS will go up to the 4000 -
5000 ms range. Then things will quiet down, then go back up to 4000ms. These
don't have to be on the same table and frequently are not...INSERTS are
going
to 1 table while the majority are going to another table in the same DB.
This
happens on all the servers we have so it's not specific to one server. They
all have the same hardware and software.
I've looked for deadlocks and there are none. I've set some of the common
things in PERFMON such as CACHE BUFFER HIT RATIO. Looks ok. There's 4GB of
RAM on the server and there's 1GB available.
The MDF has it's own separate drive and the LDF has it's own drive.
It's almost looks like theres some sort of contention between the INSERT and
the SELECT, but since it's in separate tables...i have no idea what to look
for.
any help appreciated.
The servers were recently upgraded from SQL 7 .. I'm not sure if this was
happening under SQL 7. I don't think so. I've updated statistics on all
servers and recreated the clustered indexes.
SQL 2000 with SP4.
thanks,
Don
Was this post helpful to you?
Reply | Print post TopTop
JXStern 2/13/2006 7:06 PM PST
On Mon, 13 Feb 2006 16:38:26 -0800, "donsql22222"
<donsql22222@.discussions.microsoft.com> wrote:
>It's almost looks like theres some sort of contention between the INSERT and
>the SELECT, but since it's in separate tables...i have no idea what to look
>for.
Of course there's contention, for LRU pages in memory, the moreso
because they are different tables!
Run the queries during the slow period from QA with SET STATISTICS IO
ON, and look at the physical reads numbers going from 0 to whatever.
J.It could be lots of things but the two most common are blocking (not the
same as deadlocks) and checkpoints. You can see blocking by running sp_who2
and look for rows with a number (spid) in the Blkd column. But checkpoints
are a prime suspect as well. You can see when they occur by monitoring the
perfmon counters for CheckPoint Pages / Sec under the SQL Server counters.
When this happens the disks will usually max out for the duration of the
checkpoint and will stall any other requests to or from the disk. You stated
you have the data and log files separated onto separate disks but are they
just logical or really physical disks. Having the files on two logical
drives (partitions or LUNs) that are on the same physical drive array (or
worse single drive) does nothing for performance. It actually gives a false
sense of security. You can also have a look at these links to see how to
narrow down the culprit.
http://www.sql-server-performance.com/sql_server_performance_audit10.asp
Performance Audit
http://www.microsoft.com/technet/prodtechnol/sql/2005/library/operations.mspx
Performance WP's
http://www.swynk.com/friends/vandenberg/perfmonitor.asp Perfmon counters
http://www.sql-server-performance.com/sql_server_performance_audit.asp
Hardware Performance CheckList
http://www.sql-server-performance.com/best_sql_server_performance_tips.asp
SQL 2000 Performance tuning tips
http://www.support.microsoft.com/?id=224587 Troubleshooting App
Performance
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/adminsql/ad_perfmon_24u1.asp
Disk Monitoring
http://sqldev.net/misc/WaitTypes.htm Wait Types
Andrew J. Kelly SQL MVP
"donsql22222" <donsql22222@.discussions.microsoft.com> wrote in message
news:02F1ED1B-AC28-4DA5-8CA1-E3735C6254B3@.microsoft.com...
> In PerfMon during time of simultaneous INSERTS and SELECTS ... the Lock
> Requests/Sec is around 2000 and the times for the execution of the INSERTS
> and SELECTS are around 16MS which is perfomance for the client requests.
> Suddenly, the Locks Request will drop to around 125 at the same time as
> the
> INSERTS and SELECTS increase to 4000 MS...too long for client SELECTS.
> Is one causing the other?
> Thanks,
> Don
> i've included the past thread below in case there's info that would help.
>
> Looking for suggestions about what I might look for..
> During periods of time when no INSERTS are taking place, SELECT statement
> durations are around 16-30ms for hundreds of requests per minute.
> When there is a batch of INSERTS that are sent to the table via SP that
> number in the many thousands..for a while both INSERTS and SELECTS coexist
> at
> around the same duration of 16-30 ms..watching this with Profiler.
> Then, for some reason..some SELECT and few INSERTS will go up to the
> 4000 -
> 5000 ms range. Then things will quiet down, then go back up to 4000ms.
> These
> don't have to be on the same table and frequently are not...INSERTS are
> going
> to 1 table while the majority are going to another table in the same DB.
> This
> happens on all the servers we have so it's not specific to one server.
> They
> all have the same hardware and software.
> I've looked for deadlocks and there are none. I've set some of the common
> things in PERFMON such as CACHE BUFFER HIT RATIO. Looks ok. There's 4GB of
> RAM on the server and there's 1GB available.
> The MDF has it's own separate drive and the LDF has it's own drive.
> It's almost looks like theres some sort of contention between the INSERT
> and
> the SELECT, but since it's in separate tables...i have no idea what to
> look
> for.
> any help appreciated.
> The servers were recently upgraded from SQL 7 .. I'm not sure if this was
> happening under SQL 7. I don't think so. I've updated statistics on all
> servers and recreated the clustered indexes.
> SQL 2000 with SP4.
> thanks,
> Don
> Was this post helpful to you?
>
> Reply | Print post TopTop
>
>
> Tom Moreau 2/13/2006 4:49 PM PST
> Try updating stats with FULLSCAN. Also, trace the Lock Escalation event.
> --
> Tom
> ----
> Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
> SQL Server MVP
> Columnist, SQL Server Professional
> Toronto, ON Canada
> www.pinpub.com
> ..
> "donsql22222" <donsql22222@.discussions.microsoft.com> wrote in message
> news:776E5217-2EDB-40FF-BFA6-E8A3E1ADF980@.microsoft.com...
> Looking for suggestions about what I might look for..
> During periods of time when no INSERTS are taking place, SELECT statement
> durations are around 16-30ms for hundreds of requests per minute.
> When there is a batch of INSERTS that are sent to the table via SP that
> number in the many thousands..for a while both INSERTS and SELECTS coexist
> at
> around the same duration of 16-30 ms..watching this with Profiler.
> Then, for some reason..some SELECT and few INSERTS will go up to the
> 4000 -
> 5000 ms range. Then things will quiet down, then go back up to 4000ms.
> These
> don't have to be on the same table and frequently are not...INSERTS are
> going
> to 1 table while the majority are going to another table in the same DB.
> This
> happens on all the servers we have so it's not specific to one server.
> They
> all have the same hardware and software.
> I've looked for deadlocks and there are none. I've set some of the common
> things in PERFMON such as CACHE BUFFER HIT RATIO. Looks ok. There's 4GB of
> RAM on the server and there's 1GB available.
> The MDF has it's own separate drive and the LDF has it's own drive.
> It's almost looks like theres some sort of contention between the INSERT
> and
> the SELECT, but since it's in separate tables...i have no idea what to
> look
> for.
> any help appreciated.
> The servers were recently upgraded from SQL 7 .. I'm not sure if this was
> happening under SQL 7. I don't think so. I've updated statistics on all
> servers and recreated the clustered indexes.
> SQL 2000 with SP4.
> thanks,
> Don
>
> Was this post helpful to you?
>
> Reply | Print post TopTop
>
>
> JXStern 2/13/2006 7:06 PM PST
> On Mon, 13 Feb 2006 16:38:26 -0800, "donsql22222"
> <donsql22222@.discussions.microsoft.com> wrote:
>>It's almost looks like theres some sort of contention between the INSERT
>>and
>>the SELECT, but since it's in separate tables...i have no idea what to
>>look
>>for.
> Of course there's contention, for LRU pages in memory, the moreso
> because they are different tables!
> Run the queries during the slow period from QA with SET STATISTICS IO
> ON, and look at the physical reads numbers going from 0 to whatever.
> J.sql

Lock Requests/Sec question

In PerfMon during time of simultaneous INSERTS and SELECTS ... the Lock
Requests/Sec is around 2000 and the times for the execution of the INSERTS
and SELECTS are around 16MS which is perfomance for the client requests.
Suddenly, the Locks Request will drop to around 125 at the same time as the
INSERTS and SELECTS increase to 4000 MS...too long for client SELECTS.
Is one causing the other?
Thanks,
Don
i've included the past thread below in case there's info that would help.
Looking for suggestions about what I might look for..
During periods of time when no INSERTS are taking place, SELECT statement
durations are around 16-30ms for hundreds of requests per minute.
When there is a batch of INSERTS that are sent to the table via SP that
number in the many thousands..for a while both INSERTS and SELECTS coexist a
t
around the same duration of 16-30 ms..watching this with Profiler.
Then, for some reason..some SELECT and few INSERTS will go up to the 4000 -
5000 ms range. Then things will quiet down, then go back up to 4000ms. These
don't have to be on the same table and frequently are not...INSERTS are goin
g
to 1 table while the majority are going to another table in the same DB. Thi
s
happens on all the servers we have so it's not specific to one server. They
all have the same hardware and software.
I've looked for deadlocks and there are none. I've set some of the common
things in PERFMON such as CACHE BUFFER HIT RATIO. Looks ok. There's 4GB of
RAM on the server and there's 1GB available.
The MDF has it's own separate drive and the LDF has it's own drive.
It's almost looks like theres some sort of contention between the INSERT and
the SELECT, but since it's in separate tables...i have no idea what to look
for.
any help appreciated.
The servers were recently upgraded from SQL 7 .. I'm not sure if this was
happening under SQL 7. I don't think so. I've updated statistics on all
servers and recreated the clustered indexes.
SQL 2000 with SP4.
thanks,
Don
Was this post helpful to you?
Reply | Print post TopTop
Tom Moreau 2/13/2006 4:49 PM PST
Try updating stats with FULLSCAN. Also, trace the Lock Escalation event.
Tom
----
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Columnist, SQL Server Professional
Toronto, ON Canada
www.pinpub.com
..
"donsql22222" <donsql22222@.discussions.microsoft.com> wrote in message
news:776E5217-2EDB-40FF-BFA6-E8A3E1ADF980@.microsoft.com...
Looking for suggestions about what I might look for..
During periods of time when no INSERTS are taking place, SELECT statement
durations are around 16-30ms for hundreds of requests per minute.
When there is a batch of INSERTS that are sent to the table via SP that
number in the many thousands..for a while both INSERTS and SELECTS coexist
at
around the same duration of 16-30 ms..watching this with Profiler.
Then, for some reason..some SELECT and few INSERTS will go up to the 4000 -
5000 ms range. Then things will quiet down, then go back up to 4000ms. These
don't have to be on the same table and frequently are not...INSERTS are
going
to 1 table while the majority are going to another table in the same DB.
This
happens on all the servers we have so it's not specific to one server. They
all have the same hardware and software.
I've looked for deadlocks and there are none. I've set some of the common
things in PERFMON such as CACHE BUFFER HIT RATIO. Looks ok. There's 4GB of
RAM on the server and there's 1GB available.
The MDF has it's own separate drive and the LDF has it's own drive.
It's almost looks like theres some sort of contention between the INSERT and
the SELECT, but since it's in separate tables...i have no idea what to look
for.
any help appreciated.
The servers were recently upgraded from SQL 7 .. I'm not sure if this was
happening under SQL 7. I don't think so. I've updated statistics on all
servers and recreated the clustered indexes.
SQL 2000 with SP4.
thanks,
Don
Was this post helpful to you?
Reply | Print post TopTop
JXStern 2/13/2006 7:06 PM PST
On Mon, 13 Feb 2006 16:38:26 -0800, "donsql22222"
<donsql22222@.discussions.microsoft.com> wrote:
>It's almost looks like theres some sort of contention between the INSERT an
d
>the SELECT, but since it's in separate tables...i have no idea what to look
>for.
Of course there's contention, for LRU pages in memory, the moreso
because they are different tables!
Run the queries during the slow period from QA with SET STATISTICS IO
ON, and look at the physical reads numbers going from 0 to whatever.
J.It could be lots of things but the two most common are blocking (not the
same as deadlocks) and checkpoints. You can see blocking by running sp_who2
and look for rows with a number (spid) in the Blkd column. But checkpoints
are a prime suspect as well. You can see when they occur by monitoring the
perfmon counters for CheckPoint Pages / Sec under the SQL Server counters.
When this happens the disks will usually max out for the duration of the
checkpoint and will stall any other requests to or from the disk. You stated
you have the data and log files separated onto separate disks but are they
just logical or really physical disks. Having the files on two logical
drives (partitions or LUNs) that are on the same physical drive array (or
worse single drive) does nothing for performance. It actually gives a false
sense of security. You can also have a look at these links to see how to
narrow down the culprit.
http://www.sql-server-performance.c...nce_audit10.asp
Performance Audit
http://www.microsoft.com/technet/pr...perfmonitor.asp Perfmon counters
http://www.sql-server-performance.c...mance_audit.asp
Hardware Performance CheckList
http://www.sql-server-performance.c...rmance_tips.asp
SQL 2000 Performance tuning tips
http://www.support.microsoft.com/?id=224587 Troubleshooting App
Performance
http://msdn.microsoft.com/library/d.../>
on_24u1.asp
Disk Monitoring
http://sqldev.net/misc/WaitTypes.htm Wait Types
Andrew J. Kelly SQL MVP
"donsql22222" <donsql22222@.discussions.microsoft.com> wrote in message
news:02F1ED1B-AC28-4DA5-8CA1-E3735C6254B3@.microsoft.com...
> In PerfMon during time of simultaneous INSERTS and SELECTS ... the Lock
> Requests/Sec is around 2000 and the times for the execution of the INSERTS
> and SELECTS are around 16MS which is perfomance for the client requests.
> Suddenly, the Locks Request will drop to around 125 at the same time as
> the
> INSERTS and SELECTS increase to 4000 MS...too long for client SELECTS.
> Is one causing the other?
> Thanks,
> Don
> i've included the past thread below in case there's info that would help.
>
> Looking for suggestions about what I might look for..
> During periods of time when no INSERTS are taking place, SELECT statement
> durations are around 16-30ms for hundreds of requests per minute.
> When there is a batch of INSERTS that are sent to the table via SP that
> number in the many thousands..for a while both INSERTS and SELECTS coexist
> at
> around the same duration of 16-30 ms..watching this with Profiler.
> Then, for some reason..some SELECT and few INSERTS will go up to the
> 4000 -
> 5000 ms range. Then things will quiet down, then go back up to 4000ms.
> These
> don't have to be on the same table and frequently are not...INSERTS are
> going
> to 1 table while the majority are going to another table in the same DB.
> This
> happens on all the servers we have so it's not specific to one server.
> They
> all have the same hardware and software.
> I've looked for deadlocks and there are none. I've set some of the common
> things in PERFMON such as CACHE BUFFER HIT RATIO. Looks ok. There's 4GB of
> RAM on the server and there's 1GB available.
> The MDF has it's own separate drive and the LDF has it's own drive.
> It's almost looks like theres some sort of contention between the INSERT
> and
> the SELECT, but since it's in separate tables...i have no idea what to
> look
> for.
> any help appreciated.
> The servers were recently upgraded from SQL 7 .. I'm not sure if this was
> happening under SQL 7. I don't think so. I've updated statistics on all
> servers and recreated the clustered indexes.
> SQL 2000 with SP4.
> thanks,
> Don
> Was this post helpful to you?
>
> Reply | Print post TopTop
>
>
> Tom Moreau 2/13/2006 4:49 PM PST
> Try updating stats with FULLSCAN. Also, trace the Lock Escalation event.
> --
> Tom
> ----
> Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
> SQL Server MVP
> Columnist, SQL Server Professional
> Toronto, ON Canada
> www.pinpub.com
> ..
> "donsql22222" <donsql22222@.discussions.microsoft.com> wrote in message
> news:776E5217-2EDB-40FF-BFA6-E8A3E1ADF980@.microsoft.com...
> Looking for suggestions about what I might look for..
> During periods of time when no INSERTS are taking place, SELECT statement
> durations are around 16-30ms for hundreds of requests per minute.
> When there is a batch of INSERTS that are sent to the table via SP that
> number in the many thousands..for a while both INSERTS and SELECTS coexist
> at
> around the same duration of 16-30 ms..watching this with Profiler.
> Then, for some reason..some SELECT and few INSERTS will go up to the
> 4000 -
> 5000 ms range. Then things will quiet down, then go back up to 4000ms.
> These
> don't have to be on the same table and frequently are not...INSERTS are
> going
> to 1 table while the majority are going to another table in the same DB.
> This
> happens on all the servers we have so it's not specific to one server.
> They
> all have the same hardware and software.
> I've looked for deadlocks and there are none. I've set some of the common
> things in PERFMON such as CACHE BUFFER HIT RATIO. Looks ok. There's 4GB of
> RAM on the server and there's 1GB available.
> The MDF has it's own separate drive and the LDF has it's own drive.
> It's almost looks like theres some sort of contention between the INSERT
> and
> the SELECT, but since it's in separate tables...i have no idea what to
> look
> for.
> any help appreciated.
> The servers were recently upgraded from SQL 7 .. I'm not sure if this was
> happening under SQL 7. I don't think so. I've updated statistics on all
> servers and recreated the clustered indexes.
> SQL 2000 with SP4.
> thanks,
> Don
>
> Was this post helpful to you?
>
> Reply | Print post TopTop
>
>
> JXStern 2/13/2006 7:06 PM PST
> On Mon, 13 Feb 2006 16:38:26 -0800, "donsql22222"
> <donsql22222@.discussions.microsoft.com> wrote:
> Of course there's contention, for LRU pages in memory, the moreso
> because they are different tables!
> Run the queries during the slow period from QA with SET STATISTICS IO
> ON, and look at the physical reads numbers going from 0 to whatever.
> J.

Lock Requests/Sec question

In PerfMon during time of simultaneous INSERTS and SELECTS ... the Lock
Requests/Sec is around 2000 and the times for the execution of the INSERTS
and SELECTS are around 16MS which is perfomance for the client requests.
Suddenly, the Locks Request will drop to around 125 at the same time as the
INSERTS and SELECTS increase to 4000 MS...too long for client SELECTS.
Is one causing the other?
Thanks,
Don
i've included the past thread below in case there's info that would help.
Looking for suggestions about what I might look for..
During periods of time when no INSERTS are taking place, SELECT statement
durations are around 16-30ms for hundreds of requests per minute.
When there is a batch of INSERTS that are sent to the table via SP that
number in the many thousands..for a while both INSERTS and SELECTS coexist at
around the same duration of 16-30 ms..watching this with Profiler.
Then, for some reason..some SELECT and few INSERTS will go up to the 4000 -
5000 ms range. Then things will quiet down, then go back up to 4000ms. These
don't have to be on the same table and frequently are not...INSERTS are going
to 1 table while the majority are going to another table in the same DB. This
happens on all the servers we have so it's not specific to one server. They
all have the same hardware and software.
I've looked for deadlocks and there are none. I've set some of the common
things in PERFMON such as CACHE BUFFER HIT RATIO. Looks ok. There's 4GB of
RAM on the server and there's 1GB available.
The MDF has it's own separate drive and the LDF has it's own drive.
It's almost looks like theres some sort of contention between the INSERT and
the SELECT, but since it's in separate tables...i have no idea what to look
for.
any help appreciated.
The servers were recently upgraded from SQL 7 .. I'm not sure if this was
happening under SQL 7. I don't think so. I've updated statistics on all
servers and recreated the clustered indexes.
SQL 2000 with SP4.
thanks,
Don
Was this post helpful to you?
Reply | Print post TopTop
Tom Moreau 2/13/2006 4:49 PM PST
Try updating stats with FULLSCAN. Also, trace the Lock Escalation event.
Tom
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Columnist, SQL Server Professional
Toronto, ON Canada
www.pinpub.com
...
"donsql22222" <donsql22222@.discussions.microsoft.com> wrote in message
news:776E5217-2EDB-40FF-BFA6-E8A3E1ADF980@.microsoft.com...
Looking for suggestions about what I might look for..
During periods of time when no INSERTS are taking place, SELECT statement
durations are around 16-30ms for hundreds of requests per minute.
When there is a batch of INSERTS that are sent to the table via SP that
number in the many thousands..for a while both INSERTS and SELECTS coexist
at
around the same duration of 16-30 ms..watching this with Profiler.
Then, for some reason..some SELECT and few INSERTS will go up to the 4000 -
5000 ms range. Then things will quiet down, then go back up to 4000ms. These
don't have to be on the same table and frequently are not...INSERTS are
going
to 1 table while the majority are going to another table in the same DB.
This
happens on all the servers we have so it's not specific to one server. They
all have the same hardware and software.
I've looked for deadlocks and there are none. I've set some of the common
things in PERFMON such as CACHE BUFFER HIT RATIO. Looks ok. There's 4GB of
RAM on the server and there's 1GB available.
The MDF has it's own separate drive and the LDF has it's own drive.
It's almost looks like theres some sort of contention between the INSERT and
the SELECT, but since it's in separate tables...i have no idea what to look
for.
any help appreciated.
The servers were recently upgraded from SQL 7 .. I'm not sure if this was
happening under SQL 7. I don't think so. I've updated statistics on all
servers and recreated the clustered indexes.
SQL 2000 with SP4.
thanks,
Don
Was this post helpful to you?
Reply | Print post TopTop
JXStern 2/13/2006 7:06 PM PST
On Mon, 13 Feb 2006 16:38:26 -0800, "donsql22222"
<donsql22222@.discussions.microsoft.com> wrote:
>It's almost looks like theres some sort of contention between the INSERT and
>the SELECT, but since it's in separate tables...i have no idea what to look
>for.
Of course there's contention, for LRU pages in memory, the moreso
because they are different tables!
Run the queries during the slow period from QA with SET STATISTICS IO
ON, and look at the physical reads numbers going from 0 to whatever.
J.
It could be lots of things but the two most common are blocking (not the
same as deadlocks) and checkpoints. You can see blocking by running sp_who2
and look for rows with a number (spid) in the Blkd column. But checkpoints
are a prime suspect as well. You can see when they occur by monitoring the
perfmon counters for CheckPoint Pages / Sec under the SQL Server counters.
When this happens the disks will usually max out for the duration of the
checkpoint and will stall any other requests to or from the disk. You stated
you have the data and log files separated onto separate disks but are they
just logical or really physical disks. Having the files on two logical
drives (partitions or LUNs) that are on the same physical drive array (or
worse single drive) does nothing for performance. It actually gives a false
sense of security. You can also have a look at these links to see how to
narrow down the culprit.
http://www.sql-server-performance.co...ce_audit10.asp
Performance Audit
http://www.microsoft.com/technet/pro...perations.mspx
Performance WP's
http://www.swynk.com/friends/vandenberg/perfmonitor.asp Perfmon counters
http://www.sql-server-performance.co...ance_audit.asp
Hardware Performance CheckList
http://www.sql-server-performance.co...mance_tips.asp
SQL 2000 Performance tuning tips
http://www.support.microsoft.com/?id=224587 Troubleshooting App
Performance
http://msdn.microsoft.com/library/de...rfmon_24u1.asp
Disk Monitoring
http://sqldev.net/misc/WaitTypes.htm Wait Types
Andrew J. Kelly SQL MVP
"donsql22222" <donsql22222@.discussions.microsoft.com> wrote in message
news:02F1ED1B-AC28-4DA5-8CA1-E3735C6254B3@.microsoft.com...
> In PerfMon during time of simultaneous INSERTS and SELECTS ... the Lock
> Requests/Sec is around 2000 and the times for the execution of the INSERTS
> and SELECTS are around 16MS which is perfomance for the client requests.
> Suddenly, the Locks Request will drop to around 125 at the same time as
> the
> INSERTS and SELECTS increase to 4000 MS...too long for client SELECTS.
> Is one causing the other?
> Thanks,
> Don
> i've included the past thread below in case there's info that would help.
>
> Looking for suggestions about what I might look for..
> During periods of time when no INSERTS are taking place, SELECT statement
> durations are around 16-30ms for hundreds of requests per minute.
> When there is a batch of INSERTS that are sent to the table via SP that
> number in the many thousands..for a while both INSERTS and SELECTS coexist
> at
> around the same duration of 16-30 ms..watching this with Profiler.
> Then, for some reason..some SELECT and few INSERTS will go up to the
> 4000 -
> 5000 ms range. Then things will quiet down, then go back up to 4000ms.
> These
> don't have to be on the same table and frequently are not...INSERTS are
> going
> to 1 table while the majority are going to another table in the same DB.
> This
> happens on all the servers we have so it's not specific to one server.
> They
> all have the same hardware and software.
> I've looked for deadlocks and there are none. I've set some of the common
> things in PERFMON such as CACHE BUFFER HIT RATIO. Looks ok. There's 4GB of
> RAM on the server and there's 1GB available.
> The MDF has it's own separate drive and the LDF has it's own drive.
> It's almost looks like theres some sort of contention between the INSERT
> and
> the SELECT, but since it's in separate tables...i have no idea what to
> look
> for.
> any help appreciated.
> The servers were recently upgraded from SQL 7 .. I'm not sure if this was
> happening under SQL 7. I don't think so. I've updated statistics on all
> servers and recreated the clustered indexes.
> SQL 2000 with SP4.
> thanks,
> Don
> Was this post helpful to you?
>
> Reply | Print post TopTop
>
>
> Tom Moreau 2/13/2006 4:49 PM PST
> Try updating stats with FULLSCAN. Also, trace the Lock Escalation event.
> --
> Tom
> ----
> Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
> SQL Server MVP
> Columnist, SQL Server Professional
> Toronto, ON Canada
> www.pinpub.com
> ..
> "donsql22222" <donsql22222@.discussions.microsoft.com> wrote in message
> news:776E5217-2EDB-40FF-BFA6-E8A3E1ADF980@.microsoft.com...
> Looking for suggestions about what I might look for..
> During periods of time when no INSERTS are taking place, SELECT statement
> durations are around 16-30ms for hundreds of requests per minute.
> When there is a batch of INSERTS that are sent to the table via SP that
> number in the many thousands..for a while both INSERTS and SELECTS coexist
> at
> around the same duration of 16-30 ms..watching this with Profiler.
> Then, for some reason..some SELECT and few INSERTS will go up to the
> 4000 -
> 5000 ms range. Then things will quiet down, then go back up to 4000ms.
> These
> don't have to be on the same table and frequently are not...INSERTS are
> going
> to 1 table while the majority are going to another table in the same DB.
> This
> happens on all the servers we have so it's not specific to one server.
> They
> all have the same hardware and software.
> I've looked for deadlocks and there are none. I've set some of the common
> things in PERFMON such as CACHE BUFFER HIT RATIO. Looks ok. There's 4GB of
> RAM on the server and there's 1GB available.
> The MDF has it's own separate drive and the LDF has it's own drive.
> It's almost looks like theres some sort of contention between the INSERT
> and
> the SELECT, but since it's in separate tables...i have no idea what to
> look
> for.
> any help appreciated.
> The servers were recently upgraded from SQL 7 .. I'm not sure if this was
> happening under SQL 7. I don't think so. I've updated statistics on all
> servers and recreated the clustered indexes.
> SQL 2000 with SP4.
> thanks,
> Don
>
> Was this post helpful to you?
>
> Reply | Print post TopTop
>
>
> JXStern 2/13/2006 7:06 PM PST
> On Mon, 13 Feb 2006 16:38:26 -0800, "donsql22222"
> <donsql22222@.discussions.microsoft.com> wrote:
> Of course there's contention, for LRU pages in memory, the moreso
> because they are different tables!
> Run the queries during the slow period from QA with SET STATISTICS IO
> ON, and look at the physical reads numbers going from 0 to whatever.
> J.

Lock request time out period exceeded

Hi,
What is the default for @.@.LOCK_TIMEOUT?
When it is not set, how long it is?
Thanks,
JanosThe default is -1 which is it won't timeout, it will wait
forever. See the books online topic: SET LOCK_TIMEOUT
for more information.
-Sue
On Mon, 7 Nov 2005 12:12:04 -0700, "Janos Horanszky"
<jhoranszky@.chartelltechnology.com> wrote:
>Hi,
>What is the default for @.@.LOCK_TIMEOUT?
>When it is not set, how long it is?
>Thanks,
>Janos
>|||Thanks Sue.
"Sue Hoegemeier" <Sue_H@.nomail.please> wrote in message
news:6gf0n1dh5lfvos0ua3ic5sdg08vnsmja27@.4ax.com...
> The default is -1 which is it won't timeout, it will wait
> forever. See the books online topic: SET LOCK_TIMEOUT
> for more information.
> -Sue
> On Mon, 7 Nov 2005 12:12:04 -0700, "Janos Horanszky"
> <jhoranszky@.chartelltechnology.com> wrote:
>>Hi,
>>What is the default for @.@.LOCK_TIMEOUT?
>>When it is not set, how long it is?
>>Thanks,
>>Janos
>sql

LOCK REQUEST TIME OUT PERIOD EXCEEDED

Got a VB6 program creating records in an SQL 2000 DB. I have 5 client
machines creating 100,000 records each in the same table at the same time.
On a couple of machine I get the error "LOCK REQUEST TIME OUT PERIOD
EXCEEDED". This happened maybe 4 times. Would this be due to a network or
hardware limitation or is it a SQL DB factor maybe ?
The SQL server is only a P4 with 512 ram.
Clients machines vary greatly and run 2000pro and XPpro.
Thanks for any pointers.
Scott.It seems the table is locked by one process for a longer
time, and this has forced other process to throw the
error 1222.
The LOCK_TIMEOUT setting allows an application to set a
maximum time that a statement waits on a blocked
resource. When a statement has waited longer than the
LOCK_TIMEOUT setting, the blocked statement is canceled
automatically, and error message 1222 "Lock request time-
out period exceeded" is returned to the application.
I think if after every 1000 inserts, if you commit the
transaction, then the resource will not be locked for a
longer duration.
regds,
Shrikant Patil,
MCDBA
>--Original Message--
>Got a VB6 program creating records in an SQL 2000 DB. I
have 5 client
>machines creating 100,000 records each in the same table
at the same time.
>On a couple of machine I get the error "LOCK REQUEST
TIME OUT PERIOD
>EXCEEDED". This happened maybe 4 times. Would this be
due to a network or
>hardware limitation or is it a SQL DB factor maybe ?
>The SQL server is only a P4 with 512 ram.
>Clients machines vary greatly and run 2000pro and XPpro.
>Thanks for any pointers.
>Scott.
>
>.
>|||i see.
so the error was recived because one clinet/process was ready to commit 1000
records while another clinet/process was in the process of commiting - hence
the error.
the chances that a clinet machine would recive this with our software in
practice is very remotei guess as they would probablty never create that
many records at the same time to the same table. even if they did the RETRY
option seems to deal with it well anyway.
Is there other locking methods that can be employed rather than the 1000
batch one ?
Thanks for your time
Scott

Lock request time out period exceeded

Hi,
What is the default for @.@.LOCK_TIMEOUT?
When it is not set, how long it is?
Thanks,
JanosThe default is -1 which is it won't timeout, it will wait
forever. See the books online topic: SET LOCK_TIMEOUT
for more information.
-Sue
On Mon, 7 Nov 2005 12:12:04 -0700, "Janos Horanszky"
<jhoranszky@.chartelltechnology.com> wrote:

>Hi,
>What is the default for @.@.LOCK_TIMEOUT?
>When it is not set, how long it is?
>Thanks,
>Janos
>|||Thanks Sue.
"Sue Hoegemeier" <Sue_H@.nomail.please> wrote in message
news:6gf0n1dh5lfvos0ua3ic5sdg08vnsmja27@.
4ax.com...
> The default is -1 which is it won't timeout, it will wait
> forever. See the books online topic: SET LOCK_TIMEOUT
> for more information.
> -Sue
> On Mon, 7 Nov 2005 12:12:04 -0700, "Janos Horanszky"
> <jhoranszky@.chartelltechnology.com> wrote:
>
>

Lock request time out period exceeded

Hi,
What is the default for @.@.LOCK_TIMEOUT?
When it is not set, how long it is?
Thanks,
Janos
The default is -1 which is it won't timeout, it will wait
forever. See the books online topic: SET LOCK_TIMEOUT
for more information.
-Sue
On Mon, 7 Nov 2005 12:12:04 -0700, "Janos Horanszky"
<jhoranszky@.chartelltechnology.com> wrote:

>Hi,
>What is the default for @.@.LOCK_TIMEOUT?
>When it is not set, how long it is?
>Thanks,
>Janos
>
|||Thanks Sue.
"Sue Hoegemeier" <Sue_H@.nomail.please> wrote in message
news:6gf0n1dh5lfvos0ua3ic5sdg08vnsmja27@.4ax.com...
> The default is -1 which is it won't timeout, it will wait
> forever. See the books online topic: SET LOCK_TIMEOUT
> for more information.
> -Sue
> On Mon, 7 Nov 2005 12:12:04 -0700, "Janos Horanszky"
> <jhoranszky@.chartelltechnology.com> wrote:
>

LOCK REQUEST TIME OUT PERIOD EXCEEDED

It seems the table is locked by one process for a longer
time, and this has forced other process to throw the
error 1222.
The LOCK_TIMEOUT setting allows an application to set a
maximum time that a statement waits on a blocked
resource. When a statement has waited longer than the
LOCK_TIMEOUT setting, the blocked statement is canceled
automatically, and error message 1222 "Lock request time-
out period exceeded" is returned to the application.
I think if after every 1000 inserts, if you commit the
transaction, then the resource will not be locked for a
longer duration.
regds,
Shrikant Patil,
MCDBA

>--Original Message--
>Got a VB6 program creating records in an SQL 2000 DB. I
have 5 client
>machines creating 100,000 records each in the same table
at the same time.
>On a couple of machine I get the error "LOCK REQUEST
TIME OUT PERIOD
>EXCEEDED". This happened maybe 4 times. Would this be
due to a network or
>hardware limitation or is it a SQL DB factor maybe ?
>The SQL server is only a P4 with 512 ram.
>Clients machines vary greatly and run 2000pro and XPpro.
>Thanks for any pointers.
>Scott.
>
>.
>
i see.
so the error was recived because one clinet/process was ready to commit 1000
records while another clinet/process was in the process of commiting - hence
the error.
the chances that a clinet machine would recive this with our software in
practice is very remotei guess as they would probablty never create that
many records at the same time to the same table. even if they did the RETRY
option seems to deal with it well anyway.
Is there other locking methods that can be employed rather than the 1000
batch one ?
Thanks for your time
Scott

lock request time out period exceded

Hi,

while my db is executing a store procedure i try to view the current activity in the managent but it returns to me 'Lock request time out period exceded'. It happens until the store procedure is finished. After that everything is ok. However i can see the activity executing sp_who and the db seems to work ok, maybe a little slow.

what does it means??

Sorry for my english.
Thanks. EduardoYou should understand the database engine's locking mechanism. Your stored procedures probably is modifying your data, which means an exclusive lock. If you or another process is trying to view the data, the engine tries to get a shared lock. Since there is already an exclusive lock, the request for getting the shared lock expires, which is shown to you.sql

Monday, March 19, 2012

Located databases no longer used.

I’m looking to locate databases that have not been written to or accessed for
a specified period of time; we are looking to locate databases that are not
used anymore and clean house. Is there a system table or stored procedure to
access this information? Thank you in advance for you assistance.
Pauly C
No there is not. Your best bet is to run a continuous trace filtered on the
particular db(s) and see if anything accesses them.
Andrew J. Kelly SQL MVP
"Pauly C" <paulysc@.optonline.net> wrote in message
news:04BD4AED-F586-4686-ADBB-0AD86A4EEF90@.microsoft.com...
> I'm looking to locate databases that have not been written to or accessed
> for
> a specified period of time; we are looking to locate databases that are
> not
> used anymore and clean house. Is there a system table or stored procedure
> to
> access this information? Thank you in advance for you assistance.
> Pauly C
>
|||Bummer, Thanks Andy. Tony B say's hello.
Pauly C
"Andrew J. Kelly" wrote:

> No there is not. Your best bet is to run a continuous trace filtered on the
> particular db(s) and see if anything accesses them.
> --
> Andrew J. Kelly SQL MVP
>
> "Pauly C" <paulysc@.optonline.net> wrote in message
> news:04BD4AED-F586-4686-ADBB-0AD86A4EEF90@.microsoft.com...
>
>
|||Didn't even realize that was you<g>. Unfortunately the answer is still
no<g>... Everyone wants that feature though.
Andrew J. Kelly SQL MVP
"Pauly C" <paulysc@.optonline.net> wrote in message
news:A5BDC793-6A72-4F0B-9891-025DC99D927C@.microsoft.com...[vbcol=seagreen]
> Bummer, Thanks Andy. Tony B say's hello.
> Pauly C
> "Andrew J. Kelly" wrote:

Monday, March 12, 2012

Localizing Time

Does Reporting Services provide any facilities for localizing DateTime
values based on the location of the server itself? We have DateTime values
stored in the database, and need them displayed converted to local time
where the server is located.
Thanks,
JasYou have access to all of the date/time manipulation functions of VB.Net
(http://msdn.microsoft.com/library/en-us/cpref/html/frlrfSystemDateTimeClass
Topic.asp) so you should be able to do whatever conversions are appropriate
for your application.
--
This post is provided 'AS IS' with no warranties, and confers no rights. All
rights reserved. Some assembly required. Batteries not included. Your
mileage may vary. Objects in mirror may be closer than they appear. No user
serviceable parts inside. Opening cover voids warranty. Keep out of reach of
children under 3.
"J Smith" <rs-nntp@.jascentral.com> wrote in message
news:ePM9MzGkEHA.3160@.TK2MSFTNGP10.phx.gbl...
> Does Reporting Services provide any facilities for localizing DateTime
> values based on the location of the server itself? We have DateTime
values
> stored in the database, and need them displayed converted to local time
> where the server is located.
> Thanks,
> Jas
>

Localize Report

I've read several places that there isn't a way to localize reports at run
time of a report, so I wanted to ask what is the "best practice" of deploying
the reports if you have some clients that might want to view 'English'
reports and others who might want to view 'German' reports. I'd like to
avoid having duplicate reports, but it really sounds like this is my only
option.
Any ideas you have or suggestions of articles to read on the topic would be
greatly appreciated!
DanYou could put all of the formatting and vocabulary in functions, and vary
them based on a parameter, using =Iif(...) or =Switch(...)
With this approach, or with a duplicate report approach, you could adopt an
automated search/replace process to go through the RDL file and alter it to
support multiple languages.
Cheers,
'(' Jeff A. Stucker
\
Business Intelligence
www.criadvantage.com
---
"Dan" <Dan@.discussions.microsoft.com> wrote in message
news:1666568A-5499-4452-8132-B9BEE7893157@.microsoft.com...
> I've read several places that there isn't a way to localize reports at run
> time of a report, so I wanted to ask what is the "best practice" of
> deploying
> the reports if you have some clients that might want to view 'English'
> reports and others who might want to view 'German' reports. I'd like to
> avoid having duplicate reports, but it really sounds like this is my only
> option.
> Any ideas you have or suggestions of articles to read on the topic would
> be
> greatly appreciated!
> Dan

localhost is not mapped to server name

Hi,
It is a long time that I have been using my box and have some .NET apps
running on it which use a connection string with Server=localhost and I have
not had any problem yet. Today I have updated my box Windows with recent
HotFixes (well I am not 100% sure it is the reason of this problem) and
after that my applications can not login database, and get this exception
"System.Data.SqlClient.SqlException: SQL Server does not exist or access
denied".
When I changed server name from localhost to real server name they are
working properly.
Any advice is welcomed.
Thanks
Mike(local) instead of localhost
2005 Microsoft MVP C#
Robbe Morris
http://www.masterado.net
http://www.mastervb.net
"masoud bayan" <masoud_bayan@.hotmail.com> wrote in message
news:ujOrVWe7EHA.3644@.TK2MSFTNGP09.phx.gbl...
> Hi,
>
> It is a long time that I have been using my box and have some .NET apps
> running on it which use a connection string with Server=localhost and I
> have
> not had any problem yet. Today I have updated my box Windows with recent
> HotFixes (well I am not 100% sure it is the reason of this problem) and
> after that my applications can not login database, and get this exception
> "System.Data.SqlClient.SqlException: SQL Server does not exist or access
> denied".
> When I changed server name from localhost to real server name they are
> working properly.
>
> Any advice is welcomed.
>
> Thanks
> Mike
>
>