Copy and Rename An Oracle Database
Copy and Rename An Oracle Database
(WITHOUT EXPORT/IMPORT)
by Jeff Hunter, Sr. Database Administrator
The first step is to locate and copy all database files to their
new location. You can use the view V$DATAFILE in the PROD
database to locate these files. Before running the query from
V$DATAFILE, ensure that you are connected to the PROD
database by selecting from V$DATABASE:
SQL> select name from v$database;
NAME
---------------------------------------
PROD
NAME
---------------------------------------
/u08/app/oradata/PROD/system01.dbf
/u06/app/oradata/PROD/rbs01.dbf
/u07/app/oradata/PROD/temp01.dbf
/u10/app/oradata/PROD/userd01.dbf
/u09/app/oradata/PROD/userx01.dbf
After recording these files, shutdown the PROD database and
perform an operating system copy of all database files to
another location and/or machine. In my example, I will copy all
datafiles to a new location as shown in the following table:
Old Location New Location
/u08/app/oradata/PROD/system01.dbf /u08/app/oradata/TEST/system01.dbf
/u06/app/oradata/PROD/rbs01.dbf /u06/app/oradata/TEST/rbs01.dbf
/u07/app/oradata/PROD/temp01.dbf /u07/app/oradata/TEST/temp01.dbf
/u10/app/oradata/PROD/userd01.dbf /u10/app/oradata/TEST/userd01.dbf
/u09/app/oradata/PROD/userx01.dbf /u09/app/oradata/TEST/userx01.dbf
After copying all files to their new location, startup the PROD
database.
audit_file_dest
background_dump_dest
control_files
core_dump_dest
log_archive_dest
user_dump_dest
If the TEST database is going to be on a different machine, copy
the initTEST.ora file to that machine in the proper directory.