question

Jeff O avatar image
Jeff O asked

REPAIR_ALLOW_DATA_LOSS - Lose only a partial row?

A fairly large table had an error and required executing repairs until REPAIR_ALLOW_DATA_LOSS was the only thing that fixed it (restore from backup would be the best solution.). Of course, there was lost data. I was able to compare a couple indexed fields to a backup copy of this table and identify which records were lost (15 lost out of +980K). **Table Usage:** Load production data every month (a date column to indicate month end). Users go through an approval process for the current period under review and can update or reload batches to replace existing records. Once approved (around 15th of the month), the are locked out of the data. I'm discovering the previous backups have the same error. I don't know what caused it or when. I'm approaching the point where the most recent "good" backup is going to be before the last update to the table (Still restoring), so I won't be able to compare all data (rows & columns) to see what is missing. I only know the PK which is probably due to only needing the index to query/compare. Is it possible that a part/column(s) of a particular row may be missing data or does this pretty much wipe out the entire row? I may not have the luxury of a good backup to compare or reload all the data. Based on the repair messages, I think it is the entire row. ERROR: CHECKTABLE found 0 allocation errors and 1 consistency errors not associated with any single object. * indicated all indexes were repaired * the itemized errors indicated: (type In-row data)
sql-server-2005repair
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
Grant Fritchey avatar image
Grant Fritchey answered
Well, since what's broken is data, you're pretty much guaranteed data loss. The repair will relink pages. And it doesn't care a wit how much data it throws out to relink the pages. It sounds like when you ran it the first time you probably lost a single page. That's pretty close to a miracle. I've seen entire databases go. The chances of only losing a row are close to non-existant. Losing a single page is the best I've seen and I think you're there.
3 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Jeff O avatar image Jeff O commented ·
I know I've lost 15 rows (could be the entire page), I'm just wandering if I've lost partial rows i.e. row still exists but some column(s) may have lost data. I plan on comparing all fields once a get a good backup.
0 Likes 0 ·
Grant Fritchey avatar image Grant Fritchey ♦♦ commented ·
No. It doesn't work like that. It's going off of pages & extents, so you don't need to sweat part of a row going away.
0 Likes 0 ·
Jeff O avatar image Jeff O commented ·
Finally restored a backup to do a comparison. Thanks for the help.
0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.