Home Forums SQL Server 2012 SQL 2012 - General Advice on how to repair significant database corruption without a recent good backup RE: Advice on how to repair significant database corruption without a recent good backup

  • sp_readerrorlogs doesn't show any issues except those from the times I've ran DBCC CHECKDB and a number of non-descript service exception stack dumps from a vendor-managed system which I will trace.

    SELECT *

    INTO [anotherdb].dbo.tmp_AllDocs

    FROM AllDocs (as well as with ORDER BY AllDocs.ID DESC) gives no rows and cuts the connection with

    Msg 824, Level 24, State 2, Line 1

    SQL Server detected a logical consistency-based I/O error: incorrect pageid (expected 1:132528; actual 1:6547248). It occurred during a read of page (1:132528) in database ID 52 at offset 0x00000040b60000 in file 'D:\MSSQL\SPSM.mdf'. Additional messages in the SQL Server error log or system event log may provide more detail. This is a severe error condition that threatens database integrity and must be corrected immediately. Complete a full database consistency check (DBCC CHECKDB). This error can be caused by many factors; for more information, see SQL Server Books Online.

    I had forgotten to note that the cause of this corruption was found to be a faulty VM host, and since it was moved off that host six months ago it hasn't had additional corruption. Several other databases were migrated to another host as well, and these were "fixed" via REPAIR_ALLOW_DATA_LOSS, but are now coming back clean.

    When I let the service provider who manages our server builds, software installs and database maintenance know there was corruption back in June/July they had no sense of urgency, ran REPAIR_ALLOW_DATA_LOSS over several of the corrupt databases on that host and considered that mission accomplished, and there's no scheduled CHECKDB's.

    As this database isn't critical (the database has been corrupt for six months without user complaints and management have accepted the service provider's claim that "fixing the corruption would cause more problems than it would save") I'll leave this to the people whose responsibility it is, implement routine CHECKDB's myself, and upskill so I can handle DR myself better in future. Steve Stedman's PASS session has helped me gain a basic understanding of how to diagnose corruption.

    Thanks heaps Gail and Eirikur, I appreciate having your guidance on the difficulty of repairing this.

    Andrew P.