Groups | Blog | Home
all groups > sql server new users > april 2005 >

sql server new users : Database recovery


Julio
4/19/2005 8:15:01 PM
Hi, I had a problem with one database. The hard disk of the server is damaged
but I could get the files mdf and ldf for the database. I don't have a backup
file, but I wonder if I can recover the database information with these two
files.

Hari Prasad
4/19/2005 11:25:21 PM
Hi,

You could try using the command SP_ATTACH_DB from Query analyzer to attach
the database to SQL Server. See the command
usage in SQL Server Books online.

Thanks
Hari
SQL Server MVP


[quoted text, click to view]

Donna Lambert
4/22/2005 7:33:10 AM
Hari is correct! But SP_attach_db won't work if the db was suspect (had
corruption).
Another option would be creating a db with the same exact name, in the same
exact location (identical path/filename) as the old one, and then swap out
the files.

Regardless of which method you employ, for the love of all things holy, you
need to run Dbcc checkdb on that db once you have it up and running.
Be prepared for some amount of dataloss if you have to run dbcc checkdb with
the repair allow dataloss option.

Hope that helps.
Donna

[quoted text, click to view]
Julio
4/24/2005 7:21:01 PM
Thanks, I that works very well.

Best Regards,

Julio J.

[quoted text, click to view]
AddThis Social Bookmark Button