Sunday, January 17, 2010

Fixing “Page P_ID in database ID...” Error Message

A PFS (Page Free Space) page tracks the allocation status for every page and the amount of free space available on the page. The database engine uses the information stored in the PFS pages to allocate new pages. The page stores the information in the form of bytes, including a byte that indicates that the page is a mixed page. An IAM (Index Allocation Map) page, on the other hand is an array that stores all the mixed pages assigned to a particular index. The data stored in the database components becomes inaccessible if the page that is assigned a 'mixed page' byte in PFS page, not the same page does appear in the IAM page's array. This primarily occurs due to SQL database corruption. In such cases, the database becomes unmountable, further resulting into inaccessibility of its records. For complete accessibility of records in such situations, you will need to restore the data from an updated backup. But, if backup is not available, then you will need to use advanced MS SQL Recovery application.

As a practical case, the below error message pops up while attempting to access your SQL database records:

“Page P_ID in database ID DB_ID is allocated in the SGAM SGAM_P_ID and PFS PFS_P_ID, but was not allocated in any IAM. PFS flags 'PFS_FLAGS'.”

The same error message pops up every time you attempt to access the database records. The database records become inaccessible, once the above error message appears.


The above error message pops up when the page P_ID in the database is allocated as mixed page byte in PFS page, but the mixed page does as IAM page or in an IAM page's array. This occurs due to corruption of database due to logical or physical crash.


The resolution for the above error message is discussed below:
If the corruption is caused due to physical damage of a system component, replace the system component.
If the error pops up due logical crash scenarios, then you will need to run DBCC CHECKDB command using correct repair clause.

However, if both the resolutions fail to resolve the issue and the error message pops up while mounting the database, then you will need to repair the database using SQL Database Recovery application. Such SQL Repair tools can be easily downloaded from the Internet.

No comments:

Post a Comment