If DBCC CHECKDB shows my database is corrupted, how do I know when it became corrupted?

I created a job that runs daily (every midnight) that uses DBCC CHECKDB on every database. Every day in the morning I launch SSMS to look at the logs and hope to see CHECKDB found 0 allocation errors lines.

But if I pass some days without checking the logs and discover that some database is corrupted, how can I know when the corruption ocurred to restore the backups from that point in time?

more ▼

asked Feb 25, 2010 at 09:44 PM in Default

avatar image

85 2 2 5

(comments are locked)
10|1200 characters needed characters left

1 answer: sort voted first

Check in the table msdb.dbo.suspect_pages. It has useful information about which pages are suspect, although the date in there shows you when it was last seen to be suspect, which isn't exactly what you want.

Have a look at what type of page it is that's corrupt. If it's a page for a nonclustered index page, then just rebuild the index. If it's a table, then do a page level restore. You will know straight away if you restore that page from a backup where it's also corrupt, because the restore will fail.

Your best bet is really to look at your history of DBCC results.

more ▼

answered Feb 26, 2010 at 12:29 AM

avatar image

Rob Farley
5.8k 16 22 28

(comments are locked)
10|1200 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

SQL Server Central

Need long-form SQL discussion? SQLserverCentral.com is the place.



asked: Feb 25, 2010 at 09:44 PM

Seen: 2470 times

Last Updated: Feb 26, 2010 at 05:34 AM

Copyright 2018 Redgate Software. Privacy Policy