chasmx1
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
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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.md f',
@filename2 = 'C:\MSSQL\data\Example1_lo g.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.
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.md
@filename2 = 'C:\MSSQL\data\Example1_lo
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.
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
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.
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.
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER