SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


missing .mdf and .ldf database file after hard drive crash


missing .mdf and .ldf database file after hard drive crash

Author
Message
hwp
hwp
Valued Member
Valued Member (60 reputation)Valued Member (60 reputation)Valued Member (60 reputation)Valued Member (60 reputation)Valued Member (60 reputation)Valued Member (60 reputation)Valued Member (60 reputation)Valued Member (60 reputation)

Group: General Forum Members
Points: 60 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
GilaMonster
GilaMonster
SSC Guru
SSC Guru (230K reputation)SSC Guru (230K reputation)SSC Guru (230K reputation)SSC Guru (230K reputation)SSC Guru (230K reputation)SSC Guru (230K reputation)SSC Guru (230K reputation)SSC Guru (230K reputation)

Group: General Forum Members
Points: 230282 Visits: 46344
Restore from backup.

Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
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


free_mascot
free_mascot
SSCertifiable
SSCertifiable (7.6K reputation)SSCertifiable (7.6K reputation)SSCertifiable (7.6K reputation)SSCertifiable (7.6K reputation)SSCertifiable (7.6K reputation)SSCertifiable (7.6K reputation)SSCertifiable (7.6K reputation)SSCertifiable (7.6K reputation)

Group: General Forum Members
Points: 7633 Visits: 2250
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."
hwp
hwp
Valued Member
Valued Member (60 reputation)Valued Member (60 reputation)Valued Member (60 reputation)Valued Member (60 reputation)Valued Member (60 reputation)Valued Member (60 reputation)Valued Member (60 reputation)Valued Member (60 reputation)

Group: General Forum Members
Points: 60 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.
Greg Edwards-268690
Greg Edwards-268690
SSCarpal Tunnel
SSCarpal Tunnel (4.4K reputation)SSCarpal Tunnel (4.4K reputation)SSCarpal Tunnel (4.4K reputation)SSCarpal Tunnel (4.4K reputation)SSCarpal Tunnel (4.4K reputation)SSCarpal Tunnel (4.4K reputation)SSCarpal Tunnel (4.4K reputation)SSCarpal Tunnel (4.4K reputation)

Group: General Forum Members
Points: 4364 Visits: 8599
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?
Jeff Moden
Jeff Moden
SSC Guru
SSC Guru (219K reputation)SSC Guru (219K reputation)SSC Guru (219K reputation)SSC Guru (219K reputation)SSC Guru (219K reputation)SSC Guru (219K reputation)SSC Guru (219K reputation)SSC Guru (219K reputation)

Group: General Forum Members
Points: 219866 Visits: 42002
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.
If you think its expensive to hire a professional to do the job, wait until you hire an amateur. -- Red Adair

Helpful Links:
How to post code problems
How to post performance problems
Forum FAQs
GilaMonster
GilaMonster
SSC Guru
SSC Guru (230K reputation)SSC Guru (230K reputation)SSC Guru (230K reputation)SSC Guru (230K reputation)SSC Guru (230K reputation)SSC Guru (230K reputation)SSC Guru (230K reputation)SSC Guru (230K reputation)

Group: General Forum Members
Points: 230282 Visits: 46344
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, MVP, M.Sc (Comp Sci)
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


hwp
hwp
Valued Member
Valued Member (60 reputation)Valued Member (60 reputation)Valued Member (60 reputation)Valued Member (60 reputation)Valued Member (60 reputation)Valued Member (60 reputation)Valued Member (60 reputation)Valued Member (60 reputation)

Group: General Forum Members
Points: 60 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.
hwp
hwp
Valued Member
Valued Member (60 reputation)Valued Member (60 reputation)Valued Member (60 reputation)Valued Member (60 reputation)Valued Member (60 reputation)Valued Member (60 reputation)Valued Member (60 reputation)Valued Member (60 reputation)

Group: General Forum Members
Points: 60 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.
GilaMonster
GilaMonster
SSC Guru
SSC Guru (230K reputation)SSC Guru (230K reputation)SSC Guru (230K reputation)SSC Guru (230K reputation)SSC Guru (230K reputation)SSC Guru (230K reputation)SSC Guru (230K reputation)SSC Guru (230K reputation)

Group: General Forum Members
Points: 230282 Visits: 46344
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, MVP, M.Sc (Comp Sci)
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


Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search