Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I had problems with my harddisk on my dev box, yet I was able to save my MDF and LDF files. Needless to say, they were not detached properly.

I tried sp_attach_single_file_db which broke down with the following error:

SQL Server detected a logical consistency-based I/O error: invalid protection option. It occurred during a read of page (0:0) in database ID 0 at offset 0000000000000000 in file 'FILENAME'. 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 also tried to create a new database with the same size, stop the service, and overwrite the new mdf with the old mdf. But after starting the server, the database is not suspected, when i look at its properties its status is "shutdown".

I use SQL 2k8.

Any ideas?

share|improve this question

closed as not a real question by mrdenny Oct 26 '09 at 2:30

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

1 Answer 1

Can you bring the database up in emergency mode?

ALTER DATABASE YourDatabase
SET EMERGENCY

If you can then you can run a DBCC on the database and see just how bad the corruption is.

If the hard drive was that hosed, the database may to badly damaged to do anything with.

share|improve this answer
    
Found out that the file(name) was recovered but the contents where all over the place. Thanks anyway. –  Gidon Oct 25 '09 at 13:19
    
Could you close this question, since it is no longer relevant? –  Gidon Oct 25 '09 at 13:20
    
Sure, I can close it. –  mrdenny Oct 26 '09 at 2:30

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