Results 1 to 12 of 12

Thread: restore db backup with different name

  1. #1
    Join Date
    Jun 2004
    Posts
    4

    restore db backup with different name

    Bear with me, I'm a newbie to SQL. I have a database that I want to duplicate for testing/training. I have performed a backup of the db through Enterprise Manager. I want to restore the db with the same name, EXCEPT for adding _TEST at the end. For example, say the db is named DATABASE_DATABASE, I want to restore as DATABASE_DATABASE_TEST. I want to be 100% sure that will NOT overwrite the existing db. It shouldn't, am I correct? Thanks!!

  2. #2
    Join Date
    Mar 2003
    Posts
    468
    when restoring a database, changing the name is really the last step and there are a few tricks with backup control files to properly rename and place the datafiles to a different area on disk so as to not overwrite the existing database.

    i am not too sure how OEM works, but would venture to say if you did a backup of a database and tried to restore this database with OEM it WOULD try and overwrite the existing.

    if you want to use OEM, you should look to see if it supports cloneing as this is Oracle's method of doing just what you mentioned.

  3. #3
    Join Date
    Jun 2004
    Posts
    4
    I was kind of afraid of that. Thanks for the help! I haven't found a cloning method yet, but that would be nice.

  4. #4
    Join Date
    Nov 2002
    Location
    New Jersey, USA
    Posts
    3,932
    What DBMS are you using?. In SQL Server, you can restore it as a new database using Enterprise Manager or T-SQL.

    You have to use WITH MOVE syntax.

  5. #5
    Join Date
    Mar 2004
    Location
    NJ
    Posts
    17
    I do this all the time in MS SQL Server using Enterprise Manager. I can provide screen shots if you need them.

    dag

  6. #6
    Join Date
    Jun 2004
    Posts
    4
    Screen shots would be great! Thanks!

  7. #7
    Join Date
    Mar 2004
    Location
    NJ
    Posts
    17
    Where it says Databases under the tree, right click, select all tasks, then Restore Database. This will activate the Restore Database wizard.

    See attached
    Attached Images Attached Images

  8. #8
    Join Date
    Sep 2002
    Location
    Fantasy
    Posts
    4,254
    --Backuping a database
    backup database dicaf to disk ='d:\dicaf_may25.bak' with init

    --restoring it in a different name

    use master
    go
    restore database Dicaf2222 from Disk = 'd:\dicaf_may25.bak' with replace,
    move 'DiCaf_Data' to 'd:\dicaf\DiCaf2222_Data.mdf',
    move 'DiCaf_Log' to 'd:\dicaf\DiCaf2222_log.ldf'

  9. #9
    Join Date
    Mar 2004
    Location
    NJ
    Posts
    17
    It this dialog box do the following:

    Change the field Restore as database: to the name of the new database

    In the Restore: radio buttons - choose From Device.

    Click on the Select Devices command button.

    Click Add in the Choose Restore Devices Dialog box.

    Click the ... command button to find the file you would like to restore from.

    Once you choose the file, select OK.

    Click OK to return to the Choose Restore Device dialog box.

    Click OK one more time to return to the Restore Database dialog box.

    Click on the Options Tab

    See attached
    Attached Images Attached Images

  10. #10
    Join Date
    Mar 2004
    Location
    NJ
    Posts
    17
    If the new database exists already, click on the Force restore over existing database. Warning, this will overwrite the database you chose.

    In the "Move to physical file name", choose the location and name you would like the data and log files to reside.

    Good Luck

    dag

    P.S. of course you could do what MAK posted.

  11. #11
    Join Date
    Sep 2002
    Location
    Fantasy
    Posts
    4,254
    It is just a style of handling things. Some choose to use GUI and some choose to write SQL script.

    Goodluck.

  12. #12
    Join Date
    Jun 2004
    Posts
    4
    Finally had a few minutes to try it out. Worked like a champ! Thanks!!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •