Restoring master db from db backup

  • On our Development server I am documenting the exact steps on how to restore the master db. This is Win2008/SQL 2008 SP1 64 bit

    I shutdown all SQL Server services for INST4.

    cmd prompt and navigate to the INST4 binn directory

    enter sqlservr.exe -m -s INST4 and get this message:

    initerrlog: Could not open error log file ''. Operating system error = 3(The system cannot find the path specified.).

    I am logged onto the server with the ID that runs the SQL Server service and if I use the SERVICES it starts just fine which is what is odd. It CAN find the system path started via the SERVICES but not at command prompt. Any help would be appreciated.

  • Make sure the sql instance is not running and the log folder path exists and you login account has the sufficient access.

    Make sure SQL Agent is disabled....

    Have tried using SQL Configuration manger to start server in sigle user mode if so what is the error..

    http://msdn.microsoft.com/en-us/library/ms190679.aspx

    http://msdn.microsoft.com/en-us/library/ms188236.aspx

    MohammedU
    Microsoft SQL Server MVP

  • edit the service startup parameters (in services applet) to add the -m switch then start the service.

    The probability of survival is inversely proportional to the angle of arrival.

  • OK, I went into the Configuration manager and added the -c:-m parameters and SQL Server will not start. I see this error in the event log

    FCB::Open failed: Could not open file M:\Program Files\Microsoft SQL Server\MSSQL10.INST4\MSSQL\DATA\mastlog.ldf –c for file number 2. OS error: 2(The system cannot find the file specified.).

    I cannot understand why though. I am logged into the physical server with the same ID that runs the service. I navigated to the file and it is in this same path. I remove the -c;-m parameters and SQL Server starts just fine... what could possibly be the problem, it just doesn't make sense?

  • what is M: drive? When you log in as the mssqlserver user can you navigate to to that location and see that file? - sorry you already specified that you could.

    The probability of survival is inversely proportional to the angle of arrival.

  • The M drive has master, model, msdb and temp all on them. It is there and the application data files are on a seperate drive. Yes, when I navigate to the M drive the master ldf file is there.

  • Can you post the startup parameter string and what edition of sql server it is?

    MohammedU
    Microsoft SQL Server MVP

  • -dM:\Program Files\Microsoft SQL Server\MSSQL10.INST4\MSSQL\DATA\master.mdf;-eM:\Program Files\Microsoft SQL Server\MSSQL10.INST4\MSSQL\Log\ERRORLOG;-lM:\Program Files\Microsoft SQL Server\MSSQL10.INST4\MSSQL\DATA\mastlog.ldf

    This is SQL 2008 64 bit Standard Edition SP1 on Win2008 I have 4 instances on this server as it is a DEV and TEST SQL Server. I tried and the default instance will not start in single user mode either.

  • Try copy and paste the following and restart it...

    -m;-dM:\Program Files\Microsoft SQL Server\MSSQL10.INST4\MSSQL\DATA\master.mdf;-eM:\Program Files\Microsoft SQL Server\MSSQL10.INST4\MSSQL\Log\ERRORLOG;-lM:\Program Files\Microsoft SQL Server\MSSQL10.INST4\MSSQL\DATA\mastlog.ldf

    Under what account sql server is running?

    MohammedU
    Microsoft SQL Server MVP

  • OK.... that worked..... what other than the -m at the beginning of the string is different from what was installed there?

    Also, now... to do a master db restore exercise how do I start SQL Server in single user mode via command prompt?

  • http://msdn.microsoft.com/en-us/library/ms188236.aspx

    MohammedU
    Microsoft SQL Server MVP

  • But when I use cmd prompt and navigate to the BINN folder and type in sqlservr.exe -c -m -s INST4 it says it cannot find the log file. That was my problem from the beginning I cannot start SQL Server in single user mode to goto sqlcmd to restore master.

  • Make sure you Stop the SQL Server Agent service before connecting to an instance of SQL Server in single-user mode; otherwise, the SQL Server Agent service uses the connection, thereby blocking it.

    First stop the sql server intance the one you want to start in sigle user mode

    open the command window

    run

    cd m:\Program Files\Microsoft SQL Server\....

    once you are in the binn folder of the sql intance you are trying to start

    run

    sqlservr.exe -m

    Please post the exact error you are getting to troubleshoot...

    MohammedU
    Microsoft SQL Server MVP

  • using CMD Prompt I navigate to the INST4 Binn folder and issue sqlservr.exe -m -s INST4 and I get this error:

    initerrlog: Could not open error log file ''. Operating system error = 3(The system cannot find the path specified.).

    Yes SQL Server Agent is stopped and disabled.

Viewing 14 posts - 1 through 13 (of 13 total)

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