We help IT Professionals succeed at work.

RESTORE MASTER DATABASE -- NOW

dbaSQL
dbaSQL asked
on
130 Views
Last Modified: 2018-03-28
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.
Comment
Watch Question

Commented:
This problem has been solved!
(Unlock this solution with a 7-day Free Trial)
UNLOCK SOLUTION

Author

Commented:
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.