Sunday, March 25, 2012

Create a new database with a backup

Let say I have called database A and I make a backup copy
of it. I now want to create a new database on the same
server for testing purposes and I want to call it database
B. How do I create this database with the backup copy of
database A without overrighting database A in the restore?
Thank You
MichaelFirst off, you'll need to restore the database files in a seperate location
from database A.
You can restore from the backup set by naming the database in the restore
script:
--restore database A as B
Restore database B from disk = "c:\mybackup.bak'
with move 'A' to 'C:\A.mdf',
move 'A_Log' to 'C:\A.ldf'
Note that you cannot rename the Logical or Physical filenames, as they are
defined in the backup set.
If, before you restore, you need to get the filenames, use
Restore filelistonly from disk = 'c:\mybackup.bak'
and it will list all files in the backup.
-Morgan
"Michael" <java_html@.hotmail.com> wrote in message
news:080c01c37278$cd357320$a101280a@.phx.gbl...
> Let say I have called database A and I make a backup copy
> of it. I now want to create a new database on the same
> server for testing purposes and I want to call it database
> B. How do I create this database with the backup copy of
> database A without overrighting database A in the restore?
> Thank You
> Michael|||Thank You...
Michael
>--Original Message--
>First off, you'll need to restore the database files in a
seperate location
>from database A.
>You can restore from the backup set by naming the
database in the restore
>script:
>--restore database A as B
>Restore database B from disk = "c:\mybackup.bak'
>with move 'A' to 'C:\A.mdf',
>move 'A_Log' to 'C:\A.ldf'
>Note that you cannot rename the Logical or Physical
filenames, as they are
>defined in the backup set.
>If, before you restore, you need to get the filenames, use
>Restore filelistonly from disk = 'c:\mybackup.bak'
>and it will list all files in the backup.
>-Morgan
>
>"Michael" <java_html@.hotmail.com> wrote in message
>news:080c01c37278$cd357320$a101280a@.phx.gbl...
>> Let say I have called database A and I make a backup
copy
>> of it. I now want to create a new database on the same
>> server for testing purposes and I want to call it
database
>> B. How do I create this database with the backup copy of
>> database A without overrighting database A in the
restore?
>> Thank You
>> Michael
>
>.
>

No comments:

Post a Comment