none
SQL Server 2005 Master Database Corrupted

    Question

  • I have an installation of SQL server 2005 with two instances viz. WINCC & WINCCPLUSMIG.

    One of the instances has got corrupted (WINCCPLUSMIG). I'mnot able to connect to the instance in the SSMS and the services for the instances cannot be started forcibly either.

    The error log for SQL says that the master DB for the instance is corrupted. 

    How to rebuild the Master DB files?

    Your help is valuable to close an ongoing (dragged/prolonged) project 

    Regards,

    Yogashankar

    Saturday, October 05, 2013 5:55 AM

Answers

All replies

  • Hello,

    To rebuild master

    http://technet.microsoft.com/en-us/library/dd207003.aspx

    http://www.codeproject.com/Tips/537811/Rebuilding-Master-Database-in-SQL-Server


    Please mark this reply as the answer or vote as helpful, as appropriate, to make it useful for other readers


    Saturday, October 05, 2013 6:16 AM
  • Hi Yogashankar,

    If you have a proper backup of your master, you can try this solution as well

    http://blogs.technet.com/b/fort_sql/archive/2011/02/01/the-easiest-way-to-rebuild-the-sql-server-master-database.aspx

    Thanks

    Please click the Mark as answer button and vote as helpful if this reply solves your problem

    Saturday, October 05, 2013 6:53 AM
  • Hi YogaShankar

    MasterDB can be rebuild. But there are some other features that I need to understand.

    Like If the instance of SQL Server is configured as a replication Distributor or not. Where do you lie in the security hierarchy. Which platform you are running this on (x86, x64)

    But still some of the points as I remember are stated below:

    Pre-requisites are that you record all the current configurations, Versions, Record log file locations, So that while building you know what you have to do.

    Use below script for above.

     

     

     

    SELECT configuration_id, name, value,minimum, maximum, value_in_use, description, is_dynamic, is_advanced 
    FROM sys.configurations;
    
    SELECT SERVERPROPERTY('ProductVersion ') AS PrdctVersion,
    SERVERPROPERTY('ProductLevel') AS PrdctLevel,
    SERVERPROPERTY('ResourceVersion') AS RsrcVersion,
    SERVERPROPERTY('ResourceLastUpdateDateTime') AS RsrcLastUpdDateTime,
    SERVERPROPERTY('Collation') AS Collation;
    
    
    SELECT name, physical_name AS CurrentFileLocn
    FROM sys.master_files
    WHERE database_id IN (DB_ID('master'), DB_ID('model'), DB_ID('msdb'), DB_ID('tempdb'));
    
    
    
    Now use the installation disc and use below script in a command shell.

    Setup /ACTION=REBUILDDATABASE /INSTANCENAME=WINCCPLUSMIG /SQLSYSADMINACCOUNTS=accounts

    [/ SAPWD= your password] [ /SQLCOLLATION=<Check the collation from config>]

    PS: Don't forget to use all the latest service packs and patches to this newly built sys dbs


    Please use Marked as Answer if my post solved your problem and use Vote As Helpful if a post was useful.

    • Proposed as answer by HimanshuSharma Saturday, October 05, 2013 7:30 AM
    Saturday, October 05, 2013 7:29 AM