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)
 Restoring From A File

Author  Topic 

robc
Yak Posting Veteran

60 Posts

Posted - 2004-09-29 : 05:06:54
My DB server recently crashed and had to undergo hardware upgrades...
With that, I had to reinstall the OS.

Now all I have are the original files and I am stuck trying to import or restore them into the new installation of SQL Server.

Is there a way to do this?

pyeoh
Starting Member

18 Posts

Posted - 2004-09-29 : 06:01:00
If you had made backups, you should be able to restore the databases from those backups.

What do you mean by original files? The mdfs' and ldfs? Did you detach them before copying them? If so, you should be able to attach them using the sp_attach_db command. If you did not detach them, but just copied them when SQL Server was not running, there is a possibility that those files may be inconsistent. One way to get the database online using those files is described by Jasper Smith here (http://tinyurl.com/6ldkg). You should make a backup of the mdf file first, and note that the suggestion uses some undocumented and unsupported Microsoft features.


Peter Yeoh
http://www.yohz.com
Need smaller SQL2K backups? Use MiniSQLBackup Lite, free!
Go to Top of Page

derrickleggett
Pointy Haired Yak DBA

4184 Posts

Posted - 2004-09-29 : 12:42:28
Also, start backing up the databases. Don't you have a DBA? I would assume he would do that BEFORE the hardware upgrades. If you do,........fire him!!!!

The attach databases usually does work if you just copy the files though. What you will notice though, is that when you attach them, several transactions might be rolled back. These transactions will just be lost and non-recoverable unless you have Lumigent Log Explorer or some such tool.

Have fun!

MeanOldDBA
derrickleggett@hotmail.com

When life gives you a lemon, fire the DBA.
Go to Top of Page

robc
Yak Posting Veteran

60 Posts

Posted - 2004-09-29 : 12:55:02
Thank you.

The sp_attach_db worked perfectly.

Much respect.

Rob
Go to Top of Page
   

- Advertisement -