Showing posts with label lock. Show all posts
Showing posts with label lock. Show all posts

Monday, March 19, 2012

Deleting a lock or killing a process

Hi everyone,
We are currently having a problem with our SQL server. What seems to have
happened is a lock has been put on a row and then hasnt been removed, so now
we can't update because the lock is still there.
I'm wondering what we can do about this. Is there anyway you can delete or
remove locks in SQL Server?
At the moment, using SQL Sever, I can see a list of locks on the database
and table in question. What happens if I delete them? Each lock is
associated with a process - what happens if I kill the process?
Thanks to anyone who can offer any advice on this
kindest regards
SimonHi,
Before killing the process, try to identify the issue.
I feel that u are not commiting the transaction. after a Begin TRAN.
Thanks
Hari
MCDBA
"Simon Harvey" <simon.harvey@.the-web-works.co.uk> wrote in message
news:uXeVMVsAEHA.3400@.tk2msftngp13.phx.gbl...
> Hi everyone,
> We are currently having a problem with our SQL server. What seems to have
> happened is a lock has been put on a row and then hasnt been removed, so
now
> we can't update because the lock is still there.
> I'm wondering what we can do about this. Is there anyway you can delete or
> remove locks in SQL Server?
> At the moment, using SQL Sever, I can see a list of locks on the database
> and table in question. What happens if I delete them? Each lock is
> associated with a process - what happens if I kill the process?
> Thanks to anyone who can offer any advice on this
> kindest regards
> Simon
>|||This is a multi-part message in MIME format.
--=_NextPart_000_0034_01C40295.3C0B6960
Content-Type: text/plain;
charset="Windows-1252"
Content-Transfer-Encoding: quoted-printable
Killing the process that holds the locks will rollback the transaction =of that process, thereby releasing all of its locks. However, to save =yourself this kind of trouble in the future, you should invest some time =into troubleshooting the problem. There are probably a couple of =options, but all of them come down to why a transaction has not =committed.
See if224453 INF: Understanding and Resolving SQL Server 7.0 or 2000 =Blocking Problems
(http://support.microsoft.com/?id=3D224453) helps you out any. 171224 =INF: Understanding How the Transact-SQL KILL Command Works =(http://support.microsoft.com/?id=3D171224) might also be interesting =for you.
Thanks,
Ryan Stonecipher
Microsoft SQL Server Storage Engine
"Simon Harvey" <simon.harvey@.the-web-works.co.uk> wrote in message =news:uXeVMVsAEHA.3400@.tk2msftngp13.phx.gbl...
Hi everyone,
We are currently having a problem with our SQL server. What seems to =have
happened is a lock has been put on a row and then hasnt been removed, =so now
we can't update because the lock is still there.
I'm wondering what we can do about this. Is there anyway you can =delete or
remove locks in SQL Server?
At the moment, using SQL Sever, I can see a list of locks on the =database
and table in question. What happens if I delete them? Each lock is
associated with a process - what happens if I kill the process?
Thanks to anyone who can offer any advice on this
kindest regards
Simon
--=_NextPart_000_0034_01C40295.3C0B6960
Content-Type: text/html;
charset="Windows-1252"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
&

Killing the process that holds the locks will =rollback the transaction of that process, thereby releasing all of its locks. =However, to save yourself this kind of trouble in the future, you should invest =some time into troubleshooting the problem. There are probably a couple of =options, but all of them come down to why a transaction has not =committed.
See if224453 INF: Understanding and Resolving SQL =Server 7.0 or 2000 Blocking Problems(http://support.microsoft.com/?id=3D224453">http://support.microso=ft.com/?id=3D224453) helps you out any. 171224 INF: Understanding How the Transact-SQL KILL =Command Works (http://support.microsoft.com/?id=3D171224">http://support.microso=ft.com/?id=3D171224) might also be interesting for you.
Thanks,
Ryan Stonecipher
Microsoft SQL Server Storage Engine
"Simon Harvey" wrote in message news:uXeVMVsAEHA.3400=@.tk2msftngp13.phx.gbl...Hi everyone,We are currently having a problem with our SQL =server. What seems to havehappened is a lock has been put on a row and then =hasnt been removed, so nowwe can't update because the lock is still =there.I'm wondering what we can do about this. Is there anyway you can delete orremove locks in SQL Server?At the moment, using SQL =Sever, I can see a list of locks on the databaseand table in question. What =happens if I delete them? Each lock isassociated with a process - what =happens if I kill the process?Thanks to anyone who can offer any advice on thiskindest =regardsSimon

--=_NextPart_000_0034_01C40295.3C0B6960--

Deleting a lock or killing a process

Hi everyone,
We are currently having a problem with our SQL server. What seems to have
happened is a lock has been put on a row and then hasnt been removed, so now
we can't update because the lock is still there.
I'm wondering what we can do about this. Is there anyway you can delete or
remove locks in SQL Server?
At the moment, using SQL Sever, I can see a list of locks on the database
and table in question. What happens if I delete them? Each lock is
associated with a process - what happens if I kill the process?
Thanks to anyone who can offer any advice on this
kindest regards
SimonHi,
Before killing the process, try to identify the issue.
I feel that u are not commiting the transaction. after a Begin TRAN.
Thanks
Hari
MCDBA
"Simon Harvey" <simon.harvey@.the-web-works.co.uk> wrote in message
news:uXeVMVsAEHA.3400@.tk2msftngp13.phx.gbl...
> Hi everyone,
> We are currently having a problem with our SQL server. What seems to have
> happened is a lock has been put on a row and then hasnt been removed, so
now
> we can't update because the lock is still there.
> I'm wondering what we can do about this. Is there anyway you can delete or
> remove locks in SQL Server?
> At the moment, using SQL Sever, I can see a list of locks on the database
> and table in question. What happens if I delete them? Each lock is
> associated with a process - what happens if I kill the process?
> Thanks to anyone who can offer any advice on this
> kindest regards
> Simon
>|||Killing the process that holds the locks will rollback the transaction of th
at process, thereby releasing all of its locks. However, to save yourself t
his kind of trouble in the future, you should invest some time into troubles
hooting the problem. There are probably a couple of options, but all of the
m come down to why a transaction has not committed.
See if224453 INF: Understanding and Resolving SQL Server 7.0 or 2000 Blockin
g Problems
(http://support.microsoft.com/?id=224453) helps you out any. 171224 INF: Understanding
How the Transact-SQL KILL Command Works ([url]http://support.microsoft.com/?id=171224[
/url]) might also be interesting for you.
Thanks,
Ryan Stonecipher
Microsoft SQL Server Storage Engine
"Simon Harvey" <simon.harvey@.the-web-works.co.uk> wrote in message news:uXeV
MVsAEHA.3400@.tk2msftngp13.phx.gbl...
Hi everyone,
We are currently having a problem with our SQL server. What seems to have
happened is a lock has been put on a row and then hasnt been removed, so now
we can't update because the lock is still there.
I'm wondering what we can do about this. Is there anyway you can delete or
remove locks in SQL Server?
At the moment, using SQL Sever, I can see a list of locks on the database
and table in question. What happens if I delete them? Each lock is
associated with a process - what happens if I kill the process?
Thanks to anyone who can offer any advice on this
kindest regards
Simon

Sunday, March 11, 2012

deleteing small amount of records from a view causes IX lock on all the base tables.

Sorry that I had to post it as new message instead of replying since I got server application error.
Kalen, this is a different issue. I wonder why other 4 base tables got IX TAB lock as well since the partitioned view is supposed to look up the relevant tables only by querying on the constraint column.Tom
Can you please include relevant portions of the original message, so I can
know what I am replying to without having to search the archives?
If this is a question about partitioned views, did you supply the view
definition, and the version you are using?
--
HTH
--
Kalen Delaney
SQL Server MVP
www.SolidQualityLearning.com
"Tom" <anonymous@.discussions.microsoft.com> wrote in message
news:29346002-6963-4D4E-B63C-C6A5C5E292CD@.microsoft.com...
> Sorry that I had to post it as new message instead of replying since I got
server application error.
> Kalen, this is a different issue. I wonder why other 4 base tables got IX
TAB lock as well since the partitioned view is supposed to look up the
relevant tables only by querying on the constraint column.

Tuesday, February 14, 2012

Delete Lock

Hi,
I'm trying to clean up some old mess. We've got an sql server that keeps
reporting deadlocks. There is a loging application that keeps inserting
and deleting records from a table. The delete statement will always delete
only 1 row. The table is without primary keys and indexes. My question is
this: How will the delete statement lock the rows ? Will it apply a
rowlock, pagelock or table lock ?
Using Opera's revolutionary e-mail client: http://www.opera.com/m2/If the table does not have primary key or indexes, then sql server have to d
o
a table scan to find the row and may be it is scalating the lock. See "Lock
Escalation" in BOL. If possible, create a pk.
AMB
"kfu" wrote:

> Hi,
> I'm trying to clean up some old mess. We've got an sql server that keeps
> reporting deadlocks. There is a loging application that keeps inserting
> and deleting records from a table. The delete statement will always delete
> only 1 row. The table is without primary keys and indexes. My question is
> this: How will the delete statement lock the rows ? Will it apply a
> rowlock, pagelock or table lock ?
> --
> Using Opera's revolutionary e-mail client: http://www.opera.com/m2/
>|||Who is blocking who and under what circumstances. Even a query will acquire
shared locks, meaning that a long running query can block an
insert/update/delete for the duration of it's select or an i/u/d can block a
query for the duration of it's transaction. Read up on options for "set
transaction isolation level". Perhaps allowing queries to the log table to
read uncommitted will help resolve you issue. Also, if you are logging
things like user activity (for example logging the last time a record was
viewed by the user), then do not do this in a fact table, instead use a
seperate log table just for that purpose.
"kfu" <kfurnes@.netcom.no> wrote in message
news:op.sraov9ia0gg7rt@.kjafur2.sense.sensetech.no...
> Hi,
> I'm trying to clean up some old mess. We've got an sql server that keeps
> reporting deadlocks. There is a loging application that keeps inserting
> and deleting records from a table. The delete statement will always delete
> only 1 row. The table is without primary keys and indexes. My question is
> this: How will the delete statement lock the rows ? Will it apply a
> rowlock, pagelock or table lock ?
> --
> Using Opera's revolutionary e-mail client: http://www.opera.com/m2/