Encountering an error while working in the SQL Server database is not a surprising thing. SQL Server, a popular database management system is preferred by many organizations for storing and managing their crucial database and thus occurrence of errors are customary. Along with the occurrence of many SQL errors, 5228 is a prominent one and needs to be resolved. The error message for 5228 in the event log is shown as follows.
"Error: 5228, Severity: 16, Table error: object ID %d, index ID %d, partition ID %I64d, alloc unit ID %I64d (type %.*ls), page %S_PGID, row %d. DBCC detected incomplete cleanup from an online index build operation. (The anti-matter column value is %d.)"
In SQL Server, an intermediary state occurs when the user runs any command to delete, add and modify the database and an unfinished index for the O_ID object, I_ID index, and PN_ID partition is identified that also leads to the occurrence of this error. The main reason for the occurrence of the intermediary state leading to SQL Server error 5228 is the corruption of database. This Error is addressed in SQL Server version 2000 and above. To fix such error cases users need to perform database recovery.
Occurrence of this error or can say any error is catastrophic for our databases and therefore immediate resolution is important. As a regular user, using manual solution is the very step towards the error resolution. So for a manual solution, below mentioned methods should be followed in order.
Hardware Related Issues Diagnose: - Firstly user should perform hardware diagnose to check if the reason behind the occurrence of SQL error 5228 arises from hardware malfunctioning. Swapping hardware components to zero can help out to resolve or user can go for disk formatting and reinstalling the operating system.
Backup Restoration: - Restoring the database from the backup can help the user and it is the most feasible option. Nevertheless interruptions may occurs when the user might not have full backup or may be the backup is corrupt.
DBCC CHECKDB Command: - Running CHECKDB command can be used as an alternative option after backup option. The command will perform a check to diagnose the consistency error. The command will provide you with the clauses which are needed to be repair. Using this command with “REPAIR_ALLOW_DATA_LOSS” will help you to fix the error but it may lead to the loss of certain data.
So after analyzing the above mentioned manual methods of recovery, an issue emerges out that there are some low poles in the methods. We can also say that sometimes these methods are not sufficient to cope up with the error and so the use of third party tool can be done for recovery. The user can move for third party software to recover SQL database from the error without the data loss.