Link to home
Start Free TrialLog in
Avatar of dbaSQL
dbaSQLFlag 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.
ASKER CERTIFIED SOLUTION
Avatar of dbaSQL
dbaSQL
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of 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.