sql-serversql-server-2008-r2repairmaster-db

SQL Server 2008 R2 giving named provider error 40 :sql error 2


When I start SQL-Server2008R2 I get the error :- SQL Server named provider error 40 cannot connect to SQL Server :sql error 2

On checking 'EventViewer from Administrative tools' i found out the below error

Cannot recover the master database. SQL Server is unable to run. Restore master from a full backup, repair it, or rebuild it. For more information about how to rebuild the master database, see SQL Server Books Online.

I tried repair install using SQL2008R2 disc but installation failed

What are my next step should I uninstall and re-install ?

Regards Sujit P


Solution

  • So, if master won't recover, make sure all the disks in the server are online, it may be that the disk that the master database files live on is unavailable and fixing this could solve the issue.

    If that's not the problem then you can either restore the master database from backup if you have one:

    How to: Restore the master Database

    If you don't have a backup, you can get away without having to do a full re-install and just rebuild the system databases (note that this is different from running a repair install):

    How to Rebuild System Databases

    If you do this though you will have to re-attach all your databases and set up all your logins etc from scratch just like a new server install.