restore master database

  • I'm new to SQL Server and preparing for worst case scenario. There's one thing I don't understand. What "should" happen if I start the instance in single user mode?

    After I do this: sqlservr.exe -c - m -s {instancename} my command prompt is not coming back. Last output I see is "recovery complete". What am I doing wrong here?

  • You are not suppose to get your command prompt back, until SQL Server is shutdown. What you are seeing, are the messages that normally would be stored in the ERRORLOG file in the LOG directory. What you need to do now is start a QA, or EM session and restore the master database. Once the master datbase is restored SQL Server will shutdown automatically and you will get your command prompt back. Also you should see some additional messages displayed prior to getting your command prompt.

    Gregory Larsen, DBA

    If you looking for SQL Server Examples check out my website at http://www.geocities.com/sqlserverexamples

    Gregory A. Larsen, MVP

  • Thanks for your answer, but I tried that before to see what happens. When I try to connect through QA I get the message: login failed because server is in single user mode. When I connect through EM I get the question: would you like to start it now? (when I accept this the sql server is started (again) but not in single user mode)

    I thought that only one connection is possible in single user mode, so if my prompt is not coming back, there is already one user. Is this not true?

  • It is true you can only have one connection open in single user mode, but the service running at the command prompt does not count. I'm normally able to start either and EM or QA session while I'm running SQL Server from the command prompt, like you said you where doing. Although I have never tried this on a named instance. You could also try to submit the restore command via an OSQL statement.

    Gregory Larsen, DBA

    If you looking for SQL Server Examples check out my website at http://www.geocities.com/sqlserverexamples

    Gregory A. Larsen, MVP

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply