restore a database with different name

  • I have a backup from production database, and want restore it to the standby. For business reason, our standby has different name from the production. Using Enterprise Manager, the restoring processes OK.

    When I check the restored standby database in Enterprise Manager tab Data Files, I find that while the physical file location is correc, but the Filename is still the name of the production, whose backup is used to restore.

    Is there a way I can change the File Name to the the true database name ?

  • you should have done that on your restore, with move option.

    or in em in the options tab.

    but for now, I think you can detach the existing db.

    Rename the files, and reattach the file.

     

  • You can only change the PHYSICAL file name using restore with move option.

    Use this to change the LOGICAL file name:

    ALTER DATABASE <db_name> MODIFY FILE (NAME = current_name_Data, NEWNAME = new_name_Data)

     

  • This works.

    Thank you

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply