SQL Server restores the master database and sqlmaster database by means of Reconstruction
SQL Server restores the master database through reconstruction. The details are as follows:
1. Back up the master database
2. Stop the service and directly Delete the master data file.
3. Use the installer to recreate the master data file
Enter the installation directory in the console.
D: \ SetUp \ sqlserver2012> Setup/QUIET/ACTION = REBUILDDATABASE/INSTANCENAME = sqlserver2012/SQLSYSADMINACCOUNTS = UserName/SAPWD = ***
4. Start the SQL Server service in single-user mode and restore it using backup files
Start in single user mode: net start mssql $ sqlserver2012/m
Sqlcmd connection: sqlcmd-S "ServerName \ InstanceName"
If the master file is not damaged and there is a backup of the master, you only need to restore the master in step 4.
5. Restart the database service and then access the database normally.
The above is all the content of this article. I hope it will be helpful for your learning and support for helping customers.