How to Restore the MASTER Database in SQL Server 2012
Published by Jacob Martin on November 17, 2014
For all the Microsoft SQL Server admin it is necessary to know how to repair a corrupt master database. We know that master database stores very important information like logins and, the pointers to all of your databases. If it gets corrupt once you cannot successfully start SQL Server.
This article will teach you the complete process of recovering the master database in the event of corruption and describe you how to rebuild a corrupt master database.
Recover your master database
To recover or rebuild damaged master database, you have to use the Rebuild Wizard (Rebuildm.exe). You can find this wizard in: \Program Files\Microsoft SQL Server\80\Tools\BINN directory.
Double-click on Rebuildm.exe to start it.
On this window, give the collation settings of your database server and the location of your data files through your original install. To make the process easier, copy the x86 directory from the SQL CD to your PC’s hard drive and point to the local copy. After confirming all of this information, click on Rebuild. A window will prompted to confirm the process, same as the given bellow image.
Click on Yes, after the completion of process a message appears that telling you “the rebuild was successful”. Now you have a blank master database which is ready to restore your master database.
Execute the SQL Server in single-user mode through command prompt and typing the command sqlservr.exe –c -m from the \Program Files\Microsoft SQL Server\MSSQL\BINN\ directory. You will see the result of this command as given in the bellow image.
After it you can restore your master database from a previously created backup. Use either the Query Analyzer or SQL Enterprise Manager for restoring database.
To restore master database through Enterprise Manager, right-click on the master database, select All Tasks | Restore Database, and browse to where your device is located, same as given in Figure. To complete the restore process click on OK twice
After restoring your master database, exit from single-user mode and restart SQL Server in normal operation mode.
If you are unable to restore through this method then you can also try an alternative method known as Master database repair tool. This tool is very simple and easy to operate if you are a new user and unable to execute the above given command then through this tool you can easily rebuild your corrupt or error showing SQL master database.
This tool is also help you when you don’t have any backup of your master database, this recovery tool doesn’t need any backup file to recover your database. So now you can also retrieve any corrupt database without need of recently updated backup file. Simply download this SQL recovery tool and get rid of master database error by restoring it.
Steps to Restore the MASTER Database in SQL Server 2012
Step 1: Stop the running MS SQL server. Perform the repair task on the copy of the corrupt database, click on the ‘OK’ button to continue.
Step 2: Click on the ‘Select database’ button and select the path of corrupt MDF file. You can also search your corrupt database file by using ‘Look in’ and ‘File Type’ button. click on the ‘Scan file‘ button to start the repairing process.
Step 3: The recoverable objects of database are listed in a tree view on the left side of the window. You can see the preview by clicking on the object.
Step 4: You can also search for a particular object by using ‘Find item’ option. Write the object name or a part of the object name in the given text box, check on ‘Match case‘ or ‘Match whole word‘ and then click find next button.
Step 5: Click on the ‘Start Repair’ icon. A dialog box will appear fill the SQL server instance name. To save the repaired file in the desired location click on the brows button and give the path, else the repaired file will be saved in the ‘Default SQL Location’. Click on the ‘OK’ button.
530 Total Views 1 Views Today