Unsolved

This post is more than 5 years old

23 Posts

950

August 15th, 2008 05:00

How to relocate database files during recover SQL database

Hello to all, please help.

I can't relocate *.mdf and *.ldf files during recover proccess via command line. I must mention that I am able to do this succesfully thrue GUI.

Also I can do succesfully restore of one database from one sql server to another thrue command line, but can't relocate database mdf and ldf files during recover process to exactly predefined folder.

This is my syntax:
C:\>nsrsqlrc -s dc.fast.rs -c sql2k -f -d MSSQL:Northwindtest MSSQL:Northwind -C Northwind=E:\Base\northwnd.md
f, Northwind_ldf=E:\Base\northwnd.ldf
43708:nsrsqlrc:Start time: Fri Aug 15 14:36:04 2008
43621:nsrsqlrc:Computer Name: SQL     User Name: Administrator
37740:nsrsqlrc:Recover of '-C' will be skipped because a full backup was not found.
37740:nsrsqlrc:Recover of 'Northwind=E:Basenorthwnd' will be skipped because a full backup was not found.
37740:nsrsqlrc:Recover of 'Northwind_ldf=E:Basenorthwnd' will be skipped because a full backup was not found.
                  NSR_CLIENT: sql2k.fast.rs;
                  NSR_SERVER: dc.fast.rs;
37725:nsrsqlrc:Recovering database 'Northwind' into 'Northwindtest' ...
4690:nsrsqlrc:RESTORE database [Northwindtest] FROM virtual_device='Legato#cba0aab4-74e3-455d-9af4-69c4c24b912
6'  WITH move 'Northwind' to 'C:\Program Files\Microsoft SQL Server\MSSQL\Data\Northwindtest_northwnd_15342.md
f', move 'Northwind_log' to 'C:\Program Files\Microsoft SQL Server\MSSQL\Data\Northwindtest_northwnd_15342.ldf
', replace
35866:nsrsqlrc:The restore of database 'Northwind' completed successfully.
29309:nsrsqlrc:
Received  3219 KB  1 item(s)  from NSR server.
43709:nsrsqlrc:Stop time: Fri Aug 15 14:36:09 2008


As you can see this is one succesfully restore but also ignored option for relocation files.
What's wrong with my switch -C or something else.

2 Intern

 • 

724 Posts

August 15th, 2008 08:00

Admin guide says to:

"... specify the relocation list for the database files, but do not include the client host name command option.."

I think you don't have to use "-c "

23 Posts

August 15th, 2008 10:00

No, I'm afraid that your suggestion helps only in situation when you do a recover of an sql database under different name inside the same sql instance. I am trying to recover database from one instance of sql server to a another sql instance (from host to host, direct restore).

2 Intern

 • 

14.3K Posts

September 4th, 2008 04:00

Try this:
-C northwind=E:\Base\northwnd.mdf, northwind=E:\Base\northwnd.ldf

...or simply when doing this from GUI check in logs what CLI module has built for you and compare differences.
No Events found!

Top