Monday 26 September 2011

How to Restore SQL Database from .bak Script

 Restore your SQL database from.bak script
SQL Server has files saved with .mdf extension. These files are so valuable that losing them cannot be compromised. However, there is possibility of losing them as SQL can lead to corruption owing to various uninvited reasons like unexpected application shutdown, application errors, hardware bugs etc.


Error Message Received After Corruption: After SQL corruption, you receive error message like DBCC CHECKDB errors which make your table data inaccessible. Now, user do not want to lose crucial data and wants it back and wants SQL Server to work again properly and to restore SQL Server database with some third-party application.  Error Message: Following error message you receive after table error message:
Server: Msg 8942, Level 16, State 1 Table error: Object ID O_ID, index ID I_ID, page P_ID. Test (TEST) failed. Slot S_ID, offset 0xADDRESS overlaps with the prior row.
Reason for Receiving above Mentioned Error Message: When you receive such kind of error messages you must be eager to know the reason behind this. The reason for receiving such error message is basically the overlapping of slots. The table structure of SQL database happens slot by slot which has a specific id. In normal situation the next slot has to be greater than the previous one because it slots are managed in ascending order. During table test it reads SQL table structure so the table slots should be in normal order. At times, this becomes order less and previous slot id becomes greater than the next slot which leads to an error which is generated in the next slot. An error is appeared that the id of a particular slot is greater than its next slot which should not happen because this way ascending order of the table structure broke. In such circumstances it becomes vital to restore SQL database.  Resolve the Issue: For such problematic situation, you can:   • You can perform SQL database restoring process to set backups at the time of recovery. These backups have ‘.bak’ extension; they can be saved to a hard drive, DVD or CD and can be used restore database from the latest data backup. In the absence of backups you can try other methods mentioned below or can use third-party software application.
• You might be facing hardware issues causing such error. So, you are required to detect the system, the application and the SQL Server error logs to know the main reason behind the issue. Finding any problem you can replace the damaged hardware with a fresh functioning hardware.
• Now, suppose there was no hardware issue, then user you can run DBCC CHECKDB command without using any of the repair clauses. This command will help you to settle on the repair clause that needs to be applied for the solving of this error. After attaining repair clause, you can run DBCC CHECKDB with the correct repair clause.

No comments:

Post a Comment

Flag Counter