A process running on SQL Server 2008 R2 with spid = -2

On Sql Server 2008 R2 SP2, I cannot delete the database. Error: The database is in use.

I don’t see anything in the activity monitor

Starting DBCC OPENTRAN I see an active transaction with SPID: 13s. What I cannot kill due to "s" seems to be a sytem transaction.

Here is the result of the DBCC opentran command:

Oldest active transaction: SPID (server process ID): 35s UID (user ID) : -1 Name : offline index build LSN : (4082851:348:145) Start time : Jul 25 2014 4:06:51:260PM SID : 0x0

Syslockinfo lokk content:

rsc_text                         rsc_bin                            rsc_valblk                         rsc_dbid rsc_indid rsc_objid   rsc_type rsc_flag req_mode req_status req_refcnt req_cryrefcnt req_lifetime req_spid    req_ecid    req_ownertype req_transactionID    req_transactionUOW
-------------------------------- ---------------------------------- ---------------------------------- -------- --------- ----------- -------- -------- -------- ---------- ---------- ------------- ------------ ----------- ----------- ------------- -------------------- ------------------------------------
                                 0x00000000000000000000000016000200 0x00000000000000000000000000000000 22       0         0           2        0        3        1          1          0             0            -2          0           4             0                    00000000-0000-0000-0000-000000000000
                                 0x00000000000000000000000016000200 0x00000000000000000000000000000000 22       0         0           2        0        3        1          1          0             0            122         0           4             0                    00000000-0000-0000-0000-000000000000

If I backup and restore this database with another namre, I get the same problem. So I suppose this has something to do with a transaction in progress. Of course, he cannot compress a magazine that continues to grow and grow.

, #, Microsoft.SqlServer.Management.Smo < - !!!

, , trasaction spid = -2. , #. -2 ?

!

,

+4
1

SPID -2 - DTC.

( UOW Unit of Work Number) SPID-2 :

select req_transactionUOW
from master..syslockinfo
where req_spid = -2

, UOW.

, GUID - , .

KILL 'C2645B98-2962-4c3e-83AC-8A5626A0C0A3'

spid sql-.

: http://social.msdn.microsoft.com/forums/sqlserver/en-US/c856fb4b-9c61-4180-a172-f6ceed5b0c45/blocking-caused-by-2-spid

spid -2, .

SPID MSDTC(), , , MSDTC , SQL db . - , MSDTC ACID , MSDTC SPID Orpahned SPID, , SPID + -ve, , -2 ( ).

, , , , / . obviuosly , spids ...

Kill -ve spid, UNIT OF WORK (UOW) spid, kill . , ... : Rama Udaya.K

+4

Source: https://habr.com/ru/post/1548665/


All Articles