Solved

single user mode - list connections

Posted on 2007-11-30
2
1,026 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

Question has a verified solution.

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

by Mark Wills Attending one of Rob Farley's seminars the other day, I heard the phrase "The Accidental DBA" and fell in love with it. It got me thinking about the plight of the newcomer to SQL Server...  So if you are the accidental DBA, or, simp…
So every once in a while at work I am asked to export data from one table and insert it into another on a different server.  I hate doing this.  There's so many different tables and data types.  Some column data needs quoted and some doesn't.  What …
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…

624 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