Sql-server – database corruption

sql serversql-server-2008-r2

The database is corrupted and there is no recent backup,

Error from DBCC CHECKDB

Msg 8909, Level 16, State 1, Line 1 Table error: Object ID 0, index ID
-1, partition ID 0, alloc unit ID 0 (type Unknown), page ID (1:72792) contains an incorrect page ID in its page header. The PageId in the
page header = (0:0). Msg 8998, Level 16, State 2, Line 1 Page errors
on the GAM, SGAM, or PFS pages prevent allocation integrity checks in
database ID 5 pages from (1:72792) to (1:80879). See other errors for
cause.

  1. Any recommendation ?

  2. How can i tell which object is corrupted ?

Errors from DBCC CHECKDB (XXX) with NO_INFOMSGS, all_errormsgs

Msg 8909, Level 16, State 1, Line 1 Table error: Object ID 0, index ID
-1, partition ID 0, alloc unit ID 0 (type Unknown), page ID (1:72792) contains an incorrect page ID in its page header. The PageId in the
page header = (0:0). Msg 8998, Level 16, State 2, Line 1 Page errors
on the GAM, SGAM, or PFS pages prevent allocation integrity checks in
database ID 5 pages from (1:72792) to (1:80879). See other errors for
cause. CHECKDB found 2 allocation errors and 0 consistency errors not
associated with any single object. CHECKDB found 2 allocation errors
and 0 consistency errors in database 'NSR_M'.

Best Answer

First things first, I hope you have a backup, this is a serious error and you should do a restore, even if you lose some data as that way you will end up with a consistent database but the second best option would be this.

You can peek into the data pages to see what is stored there and maybe, just maybe you can get most of the data from the non damaged tables. Now before we start you should at least read Paul Randal's Inside the Storage Engine: Anatomy of a page and How to use DBCC PAGE. and you should really watch his video on Advanced Data Recovery Techniques

First to make sure what is on the damaged page.

dbcc traceon (3604); 
GO
dbcc page (5,1,73703,0);

This will dump the page header which you can use to decipher what is on the page. From the error message posted there seems to be errors in the GAM/SGAM/PFS for pages 72792-80879 so you can look at which object is stored there by dumping the headers and check the object_id. The syntax for DBCC PAGE is dbcc page (database_id,File_id,PAGE_ID,0); The zero is for dumping the page header but you can dump the whole page by changing that last flag

dbcc page (5,1,72792,0);
GO
dbcc page (5,1,72793,0); 
...

and for each page find to which object it belongs

When you have that information you can hopefully copy the non damaged data from the database into another.