Solved

Restore Master DB and our own DB to a freshly installed SQL 2008 server

Posted on 2011-02-25
10
355 Views
Last Modified: 2012-05-11
Hi All

I have had to re-install our SQL 2008R2 server, before reinstalling i backed up the master database and our own SQL database,  i have now reinstalled the server and installed SQL.

My next step is to restore the database. is it as simple as right clicking on each database and restoring.

Does the New SA password need to match the old one, and also now i have re-installed the file paths are slightly different as the path to the databases i chose during install was E:\SQL_Data

in the original install it was still on the E drive but was just the long default path that SQL.

Thanks

0
Comment
Question by:ncomper
  • 4
  • 4
  • 2
10 Comments
 
LVL 57

Expert Comment

by:Raja Jegan R
ID: 34978417
>> My next step is to restore the database. is it as simple as right clicking on each database and restoring.

Nope, there are few more restrictions applicable.
Follow the steps mentioned in the link below to get your master database restored properly:
http://msdn.microsoft.com/en-us/library/ms190679.aspx

>> Does the New SA password need to match the old one, and also now i have re-installed the file paths are slightly different as the path to the databases i chose during install was E:\SQL_Data

SA password neet not match..
0
 
LVL 9

Expert Comment

by:mayank_joshi
ID: 34978654
the database files path need not to be same too.

0
 
LVL 5

Author Comment

by:ncomper
ID: 34978655
Thanks

How do i run that sqlcmd specifying my sa username and password, for some reason even thhough the server is in mixed mode and i have given domain admins group  the sysadm right i can not connect to the sql server using my domain admin account, i can only login using the SA details.

Thanks
0
 
LVL 57

Expert Comment

by:Raja Jegan R
ID: 34978667
>> i can not connect to the sql server using my domain admin account, i can only login using the SA details.

Then Builtin\Administrators account in your server might have been disabled..
Kindly enable it or use sa password..
0
 
LVL 5

Author Comment

by:ncomper
ID: 34978839
Hi All

Im getting the following error when i try this

C:\Users\Administrator>sqlcmd
1> RESTORE DATABASE master FROM DISK = `E:\SQL_db_backups\MASTER.BAK` WITH REPLACE;
2> GO
Msg 102, Level 15, State 1, Server SQLSVR, Line 1
Incorrect syntax near '`'.
Msg 319, Level 15, State 1, Server SQLSVR, Line 1
Incorrect syntax near the keyword 'with'. If this statement is a common table ex
pression, an xmlnamespaces clause or a change tracking context clause, the previ
ous statement must be terminated with a semicolon.

I have tried this with and without the semicolon at the end of line 1

Anyone have any ideas?
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 9

Assisted Solution

by:mayank_joshi
mayank_joshi earned 250 total points
ID: 34978876
you are using ` instead of '
0
 
LVL 57

Accepted Solution

by:
Raja Jegan R earned 250 total points
ID: 34979033
As mayank_joshi stated, it should be

RESTORE DATABASE master FROM DISK = 'E:\SQL_db_backups\MASTER.BAK' WITH REPLACE;
0
 
LVL 5

Author Comment

by:ncomper
ID: 34979135
sorry could you explain, im not a dba as ours is away so im a newbie when itc omes to SQL

that line you have stated above looks the same as what i was typing or am i missing somthing?

Thanks again
0
 
LVL 57

Expert Comment

by:Raja Jegan R
ID: 34979167
Ok, here it is..

Your version - `E:\SQL_db_backups\MASTER.BAK`
My Version   -  'E:\SQL_db_backups\MASTER.BAK'

Actually you need to encapsulate value with Single quotes (') but you have used (`) sign.
Hence changing this should help..
0
 
LVL 5

Author Closing Comment

by:ncomper
ID: 34980556
Thanks all, you saved me a lot of stress
0

Featured Post

Free Gift Card with Acronis Backup Purchase!

Backup any data in any location: local and remote systems, physical and virtual servers, private and public clouds, Macs and PCs, tablets and mobile devices, & more! For limited time only, buy any Acronis backup products and get a FREE Amazon/Best Buy gift card worth up to $200!

Join & Write a Comment

In this article I will describe the Backup & Restore method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now