Fix SQL Error 8903

SQL Server is Relational Database Management System that is extensively used to keep records efficiently. This data is stored in large databases and can be updated, deleted along with inserting new records in the databases. In these databases the IAM or the Index Allocation Map, the GAM or the Global Allocation Map and the SGAM or the Shared GAM are used for storing the records on hard disk. These combine together to hold the metadata of the database. However, mismatching of the files also occur leading to the corruption of the database and other inaccessibility issues. In such a situation you may encounter the SQL error 8903 and an error message like the following:

“Extent E_ID in database ID DB_ID is allocated in both GAM GAM_P_ID and SGAM SGAM_P_ID.”

The most common reason for the occurrence of the SQL error 8903 is the mismatch between the three pages, that is the GAM, SGAM and the IAM pages.

To fix the error you can go through the following steps:

  • Check if all the hardware components are working properly.

    • Check Windows application logs and SQL Server error logs and see if the SQL error 8903 is actually the result of any hardware problems.
    • Run hardware diagnostics
    • Swap the hardware components to find out the exact component that is causing the error.
    • If the write caching is enabled on the disk then replace the disks.

  • Restore the data from a clean and updated backup if it is available.
  • Run the DBCC CHECKDB command to get rid of any errors.

If the SQL error 8903 is not resolved with the help of all the aforementioned steps then you need to use an efficient third party MDF repair utility that can repair the MDF file and also bail you out of all data inaccessibility issues. These make use of strong scanning algorithms that help it to repair the MDF file and repair the database and also all the database objects like tables, stored procedures, defaults and much more.