Krieg
asked on
RESTORE DATABASE?
Dear Everybody,
I have a problem on how to restore the MSSQL Backup file. It will be restored thru network.
I hope you can help me with this. I actually have my source code below, but it gives an error.
I am using SQL Query Analyzer before putting it in Delphi 6.
Here's the SQL Query Analyzer code:
RESTORE DATABASE Oliver
FROM DISK = '\\sqlserver\c$\OliverBack up.bak'
WITH MOVE 'Oliverbackup' TO '\\sqlserver\c$\oliverback up.mdf',
MOVE 'Oliverbackup_log' TO '\\sqlserver\c$\oliverback up_log.ldf '
Error:
Server: Msg 3234, Level 16, State 2, Line 1
Logical file 'Oliverbackup' is not part of database 'Oliver'. Use RESTORE FILELISTONLY to list the logical file names.
Server: Msg 3013, Level 16, State 1, Line 1
RESTORE DATABASE is terminating abnormally.
I don't want to use the RESTORE FILELISTONLY since you cannot specify there the path.
I hope you can help me guys.
Thanks in advance.
I have a problem on how to restore the MSSQL Backup file. It will be restored thru network.
I hope you can help me with this. I actually have my source code below, but it gives an error.
I am using SQL Query Analyzer before putting it in Delphi 6.
Here's the SQL Query Analyzer code:
RESTORE DATABASE Oliver
FROM DISK = '\\sqlserver\c$\OliverBack
WITH MOVE 'Oliverbackup' TO '\\sqlserver\c$\oliverback
MOVE 'Oliverbackup_log' TO '\\sqlserver\c$\oliverback
Error:
Server: Msg 3234, Level 16, State 2, Line 1
Logical file 'Oliverbackup' is not part of database 'Oliver'. Use RESTORE FILELISTONLY to list the logical file names.
Server: Msg 3013, Level 16, State 1, Line 1
RESTORE DATABASE is terminating abnormally.
I don't want to use the RESTORE FILELISTONLY since you cannot specify there the path.
I hope you can help me guys.
Thanks in advance.
ASKER
hi rafrancisco,
I actually tried this code already, and what I need is the RESTORE DATABASE where you can specify a certain path. But I don't if why it will give an error when using this command.
I actually tried this code already, and what I need is the RESTORE DATABASE where you can specify a certain path. But I don't if why it will give an error when using this command.
After issuing the previous command, look at the name of the data file and replace it below. The error means that there is no Oliverbackup in your backup. Most probably it is called Oliverbackup_Data:
RESTORE DATABASE Oliver
FROM DISK = '\\sqlserver\c$\OliverBack up.bak'
WITH MOVE 'Oliverbackup_Data' TO '\\sqlserver\c$\oliverback up.mdf',
MOVE 'Oliverbackup_log' TO '\\sqlserver\c$\oliverback up_log.ldf '
RESTORE DATABASE Oliver
FROM DISK = '\\sqlserver\c$\OliverBack
WITH MOVE 'Oliverbackup_Data' TO '\\sqlserver\c$\oliverback
MOVE 'Oliverbackup_log' TO '\\sqlserver\c$\oliverback
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Hi Guys,
Thank you for sharing your solutions, but I think I have to give the points to jimpen.
Thanks to you all :)
Thank you for sharing your solutions, but I think I have to give the points to jimpen.
Thanks to you all :)
Thank you for the points. As is obvious, I have run into this many times. Good luck on your DR plan.
RESTORE FILELISTONLY
FROM DISK = '\\sqlserver\c$\OliverBack