1

I have a database that has lost one of its .ndf files and have been unable to get at the data. The .ndf file in question was added last Thursday and placed in a temporary storage location by a colleague (d'oh!). There is no backup available from this database since prior to this .ndf being created. I have seen numerous solutions to similar problems when the .ndf in question is its own filegroup, but in this case it actually is in a filegroup with an additional file which I want to try and get data from. I am pretty sure what I am trying to do is not possible but there is always a chance right?

The database setup

  • PRIMARY: Data.mdf -200mb
  • Data Filegroup 1: Data_1.ndf - 2.9gb
  • Data_2.ndf - 64gb (newly added file that is now lost - I believe it is just preallocated space)

  • LOG: Log.ldf - 128mb

When we logged into the VM this morning (hosted in Azure), we were presented with an unexpected shutdown notification from Windows (it seems there was a powerloss/shutdown at 1am) and our application was not reaching the database. Looking in SQL Server Management Studio I could see that it was Recovery Pending status. Trying to bring the db online lead me to an error about Data_2.ndf not being found (located at D:\SQL\Data\Data_2.ndf).

When I accessed the D drive (temporary storage drive) I was presented with a wonderful blank Windows Explorer window - completely blank drive.

I was able to set the Data_2.ndf file offline and bring the database itself online, however I am not able to query any of the data (as all tables were in Data Filegroup 1) due to the filegroup being offline. The other 3 files (mdf, ndf, ldf) are all online.

Is there any way out of this? Any way to perhaps recover any remaining data from Data_1.ndf or is it completely toast?

(This was a hastily stood up development server and there was no backup/recovery strategy for it, as "Azure never crashes" :)).

(Edit:formatting)

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Steve M
  • 13
  • 5

1 Answers1

0

You are hosed. Its a miracle you can bring up your database. Are you sure you can retrieve data - have you tried doing selects? You probably will receive more extensive answers on the Database Administrators group.

benjamin moskovits
  • 5,261
  • 1
  • 12
  • 22
  • As I figured/was expecting - thanks. I cannot select any data as I get Msg 8653, Level 16, State 1, Line 17 The query processor is unable to produce a plan for the table or view 'Object' because the table resides in a filegroup that is not online. – Steve M Apr 09 '15 at 18:14
  • Your only hope is to be really obnoxious to the Azure people to get them to find a backup to your files. I don't know how Azure works but that is where I put my energy. – benjamin moskovits Apr 09 '15 at 18:34