Are you getting DBCC CHECKDB error on the screen? While restoring the SQL Database, you get an error message related to DBCC CHECKDB? The solution to fix this error has been mentioned in this blog.
The physical, as well as the logical consistency of database pages, are checked by DBCC CHECKDB, such as system table referential integrity, index relationships, rows, allocation pages, and other structure checks. While checking, if any of above-mentioned checks fails, then you would get errors. These errors generally vary from the file system corruption such as driver issues, corrupted pages in memory, underlying hardware system issues, or issues with the SQL Server Engine. While working in SQL Server, you may get the following error log while executing the DBCC CHECKDB command which is as follows:
2010-03-31 22:07:06.34 spid53 DBCC CHECKDB (mydb) executed by MYDOMAIN\theuser found 15 errors and repaired 0 errors. Elapsed time: 0 hours 0 minutes 0 seconds. Internal database snapshot has split point LSN = 00000026:0000089d:0001 and first LSN = 00000026:0000089c:0001. This is an informational message only. No user action is required.
Manual way to restore SQL database:
When you get an error message from DBCC CHECKDB reports, from the backup you can restore it. From the backup, if you are unable to restore it, then you can repair errors using the CHECKDB feature. If the problems are related to file system or hardware, then you should fix them first and then execute the repair process. The minimum level to resolve all errors by CHECKDB is by repairing them. By repairing it would fix some errors, but all the errors cannot be resolved.
In order to fix the errors in SQL server, you can fix the issues with the help of MS SQL Database Repair. This is a very professional software, and it would help you to restore all your SQL Database. It scans the damaged database file effectively and repairs and recovers the inaccessible objects in MDF and NDF database files. It can repair and restore the corrupt database files along with the stored procedures, triggers, indexes, tables, keys, views, deleted records etc. above all this software is very user-friendly.
Steps to restore SQL database after DBCC CHECKDB failed:
Step 1: Stop the running MS SQL server. Perform the repair task on the copy of the corrupt database, click on the ‘ok’ button to continue.
Step 2: Click on the ‘Select database’ button and select the path of corrupt MDF file. You can also search your corrupt database file by using ‘Look in’ and ‘File Type’ button. click on the ‘Scan file; button to start the repairing process.
Step 3: The recoverable objects of the database are listed in a tree view on the left side of the window. You can see the preview by clicking on the object.
Step 4: you can also search for a particular object by using ‘Find item’ option. Write the object name or a part of the object name in the given text box, check on ‘Match case’ or ‘Match whole word’ and then click find next button.
Step 5: Click on the ‘Start Repair’ icon. A dialog box will appear to fill the SQL server instance name. To save the repaired file in the desired location click on the browse button and give the path, else the repaired file will be saved in the ‘Default SQL Location’. Click on the ‘Ok’ button.
So, in order to restore the database, if the DBCC CHECKDB fails, then you can restore from the backup or with the help of MS SQL File repair Tool. Using this software, you can fix many errors that are related with SQL Database corruption and at the same time repair all the database components.