• Documentation 09-19-2008

    http://www.dba-oracle.com/oracle_tips_db_copy.htm

    Actual commands:

    1. login to source db and backup the controlfile:
    alter database backup controlfile to trace as ‘<filename>’ reuse;

    2. shut down source database and target database

    3. Copy all data files into the new directories on the new server. You may change the file names if you want, but you must

    edit the controlfile to reflect the new data files names on the new server. DO NOT copy over the control files.

    4. edit the trace control file and change all references to the old database name to the new database name. BEWARE that there

    are 2 cases. Just delete all of the lines for the second case.

    5. Look out for comments in sql blocks and remove them!! they cause the script to blow up.

    6. Move the control files for the target database to backup.

    7. Comment out the ‘RECOVER DATABASE’ — it is not necessary as the source was shutdown cleanly.

    8. change the line:
    CREATE CONTROLFILE REUSE DATABASE “OLDSQL” NORESETLOGSĀ  ARCHIVELOG

    to

    CREATE CONTROLFILE SET DATABASE “NEWLSQ” RESETLOGS ARCHIVELOG

    9. The OPEN statement needs to be with the resetlogs clause.

    10. login to the idle target database and run the updated trace script!

    Posted by admin @ 3:10 pm

  • Comments are closed.