Thursday, July 30, 2009

Resolving SQL Server Error 2511

SQL Server stores database in b-tree presentation. It is the general method of locating and placing data in a database, purposed for minimizing seek and access time for a particular record. If you have stored the table by using clustered index to sort it, its location can be comprised of components like page number, file number and slot number for the row. But sometimes, SQL Server reports keys being out of order for a particular page in a table. Such errors generally indicate table corruption, which are required to be restored from backup. On the other hand, the unavailability or invalid state of backup requires you to use commercial SQL recovery applications.

As an example, you might experience the below error message with your SQL Server database:

Server: Msg 2511, Level 16, State 2
Table Corrupt: Object ID %d, Index ID %d. Keys out of order on page %S_PGID, slots %d and %d.
Table error: Object ID %d, Index ID %d. Keys out of order on page %S_PGID, slots %d and %d.


As the error message suggests, it occurs when two specified slots are in incorrect order and are not in accordance to comparison of their keys. Here, P_ID represents the index page and data page.


You should consider these steps in order to correct the above issue:

You first need to ensure if system is free from hardware errors. For this, you should run hardware diagnostics and correct the problem, if exists any. You can also check Windows, application and SQL Server error log to determine the exact cause.
Restore the damaged database from your most recent backup, if exists and has valid state.
In case of backup concerns, you should run DBCC CHECKDB command without using any repair clause, which will determine the repair clause that should be applied. Next, run DBCC CHECKDB command with the suggested repair clause.
The above step can cause data loss and hence, for safe database repair, you should use third-party SQL Repair tools. These are graphically rich SQL Recovery software designed to achieve complete SQL database repair results.

Stellar Phoenix SQL Recovery is the most powerful tool that repairs and restores damaged SQL databases. It supports SQL Server 2008, 2005 and 2000. It can recover all database objects like tables, views, stored procedures, user defined functions etc. Phoenix SQL Recovery is a read-only tool that is compatible with Windows Vista, 2003, XP, and NT.

No comments:

Post a Comment