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
 Import/Export (DTS) and Replication (2000)
 How can i copy the database using restore command

Author  Topic 

venkath
Posting Yak Master

202 Posts

Posted - 2006-06-05 : 14:38:51
Hi guys

i am new guy to Server administration..

I have a database in server1 and want to copy this database to server2
using restore command..

How can i accomplish this task..

Help on this is greatly appreciated..

Thanks in advance.

sanjnep
Posting Yak Master

191 Posts

Posted - 2006-06-05 : 15:16:59
restore database dbname from disk = '\\networkpath\db.BAK'
with replace,stats =1


Sanjeev Shrestha
12/17/1963
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2006-06-06 : 00:06:33
For an example of the RESTORE syntax see:

http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=55210&SearchTerms=RESTORE%20syntax%20/%20example

Kristen
Go to Top of Page

Slammed
Starting Member

3 Posts

Posted - 2006-06-20 : 23:37:48
I posted this in an old thread but I just want to know if anybody can help me figure out why this restore script wont work


RESTORE FILELISTONLY

FROM DISK = 'D:\temp\vernonstoragecenter_db_200601270401.BAK'

RESTORE DATABASE vernonstoragecenter

FROM DISK = 'D:\temp\vernonstoragecenter_db_200601270401.BAK'

WITH RECOVERY,

MOVE 'vernonstoragecenter_data' TO 'D:\MSSQL\Datafiles\data\vernonstoragecenter_data.mdf',

MOVE 'vernonstoragecenter_log' TO 'D:\MSSQL\Datafiles\data\vernonstoragecenter_log.ldf'

GO




This is the error I am getting


Error -2147217900
Cannot open backup device 'D:\temp\vernonstoragecenter_db_200601270401.BAK'. Device error or device off-line. See the SQL Server error log for more details.

RESTORE FILELISTONLY

FROM DISK = 'D:\temp\vernonstoragecenter_db_200601270401.BAK'

RESTORE DATABASE vernonstoragecenter

FROM DISK = 'D:\temp\vernonstoragecenter_db_200601270401.BAK'

WITH RECOVERY,

MOVE 'vernonstoragecenter_data' TO 'D:\MSSQL\Datafiles\data\vernonstoragecenter_data.mdf',

MOVE 'vernonstoragecenter_log' TO 'D:\MSSQL\Datafiles\data\vernonstoragecenter_log.ldf'

GO

According to my host I am on the d:/ drive

Now I should also mention that this is a bak file given to me and I ftp ed it onto the site into the temp folder so I can do the restore

I KNOW NOTHING ABOUT SQL (not my field but I might have to learn)
Go to Top of Page

DavidD
Yak Posting Veteran

73 Posts

Posted - 2006-06-21 : 00:36:50
it needs to be the d:\ drive of the server - not the pc you are using (unless they are one and the same of course)
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2006-06-21 : 09:11:55
If you have Enterprise Manager on your machine I suggest you try that. It has a "file browser" so you can locate the file locally - which might help you to find the folder that you, externally!!, know as D:\TEMP

Alternatively if you have permissions to execute xp_CmdShell you could try:

EXEC xp_CmdShell 'DIR C:\vernonstoragecenter_db_200601270401.BAK /S'

which will do a directory search of all folders on C: drive - you may need to try other drives too.

Kristen
Go to Top of Page

Slammed
Starting Member

3 Posts

Posted - 2006-06-21 : 17:44:39
Thanks for the replys I will give it a try
Go to Top of Page
   

- Advertisement -