3

I have a sporadic problem, when upgrading SQL Server in a single-user mode, some other application somehow logs into the database and kicks my process out.

Last time when that happened, I ran sp_who, and I could see that a process that took control of the database is "TASK MANAGER". EDIT By "took control" I mean that my process crashed with exception Database '...' is already open and can only have one user at a time. while it was running database upgrade code. SqlConnection was NOT closed or disposed.

Anyone could tell me what is this process, what is it's purpose, and how in the world it could get into a database, which is in single-user mode, and there is an active connection?

4
  • When you say it's "called" TASK MANAGER, is that the loginname or cmd field from the sp_who results?
    – Widor
    Jul 11 '12 at 16:20
  • TASK MANAGER should normally be on the master db, but it's a background process and not sure what you mean by "taking control" of the database.
    – Widor
    Jul 11 '12 at 16:23
  • @Widor TASK MANAGER is Command field.
    – galets
    Jul 11 '12 at 16:31
  • AFAIK Task Manager as it's a system SPID would not take up a user connection to the DB. Someone more knowledgeable than me may be able to confirm this. Do you have sql server agent running on this instance? From memory this counts as a 'user connection' and can interfere with single user mode.
    – WT_W
    Jul 12 '12 at 0:07
4

Any SPIDs below 50 are system processes. "TASK MANAGER" is one of these. I'm not sure exactly what it does but it is initiated only by the server itself, dealing with system level jobs. Seeing this on the database "sp_who" is nothing to worry about.

I highly doubt this process is the reason why you are getting kicked out of the DB running in single user mode, but if you are curious what the process might be doing you could run dbcc inputbuffer(the_spid_of_process) to check if it is running any commands.

1
  • Is there something to worry if we are seeing the same for many SPIDs. For me SPID 22 --> 34 is Command : TASK MANAGER under user account sa Jul 21 '14 at 10:22
2

The "Task Manager" process is used by change tracking to do cleanup steps in change tracking. To make it stop, you can either disable change tracking, or you can disable change tracking cleanup.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.