Solved

single user mode - list connections

Posted on 2007-11-30
2
967 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

Zoho SalesIQ

Hassle-free live chat software re-imagined for business growth. 2 users, always free.

Join & Write a Comment

Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

708 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now