Recovering .mdf and .ldf files from SQL Server

Tags:
File recovery
SQL Server
SQL Server database
I backed-up our SQL Server yesterday around noon, and we then added more data in. Today, when we tried to start our application, we found that the database is in SUSPEND mode. We stopped our SQL services and tried to copy the newer data, but there was a data error. It seems that our .mdf file is corrupted. Is it possible to recover the data from the corrupted .mdf file, or our current .ldf file? It will take several days if we give the information over for file recovery.

Answer Wiki

Thanks. We'll let you know when a new response is added.

It depends on the state of the database corruption as to how much data you will be able to recover.

Is this SQL 2000 or SQL 2005? If it’s SQL 2005 you can do an ALTER DATABASE command and set the database into Emergency mode which will allow you to query as much data as possible. Can you post the exact error message that you are getting?

You can also try doing a DBCC CHECKDB of the database and try and fix the problem.

Is your database in full recovery mode or simple recovery mode? If you are in full recovery mode, and you can fix the database via DBCC CHECKDB you can try to backup the log and then restore the full backup, then roll the log forward until just after the data addition was completed.

Discuss This Question: 2  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following