Replace data and log files of master

  • My master db is corrupted. can anyone tel me how to replace data and log files of master

  • If you have a good backup and the server is still starting, you can restore the backup. see here for instructions:

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

    If you don't have a backup or your server won't start anymore because of the corruption, you have to use setup.exe to rebuild the system databases.

    http://msdn.microsoft.com/en-us/library/ms144259(SQL.90).aspx">

    http://msdn.microsoft.com/en-us/library/ms144259(SQL.90).aspx

    But keep in mind that this will also rebuild msdb and model and that you have to re-apply any servicepacks.

    [font="Verdana"]Markus Bohse[/font]

  • Do you mean I have to install sql server again if I don't have master DB backup. Thanks for telling that msdb and model would be rebuilt. Actually this is a test server.

  • luckysql.kinda (12/3/2009)


    Do you mean I have to install sql server again if I don't have master DB backup.

    No. The SQL installer can, if run with specific parameters, rebuild the master database of an existing SQL installation. You'll lose all logins and all user databases will have to be reattached, but it will give you a clean master database.

    This is why master (and msdb) should be backed up regularly.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass

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

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