Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

SQL Restore

Posted on 2012-04-11
9
Medium Priority
?
86 Views
Last Modified: 2015-05-24
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
0
Comment
Question by:chasmx1
  • 2
  • 2
  • 2
  • +1
7 Comments
 
LVL 2

Accepted Solution

by:
SE-Pneumatic earned 1000 total points
ID: 37832727
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
 

Author Comment

by:chasmx1
ID: 37834532
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
 
LVL 23

Expert Comment

by:Mysidia
ID: 37835854
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
Who's Defending Your Organization from Threats?

Protecting against advanced threats requires an IT dream team – a well-oiled machine of people and solutions working together to defend your organization. Download our resource kit today to learn more about the tools you need to build you IT Dream Team!

 

Author Comment

by:chasmx1
ID: 37835874
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
 
LVL 2

Expert Comment

by:SE-Pneumatic
ID: 37844400
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
 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 37845457
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
 
LVL 23

Assisted Solution

by:Mysidia
Mysidia earned 1000 total points
ID: 37847707
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

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

Question has a verified solution.

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

Introduction: When running hybrid database environments, you often need to query some data from a remote db of any type, while being connected to your MS SQL Server database. Problems start when you try to combine that with some "user input" pass…
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.
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Suggested Courses
Course of the Month13 days, 3 hours left to enroll

578 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