question

JCAirey1 avatar image
JCAirey1 asked

Recovery after lost data file

I am wonder what the process would be to recover from a lost data file in MSSQL. Up front this is a hypothetical situation but lets say that there is no backups available and a data file from a database in question is completely corrupted/deleted/vaporized :) . This could be simulated by stopping the sql service, renaming the file and then restarting the service. The database is then put into recovery pending mode and is not able to come back online because it cannot find the file. I am under the assumption that if this is the primary database file you are probably hosed. However if this is a secondary data file I can imagine that there is a way to force the database online. I am not concerned with the loss of data that will be involved but more concerned with how this can be performed.
recovery
10 |1200 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Grant Fritchey avatar image
Grant Fritchey answered
What you're talking about is called a piecemeal restore. It's actually only available when using the Enterprise version of SQL Server. You can get an introduction to the topic here in [Books Online][1]. Probably, in many situations, you're just out of luck and will probably not get that database back online. [1]: http://msdn.microsoft.com/en-us/library/ms191253.aspx
2 comments
10 |1200 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Thanks man!
0 Likes 0 ·
Spot on with that answer. The key is to getting the filegroups properly established beforehand. Of course, having backups of those filegroups would help ;)
0 Likes 0 ·
alice_phoebe avatar image
alice_phoebe answered
First when you find you lost your important file, you can double-click on the Recycle Bin in Windows to see if the file is there. If you find the file, drag it to the desktop. Or click on the file and click "Restore" button in the drop-down menu to return the file to its original location. Otherwise, you can choose to use EaseUS Data Recovery Wizard, a powerful online file recovery utility to fins and recover lost files. [ http://www.easeus.com/datarecoverywizard/recover-lost-files.htm][1] [1]: http://www.easeus.com/datarecoverywizard/recover-lost-files.htm
10 |1200 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.