An IAM (Index Allocation Map) is a page in the database that stores one bit per extent in all the GAM (Global Index Map). A set bit is used to point out that the extent is allocated to that particular index. At times, this convention is not followed as two IAM pages refer to the same GAM interval. Lot of times, this problem is caused due to database corruption, which in turn, can occur because of virus infections, database header corruption, abrupt or unplanned system shutdown, etc. There are several methods that can be used to achieve MDF file recovery. However, if you fail to do so then you should use a third-party SQL recovery software to do the needful.
Let us assume a situation in which you are getting the following error message while working on the MS SQL Server 2000 database:
“Table error: Multiple IAM pages for object ID O_ID, index ID I_ID contain allocations for the same interval. IAM pages P_ID1 and P_ID2.”
The root problem of this error is that the IAM chain for the specified index has two IAM pages, P_ID1 and P_ID2, that cover the same GAM interval.
To overcome from such situation, you should perform the following methods, preferably in the given order:
Addressing the hardware-related problems: First of all, you should look at the hardware-related issues that may have caused the database corruption. Some of the measures that you can follow are:
Checking if write-caching is enabled on the hard disks. If yes, then you should get the hard disk replaced from your local hardware vendor.
Fixing any error that appear after you run hardware diagnostics.
Checking the Application error logs to ensure that the problem is not caused from hardware malfunctioning.
swapping the hardware components to isolate the actual error of corruption.
Restoring from backup: You should check the status of the backup. If it is clean and updated, then you should restore the database with the backup.
Running DBCC CHECKDB: You should repair SQL database using DBCC CHECKDB tool with the suggested repair clause.
If you still get the same error, then you should recover MDF file with the help of a third-party SQL database recovery software. These tools use highly advances scanning mechanisms to safely recover database without any modifications.