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
chasmx1Asked:
Who is Participating?
 
SE-PneumaticConnect With a Mentor Commented:
First thing is that you would need to reinstall SQL server on the server if it was just wiped out. Once it is reinstalled, you can do a "restore" from Backup Exec that will get the files back that you had before. This won't just magically make the database work though. You will need to find the database file (wherever it was stored before in the backup files) and then do a restore in SQL. If you are using MS SQL management studio (versions are basically the same so it doesn't matter), you will create a database (name isn't important if this is just to pull data and not to run a business just like it was before), and then right click on it, click tasks, and then restore. It will give you prompts at this point to walk you through restoring it to that database.
0
 
chasmx1Author Commented:
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.
0
 
MysidiaCommented:
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.
0
NEW Internet Security Report Now Available!

WatchGuard’s Threat Lab is a group of dedicated threat researchers committed to helping you stay ahead of the bad guys by providing in-depth analysis of the top security threats to your network.  Check out this quarters report on the threats that shook the industry in Q4 2017.

 
chasmx1Author Commented:
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
0
 
SE-PneumaticCommented:
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.
0
 
Anthony PerkinsCommented:
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.
0
 
MysidiaConnect With a Mentor Commented:
Indeed,  we really need the text of the error message at least

Renaming a database is to be done by the SQL server, either through the SQL management console or by running an ALTER DATABASE mydatabase MODIFY NAME='blah blah blah'  
SQL statement.

Don't move or rename the underlying files around using file management tools.
There are ALTER statements you can use to change filenames as well.


You should shut down all other applications, tools, and services attempting to access this database,  before attempting to rename it;   if there are other users/apps connected to the database performing queries,  renaming may fail with an error.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.