I need to restore the master database in sql 2008 sp1 but get msg18461 error

QuissEngineer
QuissEngineer used Ask the Experts™
on
i need to recover the master database.

Ive reinstall sql 2008 and sp1

i stop sql service

i run "d:\program files\microsoft sql server\mssql10.mssqlserver\mssql\binn\sqlservr.exe" /c /m"sqlcmd"

i then open another command prompt and type sqlcmd.

 i want to run

RESTORE DATABASE master FROM DISK = "d:\master.bak" WITH REPLACE;
GO

but as soon as i run the sqlcmd command i get the following error

"Msg 18461, Level 14, State 1, Server SQLSERVER, Line 1 login failed for 'domain1\administrator'. Reason: Server is in single user mode. Only one administrator can connect at this time.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Make sure the only services running are SQL Server and SQL Server browser services.  I believe other things like SSIS, SSRS, etc. can count as a connection.

Greg

Author

Commented:
Greg

I have to have the sql server service stopped to enable me to enable single user mode.
I understand that, but when you start SQL in single user mode, if any other service starts, it will take that single connection.  Basically, the reason you can't connect to SQL is because something else is taking that connection.  You have to figure out what that something is.  You could disconnect it from the network to eliminate the possibility of outside connections.

Greg

How to Generate Services Revenue the Easiest Way

This Tuesday! Learn key insights about modern cyber protection services & gain practical strategies to skyrocket business:

- What it takes to build a cloud service portfolio
- How to determine which services will help your unique business grow
- Various use-cases and examples

Author

Commented:
120 miles away from the server sadly using mstsc and dameware to connect to it.

Ouch!  That makes it a little more tricky.  If you are sure that there aren't any SQL services taking the connection, you might need to have physical access to the server to make sure that you get that only connection.  Otherwise, you will have to get lucky to get that one connection before someone else does.

Greg

sql server service stopped  Enable it
dropping the "sqlcmd" so just running sqlservr.exe -c -m stops itself taking the connection.

Author

Commented:
This fixed it.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial