Link to home
Start Free TrialLog in
Avatar of ncomper
ncomper

asked on

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

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

Avatar of Raja Jegan R
Raja Jegan R
Flag of India image

>> 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..
the database files path need not to be same too.

Avatar of ncomper
ncomper

ASKER

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
>> 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..
Avatar of ncomper

ASKER

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?
SOLUTION
Avatar of mayank_joshi
mayank_joshi
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ncomper

ASKER

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
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..
Avatar of ncomper

ASKER

Thanks all, you saved me a lot of stress