​Cannot Start MSSQL Error Code 3 (Corrupt MASTER.MDF)

Home Forums Other Microsoft Servers and SaaS SQL Server 2005 / 2008 / 2008 R2 / 2012 / 2016 ​Cannot Start MSSQL Error Code 3 (Corrupt MASTER.MDF)

This topic contains 4 replies, has 4 voices, and was last updated by Avatar vegas588 3 years, 5 months ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • Avatar
    allorhina
    Member
    #165758

    Afternoon All MSSQL Experts

    We run a MRP package called PREDCOM that uses MSSQL as a db. Since of this morning we cannot start the db service. The error message indicates that the master.mdf file is corrupt. Can anybody assist us to restore the database without losing the table definitions, stored procedures and data.

    Thanks

    Avatar
    Ossian
    Moderator
    #190879

    This is the main file for the Master database that controls all of SQL server. If it is corrupt, the best solution is to restore from backup. Failing that, you can create a new master database and re-attach other existing databases, so not losing data but probably losing security settings, logins etc.

    If you tell us which version of SQL server you are using, I will pull out some references, otherwise :google: for SQL Server lost master database or similar will get you to the right place: https://www.google.co.uk/search?q=SQ…gBw&gws_rd=ssl

    If you don’t have backups of the master database, I strongly suggest you review your backup policy once you have recovered

    Avatar
    StevDo
    Member
    #391174

    One of the methods for restoring sql database via T-SQL, if guide below can’t help you, take a look at more powerful methods
    [MOD EDIT DODGY LINKS DELETED]

    Restore With Transact-SQL
    Step 1
    Click “New Query” in the Management Studio’s main toolbar. This opens a large text area on the right side of the screen.
    Step 2
    Click in the text area and type a Create Database statement using the following Transact-SQL code as a guide:
    CREATE DATABASE MyDatabase ON (FILENAME = ‘c:data filesmy_data.mdf’), (FILENAME = ‘ c:data filesmy_data.ldf’) FOR ATTACH;
    Step 3
    Click the “Execute” button in the Transact-SQL toolbar, located just under the Management Studio’s main toolbar. The Execute button symbol is a right-pointing triangle. SQL Server Management Studio restores the database.

    Avatar
    Ossian
    Moderator
    #190910

    If you took the trouble to read the original post, you would see that the OP cannot start SSMS without the master database, so your post is useless.

    I suspect spam and am removing the links you posted.

    Avatar
    vegas588
    Member
    #391354

    When you can’t restore .sql data via standard solutions make use of guide below or if even the guide can’t help you, it might be that your sql data was severely corrupted and you may get more powerful tips on
    [MOD EDIT – commercial link deleted and spammer banned]

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.