Solved

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

Posted on 2011-02-25
10
356 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
Control application downtime with dependency maps

Visualize the interdependencies between application components better with Applications Manager's automated application discovery and dependency mapping feature. Resolve performance issues faster by quickly isolating problematic components.

 
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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

910 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

22 Experts available now in Live!

Get 1:1 Help Now