Solved

single user mode - list connections

Posted on 2007-11-30
2
1,004 Views
Last Modified: 2010-08-05
I am trying to move the location of my 'msdb' database.  I stopped the Agent service, Analysis service, reporting service and Fulltext service for this instance.

I started up my default instance of sql server 2005 instance in single user mode using the following:
net stop mssqlserver
net start mssqlserver /c /m /T3608

I then type SQLCMD at the prompt and get the following:
Msg 18461, Level 14, State 1, Server XXXXX, Line 1
Login failed for user 'yyyy\xxxx'. Reason: Server is in single user mode. Only one administrator can connect at this time.

I assume that something is connecting to this instance automatically.  How can i list / determine what it is?

thanks
0
Comment
Question by:jlingg
2 Comments
 
LVL 1

Accepted Solution

by:
nbraasch earned 500 total points
ID: 20384099
Look under your processes under current activity, process info in EM.  You will see what is using msdb there.

Here is how you can kill all connections - I use it all the time for moving dbs.

Call it by installing it in master, then run  EXEC USP_KILLPROCESS "msdb"

CREATE procedure usp_killprocess @dbname varchar(128) as
set nocount on
set quoted_identifier off
declare @kill_id int
declare @query varchar(320)
declare killprocess_cursor cursor for
select a.spid from sysprocesses a join
sysdatabases b on a.dbid=b.dbid where b.name=@dbname
open killprocess_cursor
fetch next from killprocess_cursor into @kill_id
while(@@fetch_status =0)
begin
set @query = 'kill ' + convert(varchar,@kill_id)
exec (@query)
fetch next from killprocess_cursor into @kill_id
end
close killprocess_cursor
deallocate killprocess_cursor
GO
0
 
LVL 1

Author Closing Comment

by:jlingg
ID: 31411954
I appreciate the procedure to kill connections.  Very helpful.
0

Featured Post

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Compare data between two databases 16 110
SQL help 5 56
SSRS report parameters set after publishing to report manager 1 64
How to import SQL 2000 database to SQL 2014 5 138
In this article I will describe the Backup & Restore method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
In this article I will describe the Copy Database Wizard method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

829 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question