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 ?
!
,