REBUILD MASTER DATABASE WITH COMMAND PROMPT
If the services did not come online before you go for REBUILD database try to bring the server online by using the command below using TRACE FLAG. If this did not work follow the rebuild process. First check with below command.
If the above command does not work please add "-f" parameter which is case sensitive and try once.
If you are rebuilding NAMED INSATNCE of sql server please use provide the server name like below whether you start in single user mode or whether you start normally.
Whether it is windows authentication or mixed mode authentication providing value to 'sa' account is compulsory.
After REBUILDING the master database if we want to restore the master database with earlier .BAK file, because REBUILD master database will clean up all other databases. If you reconnect to instance and see you wont see any earlier user databases in the instance. So you need to restore 'master' database with earlier backup file and follow the approach below.
1)To restore master database restore from the old backup need to follow the instructions below.
2) Start the sqlserver instance(here I am working with default instance and the name is MAPS) in a single user mode. Before that open cmd with administrative mode as fresh
4) Now from the "cmd" go to "sqlcmd" in the command prompt run the commands one after another. Here the "GO" command is very important. If you don't put go in the command the command will not run. And always run the command below from C:\Windows\system32" level. Which means root level.
5)After restoring the database, run the "NET START MSSQLSERVER" from cmd and check the databases.
6) Now if you connect to the SSMS and connect to the respective instance you can see all the databases which were disappeared earlier.
6) Now if you connect to the SSMS and connect to the respective instance you can see all the databases which were disappeared earlier.
Comments