Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

I have a problem with a SQL Server 2008 database.

Launching

DBCC CHECKDB

I get this error:

SQL Server detected a logical consistency-based I/O error: incorrect checksum (expected: 0xd2e00940; actual: 0x925ef494). It occurred during a read of page (1:15215) in database ID 22 at offset 0x000000076de000 in file 'C:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\DATA\file.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 found the table causing the problem:

DBCC CHECKTABLE

Msg 824, Level 24, State 2, Line 8
SQL Server detected a logical consistency-based I/O error: incorrect checksum (expected: 0xd2e00940; actual: 0x925ef494). It occurred during a read of page (1:15215) in database ID 22 at offset 0x000000076de000 in file 'C:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\DATA\file.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.

So I tried with the repair operations:

DBCC CHECKTABLE (table_name, REPAIR_ALLOW_DATA_LOSS)

but I get the same error:

Msg 824, Level 24, State 2, Line 8
SQL Server detected a logical consistency-based I/O error: incorrect checksum (expected: 0xd2e00940; actual: 0x925ef494). It occurred during a read of page (1:15215) in database ID 22 at offset 0x000000076de000 in file 'C:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\DATA\file.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've also tried setting the DB in SINGLE_USER mode, but with no result.

I am not able to delete nor truncate the table. As I always get the same error.

The table does not have any constraints. It has one PK and one Index, but I can't drop any of them.

share|improve this question

migrated from stackoverflow.com Mar 12 '13 at 17:17

This question came from our site for professional and enthusiast programmers.

7  
Do you have a backup that's still good? You may have to use WITH REPAIR_ALLOW_DATA_LOSS or revert to a good backup. See sqlskills.com/blogs/paul/… and sqlskills.com/blogs/paul/… –  Aaron Bertrand Mar 12 '13 at 17:03
    
If this is a large database and you have good backups, I'd attempt a single-page restore and see if that fixes it. –  Jon Seigel Mar 12 '13 at 17:47
    
I've already tried the repair WITH REPAIR_ALLOW_DATA_LOSS, but it does not work and gives me back an error message. I don't have a good backup to be used for the entire DB. Is it possible to restore only the broken table from a simple backup? –  Enrico Mar 13 '13 at 8:08

2 Answers 2

You need to restore the page from a full backup, then applying the logs forward to current or you need to do a full restore.

I'd also run chkdsk as it appears you might be having a disk problem as the same page is reporting problems when attempting to repair it. Also run any disk management tools and see if they report problems with the disk.

share|improve this answer
    
Thank you for your answer. I don't have a full backup because I inly have simple ones. Otherwise, I wouldn't mind lose or delete the wrong table, but I can't delete nore drop it. How can I force the table delete? Thanks! –  Enrico Mar 13 '13 at 8:03
    
Please define a simple backup as that isn't SQL Server terminology. –  mrdenny Mar 13 '13 at 19:03
    
I'm sorry, you are right, I was talking about the Recovery Model. –  Enrico Mar 14 '13 at 8:11
    
@Enrico So, do you have a full backup of the database? –  Marian Mar 14 '13 at 9:44
2  
Being that you are in simple recovery a full restore is your only option. Had you been in full recovery and taking transaction log backups you could have restored just the page instead of the entire database. This is one of the known limitations of the simple recovery model. –  mrdenny Mar 14 '13 at 16:26
up vote 0 down vote accepted

I didn't find a fast solution, so I recovered from a backup. I created a DB restoring an old backup. Then I updated the datas in the new DB importing them from the broken DB, bypassing the broken tables. Finally I replaced the broken DB with the new one. Thank you for your help.

share|improve this answer

protected by Martin Smith May 24 at 18:34

Thank you for your interest in this question. Because it has attracted low-quality answers, posting an answer now requires 10 reputation on this site.

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.