Solved

Restoring to a new database SQL 2005

Posted on 2013-12-20
5
591 Views
Last Modified: 2013-12-20
We have a  SQL server with a database "OurDB". I am trying to create a copy of that database on the same server using SQL Server Management Studio. I tried two ways:

1) I right-clicked 'databases' -> Retore -> Typed in "OurTestDB"  in 'To database' field -> Selected "OurDB" in 'From database' dropdown. When I hit OK, it says "You must select a restore source".
What does this mean? I have done restores like this before. Does this error mean the backup policies are set up in some way?

2) So I backed up "OurDB" and followed the same steps as above, except that I selected 'From Device' field during restore, and browsed to OurDB.bak. This added a back up set and I selected it. Now when I hit OK, it either keeps running with 0% progress or gives me an error something like "The back up set you selected belongs to a database other than OurTestDB"

Please advise.
0
Comment
Question by:Angel02
  • 2
  • 2
5 Comments
 
LVL 15

Assisted Solution

by:weinberk
weinberk earned 100 total points
ID: 39731876
I don't have SQL Server 2005 installed anymore, but from memory, when you go to restore there's an additional tab where you can specify the name of the database and log files that are to be written to.  Change the names there so that it's not the same as the original database.  Again from memory, I recall this same sort of thing happening if the names aren't changed (and you WANT to change them otherwise the original DB will have trouble if it worked for some reason without the change).

Hope this helps.
0
 
LVL 9

Accepted Solution

by:
QuinnDex earned 400 total points
ID: 39731911
create a new database giving it a new name, right click the new database and select:

 tasks>restore>database

select device and then browse to your backup set, select the set to restore by checking the tick box

click options in the left side pane

check overwrite existing database(with Replace)

in the window "restore the database files as, edit the database original  name to match the new name of your new database, then in the restore as column change the names of the mdf and ldf files to match (dont change the path)

click ok and you should be good to go
0
 

Author Comment

by:Angel02
ID: 39731984
Thank you for the response.
I checked overwrite but in the window "Restore the database files as:", it wouldn't let me edit the 'Original File Name' column. I could just edit the 'Restore As' column. I kept the path the same and just changed the names of files to OurTestDB.mdf and OurTestDB.LDF.

Is it OK?
0
 
LVL 9

Expert Comment

by:QuinnDex
ID: 39732021
that should still work
0
 

Author Comment

by:Angel02
ID: 39732035
Worked great! Thank you.
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

911 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now