Monday, March 26, 2012

Killing Locks by Object - SS2005

splocI can't restore a database due to a locking issue. While I've killed
the Process in Activity Monitor, I still see the database listed on the Locks
By Object page. The Process ID is a negative number. Any ideas as to what I
can do to get rid of this lock?
Here's the output from sp_lock: -2 7 0 0 DB
S GRANT
Thanks in advance.
JohnOn Oct 5, 1:49 am, John Roberts
<JohnRobe...@.discussions.microsoft.com> wrote:
> splocI can't restore a database due to a locking issue. While I've killed
> the Process in Activity Monitor, I still see the database listed on the Locks
> By Object page. The Process ID is a negative number. Any ideas as to what I
> can do to get rid of this lock?
> Here's the output from sp_lock: -2 7 0 0 DB
> S GRANT
> Thanks in advance.
> John
After killing the process you may try putting database in single user
mode which would prevent application or user establishing connection.
Thanks
VS|||Thanks for the response..
When I do a select distinct req_transactionuow, req_transactionID from
syslockinfo where req_spid = -2
I see the follwing:
req_transactionuow req_transactionID
--
--
00000000-0000-0000-0000-000000000000 0
When I try to kill this UOW using the guid of all zeroes, we get the
following error:
Msg 6110, Level 16, State 1, Line 1
The distributed transaction with UOW {00000000-0000-0000-0000-000000000000}
does not exist.
Anybody out there familiar with killing orphaned transactions where the UOW
GUID is all zeros? My only solution now is to restart the service and, as
you might have imagined, that's NOT the only database running!!
Thanks in advance.
John
"vijay" wrote:
> On Oct 5, 1:49 am, John Roberts
> <JohnRobe...@.discussions.microsoft.com> wrote:
> > splocI can't restore a database due to a locking issue. While I've killed
> > the Process in Activity Monitor, I still see the database listed on the Locks
> > By Object page. The Process ID is a negative number. Any ideas as to what I
> > can do to get rid of this lock?
> >
> > Here's the output from sp_lock: -2 7 0 0 DB
> > S GRANT
> >
> > Thanks in advance.
> >
> > John
> After killing the process you may try putting database in single user
> mode which would prevent application or user establishing connection.
> Thanks
> VS
>

No comments:

Post a Comment