Restore and Recover a Database to a New Host with a Different Directory Structure (Oracle and Oracle RAC)

The following procedure describes the steps involved in restoring and recovering a database (either in ARCHIVELOG or NOARCHIVELOG) mode to a new host, with a different directory structure.

When you are restoring data from a database in NOARCHIVELOG mode, you must always restore and recover the entire database.

Before You Begin:

Required Capability: See Capabilities and Permitted Actions

wedge.gif (136 bytes)To restore and recover a database to a new host with a different directory structure:

  1. Copy the init<SID>.ora from the old host to the new host.
  2. Edit the init<SID>.ora file on the new host to reflect all the directory structure changes (i.e., change the path for control files, archivelog destination and *dump destinations).
  3. Create the directory structures as defined in init<SID>.ora file for all paths.
  4. Configure the destination machine's $TNS_ADMIN/tnsnames.ora file to include the Recovery Catalog database's service entry. The easiest way to configure this file is to copy the Recovery Catalog database's service entry from the source machine's tnsnames.ora file and append it to the destination machine's tnsnames.ora file. The Recovery Catalog database's service entry should look similar to the following:
    <service_name> =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = <protocol>)(HOST = <host>) (PORT = <##>))
    (CONNECT_DATA = (SID = <Recovery Catalog database>)))
  5. Make sure that ORACLE_SID is set to the database that you are restoring and that ORACLE_HOME is set appropriately. Note the following example for Solaris:
    #export ORACLE_SID= <target database SID>
    #export ORACLE_HOME= <Oracle home directory>

    Note the following example for Windows 2000 machines:
    C:\set ORACLE_SID= <target database SID>
    C:\set ORACLE_HOME= <Oracle home directory>
  6. From Server Manager or SQL Plus on the source machine, create a new user account within the Recovery Catalog for the destination machine by executing the commands in the following display:
    SVRMGR>create user <username> identified by <password>
    2>temporary tablespace <temp_tablespace_name>
    3>default tablespace <default_tablespace_name>
    4>quota unlimited on <default_tablespace_name>;
    Statement processed.
    SVRMGR>grant connect, resource, recovery_catalog_owner to <username>;
    Statement processed.
    Make sure that the <username>you supply for the destination machine is different than the username for the source machine.

    When you are granting the user database permissions, make sure to include the recovery_catalog_owner option shown above.

  7. Transfer the Oracle password file "orapw<Oracle SID name>" from the source machine to the destination machine. Usually this file resides in ORACLE_HOME/dbs.
  8. From the source machine, use the Oracle exp command to export the Recovery Catalog data. You are exporting the data by user. For example, if the user ID for the Recovery Catalog owner is rman, you would export the database backup information for the user rman.
  9. From the source machine, use the Oracle imp command to import the contents of the file you created in the previous step into the new user account for the destination machine. Depending on the version of Oracle that you are running, you may receive the following error when you run the imp command:
    IMP-00044: unable to allocate enough memory for statement
  10. Perform these steps if you receive an error while running the imp command:
  11. Ensure that the database in NOMOUNT mode in the destination machine.
  12. If you want to perform the cross-machine restore from the CommCell Console then continue on with this procedure. Otherwise, if you want to perform the cross-machine restore from the RMAN command line using your own custom script, then exit this help and run the script now (refer to Oracle's Recovery Manager documentation for more information).

    When performing cross-machine restore, do the following:

  13. From the CommCell Browser, right-click the instance that contains the database you want to restore and recover to a new host, click All Tasks and then click Restore.
  14. From the Oracle Restore Options (General) dialog box, select or enter the following:
  15. Click the Advanced button and verify the following options are selected in the identified tab for the Oracle Advanced Restore Options dialog box:
  16. Click OK on the Oracle Advanced Restore Options dialog box.
  17. When restoring encrypted data, refer to Data Encryption.
  18. Optionally for Oracle RAC, from the Oracle Restore Options (Stream) dialog box, set the instance restore order per stream allotment.
  19. Begin or schedule the restore.
    Before the restore job is run, the system will check whether the database is in the correct mode for this type of restore. If it is not, a message dialog will inform you of this and offer to automatically switch the database into the valid mode. When this happens, either click Yes on the message dialog to have the system automatically switch the database to the valid mode and continue the restore, or click No to manually switch the database to the valid mode before proceeding.
  20. View the progress of the restore in the Job Controller window. Perform the following steps if your database is in the NOARCHIVELOG mode.
  21. Manually recover and open the database using the following steps.
  22. From the Server Manager window, execute the command displayed in the following example:
    SVRMGR>recover database using backup control file until cancel;

    Server Manager displays several messages, including the following:
    Specify log: {<RET>=suggested | filename | AUTO | CANCEL}
  23. Type cancel

    The following message is displayed:
    Media recovery cancelled.
  24. Execute the commands displayed in the following example:
    SVRMGR>alter database open resetlogs;
    SVRMGR>exit
  25. Reset the Recovery Catalog by executing the commands displayed in the following example:
    #rman rcvcat <catalog connect string>
    Recovery Manager: Release 8.1.5.00 - Production
    RMAN-06008: connected to recovery catalog database
    RMAN>connect target;
    RMAN-06005: connected to target database: <database_name> DBID=<##>)
    RMAN> reset database;
    RMAN-03022: compiling command: reset
    RMAN-03023: executing command: reset
    RMAN-08006: database registered in recovery catalog
    RMAN-03023: executing command: full resync
    RMAN-08002: starting full resync of recovery catalog
    RMAN-08004: full resync complete
    RMAN>exit

    Resetting the Recovery Catalog creates a new incarnation of the database. Before you can restore and recover the database to the current time, you must perform another full backup and wait for it to complete successfully.
  26. Perform an immediate offline full backup.