Link to home
Start Free TrialLog in
Avatar of chasmx1
chasmx1Flag for United States of America

asked on

SQL Restore

I need to restore a backup from an old database.  I had to do a wipe and re-install on our Windows 2003 SBS box.  How can I restore the database to the new instance of SQL?  We are using Backup Exec 2010.

Thanks
ASKER CERTIFIED SOLUTION
Avatar of SE-Pneumatic
SE-Pneumatic
Flag of United States of America 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
Avatar of chasmx1

ASKER

We are using Backup Exec 2010 and I can seem to find the database files when I use the Restore Wizard.  Is there a way to search the backups in Backup Exec 2010?  All I see is the various backups on our NAS and I'm not sure exactly which one I need.  I just need the database file and log file right?  I've already installed a new OS including SQL 2005.
You need SQL server re-installed as a pre-requisite for starting a SQL restore.

If you have a good database data and log file,  you can re-attach the database,
after restoring the database and log files to a path on the DB server.

Another option is to run the restore wizard against a .BKF file  obtained by running
the SQL backup command against the SQL server.

Which version of Microsoft SQL Server are you using?

Here's an explanation of what you do in SQL Server 2012:
http://msdn.microsoft.com/en-us/library/ms190209.aspx

In old versions of SQL server, it used to be
a matter of running a T-SQL statement  on the SQL server

EXEC sp_attach_db @dbname = 'mydatabasename',
     @filename1 = 'C:\MSSQL\data\Example1.mdf',
     @filename2 = 'C:\MSSQL\data\Example1_log.ldf'


sp_attach was deprecated as of SQL 2005.

In SQL 2003 and higher, you can use SQL Server Management Studio

Open management studio,  Right click Databases
choose the 'Attach Database'  option

add the restored files.
Avatar of chasmx1

ASKER

Okay I got Backup Exec to restore my database under a different name since the application created a new blank database with the correct name. Now what I need to do is rename the current database to xxsomething and rename oldDb to corrected. I tried just to right mouse on each database and use The rename menu item but that generated an error. How can I change the name of these two databases running on the same instance of SQL Server 2005.

Thanks again
Make sure you have the appropriate Alter permissions on the databases in order to rename them. Right clicking on them and selecting Rename should work.
Avatar of Anthony Perkins
Right clicking on them and selecting Rename should work.
I suspect the author is talking about renaming the actual database files and they do not realize that they cannot do that as they are open by SQL Server.
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