Restore Master Database

  • I'm testing a plan for Disaster and Recovery and I retored the master database, but after the instance not start.

    Someone has the same problem?

  • What error messages are in SQL Server Log? By default it gets installed here:

    C:\Program Files\Microsoft SQL Server\MSSQL\LOG\ERRORLOG

    As your instance won't go up you probably can't use EM to view error log contents, so you will have to go straight to file system and use notepad or something like that.

    I came across this problem when I restored master on a server with different disk/directory structure than the original one had. Master db contains pointers to other system dbs and if they are not found on startup sql server won't start.

  • I agree, the problem is most likly that the master database is looking for other system databases in specific locations which it cannot find.  Usually the most common one is tempdb.  Here so the process I generally use after restoring the master database.  This sets the system databases back to their new instalation locations thus allowing you to start the server and them restore them if need be.

    1.  Run the command sqlservr –c –f –T3608 –T4022 to put the server in recovery mode.

    2.  Open a query analyzer window STARTà PROGRAMSà Microsoft SQL Serverà Query Analyzer. (Please note that once master is installed you will need to use the sa password from the recovered master server to login.)

    3.  Execute the following commands:

    sp_detach_db 'model'

    GO

    EXEC sp_attach_db @dbname = N'model',

    @filename1 = N'c:\Program Files\Microsoft SQL Server\MSSQL\Data\model.mdf',

    @filename2 = N'c:\Program Files\Microsoft SQL Server\MSSQL\Data\modellog.ldf'

    GO

    sp_detach_db 'msdb'

    GO

    EXEC sp_attach_db @dbname = N'msdb',

    @filename1 = N'c:\Program Files\Microsoft SQL Server\MSSQL\Data\msdbdata.mdf',

    @filename2 = N'c:\Program Files\Microsoft SQL Server\MSSQL\Data\msdblog.ldf'

    GO

    Alter database TempDB Modify file (name = tempdev, filename = 'c:\tempdb.mdf')

    Alter database TempDB Modify file (name = templog, filename = 'c:\tempdb.ldf')

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

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