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 mdf and ldf

Author  Topic 

rohans
Posting Yak Master

194 Posts

Posted - 2003-10-30 : 14:50:43
Hello all,
1. If I have the '.mdf' and '.ldf' files for my database will this give me a clean restore of the original database if I put these files on a different SQL server box in the data folder?

2.What are the draw backs of using this method versus backing up the DB on one server and using the restore option on the other SQL server?

3. If I have do a backup of my DB and restore it I loose the relationship between my tables in the diagrams view. Why is this so? How do I get around this? (I would much rather keeping my relationships.)

All help appriciated.

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2003-10-30 : 14:56:20
You can only use the MDF and LDF file for a restore if those files were copied when the MSSQLSERVER service was stopped or if the database was detached. You would need to run sp_attach_db in order to attach these files to the server.

The drawbacks of this method is that the database must be detached or the service must be stopped so that you can use the MDF and LDF files. BACKUP/RESTORE option is a better solution for production databases because the BACKUP command can be performed online.

Diagrams are stored in the dtproperties table, so your diagrams should transfer over with detach/attach or backup/restore method. Even if the diagram isn't there, your relationships aren't lost. Let me look up the article that describes how to transfer them.

Tara
Go to Top of Page

chadmat
The Chadinator

1974 Posts

Posted - 2003-11-03 : 13:27:39
You will also lose the relationships between logins and users with either method.
This topic is well covered in these forums, just search for "orphaned users"

-Chad

http://www.clrsoft.com

Software built for the Common Language Runtime.
Go to Top of Page
   

- Advertisement -