[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 356
  • Last Modified:

syntax using the move command

on a sql2000+sp4 server I am trying to restore from backup the master DB from one server to another, and in a different location on the recovery server, as part of a disaster recovery plan. Working the sql on the second server, I start up in single server mode (sqlservr -c -m) and try to run the following in query analyizer

RESTORE DATABASE MASTER
               FROM DISK = 'c:\sql_backup_test\mastermaster_db_200603270200.BAK',
               WITH MOVE  'MASTER'  TO  'c:\sql\mssql\data\master_mdf',
               MOVE 'MASTLOG' TO 'C:\sql\mssql\data\master.ldf,


It is givining me an error of incorrect syntax near the keyword 'with' on line 3 I am not a DB developer and not experienced with SQl. Any help would be appreciated.

0
gbird2005
Asked:
gbird2005
  • 4
  • 2
1 Solution
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
RESTORE DATABASE MASTER
               FROM DISK = 'c:\sql_backup_test\mastermaster_db_200603270200.BAK'
               WITH MOVE  'MASTER'  TO  'c:\sql\mssql\data\master_mdf',
               MOVE 'MASTLOG' TO 'C:\sql\mssql\data\master.ldf,
0
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
ie the comme after the FROM DISK was too much
0
 
gbird2005Author Commented:
Thats sovled the sqyntax problem but I am getting the error that the system database can not be move by a restore command, which I thouhg you can do when in single user mode.
0
Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
to move the master database, simply do the following steps:

* shut down sql server
* move the physical files
* change the sql server's registry settings that specify the master database file locations
* startup sql server

registry path:
HKLM\SOFTWARE\Microsoft\Microsoft SQL Server\SQLINSTNAME\MSSQLServer\Parameters
0
 
ptjcbCommented:
0
 
gbird2005Author Commented:
excellent reference thank for all your help. consider this closed.
0
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
>consider this closed.

it's your job to close it. either accept a single comment as answer, or split the points using the split points link below the last comment (which I guess won't appear here as you need at least 60 points to split)
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 4
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now