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.
| Author |
Topic |
|
interclubs
Yak Posting Veteran
63 Posts |
Posted - 2002-05-12 : 13:01:37
|
| One of our Hard Drives with all our SQL on it died. Luckily enough I was able to save all the *.mdf files for the different databases. Unfortunately though, I can't seem to get them back in there.I tried creating a database (with the same name as the old one), and then copying over the .mdf file to replace it. Marked the database suspect and then I tried 'sp_resetstatus' which gave me this:"Prior to updating sysdatabases entry for database 'NursingHands', mode = 0 and status = 1073741824 (status suspect_bit = 0).No row in sysdatabases was updated because mode and status are already correctly reset. No error and no changes made."So that didn't work.So then I tried creating a database and detaching the just created DB, and attaching the backed-up .mdf file. Didn't seem to work either, it told me that I "Cannot associate files with different databases."Anyone have any ideas, I am desperate. THanks! |
|
|
SQLServerDBA_Dan
Aged Yak Warrior
752 Posts |
Posted - 2002-05-12 : 15:52:11
|
| just use sp_attach_single_file_dbDanielSQL Server DBA |
 |
|
|
jasper_smith
SQL Server MVP & SQLTeam MVY
846 Posts |
Posted - 2002-05-12 : 19:19:03
|
| How about your backups ??You do have backups don't you ?If not - learn the lesson well - you can never have enough backups.Saving your mdf's is all well and good but thats not really adequate.The "normal" way to recover would be to restore your last full backup and apply and diff/tran log backups to get you up to date.Depending on what was in your log (ldf file) at the time of failure you could end up with data loss by just attaching the mdf depending on how much work had yet to be written to the data file.As part of your basic disaster recovery you need to have procedures in place to cope with hardware failures and make sure they work - all too many plans look great on paper but when it comes to the crunch they haven't been tested and they don't work.Hope you have good luck with attaching your mdf's however maybe next time you won't have to rely on luck !CheersJasper Smith |
 |
|
|
|
|
|