When it comes to Oracle database administration, the RMAN Duplicate command is one of the most reliable ways to clone or refresh databases. It allows DBAs to create an exact copy of a production database—either on the same host or a remote server—using the Active Database method.
In this guide, you’ll learn how to use RMAN Duplicate step by step to create a duplicate Oracle database, configure listeners, and troubleshoot common RMAN issues with confidence.

What Is RMAN Duplicate?
The RMAN DUPLICATE DATABASE command lets you create an exact copy of a source (target) database. It can be used for:
- Creating a test or development environment.
- Setting up a Data Guard standby database.
- Migrating or refreshing databases between environments.
You can duplicate a database in two ways:
- From Active Database – RMAN copies datafiles over the network directly (no backups required).
- From Backup – RMAN uses pre-taken backups to build the new database.
In this post, we’ll focus on Active Database Duplication on the same server, a fast and convenient method when both databases share the same Oracle Home and filesystem.
Why Use RMAN Active Duplication?
Active duplication is ideal when:
- You want a real-time clone of your source database.
- You don’t want to create backups before cloning.
- Both the source and auxiliary (clone) instances are on the same server or network.
Key advantages:
- No downtime: Your production database stays online.
- No need for backups: Data is transferred live via RMAN channels.
- Automated configuration: RMAN automatically handles control files, redo logs, and SPFILE creation.
Prerequisites Before You Begin
To ensure a successful duplication process, make sure the following are in place:
- Same Oracle Home version on both databases.
- Password files exist for both source and target SIDs.
- TNS entries configured for both databases.
- Listener running and able to resolve both service names.
- Adequate disk space for datafiles and the Fast Recovery Area (FRA).
- The auxiliary instance must be started in NOMOUNT mode before running RMAN.
Step-by-Step: Duplicate Oracle Database Using Active Database
Let’s assume we have the following setup:
| Parameter | Value |
|---|---|
| Source Database (Target) | oem |
| Auxiliary Database | dup |
| Server | prod |
| Oracle Home | /u01/app/oracle/product/19.0.0/ |
Step 1: Verify Existing Backups
Log in to the source database and ensure there are no old backups that may conflict. If you haven’t yet set up Oracle 19c on RHEL9, check out our detailed guide on
installing Oracle 19c Database on RHEL9 to prepare a compatible environment before proceeding.
. oraenv
ORACLE_SID=oem
rman target /
RMAN> LIST BACKUP SUMMARY;
RMAN> DELETE BACKUP;
This step ensures you’re starting with a clean slate.
Step 2: Create a PFILE for the Auxiliary Database
Create a temporary parameter file for the new database.
File: /u01/app/oracle/product/19.0.0/dbs/initdup.ora
*.db_name='dup'
*.db_block_size=8192
*.remote_login_passwordfile='exclusive'
*.db_create_file_dest='/u01/app/oracle/oradata/'
*.db_recovery_file_dest='/u01/app/oracle/fast_recovery_area'
*.db_recovery_file_dest_size=5G
*.compatible='19.0.0'
*.enable_pluggable_database=true
Tip: Use enable_pluggable_database=true only for multitenant setups.
Step 3: Add to /etc/oratab
Add your new database entry:
dup:/u01/app/oracle/product/12.1.0.2/db_3:N
Step 4: Start the Auxiliary Instance in NOMOUNT
. oraenv
ORACLE_SID=dup
sqlplus / as sysdba
SQL> STARTUP NOMOUNT PFILE='$ORACLE_HOME/dbs/initdup.ora';
ORACLE instance started.
Total System Global Area 3221224568 bytes
Fixed Size 8944760 bytes
Variable Size 654311424 bytes
Database Buffers 2550136832 bytes
Redo Buffers 7831552 bytes
You’ll see confirmation that the Oracle instance has started in NOMOUNT mode.
Step 5: Configure tnsnames.ora
Edit your TNS configuration to include both databases:
OEM =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.56.100)(PORT = 1521))
(CONNECT_DATA = (SERVER = DEDICATED)(SERVICE_NAME = oem))
)
DUP =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.56.100)(PORT = 1521))
(CONNECT_DATA = (SERVER = DEDICATED)(SERVICE_NAME = dup))
)
Step 6: Create Password Files
orapwd file=$ORACLE_HOME/dbs/orapwoem password=oracle entries=10
orapwd file=$ORACLE_HOME/dbs/orapwdup password=oracle entries=10
Copy Password file
cp $ORACLE_HOME/dbs/orapwoem $ORACLE_HOME/dbs/orapwdup
Step 7:Static Listener
File: $ORACLE_HOME/network/admin/listener.ora
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = dup)
(ORACLE_HOME = /u01/app/oracle/product/19.0.0/)
(SID_NAME = dup)
)
)
Reload the listener:
lsnrctl reload
lsnrctl status
Step 8: Run the RMAN Duplicate Command
Now comes the exciting part — running the duplication.
rman TARGET sys/oracle@oem AUXILIARY sys/oracle@dup
RMAN> DUPLICATE DATABASE TO DUP FROM ACTIVE DATABASE;
Output
[oracle@prod ~]$ rman target sys/<password>@oem AUXIliary sys/<password>@dup
Recovery Manager: Release 19.0.0.0.0 - Production on Mon Oct 6 08:52:11 2025
Version 19.28.0.0.0
Copyright (c) 1982, 2019, Oracle and/or its affiliates. All rights reserved.
connected to target database: OEM (DBID=3049642149)
connected to auxiliary database: DUP (not mounted)
RMAN> DUPLICATE DATABASE TO DUP FROM ACTIVE DATABASE;
DUPLICATE DATABASE TO DUP FROM ACTIVE DATABASE;
Starting Duplicate Db at 06-OCT-25
using target database control file instead of recovery catalog
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=37 device type=DISK
current log archived
duplicating Online logs to Oracle Managed File (OMF) location
duplicating Datafiles to Oracle Managed File (OMF) location
contents of Memory Script:
{
sql clone "alter system set db_name =
''OEM'' comment=
''Modified by RMAN duplicate'' scope=spfile";
sql clone "alter system set db_unique_name =
''dup'' comment=
''Modified by RMAN duplicate'' scope=spfile";
shutdown clone immediate;
startup clone force nomount
restore clone from service 'oem' primary controlfile;
alter clone database mount;
}
executing Memory Script
sql statement: alter system set db_name = ''OEM'' comment= ''Modified by RMAN duplicate'' scope=spfile
sql statement: alter system set db_unique_name = ''dup'' comment= ''Modified by RMAN duplicate'' scope=spfile
Oracle instance shut down
Oracle instance started
Total System Global Area 3221224568 bytes
Fixed Size 8944760 bytes
Variable Size 654311424 bytes
Database Buffers 2550136832 bytes
Redo Buffers 7831552 bytes
Starting restore at 06-OCT-25
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=35 device type=DISK
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service oem
channel ORA_AUX_DISK_1: restoring control file
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:02
output file name=/u01/app/oracle/oradata/dup/control01.ctl
output file name=/u01/app/oracle/oradata/dup/control02.ctl
Finished restore at 06-OCT-25
database mounted
contents of Memory Script:
{
set newname for clone datafile 1 to new;
set newname for clone datafile 2 to new;
set newname for clone datafile 3 to new;
set newname for clone datafile 4 to new;
set newname for clone datafile 5 to new;
set newname for clone datafile 6 to new;
set newname for clone datafile 7 to new;
restore
from nonsparse from service
'oem' clone database
;
sql 'alter system archive log current';
}
executing Memory Script
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
Starting restore at 06-OCT-25
using channel ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service oem
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00001 to /u01/app/oracle/oradata/DUP/DUP/datafile/o1_mf_system_%u_.dbf
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:16
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service oem
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00002 to /u01/app/oracle/oradata/DUP/DUP/datafile/o1_mf_sysaux_%u_.dbf
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:15
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service oem
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00003 to /u01/app/oracle/oradata/DUP/DUP/datafile/o1_mf_undotbs1_%u_.dbf
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:15
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service oem
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00004 to /u01/app/oracle/oradata/DUP/DUP/datafile/o1_mf_users_%u_.dbf
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:02
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service oem
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00005 to /u01/app/oracle/oradata/DUP/DUP/datafile/o1_mf_mgmt_ad4_%u_.dbf
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:15
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service oem
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00006 to /u01/app/oracle/oradata/DUP/DUP/datafile/o1_mf_mgmt_ecm_%u_.dbf
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service oem
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00007 to /u01/app/oracle/oradata/DUP/DUP/datafile/o1_mf_mgmt_tab_%u_.dbf
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:01:17
Finished restore at 06-OCT-25
sql statement: alter system archive log current
current log archived
contents of Memory Script:
{
restore clone force from service 'oem'
archivelog from scn 8755955;
switch clone datafile all;
}
executing Memory Script
Starting restore at 06-OCT-25
using channel ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: starting archived log restore to default destination
channel ORA_AUX_DISK_1: using network backup set from service oem
channel ORA_AUX_DISK_1: restoring archived log
archived log thread=1 sequence=67
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01
channel ORA_AUX_DISK_1: starting archived log restore to default destination
channel ORA_AUX_DISK_1: using network backup set from service oem
channel ORA_AUX_DISK_1: restoring archived log
archived log thread=1 sequence=68
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01
Finished restore at 06-OCT-25
datafile 1 switched to datafile copy
input datafile copy RECID=8 STAMP=1213779374 file name=/u01/app/oracle/oradata/DUP/DUP/datafile/o1_mf_system_ng6fl7c4_.dbf
datafile 2 switched to datafile copy
input datafile copy RECID=9 STAMP=1213779375 file name=/u01/app/oracle/oradata/DUP/DUP/datafile/o1_mf_sysaux_ng6flpy0_.dbf
datafile 3 switched to datafile copy
input datafile copy RECID=10 STAMP=1213779375 file name=/u01/app/oracle/oradata/DUP/DUP/datafile/o1_mf_undotbs1_ng6fm5vn_.dbf
datafile 4 switched to datafile copy
input datafile copy RECID=11 STAMP=1213779375 file name=/u01/app/oracle/oradata/DUP/DUP/datafile/o1_mf_users_ng6fmo1z_.dbf
datafile 5 switched to datafile copy
input datafile copy RECID=12 STAMP=1213779375 file name=/u01/app/oracle/oradata/DUP/DUP/datafile/o1_mf_mgmt_ad4_ng6fmp4r_.dbf
datafile 6 switched to datafile copy
input datafile copy RECID=13 STAMP=1213779375 file name=/u01/app/oracle/oradata/DUP/DUP/datafile/o1_mf_mgmt_ecm_ng6fn58w_.dbf
datafile 7 switched to datafile copy
input datafile copy RECID=14 STAMP=1213779375 file name=/u01/app/oracle/oradata/DUP/DUP/datafile/o1_mf_mgmt_tab_ng6fn6w4_.dbf
contents of Memory Script:
{
set until scn 8756732;
recover
clone database
delete archivelog
;
}
executing Memory Script
executing command: SET until clause
Starting recover at 06-OCT-25
using channel ORA_AUX_DISK_1
starting media recovery
archived log for thread 1 with sequence 67 is already on disk as file /u01/app/oracle/oradata/DUP/FRA/DUP/archivelog/2025_10_06/o1_mf_1_67_ng6fpnwo_.arc
archived log for thread 1 with sequence 68 is already on disk as file /u01/app/oracle/oradata/DUP/FRA/DUP/archivelog/2025_10_06/o1_mf_1_68_ng6fpovv_.arc
archived log file name=/u01/app/oracle/oradata/DUP/FRA/DUP/archivelog/2025_10_06/o1_mf_1_67_ng6fpnwo_.arc thread=1 sequence=67
archived log file name=/u01/app/oracle/oradata/DUP/FRA/DUP/archivelog/2025_10_06/o1_mf_1_68_ng6fpovv_.arc thread=1 sequence=68
media recovery complete, elapsed time: 00:00:01
Finished recover at 06-OCT-25
contents of Memory Script:
{
delete clone force archivelog all;
}
executing Memory Script
released channel: ORA_AUX_DISK_1
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=82 device type=DISK
deleted archived log
archived log file name=/u01/app/oracle/oradata/DUP/FRA/DUP/archivelog/2025_10_06/o1_mf_1_67_ng6fpnwo_.arc RECID=1 STAMP=1213779373
deleted archived log
archived log file name=/u01/app/oracle/oradata/DUP/FRA/DUP/archivelog/2025_10_06/o1_mf_1_68_ng6fpovv_.arc RECID=2 STAMP=1213779373
Deleted 2 objects
Oracle instance started
Total System Global Area 3221224568 bytes
Fixed Size 8944760 bytes
Variable Size 654311424 bytes
Database Buffers 2550136832 bytes
Redo Buffers 7831552 bytes
contents of Memory Script:
{
sql clone "alter system set db_name =
''DUP'' comment=
''Reset to original value by RMAN'' scope=spfile";
sql clone "alter system reset db_unique_name scope=spfile";
}
executing Memory Script
sql statement: alter system set db_name = ''DUP'' comment= ''Reset to original value by RMAN'' scope=spfile
sql statement: alter system reset db_unique_name scope=spfile
Oracle instance started
Total System Global Area 3221224568 bytes
Fixed Size 8944760 bytes
Variable Size 654311424 bytes
Database Buffers 2550136832 bytes
Redo Buffers 7831552 bytes
sql statement: CREATE CONTROLFILE REUSE SET DATABASE "DUP" RESETLOGS ARCHIVELOG
MAXLOGFILES 16
MAXLOGMEMBERS 3
MAXDATAFILES 100
MAXINSTANCES 8
MAXLOGHISTORY 292
LOGFILE
GROUP 1 SIZE 290 M ,
GROUP 2 SIZE 290 M ,
GROUP 3 SIZE 290 M
DATAFILE
'/u01/app/oracle/oradata/DUP/DUP/datafile/o1_mf_system_ng6fl7c4_.dbf'
CHARACTER SET AL32UTF8
contents of Memory Script:
{
set newname for clone tempfile 1 to new;
switch clone tempfile all;
catalog clone datafilecopy "/u01/app/oracle/oradata/DUP/DUP/datafile/o1_mf_sysaux_ng6flpy0_.dbf",
"/u01/app/oracle/oradata/DUP/DUP/datafile/o1_mf_undotbs1_ng6fm5vn_.dbf",
"/u01/app/oracle/oradata/DUP/DUP/datafile/o1_mf_users_ng6fmo1z_.dbf",
"/u01/app/oracle/oradata/DUP/DUP/datafile/o1_mf_mgmt_ad4_ng6fmp4r_.dbf",
"/u01/app/oracle/oradata/DUP/DUP/datafile/o1_mf_mgmt_ecm_ng6fn58w_.dbf",
"/u01/app/oracle/oradata/DUP/DUP/datafile/o1_mf_mgmt_tab_ng6fn6w4_.dbf";
switch clone datafile all;
}
executing Memory Script
executing command: SET NEWNAME
renamed tempfile 1 to /u01/app/oracle/oradata/DUP/DUP/datafile/o1_mf_temp_%u_.tmp in control file
cataloged datafile copy
datafile copy file name=/u01/app/oracle/oradata/DUP/DUP/datafile/o1_mf_sysaux_ng6flpy0_.dbf RECID=1 STAMP=1213779481
cataloged datafile copy
datafile copy file name=/u01/app/oracle/oradata/DUP/DUP/datafile/o1_mf_undotbs1_ng6fm5vn_.dbf RECID=2 STAMP=1213779481
cataloged datafile copy
datafile copy file name=/u01/app/oracle/oradata/DUP/DUP/datafile/o1_mf_users_ng6fmo1z_.dbf RECID=3 STAMP=1213779481
cataloged datafile copy
datafile copy file name=/u01/app/oracle/oradata/DUP/DUP/datafile/o1_mf_mgmt_ad4_ng6fmp4r_.dbf RECID=4 STAMP=1213779481
cataloged datafile copy
datafile copy file name=/u01/app/oracle/oradata/DUP/DUP/datafile/o1_mf_mgmt_ecm_ng6fn58w_.dbf RECID=5 STAMP=1213779481
cataloged datafile copy
datafile copy file name=/u01/app/oracle/oradata/DUP/DUP/datafile/o1_mf_mgmt_tab_ng6fn6w4_.dbf RECID=6 STAMP=1213779481
datafile 2 switched to datafile copy
input datafile copy RECID=1 STAMP=1213779481 file name=/u01/app/oracle/oradata/DUP/DUP/datafile/o1_mf_sysaux_ng6flpy0_.dbf
datafile 3 switched to datafile copy
input datafile copy RECID=2 STAMP=1213779481 file name=/u01/app/oracle/oradata/DUP/DUP/datafile/o1_mf_undotbs1_ng6fm5vn_.dbf
datafile 4 switched to datafile copy
input datafile copy RECID=3 STAMP=1213779481 file name=/u01/app/oracle/oradata/DUP/DUP/datafile/o1_mf_users_ng6fmo1z_.dbf
datafile 5 switched to datafile copy
input datafile copy RECID=4 STAMP=1213779481 file name=/u01/app/oracle/oradata/DUP/DUP/datafile/o1_mf_mgmt_ad4_ng6fmp4r_.dbf
datafile 6 switched to datafile copy
input datafile copy RECID=5 STAMP=1213779481 file name=/u01/app/oracle/oradata/DUP/DUP/datafile/o1_mf_mgmt_ecm_ng6fn58w_.dbf
datafile 7 switched to datafile copy
input datafile copy RECID=6 STAMP=1213779481 file name=/u01/app/oracle/oradata/DUP/DUP/datafile/o1_mf_mgmt_tab_ng6fn6w4_.dbf
contents of Memory Script:
{
Alter clone database open resetlogs;
}
executing Memory Script
database opened
Finished Duplicate Db at 06-OCT-25
RMAN will:
- Create SPFILE from memory
- Restore control files and datafiles via network
- Recover and open the database with RESETLOGS
- Open all pluggable databases (if applicable)
The process can take a few minutes to hours depending on database size.
Step 9: Verify the Duplicate Database
After RMAN completes, log in to the new database:
SQL> SELECT name, open_mode FROM v$database;
SQL> SELECT name FROM v$datafile;
SQL> SELECT member FROM v$logfile;
SQL> SELECT name FROM v$controlfile;
You should see DUP5 open in READ WRITE mode with its own set of datafiles, control files, and redo logs.
Troubleshooting Common Issues
| Issue | Cause | Fix |
|---|---|---|
| ORA-12528 | Listener blocked new connections | Add static SID and reload listener |
| Password mismatch | Different password file entries | Recreate password files on both SIDs |
| File name conflicts | Same file destinations | Use OMF or NOFILENAMECHECK parameter |
| SPFILE issues | Missing spfile entry | Include SPFILE clause in RMAN command |
Best Practices for RMAN Duplication
- Always test on a lower environment before duplicating production databases.
- Use OMF (Oracle Managed Files) to simplify path management.
- Keep listener logs and alert logs open in separate terminals to monitor progress.
- In large databases, prefer
USING BACKUPSETto reduce memory usage. - After duplication, update parameters like:
ALTER SYSTEM SET DB_UNIQUE_NAME='dup' SCOPE=SPFILE;
Final Thoughts
Duplicating an Oracle database using RMAN’s Active Database feature is a powerful and efficient way to clone databases without downtime or complex backup steps. Once you master this, you can easily create standby setups, test instances, or refresh dev environments in a few commands.
With a properly configured listener, password files, and parameter setup, the duplication process becomes almost fully automated — saving hours of manual work for DBAs.
Whether you’re managing a single instance or a clustered environment, RMAN Duplicate gives you speed, control, and consistency — key pillars of modern Oracle database administration.





Comments 1