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)
 Restore Databases with Multiple Files

Author  Topic 

Sarat
Constraint Violating Yak Guru

265 Posts

Posted - 2004-02-27 : 15:43:50
Hi,
I have a database with two data files (NDF) and a primary file. If I want to restore the database with Restore command, should the script look something like this assuming all data files are on one disk?

Restore database NewDb
from disk = '\\Prd_Box\X$\ProdDb.Bak'
WITH MOVE 'Prod_Data' to 'K:\NewDb_Data.mdf',
MOVE 'Prod_Data_1' to 'K:\NewDb_Data_1.ndf',
Move 'Prod_Data_2' to 'K:\NewDb_Data_2.ndf',
MOVE 'Prod_Log' TO 'L:\NewDb_Log.ldf',
STATS = 2
GO

Thanks,
Sarat.



**To be intoxicated is to feel sophisticated, but not be able to say it.**

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2004-02-27 : 16:12:13
You only need to use the WITH MOVE option if you want to restore the files to a different location than what the backup specifies.

Tara
Go to Top of Page

Sarat
Constraint Violating Yak Guru

265 Posts

Posted - 2004-02-27 : 18:55:04
I do need to move it to a different location. I am assuming the script is good then!
Sarat.

**To be intoxicated is to feel sophisticated, but not be able to say it.**
Go to Top of Page
   

- Advertisement -