Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have an unused database B, not valuable. I'd like to make a copy of database A, but do not want to go through all the manual steps RMAN requires to set up the auxiliary database. Can I use RMAN duplicate to copy database B over database A, replacing everything in it but reusing the instance? I know you can synchronize database copies this way, I'm hoping this is just a more drastic version of that procedure.


share|improve this question
What exactly do you mean by "the manual steps RMAN requires to set up the auxiliary database"? – kubanczyk May 25 '12 at 13:35
tnsnames, lsnrctl, init.ora, .... Fraught with errors, at least for me. – orbfish Jun 26 '12 at 17:25

The changes required to setup a duplicate from A (target) to B (auxiliary) in RMAN are pretty trivial.

1) db_file_name_convert AND log_file_name_convert parameters in the auxiliary database. If the file paths are exactly the same, simple name replacement should suffice:


IF your path changes are more complicated, you can specify full path replacement:


2) Make sure to setup an oracle password file for the instance and configured for remote login.

3) Make sure the target and auxiliary instances are configured in TNSNAMES.ORA on both instance servers (if they are different).

4) Shutdown B (auxiliary), remove all control files, redo logs and data files.

5) Startup B in NOMOUNT mode.


6) Connect to rman like so:

rman target sys/change_on_install@A auxiliary sys/change_on_install@B

duplicate target database to "B" from active database;

Oracle will handle backup mode, compression, transport and unpack of the A database to replace the B database. When this completes, your database will be done.


6) Configure flash recovery area in the target instance:


7) Backup database using rman. If your A (target) is in archive log mode, this can be done hot. If not, cold. Compressed below is optional. I always use it. The backupset ends up around 10-20% of the original instance size.

rman target sys/change_on_install@A

backup database as compressed backupset;

8) Using the location you chose above for the recovery area, copy the database to the server auxiliary is on (this is better if you have clustered/shared storage between the two servers). The date of course is the date you run the rman backup. Make sure the files end up in the same place. If there isn't room, you have options, but the easiest way on Unix/Linux is a symbolic link, or on Windows (NTFS only) a junction.


9) Using rman, duplicate the target database:

rman target sys/change_on_instance@A auxiliary sys/change_on_install@B

duplicate target database to "B";

AND, you are up.

IF you really want to do a new clone with "less" effort, then you can setup a very shell database (an init.ora file with only 1 parameter), and use the SPFILE parameter in the rman duplicate to copy the parameter file over to the new instance, converting every name based parameter on the way. The can be good, except when the test machine may have more than one instance, and memory tuning may need tweaking.

share|improve this answer
Consequently, after the initial steps are setup, this can be scripted for subsequent clones. – REW Jul 30 '12 at 5:26

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.