SQL Server stores all the data in the form of pages, each of 8 KB in size. These pages have a specific page type according to the function they perform and areassigned with a numerical value. For example, DATA_PAGE (type 1) defines the data page in clustered index or heap, WF_PAGE (type 6) is a work file page,INDEX_PAGE (type 2) is the page in tree of a non-clustered or clustered index and a GAM_PAGE [type 8] defines a GAM allocation map. When you run DBCCCHECKDB to check database sanity, it looks for correct page types. If page type yields incorrect information, it reports table errors. Such errors indicate tablecorruption and thus data should be restored from backup or you should run DBCC CHECKDB command with appropriate repair clause. You can alternativelychoose safe database repair option- MDF Recovery software.

You might receive the below error while running DBCC CHECKDB command on your SQL Server database:

Table error: Page P_ID, Object ID O_ID, index ID I_ID. Unexpected page type TYPE.

Cause

The page specified at P_ID has a different page type as what is expected by DBCC code. The above error might exhibit different states, which allows you to interpret the exact error:

State 1: The code has detected the page at leaf level but it is not a data page, which should have a type 1.

State 36: A completely unrecognizable page type or the page has been marked as de-allocated.

State 300: Page type is 1 but is actually related to non-clustered index.

State 301: Page type is 2 but is actually related to text index or heap.

State 302: Page type is 3 or 4 but is actually related to clustered, non-clustered or heap index.

State 303: The pages are index, text, IAM or data pages, but don’t exist with valid page type.

Solution

To troubleshoot such problems, use these methods:
.    Run DBCC CHECKDB to determine the exact repair clause to be applied. Next, run the command again with the suggested repair clause.

.    The above measure can cause data loss. Thus, for safe recover mdf, it is suggested to use commercial tools. MDF Recovery software are high end applications that can repair and restore damaged SQL Server databases without harming data integrity.

Stellar Phoenix SQL Recovery is a comprehensive mdf recovery tool for damaged SQL Server databases. It supports repair for SQL Server 2008, 2005 and 2000. The software is available with self-descriptive interface and restores all database objects including tables, user defined data types and functions, triggers, stored procedures, views, rules etc. The software is compatible with Windows Vista, XP, 2003, 2000, and NT.