Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase 12»»

missing .mdf and .ldf database file after hard drive crash Expand / Collapse
Author
Message
Posted Friday, March 21, 2014 6:10 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Friday, April 11, 2014 2:41 PM
Points: 6, Visits: 45
Hello guru,

Recently our hard drive crash and it doesn't look like we can recover the data any longer.

Now we SQL server can't start, error message was missing .mdf and .ldf file. Tried searching manually, found master.mdf and tempdb.mdf, but the database .mdf is nowhere to be found.

The error message when loading SSMS :

******************************

TITLE: Microsoft SQL Server Management Studio
------------------------------

Failed to retrieve data for this request. (Microsoft.SqlServer.Management.Sdk.Sfc)

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&LinkId=20476

------------------------------
ADDITIONAL INFORMATION:

An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)

------------------------------

Unable to open the physical file "D:\XYZ.mdf". Operating system error 2: "2(The system cannot find the file specified.)".
Database 'XYZ' cannot be opened due to inaccessible files or insufficient memory or disk space. See the SQL Server errorlog for details.
File activation failure. The physical file name "D:\XYZ_log.LDF" may be incorrect. (Microsoft SQL Server, Error: 5120)

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=10.00.1600&EvtSrc=MSSQLServer&EvtID=5120&LinkId=20476

------------------------------
BUTTONS:

OK
------------------------------
******************************************

When ran DBCC CheckDB, the error message was :

*********************************

Msg 945, Level 14, State 2, Line 1
Database 'XYZ' cannot be opened due to inaccessible files or insufficient memory or disk space. See the SQL Server errorlog for details.

*********************************

The system has plenty of disk space and memory.

Is it possible to recreate the database .mdf and .ldf file?

Sorry for the long post, hopefully enough information.

Windows Server 2008 Standard
Windows SQL Server 2008

Any help is greatly appreciated.

Thanks,
Howard
Post #1553719
Posted Saturday, March 22, 2014 8:17 AM


SSC-Dedicated

SSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-Dedicated

Group: General Forum Members
Last Login: Today @ 6:44 AM
Points: 39,983, Visits: 36,351
Restore from backup.


Gail Shaw
Microsoft Certified Master: SQL Server 2008, MVP
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass

Post #1553762
Posted Monday, March 24, 2014 12:35 AM
SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Monday, July 21, 2014 2:56 AM
Points: 2,603, Visits: 2,061
Make sure installation files of SQL Server are not corrupt. Also best way is to restore from previous backup as mention by Gila.

---------------------------------------------------
"Thare are only 10 types of people in the world:
Those who understand binary, and those who don't."
Post #1553873
Posted Monday, March 24, 2014 11:20 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Friday, April 11, 2014 2:41 PM
Points: 6, Visits: 45
Hi All,

Thank you for the reply. The hard drive that crashed was actually the DATA drive.

And the backup is corrupted as well, plus it is a .bak file. It doesn't have .mdf and .ldf file.

Sorry, a total noob here.

Thanks,
Howard.
Post #1554156
Posted Monday, March 24, 2014 2:02 PM


Say Hey Kid

Say Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey Kid

Group: General Forum Members
Last Login: Friday, September 26, 2014 1:39 PM
Points: 670, Visits: 6,720
How do you know the .bak is corrupt?
How recent is it?
And do you know what kind of recovery model the database was using?
Post #1554208
Posted Monday, March 24, 2014 2:30 PM


SSC-Dedicated

SSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-Dedicated

Group: General Forum Members
Last Login: Today @ 7:02 AM
Points: 35,267, Visits: 31,761
hwp (3/24/2014)
Sorry, a total noob here.


If the data is valuable, then I suggest you stop all efforts and get a local pro in there to help you. This is not the time for a "total noob" to learn by doing... it's time to learn by watching.


--Jeff Moden
"RBAR is pronounced "ree-bar" and is a "Modenism" for "Row-By-Agonizing-Row".

First step towards the paradigm shift of writing Set Based code:
Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column."

(play on words) "Just because you CAN do something in T-SQL, doesn't mean you SHOULDN'T." --22 Aug 2013

Helpful Links:
How to post code problems
How to post performance problems
Post #1554214
Posted Monday, March 24, 2014 3:06 PM


SSC-Dedicated

SSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-Dedicated

Group: General Forum Members
Last Login: Today @ 6:44 AM
Points: 39,983, Visits: 36,351
hwp (3/24/2014)
Thank you for the reply. The hard drive that crashed was actually the DATA drive.


If you've lost the data drive and you have no usable backups, you're pretty much out of luck. You can try sending the drive to a data recovery company, they're not cheap. Otherwise see if you have an old copy anywhere on a test or dev server.



Gail Shaw
Microsoft Certified Master: SQL Server 2008, MVP
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass

Post #1554222
Posted Monday, March 24, 2014 3:22 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Friday, April 11, 2014 2:41 PM
Points: 6, Visits: 45
Because before the drive failed, I have seen a couple of times that the bak file is only a couple of Kbyte while it should be around 200 MB. At that time I ran the backup manually then I could get a good backup.

So, no I don't know 100% that the backup it corrupted but since the data hard drive had gone bad and for the fact that it had backup problem before I think most likely the bak file is corrupted too.

Sorry I don't know about the recovery model.

Thanks,
Howard.
Post #1554232
Posted Monday, March 24, 2014 3:31 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Friday, April 11, 2014 2:41 PM
Points: 6, Visits: 45
I did find an old bak file, that was about half the size of the current bak.

So If possible I tried not to use the old bak file.

Thank you,
Howard.
Post #1554236
Posted Monday, March 24, 2014 3:33 PM


SSC-Dedicated

SSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-Dedicated

Group: General Forum Members
Last Login: Today @ 6:44 AM
Points: 39,983, Visits: 36,351
Try restore the backup you suspect is damaged. Worse case it won't restore, you're no worse off that way.

As for the old backup, if it's a choice between that and nothing, surely the old backup is the better option?



Gail Shaw
Microsoft Certified Master: SQL Server 2008, MVP
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass

Post #1554237
« Prev Topic | Next Topic »

Add to briefcase 12»»

Permissions Expand / Collapse