If the primary database fails, Microsoft's SQL Server may enthusiasts down. See how you can handle this event to find out how to repair the primary database with Enterprise Manager and Query Analyzer.
As an administrator of Microsoft SQL Server, you must know how to fix a crashed primary database. The primary database holds your login information and, most importantly, pointers to all of your databases. If you do not have a primary database, you will not be able to successfully start SQL Server. In this article, I'll show you how to fix the primary database in the event of a crash, and tell you how to rebuild the primary database if necessary.
Make a plan
It is important to develop a plan to deal with crashes and/or primary database failures. This will help you deal with a disaster in accordance with the established approach, rather than being pressured into reacting hastily. I've met a lot of things that are easy to panic about, but I finally managed to get through all the difficulties by staying calm and dealing with the problem in the right way.
How to tell if the primary database has crashed
Before we begin to discuss the primary database of how a system failure can be repaired and rebuilt, we need to know how to tell if it has crashed. To illustrate this point, I will collapse a primary database and tell you what symptoms will occur when the primary database crashes.
Now let's assume that your company ran into a power surge, causing SQL Server restart. The SQL Server did not start properly when it was restarted. If you view the error log (Figure A), you will see that the primary database crashes or is missing. Now that you know what information you need to see, let's see how to fix the primary database.
Repair your primary database
The first step in repairing the primary database is to use the Rebuild Wizard (Rebuild Wizard,rebuildm.exe), which is placed in the program FilesMicrosoft SQL Server80toolsbinn directory. Now let's take a look at how the rebuilding wizard works.
Double-click the dialog box shown in Rebuildm.exe to start diagram B:
In this dialog box, you can specify the repair settings for the database server and the location of the original installed data files. To make this process easier and faster, copy the x86 directory from the SQL CD to the hard disk and change the point to a local copy. Once all the information has been validated, click "Rebuild" (Rebuild). You will then be prompted to confirm the operation, as shown in Figure C: