One of my friends client has got an issue with his SQL Server. A weekly database integrity check has reported a corruption for one of his databases. The corruption reported was of consistency type. There are manual and automated methods for repairing database corruption. I have Recover Database using Stellar Repair for MS SQL for this very case. Let me brief you about the consistency error first and then I will give you overview of how easy it is to use Stellar Repair for MS SQL.
SQL Server database is Crucial and important where in your production are dependent on this and you make all attempt to make it persistent to make your day to day business transaction smooth and workable. Here, for MS SQL, the consistency means that the database and the data should be available for access smoothly or in clean state.
There can be multiple reasons why database reports consistency error. It can be Physical or Logical damage. The database can get corruption at row level, Indexes, allocation pages or it can be referential integrity. This damage can be due to a hardware system or damaged pages or driver. It can be any of this.
Recover Corrupt Database
There are manual methods for recovering corrupt database. Microsoft has put together some guidelines on how to troubleshoot database consistency errors here. An MVP Steve Stedman (W | T) has a series on Database Corruption. In case you may want to read more on different kind of corruption issues I would encourage you to read Steve’s blog series. I will take some time to recover database corruption manually.
In this case which I have mentioned above, I have used a tool called Stellar Repair for MS SQL.
Recover Database using Stellar Repair for MS SQL
As I have already provide you the details about what database corruption is. And how to repair database manually. Let me now show you how I was able to recover the database corruption.
Step 00: I ran the DBCC CHECKDB to see the what kind of corruption it is and for record.
Step 01: Download the Stellar Repair for MS SQL
Step 02: Set up the Tool. It will take a couple of minute and I bet the installation would take only a couple of minutes
Step 03: When you launch the tool it will greet you with a beautiful and user friendly GUI
Step 04: The first thing first, it will ask you to stop the SQL Server services and copy the corrupt database files at a different location
Step 05: You will have to browse to the location where you have kept a corrupt database files
Step 06: Select the database file and click on Repair button
Step 07: Depending on the size of the database and corruption it may take a few minute. For me it hardly take a minute
Step 08: Once the database file is repaired it will ask you where you would like to save the database. It can save the database in MDF, CSV, HTML or an XLS format
Step 09: For easyness, I have opted to save the repaired database as a New Database to an SQL Server Instance
Step 10: You will see a new database Prefixed with Recovered_yourdatabase name. You can always rename it as you deemed necessary. I did renamed it to CorruptDB again for example.
Step 11: Run the DBCC CHECKDB again to make sure your database is repaired. I did so, and it’s great.
Step 12: You are done!! It was easy, right?
Recommendation and Conclusion
As I have already mentioned. Repairing a corrupt database needs understanding of SQL Server internals and expert level knowledge. Apart from the knowledge, it will also needs an important resource – TIME. When you have a good amount of time it’s okay to follow the manual method. In case you are falling short on TIME. I would encourage you to download Stellar Repair for MS SQL. It will save you both – a Time and the production downtime.