Groups | Blog | Home
all groups > sql server new users > october 2007 >

sql server new users : Restore a DB from a Live Database



dcmanno
9/13/2007 1:34:03 PM
newbie question:
Is there such a thing as to restore a Database from another live Database?
ie. restore a "DBname_Test" from "DBname" (in production) without using the
..bak file from DBname? Is this the same as restoring the test db from a
snapshot of the live production db, is that possible given the different
names??

Ekrem_Önsoy
9/14/2007 12:00:00 AM
You could do that in SQL Server 2005.

Go to SSMS and go to the database you want to copy. Right click on it and
select Tasks and then you'll see Copy Database at the bottom of the popup
menu. Click on it and choose "Use the SQL Management Object method" as the
copy method. In this way, it's a slower operation then attach\detach but
your source database may remain online.

--
Ekrem Önsoy



[quoted text, click to view]
Erik G
9/14/2007 11:23:29 AM
If you can schedule downtime on production you can first do a full
backup of prod, detach prod , copy to test (not move), Attach them
both again. Rename test database to what ever you want. this is the
fastest and most reliable. or you can backup prod, look at the BOL
help for RESTORE DATABASE and you can see the you can have it restore
to a different name. I don't care for the copy object wizard myself,
I have probs with it when there are dependencies for ref integrity.

Erik Grob, MCDBA
Ekrem_Önsoy
9/15/2007 12:06:02 AM
Nice, however, questioner says "no .bak files, no detaching cause it's a
production thing"

--
Ekrem Önsoy
MCBDA, MCTS: SQL Server 2005, MCSD.Net, MCSE, MCT



[quoted text, click to view]
Andrew Hayes
10/25/2007 9:57:00 PM
Which version of SQL Server are you using?

I know that when using the Restore Database... option in Management Studio
(2005), you can just change the name of the Database the backup is being
restored to.

For example:

Destination for restore - "To database:" DBname_Test

Source for restore - "From database:" DBname

No need to select "From device:", but remember to select the latest backup
set and transaction logs (if any). Doing this will not affect the production
DB. Of course, this also assumes that a backup of the production database has
been done at some time.
AddThis Social Bookmark Button