Question

Asked:
Asked By:
Jul 8 2008   7:34 PM GMT
SQL Server Ask the Experts   2275 pts.

Recovering .mdf and .ldf files from SQL Server


SQL Server, File recovery, 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.

Subscribe to Alerts! Get questions and answers delivered to your Inbox.


E-mail me updates on this question



   SUBSCRIBE

hidden modal window

Answer Wiki (Improve, edit or add to this answer)


 RATE THIS ANSWER
0
Click to Vote:
  •   0
  •  0



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.
  • AddThis Social Bookmark Button

Browse more Questions and Answers on SQL Server and Storage.

Looking for relevant SQL Server Whitepapers? Visit the SearchSQLServer.com Research Library.


Discuss This Answer


You must be logged-in to discuss a question. Log-in/Register

Mrdenny   41270 pts.  |   Jul 9 2008  6:44AM GMT

Check out my SQL Server blog “SQL Server with Mr Denny” for more SQL Server information.