Avatar of dbaSQL
dbaSQL
Flag for United States of America asked on

RESTORE MASTER DATABASE -- NOW

There was an outage -- the drives that held logs were lost, so I had to rebuild the system databases to bring the system up, and then restore all databases.  Now I need to restore the master so that I can get all the logins back onto the instance -- but for the life of me, I cannot get the instance into single user AND do the restore of the master db.

I stop the service in config mgr
All other sql server services are disabled, so none of them will intrude
I got to cmd prompt and open up sqlcmd -- manuever to the sqlservr.exe directory, and run this;  .\sqlservr.exe –c –m
I get all kinds of output, including the service has started in single user mode....
then I open another cmd prompt and try to start sqlcmd, but of course, it tells me

    Login failed for user 'domain\me.'. Reason: Server is in single user mode. Only one administrator can connect at this time..

So then I try this -
Turn service back on, normal  mode
open cmd prompt, input my sqlcmd statement to restore the master databsase, and leave it there
   RESTORE DATABASE master FROM DISK = '.... master.bak' WITH REPLACE
Turn off service
open cmd prompt and run this to startup in single user mode:   .\sqlservr.exe –c –m
starts up fine, so I go back to my RESTORE statement and attempt to run it -- it fails, like this:

C:\Users\me>sqlcmd
1> RESTORE DATABASE master FROM DISK = '....master.bak' WITH REPLACE
2> GO
Shared Memory Provider: No process is on the other end of the pipe.
Communication link failure

What is the correct sequence to make this happen?  I must complete this recovery asap.  Any input is greatly appreciated.
Microsoft SQL Server

Avatar of undefined
Last Comment
dbaSQL

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
dbaSQL

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
dbaSQL

ASKER
When I was starting the service in single user mode, I was also opening a connection.  When I corrected the startup, the restore completed immediately, without error.
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy