Solved

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

Posted on 2011-02-25
10
358 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

 
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
 
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

Edgartown IT Case Study

Learn about Edgartown's quest to ensure the safety and security of the entire town's employee and citizen data. Read the case study!

Question has a verified solution.

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

In this article I will describe the Copy Database Wizard 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.
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.
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed

740 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