Tuesday, May 11, 2010

Ghost Records in MS SQL Server

The background process of “Ghost Cleanup” in MS SQL database is primarily used to improve the performance of Delete command. This record count of total number of the ghosted records is stored in the header. However, if the record count in the header does not match with the exact number of ghosted records, then you receive an error message. The cause for the error message is corruption of your SQL database records. In such situations, it is always advisable to restore the data from an updated database backup. But if in case, you have not maintained any backup, or the database backup is corrupt, then you will need to repair the database by using advanced SQL Database Repair application.

Consider a practical scenario, where you encounter the below error message while attempting to access your database table:

“Object ID O_ID, index ID I_ID: The ghosted record count (HG_COUNT) in the header does not match the number of ghosted records (G_COUNT) found on page P_ID.”

The same error message appears every time you attempt to access the table records.


The root cause for the above error message, as stated in the message, is that the number of ghosted records found on a particular page P_ID is not matching ghosted record count in the header. This mismatch primarily occurs due to SQL database corruption due to logical or physical reasons.


The resolution for the above error message is categorized in two steps:

· In case the SQL database corruption has occurred due to any physical damage of a component, then you will need to replace the component with a new one.

· In case of logical corruption of SQL database, you will need to repair the database using 'DBCC CHECKDB' command, with an appropriate repair clause.

The repair command ensures repair of corrupt database in almost every situation. However, if the command is unable to repair the database, then you will need to use powerful third-party SQL Database Repair application. Such SQL Repair tools repair the corrupt database by using effective repairing procedures. These tools are downloadable from the Internet.

Resource Link: http://www.articlesnatch.com/Article/Ghost-Records-In-Ms-Sql-Server/942477

No comments:

Post a Comment

Related Posts Plugin for WordPress, Blogger...