Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Urgent MSDE Restore Help

Status
Not open for further replies.

nickspace

IS-IT--Management
May 2, 2005
43
US
Hi everyone,
Our machine with MSDE on it crashed today. We urgently need to restore one database from that machine. We have been able to extract .MDF and .LDF files for that database from the machine but there are no backup files (most probably, no backups were taken in near past). I tried to attach this database on my SQL Server 2000 but there is not way to specify the ldf file for that. Can someone please tell me how to restore using just these files? Any help is greatly appreciated.

Thanks,
Nick
 

- Write an sql script (.sql file), say attachdb.sql, with these commands:
------
Use Master
sp_attach_db <your db name>, '<path to .mdf file>', '<path to your .ldf file>'
------
E.g. sp_attach_db Northwind, 'c:\temp\Northwind.mdf', 'c:\temp\Nortwind.ldf'

- Now on Dos Prompt use this osql command to run the above sql file:

----
osql -S<SQL server name> -U<username> -P>password> -i<path to your sql script (as above)> -o<path for the result file>
----

K.
 
Thanks for the reply kaps. I do have SQL Server 2000 on my machine. MSDE was on a different machine that crashed. I want to restore those files on my machine using enterprise manager. Is there a way to do that?

Cheers,
N
 
Yes, follow these steps:

- From the SQL Server group, choose the SQL server you want to attach the database to (i.e. if you have more than one SQL Servers)
- Right click on 'Databases' and choose All tasks -> Attach Database
- Specify the location of .MDF file, and it will automatically pick up the .LDF file as well
- Specify the database name in "Attach as:" text box
- Specify the database owner
- Click OK


 
I tried doing that... and pointed to the right .mdf file but it keeps on picking the wrong ldf file. the database name is adsystem (adsystem.mdf and adsystem.ldf) when i point it to adsystem.mdf, instead of picking up adsystem.ldf, it picks up spacemaster_log.ldf There used to be another database on the server with the name spacemaster. I dont know how to repoint it to the correct ldf. I have tried renaming adsystem.ldf to spacemaster_log.ldf. But that didn't work.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top