I am trying to recover a couple dev-dbs where the data directory was on a spanned partition that was inadvertently deleted. We were able to recover the folders/files using a recovery software, however the actual MDF file seems to have some issues.
Any attempt to attach or repair will fail with the following:
SQL Server detected a logical consistency-based I/O error: torn page (expected signature: 0x00000000; actual signature: 0x7bd02384). It occurred during a read of page (1:0) in database ID 9 at offset 0000000000000000 in file 'G:\data\database.mdf'.
Steps I've tried:
- create database for attach
- dbcc checkdb(database, repair_allow_data_loss) – after creating empty db and copying MDF file over the new one)
Note – the recovery process identified several different versions of the same file with different extension, I already tried with each files, same error. There are no backups.
Anything else that could be tried?
Best Answer
A torn-page detection error on page (1:0) indicates the primary page of the primary database file is corrupted. This page contains a multitude of important details about the database. A sample output of
DBCC PAGE
for one of my databases shows:If the first page is corrupted, that likely means you've not correctly fixed the deleted filesystem.
Clearly, having a well-tested recovery plan, even for development databases, might be considered A Good Thing™