Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Administration (2000)
 MDF Restore

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2004-05-05 : 14:58:36
chris writes "Can I restore/rebuild the sql database just from a MDF file?

We recently had a raid 5 controller go bad and the backups couldn't restore the server...I was able to get the mdf file off the corrupted volume before it totally crash.

Help...."

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2004-05-05 : 15:02:50
Yes you can. Use sp_attach_single_file_db. So I take it that you don't have a backup?

Tara
Go to Top of Page

RickD
Slow But Sure Yak Herding Master

3608 Posts

Posted - 2004-05-06 : 05:06:35
Yes, if you detached it using sp_detach_db... If not then no...

That's what backups are for...
Go to Top of Page

nr
SQLTeam MVY

12543 Posts

Posted - 2004-05-06 : 05:12:10
Hmm. You've implemented a raid system but not a backup policy.
Seems like a curious use of resources/money.

==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2004-05-06 : 12:35:03
Rick, you can still use sp_attach_single_file_db even if you haven't detached it with sp_detach_db. I've been able to restore an MDF on two different systems now without first detaching it or stopping the MSSQLSERVER service. I was shocked both times. This was not a production environment, so I was able to try things out.

Tara
Go to Top of Page

surefooted
Posting Yak Master

188 Posts

Posted - 2004-05-06 : 12:53:26
I've done that before too. Had to fix someone's mess and was surprised it worked.

-Jon
Just a starting member.
Go to Top of Page
   

- Advertisement -