Skip to main content

Oracle RMAN Duplicate: Active vs Backup-Based Guide

Oracle RMAN Duplicate utility overview diagram

Introduction

The RMAN DUPLICATE command is a built-in utility in Oracle that lets us create a copy of an existing database. It's commonly used for testing, reporting, or setting up a standby database for disaster recovery. Unlike manual duplication methods, RMAN simplifies the process by automatically handling tasks such as creating control files, assigning a new database identifier (DBID), and applying recovery to keep the cloned database consistent. In this article, we'll use the RMAN Duplicate utility for cloning and restoring a target database.

Two Main Types of Duplication

  1. Active Duplication: This method copies the database directly from the running source database to the destination over the network. It doesn't rely on existing backups, and works well when the source database is accessible and network performance is sufficient.
  2. Backup-Based Duplication: This approach uses previously created RMAN backups (stored on disk or tape) to duplicate the database. It's especially useful when the source database is unavailable or when network bandwidth is limited.

Prerequisites

  • Connectivity between the source and target database servers (required for Active Duplication).
  • A valid RMAN backup (required for Backup-Based Duplication).

Environment Used in This Guide

These are the source and target databases used throughout this walkthrough. Swap them for your own hostnames and database names, just keep the same values consistent across every step below.

Source Database
Hostname srcdb.oraeasy.com
Database Name SRCDB
Database Version 19c (19.28)

Target Database
Hostname trcdb.oraeasy.com
Database Name TRCDB & TRCDB2
Database Version 19c (19.28)

Summary of Activities

We'll walk through both duplication methods below:

Active Duplication

Step 1: Create a Test Table at the Source

Before duplicating, we create a small table at the source database so we have a simple way to confirm the data made it across after duplication completes.


SQL> def
DEFINE _DATE           = "24-MAR-26" (CHAR)
DEFINE _CONNECT_IDENTIFIER = "srcdb" (CHAR)
DEFINE _USER           = "SYS" (CHAR)
DEFINE _PRIVILEGE      = "AS SYSDBA" (CHAR)
DEFINE _SQLPLUS_RELEASE = "1928000000" (CHAR)
DEFINE _EDITOR         = "vi" (CHAR)
DEFINE _O_VERSION      = "Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.28.0.0.0" (CHAR)
DEFINE _O_RELEASE      = "1928000000" (CHAR)
SQL>
SQL> select name,open_mode from v$database;

NAME      OPEN_MODE
--------- --------------------
SRCDB     READ WRITE

SQL> show pdbs

    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         2 PDB$SEED                       READ ONLY  NO
         3 ORPDB                          READ WRITE NO
         
SQL> alter session set container=ORPDB;

Session altered.

SQL> CREATE TABLE COMPANY (EMP_ID INT,NAME VARCHAR(255), COMPANY VARCHAR(255));

Table created.

SQL> INSERT INTO COMPANY VALUES (101,'Yash','WIPRO');

1 row created.

SQL> INSERT INTO COMPANY VALUES (102,'Vijay','AIRTEL');

1 row created.

SQL> INSERT INTO COMPANY VALUES (103,'Riya','TCS');

1 row created.

SQL> commit;

Commit complete.

SQL> select count(*) from COMPANY;

  COUNT(*)
----------
         3

Step 2: Configure Networking on the Target Server

Active duplication connects to the source database live over the network, so the target server needs correct listener and TNS entries for both databases before we can proceed. Getting this wrong is one of the most common reasons an active duplicate fails to even start.

 
[oracle@trcdb ~]$ cat /u01/app/oracle/product/19c/dbhome_1/network/admin/listener.ora
# listener.ora Network Configuration File: /u01/app/oracle/product/19c/dbhome_1/network/admin/listener.ora
# Generated by Oracle configuration tools.

LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = trcdb.oraeasy.com)(PORT = 1521))
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
    )
  )

SID_LIST_LISTENER =
   (SID_LIST =
      (SID_DESC = (GLOBAL_DBNAME =  trcdb)
                  (ORACLE_HOME = /u01/app/oracle/product/19c/dbhome_1)
                  (SID_NAME =  trcdb)
       )
    )
[oracle@trcdb ~]$

[oracle@trcdb ~]$ cat /u01/app/oracle/product/19c/dbhome_1/network/admin/tnsnames.ora
# tnsnames.ora Network Configuration File: /u01/app/oracle/product/19c/dbhome_1/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.

SRCDB =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = srcdb.oraeasy.com)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = srcdb)
    )
  )


TRCDB =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = trcdb.oraeasy.com)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = trcdb)
    )
  )

[oracle@trcdb ~]$
[oracle@trcdb ~]$ lsnrctl status

LSNRCTL for Linux: Version 19.0.0.0.0 - Production on 24-MAR-2026 21:30:44

Copyright (c) 1991, 2025, Oracle.  All rights reserved.

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=trcdb.oraeasy.com)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 19.0.0.0.0 - Production
Start Date                24-MAR-2026 21:09:54
Uptime                    0 days 0 hr. 20 min. 49 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u01/app/oracle/product/19c/dbhome_1/network/admin/listener.ora
Listener Log File         /u01/app/oracle/diag/tnslsnr/trcdb/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=trcdb.oraeasy.com)(PORT=1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
Services Summary...
Service "trcdb" has 1 instance(s).
  Instance "trcdb", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully

[oracle@trcdb ~]$ tnsping srcdb

TNS Ping Utility for Linux: Version 19.0.0.0.0 - Production on 26-MAR-2026 20:02:26

Copyright (c) 1997, 2025, Oracle.  All rights reserved.

Used parameter files:

Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = srcdb.oraeasy.com)(PORT = 1521))) (CONNECT_DATA = (SERVICE_NAME = srcdb)))
OK (0 msec)
[oracle@trcdb ~]$

The tnsping test confirms the target server can reach the source database over the network. If this fails, nothing past this point will work, so it's worth fixing here before moving on.

Step 3: Create Directories, Parameter File, and Password File on the Target

The target instance needs its own directory structure, a parameter file to start it in nomount mode, and a password file so RMAN can authenticate as SYSDBA.

 
Create Directories:
[oracle@trcdb ~]$ mkdir -p /u01/app/oracle/admin/trcdb/adump [oracle@trcdb ~]$ mkdir -p /u01/app/oracle/oradata/TRCDB/ [oracle@trcdb ~]$ mkdir -p /u01/app/oracle/fast_recovery_area/TRCDB [oracle@trcdb ~]$ mkdir -p /u01/app/oracle/oradata/TRCDB/orpdb/ Parameter file (pfile):
[oracle@trcdb ~]$ cat /u01/app/oracle/product/19c/dbhome_1/dbs/inittrcdb.ora db_name=trcdb db_block_size=8192 remote_login_passwordfile=EXCLUSIVE audit_file_dest='/u01/app/oracle/admin/trcdb/adump' [oracle@trcdb ~]$ Password file:
[oracle@trcdb ~]$ orapwd file=/u01/app/oracle/product/19c/dbhome_1/dbs/orapwtrcdb entries=15 password=sys format=12

Step 4: Start the Target Instance in Nomount Mode

The target database can't be mounted yet since it has no control file of its own. Starting it in nomount mode is enough to let RMAN connect to it as an auxiliary instance in the next step.

  
[oracle@trcdb ~]$ . oraenv
ORACLE_SID = [oracle] ? trcdb
ORACLE_HOME = [/home/oracle] ? /u01/app/oracle/product/19c/dbhome_1
The Oracle base remains unchanged with value /u01/app/oracle
[oracle@trcdb ~]$
[oracle@trcdb ~]$ sqlplus / as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Tue Mar 24 21:29:37 2026
Version 19.28.0.0.0

Copyright (c) 1982, 2025, Oracle.  All rights reserved.

Connected to an idle instance.

SQL> def
DEFINE _DATE           = "24-MAR-26" (CHAR)
DEFINE _CONNECT_IDENTIFIER = "trcdb" (CHAR)
DEFINE _USER           = "SYS" (CHAR)
DEFINE _PRIVILEGE      = "AS SYSDBA" (CHAR)
DEFINE _SQLPLUS_RELEASE = "1928000000" (CHAR)
DEFINE _EDITOR         = "vi" (CHAR)
DEFINE _O_VERSION      = "" (CHAR)
DEFINE _O_RELEASE      = "" (CHAR)
SQL>

SQL> startup nomount pfile='/u01/app/oracle/product/19c/dbhome_1/dbs/inittrcdb.ora';
ORACLE instance started.

Total System Global Area  343930632 bytes
Fixed Size                  8939272 bytes
Variable Size             260046848 bytes
Database Buffers           67108864 bytes
Redo Buffers                7835648 bytes
SQL>

Step 5: Connect RMAN to the Target and Auxiliary Databases

RMAN needs to be connected to both databases at once for active duplication: the source as the "target" and the destination as the "auxiliary."


[oracle@trcdb ~]$ rman TARGET sys/sys@srcdb AUXILIARY sys/sys@trcdb

Recovery Manager: Release 19.0.0.0.0 - Production on Tue Mar 24 21:54:16 2026
Version 19.28.0.0.0

Copyright (c) 1982, 2019, Oracle and/or its affiliates.  All rights reserved.

connected to target database: SRCDB (DBID=858479241)
connected to auxiliary database: TRCDB (not mounted)

RMAN>

Step 6: Run the Active Duplication Script

This is the core step. The DUPLICATE ... FROM ACTIVE DATABASE command streams the source database's files directly to the target over the network, no backup files needed. A few parameters worth understanding:

  • DB_FILE_NAME_CONVERT and LOG_FILE_NAME_CONVERT remap the source's file paths to the target's paths, since the two servers use different directory structures here.
  • CONTROL_FILES tells RMAN where to place the new control file on the target.
  • NOFILENAMECHECK skips a safety check that would otherwise block duplication when source and target share the same hostname or file paths. Use this cautiously, it's meant for cases like this one where source and target are genuinely different databases.

RMAN> DUPLICATE TARGET DATABASE TO 'trcdb'
  FROM ACTIVE DATABASE
  SPFILE
    SET DB_FILE_NAME_CONVERT='/u01/app/oracle/oradata/SRCDB/','/u01/app/oracle/oradata/TRCDB/'
    SET LOG_FILE_NAME_CONVERT='/u01/app/oracle/oradata/SRCDB/','/u01/app/oracle/oradata/TRCDB/'
    SET CONTROL_FILES='/u01/app/oracle/oradata/TRCDB/control01.ctl'
    SET AUDIT_FILE_DEST='/u01/app/oracle/admin/trcdb/adump'
    SET DB_RECOVERY_FILE_DEST_SIZE='15G'
    SET DB_RECOVERY_FILE_DEST='/u01/app/oracle/fast_recovery_area/TRCDB'
  NOFILENAMECHECK;
  
  DUPLICATE TARGET DATABASE TO 'trcdb'
2>   FROM ACTIVE DATABASE
3>   SPFILE
4>     SET DB_FILE_NAME_CONVERT='/u01/app/oracle/oradata/SRCDB/','/u01/app/oracle/oradata/TRCDB/'
5>     SET LOG_FILE_NAME_CONVERT='/u01/app/oracle/oradata/SRCDB/','/u01/app/oracle/oradata/TRCDB/'
6>     SET CONTROL_FILES='/u01/app/oracle/oradata/TRCDB/control01.ctl'
7>      SET AUDIT_FILE_DEST='/u01/app/oracle/admin/trcdb/adump'
8>     SET DB_RECOVERY_FILE_DEST_SIZE='15G'
9>     SET DB_RECOVERY_FILE_DEST='/u01/app/oracle/fast_recovery_area/TRCDB'
10>  NOFILENAMECHECK;

Starting Duplicate Db at 24-MAR-26
using target database control file instead of recovery catalog
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=10 device type=DISK
current log archived

contents of Memory Script:
{
   restore clone from service  'srcdb' spfile to
 '/u01/app/oracle/product/19c/dbhome_1/dbs/spfiletrcdb.ora';
   sql clone "alter system set spfile= ''/u01/app/oracle/product/19c/dbhome_1/dbs/spfiletrcdb.ora''";
}
executing Memory Script

Starting restore at 24-MAR-26
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 srcdb
channel ORA_AUX_DISK_1: restoring SPFILE
output file name=/u01/app/oracle/product/19c/dbhome_1/dbs/spfiletrcdb.ora
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01
Finished restore at 24-MAR-26

sql statement: alter system set spfile= ''/u01/app/oracle/product/19c/dbhome_1/dbs/spfiletrcdb.ora''

contents of Memory Script:
{
   sql clone "alter system set  db_name =
 ''TRCDB'' comment=
 ''duplicate'' scope=spfile";
   sql clone "alter system set  db_file_name_convert =
 ''/u01/app/oracle/oradata/SRCDB/'', ''/u01/app/oracle/oradata/TRCDB/'' comment=
 '''' scope=spfile";
   sql clone "alter system set  LOG_FILE_NAME_CONVERT =
 ''/u01/app/oracle/oradata/SRCDB/'', ''/u01/app/oracle/oradata/TRCDB/'' comment=
 '''' scope=spfile";
   sql clone "alter system set  CONTROL_FILES =
 ''/u01/app/oracle/oradata/TRCDB/control01.ctl'' comment=
 '''' scope=spfile";
   sql clone "alter system set  AUDIT_FILE_DEST =
 ''/u01/app/oracle/admin/trcdb/adump'' comment=
 '''' scope=spfile";
   sql clone "alter system set  DB_RECOVERY_FILE_DEST_SIZE =
 15G comment=
 '''' scope=spfile";
   sql clone "alter system set  db_recovery_file_dest =
 ''/u01/app/oracle/fast_recovery_area/TRCDB'' comment=
 '''' scope=spfile";
   shutdown clone immediate;
   startup clone nomount;
}
executing Memory Script

sql statement: alter system set  db_name =  ''TRCDB'' comment= ''duplicate'' scope=spfile

sql statement: alter system set  db_file_name_convert =  ''/u01/app/oracle/oradata/SRCDB/'', ''/u01/app/oracle/oradata/TRCDB/'' comment= '''' scope=spfile

sql statement: alter system set  LOG_FILE_NAME_CONVERT =  ''/u01/app/oracle/oradata/SRCDB/'', ''/u01/app/oracle/oradata/TRCDB/'' comment= '''' scope=spfile

sql statement: alter system set  CONTROL_FILES =  ''/u01/app/oracle/oradata/TRCDB/control01.ctl'' comment= '''' scope=spfile

sql statement: alter system set  AUDIT_FILE_DEST =  ''/u01/app/oracle/admin/trcdb/adump'' comment= '''' scope=spfile

sql statement: alter system set  DB_RECOVERY_FILE_DEST_SIZE =  15G comment= '''' scope=spfile

sql statement: alter system set  db_recovery_file_dest =  ''/u01/app/oracle/fast_recovery_area/TRCDB'' comment= '''' scope=spfile

Oracle instance shut down

connected to auxiliary database (not started)
Oracle instance started

Total System Global Area    1962930480 bytes

Fixed Size                     9179440 bytes
Variable Size               1107296256 bytes
Database Buffers             838860800 bytes
Redo Buffers                   7593984 bytes

contents of Memory Script:
{
   sql clone "alter system set  db_name =
 ''SRCDB'' comment=
 ''Modified by RMAN duplicate'' scope=spfile";
   sql clone "alter system set  db_unique_name =
 ''TRCDB'' comment=
 ''Modified by RMAN duplicate'' scope=spfile";
   shutdown clone immediate;
   startup clone force nomount
   restore clone from service  'srcdb' primary controlfile;
   alter clone database mount;
}
executing Memory Script

sql statement: alter system set  db_name =  ''SRCDB'' comment= ''Modified by RMAN duplicate'' scope=spfile

sql statement: alter system set  db_unique_name =  ''TRCDB'' comment= ''Modified by RMAN duplicate'' scope=spfile

Oracle instance shut down

Oracle instance started

Total System Global Area    1962930480 bytes

Fixed Size                     9179440 bytes
Variable Size               1107296256 bytes
Database Buffers             838860800 bytes
Redo Buffers                   7593984 bytes

Starting restore at 24-MAR-26
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=263 device type=DISK

channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service srcdb
channel ORA_AUX_DISK_1: restoring control file
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:04
output file name=/u01/app/oracle/oradata/TRCDB/control01.ctl
Finished restore at 24-MAR-26

database mounted

contents of Memory Script:
{
   set newname for datafile  1 to
 "/u01/app/oracle/oradata/TRCDB/system01.dbf";
   set newname for datafile  3 to
 "/u01/app/oracle/oradata/TRCDB/sysaux01.dbf";
   set newname for datafile  4 to
 "/u01/app/oracle/oradata/TRCDB/undotbs01.dbf";
   set newname for datafile  5 to
 "/u01/app/oracle/oradata/TRCDB/pdbseed/system01.dbf";
   set newname for datafile  6 to
 "/u01/app/oracle/oradata/TRCDB/pdbseed/sysaux01.dbf";
   set newname for datafile  7 to
 "/u01/app/oracle/oradata/TRCDB/users01.dbf";
   set newname for datafile  8 to
 "/u01/app/oracle/oradata/TRCDB/pdbseed/undotbs01.dbf";
   set newname for datafile  9 to
 "/u01/app/oracle/oradata/TRCDB/orpdb/system01.dbf";
   set newname for datafile  10 to
 "/u01/app/oracle/oradata/TRCDB/orpdb/sysaux01.dbf";
   set newname for datafile  11 to
 "/u01/app/oracle/oradata/TRCDB/orpdb/undotbs01.dbf";
   set newname for datafile  12 to
 "/u01/app/oracle/oradata/TRCDB/orpdb/users01.dbf";
   restore
   from  nonsparse   from service
 'srcdb'   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

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

Starting restore at 24-MAR-26
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 srcdb
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/TRCDB/system01.dbf
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:01:35
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service srcdb
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/TRCDB/sysaux01.dbf
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:01:15
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service srcdb
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/TRCDB/undotbs01.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 srcdb
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/TRCDB/pdbseed/system01.dbf
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:45
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service srcdb
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/TRCDB/pdbseed/sysaux01.dbf
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:46
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service srcdb
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/TRCDB/users01.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 srcdb
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00008 to /u01/app/oracle/oradata/TRCDB/pdbseed/undotbs01.dbf
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:35
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service srcdb
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00009 to /u01/app/oracle/oradata/TRCDB/orpdb/system01.dbf
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:46
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service srcdb
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00010 to /u01/app/oracle/oradata/TRCDB/orpdb/sysaux01.dbf
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:45
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service srcdb
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00011 to /u01/app/oracle/oradata/TRCDB/orpdb/undotbs01.dbf
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:08
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service srcdb
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00012 to /u01/app/oracle/oradata/TRCDB/orpdb/users01.dbf
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01
Finished restore at 24-MAR-26

sql statement: alter system archive log current
current log archived

contents of Memory Script:
{
   restore clone force from service  'srcdb'
           archivelog from scn  2599276;
   switch clone datafile all;
}
executing Memory Script

Starting restore at 24-MAR-26
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 srcdb
channel ORA_AUX_DISK_1: restoring archived log
archived log thread=1 sequence=21
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:07
channel ORA_AUX_DISK_1: starting archived log restore to default destination
channel ORA_AUX_DISK_1: using network backup set from service srcdb
channel ORA_AUX_DISK_1: restoring archived log
archived log thread=1 sequence=22
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01
Finished restore at 24-MAR-26

datafile 1 switched to datafile copy
input datafile copy RECID=15 STAMP=1228774056 file name=/u01/app/oracle/oradata/TRCDB/system01.dbf
datafile 3 switched to datafile copy
input datafile copy RECID=16 STAMP=1228774056 file name=/u01/app/oracle/oradata/TRCDB/sysaux01.dbf
datafile 4 switched to datafile copy
input datafile copy RECID=17 STAMP=1228774056 file name=/u01/app/oracle/oradata/TRCDB/undotbs01.dbf
datafile 5 switched to datafile copy
input datafile copy RECID=18 STAMP=1228774056 file name=/u01/app/oracle/oradata/TRCDB/pdbseed/system01.dbf
datafile 6 switched to datafile copy
input datafile copy RECID=19 STAMP=1228774057 file name=/u01/app/oracle/oradata/TRCDB/pdbseed/sysaux01.dbf
datafile 7 switched to datafile copy
input datafile copy RECID=20 STAMP=1228774057 file name=/u01/app/oracle/oradata/TRCDB/users01.dbf
datafile 8 switched to datafile copy
input datafile copy RECID=21 STAMP=1228774057 file name=/u01/app/oracle/oradata/TRCDB/pdbseed/undotbs01.dbf
datafile 9 switched to datafile copy
input datafile copy RECID=22 STAMP=1228774057 file name=/u01/app/oracle/oradata/TRCDB/orpdb/system01.dbf
datafile 10 switched to datafile copy
input datafile copy RECID=23 STAMP=1228774057 file name=/u01/app/oracle/oradata/TRCDB/orpdb/sysaux01.dbf
datafile 11 switched to datafile copy
input datafile copy RECID=24 STAMP=1228774057 file name=/u01/app/oracle/oradata/TRCDB/orpdb/undotbs01.dbf
datafile 12 switched to datafile copy
input datafile copy RECID=25 STAMP=1228774057 file name=/u01/app/oracle/oradata/TRCDB/orpdb/users01.dbf

contents of Memory Script:
{
   set until scn  2612859;
   recover
   clone database
    delete archivelog
   ;
}
executing Memory Script

executing command: SET until clause

Starting recover at 24-MAR-26
using channel ORA_AUX_DISK_1

starting media recovery

archived log for thread 1 with sequence 21 is already on disk as file /u01/app/oracle/fast_recovery_area/TRCDB/TRCDB/archivelog/2026_03_24/o1_mf_1_21_nw5hg89j_.arc
archived log for thread 1 with sequence 22 is already on disk as file /u01/app/oracle/fast_recovery_area/TRCDB/TRCDB/archivelog/2026_03_24/o1_mf_1_22_nw5hghcx_.arc
archived log file name=/u01/app/oracle/fast_recovery_area/TRCDB/TRCDB/archivelog/2026_03_24/o1_mf_1_21_nw5hg89j_.arc thread=1 sequence=21
archived log file name=/u01/app/oracle/fast_recovery_area/TRCDB/TRCDB/archivelog/2026_03_24/o1_mf_1_22_nw5hghcx_.arc thread=1 sequence=22
media recovery complete, elapsed time: 00:00:04
Finished recover at 24-MAR-26

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=134 device type=DISK
deleted archived log
archived log file name=/u01/app/oracle/fast_recovery_area/TRCDB/TRCDB/archivelog/2026_03_24/o1_mf_1_21_nw5hg89j_.arc RECID=1 STAMP=1228774052
deleted archived log
archived log file name=/u01/app/oracle/fast_recovery_area/TRCDB/TRCDB/archivelog/2026_03_24/o1_mf_1_22_nw5hghcx_.arc RECID=2 STAMP=1228774055
Deleted 2 objects

Oracle instance started

Total System Global Area    1962930480 bytes

Fixed Size                     9179440 bytes
Variable Size               1107296256 bytes
Database Buffers             838860800 bytes
Redo Buffers                   7593984 bytes

contents of Memory Script:
{
   sql clone "alter system set  db_name =
 ''TRCDB'' 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 =  ''TRCDB'' 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    1962930480 bytes

Fixed Size                     9179440 bytes
Variable Size               1107296256 bytes
Database Buffers             838860800 bytes
Redo Buffers                   7593984 bytes
sql statement: CREATE CONTROLFILE REUSE SET DATABASE "TRCDB" RESETLOGS ARCHIVELOG
  MAXLOGFILES     16
  MAXLOGMEMBERS      3
  MAXDATAFILES     1024
  MAXINSTANCES     8
  MAXLOGHISTORY      292
 LOGFILE
  GROUP     1 ( '/u01/app/oracle/oradata/TRCDB/redo01.log' ) SIZE 200 M  REUSE,
  GROUP     2 ( '/u01/app/oracle/oradata/TRCDB/redo02.log' ) SIZE 200 M  REUSE,
  GROUP     3 ( '/u01/app/oracle/oradata/TRCDB/redo03.log' ) SIZE 200 M  REUSE
 DATAFILE
  '/u01/app/oracle/oradata/TRCDB/system01.dbf',
  '/u01/app/oracle/oradata/TRCDB/pdbseed/system01.dbf',
  '/u01/app/oracle/oradata/TRCDB/orpdb/system01.dbf'
 CHARACTER SET AL32UTF8

contents of Memory Script:
{
   set newname for tempfile  1 to
 "/u01/app/oracle/oradata/TRCDB/temp01.dbf";
   set newname for tempfile  2 to
 "/u01/app/oracle/oradata/TRCDB/pdbseed/temp012026-02-07_23-22-00-878-PM.dbf";
   set newname for tempfile  3 to
 "/u01/app/oracle/oradata/TRCDB/orpdb/temp01.dbf";
   switch clone tempfile all;
   catalog clone datafilecopy  "/u01/app/oracle/oradata/TRCDB/sysaux01.dbf",
 "/u01/app/oracle/oradata/TRCDB/undotbs01.dbf",
 "/u01/app/oracle/oradata/TRCDB/pdbseed/sysaux01.dbf",
 "/u01/app/oracle/oradata/TRCDB/users01.dbf",
 "/u01/app/oracle/oradata/TRCDB/pdbseed/undotbs01.dbf",
 "/u01/app/oracle/oradata/TRCDB/orpdb/sysaux01.dbf",
 "/u01/app/oracle/oradata/TRCDB/orpdb/undotbs01.dbf",
 "/u01/app/oracle/oradata/TRCDB/orpdb/users01.dbf";
   switch clone datafile all;
}
executing Memory Script

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

renamed tempfile 1 to /u01/app/oracle/oradata/TRCDB/temp01.dbf in control file
renamed tempfile 2 to /u01/app/oracle/oradata/TRCDB/pdbseed/temp012026-02-07_23-22-00-878-PM.dbf in control file
renamed tempfile 3 to /u01/app/oracle/oradata/TRCDB/orpdb/temp01.dbf in control file

cataloged datafile copy
datafile copy file name=/u01/app/oracle/oradata/TRCDB/sysaux01.dbf RECID=1 STAMP=1228774125
cataloged datafile copy
datafile copy file name=/u01/app/oracle/oradata/TRCDB/undotbs01.dbf RECID=2 STAMP=1228774125
cataloged datafile copy
datafile copy file name=/u01/app/oracle/oradata/TRCDB/pdbseed/sysaux01.dbf RECID=3 STAMP=1228774125
cataloged datafile copy
datafile copy file name=/u01/app/oracle/oradata/TRCDB/users01.dbf RECID=4 STAMP=1228774125
cataloged datafile copy
datafile copy file name=/u01/app/oracle/oradata/TRCDB/pdbseed/undotbs01.dbf RECID=5 STAMP=1228774125
cataloged datafile copy
datafile copy file name=/u01/app/oracle/oradata/TRCDB/orpdb/sysaux01.dbf RECID=6 STAMP=1228774125
cataloged datafile copy
datafile copy file name=/u01/app/oracle/oradata/TRCDB/orpdb/undotbs01.dbf RECID=7 STAMP=1228774125
cataloged datafile copy
datafile copy file name=/u01/app/oracle/oradata/TRCDB/orpdb/users01.dbf RECID=8 STAMP=1228774125

datafile 3 switched to datafile copy
input datafile copy RECID=1 STAMP=1228774125 file name=/u01/app/oracle/oradata/TRCDB/sysaux01.dbf
datafile 4 switched to datafile copy
input datafile copy RECID=2 STAMP=1228774125 file name=/u01/app/oracle/oradata/TRCDB/undotbs01.dbf
datafile 6 switched to datafile copy
input datafile copy RECID=3 STAMP=1228774125 file name=/u01/app/oracle/oradata/TRCDB/pdbseed/sysaux01.dbf
datafile 7 switched to datafile copy
input datafile copy RECID=4 STAMP=1228774125 file name=/u01/app/oracle/oradata/TRCDB/users01.dbf
datafile 8 switched to datafile copy
input datafile copy RECID=5 STAMP=1228774125 file name=/u01/app/oracle/oradata/TRCDB/pdbseed/undotbs01.dbf
datafile 10 switched to datafile copy
input datafile copy RECID=6 STAMP=1228774125 file name=/u01/app/oracle/oradata/TRCDB/orpdb/sysaux01.dbf
datafile 11 switched to datafile copy
input datafile copy RECID=7 STAMP=1228774125 file name=/u01/app/oracle/oradata/TRCDB/orpdb/undotbs01.dbf
datafile 12 switched to datafile copy
input datafile copy RECID=8 STAMP=1228774125 file name=/u01/app/oracle/oradata/TRCDB/orpdb/users01.dbf

contents of Memory Script:
{
   Alter clone database open resetlogs;
}
executing Memory Script

database opened

contents of Memory Script:
{
   sql clone "alter pluggable database all open";
}
executing Memory Script

sql statement: alter pluggable database all open
Finished Duplicate Db at 24-MAR-26

RMAN>

Step 7: Verify the Duplication

With duplication complete, we confirm the target database is open and check that the test table and its rows made it across successfully.


[oracle@trcdb ~]$ sqlplus / as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Tue Mar 24 22:16:06 2026
Version 19.28.0.0.0

Copyright (c) 1982, 2025, Oracle.  All rights reserved.

Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.28.0.0.0

SQL> def
DEFINE _DATE           = "24-MAR-26" (CHAR)
DEFINE _CONNECT_IDENTIFIER = "trcdb" (CHAR)
DEFINE _USER           = "SYS" (CHAR)
DEFINE _PRIVILEGE      = "AS SYSDBA" (CHAR)
DEFINE _SQLPLUS_RELEASE = "1928000000" (CHAR)
DEFINE _EDITOR         = "vi" (CHAR)
DEFINE _O_VERSION      = "Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.28.0.0.0" (CHAR)
DEFINE _O_RELEASE      = "1928000000" (CHAR)
SQL>
SQL> show pdbs

    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         2 PDB$SEED                       READ ONLY  NO
         3 ORPDB                          READ WRITE NO
SQL>
SQL> select name,open_mode from v$database;

NAME      OPEN_MODE
--------- --------------------
TRCDB     READ WRITE

SQL> sho parameter pfile

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
spfile                               string      /u01/app/oracle/product/19c/db
                                                 home_1/dbs/spfiletrcdb.ora

SQL> alter session set container=ORPDB;

Session altered.

SQL> select count(*) from company;

  COUNT(*)
----------
         3

SQL>

The row count of 3 matches what we inserted at the source before duplication, confirming the clone is consistent and complete.

Backup-Based Duplication

Now let's walk through the second method, which uses existing RMAN backups instead of a live network connection to the source.

Step 1: Take a Full RMAN Backup of the Source Database

Backup-based duplication restores from backup pieces rather than streaming live data, so we first need a complete backup of the source database, its archived logs, and its control file.


[oracle@srcdb ~]$ rman target /

Recovery Manager: Release 19.0.0.0.0 - Production on Wed Mar 25 19:22:30 2026
Version 19.28.0.0.0

Copyright (c) 1982, 2019, Oracle and/or its affiliates.  All rights reserved.

connected to target database: SRCDB (DBID=858479241)

RMAN> report schema;
report schema;
using target database control file instead of recovery catalog
Report of database schema for database with db_unique_name SRCDB

List of Permanent Datafiles
===========================
File Size(MB) Tablespace           RB segs Datafile Name
---- -------- -------------------- ------- ------------------------
1    1160     SYSTEM               YES     /u01/app/oracle/oradata/SRCDB/system01.dbf
3    870      SYSAUX               NO      /u01/app/oracle/oradata/SRCDB/sysaux01.dbf
4    740      UNDOTBS1             YES     /u01/app/oracle/oradata/SRCDB/undotbs01.dbf
5    490      PDB$SEED:SYSTEM      NO      /u01/app/oracle/oradata/SRCDB/pdbseed/system01.dbf
6    470      PDB$SEED:SYSAUX      NO      /u01/app/oracle/oradata/SRCDB/pdbseed/sysaux01.dbf
7    5        USERS                NO      /u01/app/oracle/oradata/SRCDB/users01.dbf
8    265      PDB$SEED:UNDOTBS1    NO      /u01/app/oracle/oradata/SRCDB/pdbseed/undotbs01.dbf
9    500      ORPDB:SYSTEM         YES     /u01/app/oracle/oradata/SRCDB/orpdb/system01.dbf
10   530      ORPDB:SYSAUX         NO      /u01/app/oracle/oradata/SRCDB/orpdb/sysaux01.dbf
11   265      ORPDB:UNDOTBS1       YES     /u01/app/oracle/oradata/SRCDB/orpdb/undotbs01.dbf
12   5        ORPDB:USERS          NO      /u01/app/oracle/oradata/SRCDB/orpdb/users01.dbf

List of Temporary Files
=======================
File Size(MB) Tablespace           Maxsize(MB) Tempfile Name
---- -------- -------------------- ----------- --------------------
1    221      TEMP                 32767       /u01/app/oracle/oradata/SRCDB/temp01.dbf
2    211      PDB$SEED:TEMP        32767       /u01/app/oracle/oradata/SRCDB/pdbseed/temp012026-02-07_23-22-00-878-PM.dbf
3    211      ORPDB:TEMP           32767       /u01/app/oracle/oradata/SRCDB/orpdb/temp01.dbf

RMAN>

RMAN> run
{
allocate channel ch1 device type disk;
backup as compressed backupset database format '/u01/app/oracle/rman/Fullback_%T_%U';
backup as compressed backupset archivelog all format '/u01/app/oracle/rman/Archive_%T_%U';
backup current controlfile format '/u01/app/oracle/rman/Controlback_%T_%U';
release channel ch1;
}

run
2> {
3> allocate channel ch1 device type disk;
4> backup as compressed backupset database format '/u01/app/oracle/rman/Fullback_%T_%U';
5> backup as compressed backupset archivelog all format '/u01/app/oracle/rman/Archive_%T_%U';
6> backup current controlfile format '/u01/app/oracle/rman/Controlback_%T_%U';
7> release channel ch1;
8>
}
allocated channel: ch1
channel ch1: SID=23 device type=DISK

Starting backup at 25-MAR-26
channel ch1: starting compressed full datafile backup set
channel ch1: specifying datafile(s) in backup set
input datafile file number=00001 name=/u01/app/oracle/oradata/SRCDB/system01.dbf
input datafile file number=00003 name=/u01/app/oracle/oradata/SRCDB/sysaux01.dbf
input datafile file number=00004 name=/u01/app/oracle/oradata/SRCDB/undotbs01.dbf
input datafile file number=00007 name=/u01/app/oracle/oradata/SRCDB/users01.dbf
channel ch1: starting piece 1 at 25-MAR-26
channel ch1: finished piece 1 at 25-MAR-26
piece handle=/u01/app/oracle/rman/Fullback_20260325_0i4jthcl_18_1_1 tag=TAG20260325T192301 comment=NONE
channel ch1: backup set complete, elapsed time: 00:01:15
channel ch1: starting compressed full datafile backup set
channel ch1: specifying datafile(s) in backup set
input datafile file number=00010 name=/u01/app/oracle/oradata/SRCDB/orpdb/sysaux01.dbf
input datafile file number=00009 name=/u01/app/oracle/oradata/SRCDB/orpdb/system01.dbf
input datafile file number=00011 name=/u01/app/oracle/oradata/SRCDB/orpdb/undotbs01.dbf
input datafile file number=00012 name=/u01/app/oracle/oradata/SRCDB/orpdb/users01.dbf
channel ch1: starting piece 1 at 25-MAR-26
channel ch1: finished piece 1 at 25-MAR-26
piece handle=/u01/app/oracle/rman/Fullback_20260325_0j4jthf1_19_1_1 tag=TAG20260325T192301 comment=NONE
channel ch1: backup set complete, elapsed time: 00:00:45
channel ch1: starting compressed full datafile backup set
channel ch1: specifying datafile(s) in backup set
input datafile file number=00005 name=/u01/app/oracle/oradata/SRCDB/pdbseed/system01.dbf
input datafile file number=00006 name=/u01/app/oracle/oradata/SRCDB/pdbseed/sysaux01.dbf
input datafile file number=00008 name=/u01/app/oracle/oradata/SRCDB/pdbseed/undotbs01.dbf
channel ch1: starting piece 1 at 25-MAR-26
channel ch1: finished piece 1 at 25-MAR-26
piece handle=/u01/app/oracle/rman/Fullback_20260325_0k4jthge_20_1_1 tag=TAG20260325T192301 comment=NONE
channel ch1: backup set complete, elapsed time: 00:00:55
Finished backup at 25-MAR-26

Starting backup at 25-MAR-26
current log archived
channel ch1: starting compressed archived log backup set
channel ch1: specifying archived log(s) in backup set
input archived log thread=1 sequence=15 RECID=1 STAMP=1225210518
input archived log thread=1 sequence=16 RECID=2 STAMP=1225224163
input archived log thread=1 sequence=17 RECID=3 STAMP=1225297296
input archived log thread=1 sequence=18 RECID=4 STAMP=1228767026
input archived log thread=1 sequence=19 RECID=5 STAMP=1228773278
input archived log thread=1 sequence=20 RECID=6 STAMP=1228773550
input archived log thread=1 sequence=21 RECID=7 STAMP=1228774045
input archived log thread=1 sequence=22 RECID=8 STAMP=1228774046
input archived log thread=1 sequence=23 RECID=9 STAMP=1228850759
channel ch1: starting piece 1 at 25-MAR-26
channel ch1: finished piece 1 at 25-MAR-26
piece handle=/u01/app/oracle/rman/Archive_20260325_0l4jthi8_21_1_1 tag=TAG20260325T192600 comment=NONE
channel ch1: backup set complete, elapsed time: 00:00:35
Finished backup at 25-MAR-26

Starting backup at 25-MAR-26
channel ch1: starting full datafile backup set
channel ch1: specifying datafile(s) in backup set
including current control file in backup set
channel ch1: starting piece 1 at 25-MAR-26
channel ch1: finished piece 1 at 25-MAR-26
piece handle=/u01/app/oracle/rman/Controlback_20260325_0m4jthjc_22_1_1 tag=TAG20260325T192636 comment=NONE
channel ch1: backup set complete, elapsed time: 00:00:01
Finished backup at 25-MAR-26

Starting Control File and SPFILE Autobackup at 25-MAR-26
piece handle=/u01/app/oracle/fast_recovery_area/SRCDB/autobackup/2026_03_25/o1_mf_s_1228850798_nw7tdq5l_.bkp comment=NONE
Finished Control File and SPFILE Autobackup at 25-MAR-26

released channel: ch1

RMAN>

Step 2: Transfer the Backup from Source to Target

Since backup-based duplication doesn't rely on a live network connection to the source database during restore, we need to copy the backup pieces across to the target server first, using scp or another file transfer method.


[oracle@srcdb ~]$ cd /u01/app/oracle/rman
[oracle@srcdb rman]$ ls -lrth
total 1.6G
-rw-r-----. 1 oracle oinstall 564M Mar 25 19:24 Fullback_20260325_0i4jthcl_18_1_1
-rw-r-----. 1 oracle oinstall 337M Mar 25 19:25 Fullback_20260325_0j4jthf1_19_1_1
-rw-r-----. 1 oracle oinstall 407M Mar 25 19:25 Fullback_20260325_0k4jthge_20_1_1
-rw-r-----. 1 oracle oinstall 253M Mar 25 19:26 Archive_20260325_0l4jthi8_21_1_1
-rw-r-----. 1 oracle oinstall  18M Mar 25 19:26 Controlback_20260325_0m4jthjc_22_1_1
[oracle@srcdb rman]$
[oracle@srcdb rman]$ scp * oracle@trcdb.oraeasy.com:/u01/app/rman
The authenticity of host 'trcdb.oraeasy.com (192.168.80.12)' can't be established.
ECDSA key fingerprint is SHA256:eo1d2VctklI0pg7ELWEIOY1g/S28y3ll5iF/+t3TVW0.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added 'trcdb.oraeasy.com,192.168.80.12' (ECDSA) to the list of known hosts.
oracle@trcdb.oraeasy.com's password:
Archive_20260325_0l4jthi8_21_1_1              100%  252MB  22.5MB/s   00:11
Controlback_20260325_0m4jthjc_22_1_1          100%   18MB  29.5MB/s   00:00
Fullback_20260325_0i4jthcl_18_1_1             100%  563MB  33.1MB/s   00:17
Fullback_20260325_0j4jthf1_19_1_1             100%  336MB  32.8MB/s   00:10
Fullback_20260325_0k4jthge_20_1_1             100%  407MB  33.6MB/s   00:12
[oracle@srcdb rman]$

Step 3: Create Directories, Parameter File, and Password File on the Target

Just like with active duplication, the second target instance needs its own directory structure, parameter file, and password file. This time we're also including the file name conversion settings directly in the parameter file, since there's no active source connection to set them interactively later.


Create Directories:
[oracle@trcdb ~]$ mkdir -p /u01/app/oracle/admin/trcdb2/adump [oracle@trcdb ~]$ mkdir -p /u01/app/oracle/oradata/TRCDB2/ [oracle@trcdb ~]$ mkdir -p /u01/app/oracle/fast_recovery_area/TRCDB2 [oracle@trcdb ~]$ mkdir -p /u01/app/oracle/oradata/TRCDB2/orpdb/ [oracle@trcdb ~]$ mkdir -p /u01/app/rman [oracle@trcdb ~]$ Password file:
[oracle@trcdb ~]$ orapwd file=/u01/app/oracle/product/19c/dbhome_1/dbs/orapwtrcdb2 entries=15 password=sys format=12 [oracle@trcdb ~]$ Parameter file (Pfile):
[oracle@trcdb ~]$ cat /u01/app/oracle/product/19c/dbhome_1/dbs/inittrcdb2.ora db_name=trcdb2 db_block_size=8192 remote_login_passwordfile=EXCLUSIVE audit_file_dest='/u01/app/oracle/admin/trcdb2/adump' DB_FILE_NAME_CONVERT='/u01/app/oracle/oradata/SRCDB/','/u01/app/oracle/oradata/TRCDB2/' LOG_FILE_NAME_CONVERT='/u01/app/oracle/oradata/SRCDB/','/u01/app/oracle/oradata/TRCDB2/' CONTROL_FILES='/u01/app/oracle/oradata/TRCDB2/control01.ctl' AUDIT_FILE_DEST='/u01/app/oracle/admin/trcdb2/adump' DB_RECOVERY_FILE_DEST_SIZE='15G' DB_RECOVERY_FILE_DEST='/u01/app/oracle/fast_recovery_area/TRCDB2' enable_pluggable_database=true [oracle@trcdb ~]$

Step 4: Start the Target Instance in Nomount Mode

As before, the second target instance starts in nomount mode since it has no control file yet. Here we also generate an spfile from the pfile so the settings persist across restarts.


[oracle@trcdb ~]$ . oraenv
ORACLE_SID = [trcdb] ? trcdb2
ORACLE_HOME = [/home/oracle] ? /u01/app/oracle/product/19c/dbhome_1
The Oracle base remains unchanged with value /u01/app/oracle
[oracle@trcdb ~]$
[oracle@trcdb ~]$ sqlplus / as sysdba
SQL*Plus: Release 19.0.0.0.0 - Production on Wed Mar 25 19:44:04 2026
Version 19.28.0.0.0

Copyright (c) 1982, 2025, Oracle.  All rights reserved.

Connected to an idle instance.

SQL> def
DEFINE _DATE           = "25-MAR-26" (CHAR)
DEFINE _CONNECT_IDENTIFIER = "trcdb2" (CHAR)
DEFINE _USER           = "SYS" (CHAR)
DEFINE _PRIVILEGE      = "AS SYSDBA" (CHAR)
DEFINE _SQLPLUS_RELEASE = "1928000000" (CHAR)
DEFINE _EDITOR         = "vi" (CHAR)
DEFINE _O_VERSION      = "Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.28.0.0.0" (CHAR)
DEFINE _O_RELEASE      = "1928000000" (CHAR)
SQL>
SQL> startup nomount pfile='/u01/app/oracle/product/19c/dbhome_1/dbs/inittrcdb2.ora';
ORACLE instance started.

Total System Global Area  343930632 bytes
Fixed Size                  8939272 bytes
Variable Size             260046848 bytes
Database Buffers           67108864 bytes
Redo Buffers                7835648 bytes
SQL>
SQL> create spfile from pfile='/u01/app/oracle/product/19c/dbhome_1/dbs/inittrcdb2.ora';

File created.

SQL> shut immediate
ORA-01507: database not mounted

ORACLE instance shut down.
SQL> startup nomount
ORACLE instance started.

Total System Global Area  343930632 bytes
Fixed Size                  8939272 bytes
Variable Size             260046848 bytes
Database Buffers           67108864 bytes
Redo Buffers                7835648 bytes
SQL>
SQL> def
DEFINE _DATE           = "25-MAR-26" (CHAR)
DEFINE _CONNECT_IDENTIFIER = "trcdb2" (CHAR)
DEFINE _USER           = "SYS" (CHAR)
DEFINE _PRIVILEGE      = "AS SYSDBA" (CHAR)
DEFINE _SQLPLUS_RELEASE = "1928000000" (CHAR)
DEFINE _EDITOR         = "vi" (CHAR)
DEFINE _O_VERSION      = "Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.28.0.0.0" (CHAR)
DEFINE _O_RELEASE      = "1928000000" (CHAR)
SQL>

Step 5: Connect RMAN to the Auxiliary Database

Unlike active duplication, backup-based duplication only needs an auxiliary connection, since we're restoring from local backup files rather than pulling live data from a target database over the network.


[oracle@trcdb ~]$ rman auxiliary /

Recovery Manager: Release 19.0.0.0.0 - Production on Wed Mar 25 20:17:29 2026
Version 19.28.0.0.0

Copyright (c) 1982, 2019, Oracle and/or its affiliates.  All rights reserved.

connected to auxiliary database: TRCDB2 (not mounted)

Step 6: Run the Backup-Based Duplication Script

This command restores the target database entirely from the backup pieces we transferred earlier, using BACKUP LOCATION to tell RMAN where to find them on the target server.


RMAN> DUPLICATE target DATABASE TO trcdb2
      BACKUP LOCATION '/u01/app/rman'
      NOFILENAMECHECK;
   
   DUPLICATE target DATABASE TO trcdb2
2> BACKUP LOCATION '/u01/app/rman'
3> NOFILENAMECHECK;
Starting Duplicate Db at 25-MAR-26
searching for database ID
found backup of database ID 858479241

contents of Memory Script:
{
   sql clone "alter system set  db_name =
 ''SRCDB'' comment=
 ''Modified by RMAN duplicate'' scope=spfile";
   sql clone "alter system set  db_unique_name =
 ''trcdb2'' comment=
 ''Modified by RMAN duplicate'' scope=spfile";
   shutdown clone immediate;
   startup clone force nomount
   restore clone primary controlfile from  '/u01/app/rman/Controlback_20260325_0m4jthjc_22_1_1';
   alter clone database mount;
}
executing Memory Script

sql statement: alter system set  db_name =  ''SRCDB'' comment= ''Modified by RMAN duplicate'' scope=spfile

sql statement: alter system set  db_unique_name =  ''trcdb2'' comment= ''Modified by RMAN duplicate'' scope=spfile

Oracle instance shut down

Oracle instance started

Total System Global Area     398458016 bytes

Fixed Size                     9178272 bytes
Variable Size                314572800 bytes
Database Buffers              67108864 bytes
Redo Buffers                   7598080 bytes

Starting restore at 25-MAR-26
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=10 device type=DISK

channel ORA_AUX_DISK_1: restoring control file
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01
output file name=/u01/app/oracle/oradata/TRCDB2/control01.ctl
Finished restore at 25-MAR-26

database mounted
released channel: ORA_AUX_DISK_1
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=10 device type=DISK

contents of Memory Script:
{
   set until scn  2618442;
   set newname for datafile  1 to
 "/u01/app/oracle/oradata/TRCDB2/system01.dbf";
   set newname for datafile  3 to
 "/u01/app/oracle/oradata/TRCDB2/sysaux01.dbf";
   set newname for datafile  4 to
 "/u01/app/oracle/oradata/TRCDB2/undotbs01.dbf";
   set newname for datafile  5 to
 "/u01/app/oracle/oradata/TRCDB2/pdbseed/system01.dbf";
   set newname for datafile  6 to
 "/u01/app/oracle/oradata/TRCDB2/pdbseed/sysaux01.dbf";
   set newname for datafile  7 to
 "/u01/app/oracle/oradata/TRCDB2/users01.dbf";
   set newname for datafile  8 to
 "/u01/app/oracle/oradata/TRCDB2/pdbseed/undotbs01.dbf";
   set newname for datafile  9 to
 "/u01/app/oracle/oradata/TRCDB2/orpdb/system01.dbf";
   set newname for datafile  10 to
 "/u01/app/oracle/oradata/TRCDB2/orpdb/sysaux01.dbf";
   set newname for datafile  11 to
 "/u01/app/oracle/oradata/TRCDB2/orpdb/undotbs01.dbf";
   set newname for datafile  12 to
 "/u01/app/oracle/oradata/TRCDB2/orpdb/users01.dbf";
   restore
   clone database
   ;
}
executing Memory Script

executing command: SET until clause

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

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

Starting restore at 25-MAR-26
using channel ORA_AUX_DISK_1

channel ORA_AUX_DISK_1: starting datafile backup set restore
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/TRCDB2/system01.dbf
channel ORA_AUX_DISK_1: restoring datafile 00003 to /u01/app/oracle/oradata/TRCDB2/sysaux01.dbf
channel ORA_AUX_DISK_1: restoring datafile 00004 to /u01/app/oracle/oradata/TRCDB2/undotbs01.dbf
channel ORA_AUX_DISK_1: restoring datafile 00007 to /u01/app/oracle/oradata/TRCDB2/users01.dbf
channel ORA_AUX_DISK_1: reading from backup piece /u01/app/rman/Fullback_20260325_0i4jthcl_18_1_1
channel ORA_AUX_DISK_1: piece handle=/u01/app/rman/Fullback_20260325_0i4jthcl_18_1_1 tag=TAG20260325T192301
channel ORA_AUX_DISK_1: restored backup piece 1
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:01:16
channel ORA_AUX_DISK_1: starting datafile backup set restore
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/TRCDB2/pdbseed/system01.dbf
channel ORA_AUX_DISK_1: restoring datafile 00006 to /u01/app/oracle/oradata/TRCDB2/pdbseed/sysaux01.dbf
channel ORA_AUX_DISK_1: restoring datafile 00008 to /u01/app/oracle/oradata/TRCDB2/pdbseed/undotbs01.dbf
channel ORA_AUX_DISK_1: reading from backup piece /u01/app/rman/Fullback_20260325_0k4jthge_20_1_1
channel ORA_AUX_DISK_1: piece handle=/u01/app/rman/Fullback_20260325_0k4jthge_20_1_1 tag=TAG20260325T192301
channel ORA_AUX_DISK_1: restored backup piece 1
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:45
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00009 to /u01/app/oracle/oradata/TRCDB2/orpdb/system01.dbf
channel ORA_AUX_DISK_1: restoring datafile 00010 to /u01/app/oracle/oradata/TRCDB2/orpdb/sysaux01.dbf
channel ORA_AUX_DISK_1: restoring datafile 00011 to /u01/app/oracle/oradata/TRCDB2/orpdb/undotbs01.dbf
channel ORA_AUX_DISK_1: restoring datafile 00012 to /u01/app/oracle/oradata/TRCDB2/orpdb/users01.dbf
channel ORA_AUX_DISK_1: reading from backup piece /u01/app/rman/Fullback_20260325_0j4jthf1_19_1_1
channel ORA_AUX_DISK_1: piece handle=/u01/app/rman/Fullback_20260325_0j4jthf1_19_1_1 tag=TAG20260325T192301
channel ORA_AUX_DISK_1: restored backup piece 1
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:45
Finished restore at 25-MAR-26

contents of Memory Script:
{
   switch clone datafile all;
}
executing Memory Script

datafile 1 switched to datafile copy
input datafile copy RECID=12 STAMP=1228854056 file name=/u01/app/oracle/oradata/TRCDB2/system01.dbf
datafile 3 switched to datafile copy
input datafile copy RECID=13 STAMP=1228854056 file name=/u01/app/oracle/oradata/TRCDB2/sysaux01.dbf
datafile 4 switched to datafile copy
input datafile copy RECID=14 STAMP=1228854056 file name=/u01/app/oracle/oradata/TRCDB2/undotbs01.dbf
datafile 5 switched to datafile copy
input datafile copy RECID=15 STAMP=1228854056 file name=/u01/app/oracle/oradata/TRCDB2/pdbseed/system01.dbf
datafile 6 switched to datafile copy
input datafile copy RECID=16 STAMP=1228854056 file name=/u01/app/oracle/oradata/TRCDB2/pdbseed/sysaux01.dbf
datafile 7 switched to datafile copy
input datafile copy RECID=17 STAMP=1228854056 file name=/u01/app/oracle/oradata/TRCDB2/users01.dbf
datafile 8 switched to datafile copy
input datafile copy RECID=18 STAMP=1228854056 file name=/u01/app/oracle/oradata/TRCDB2/pdbseed/undotbs01.dbf
datafile 9 switched to datafile copy
input datafile copy RECID=19 STAMP=1228854056 file name=/u01/app/oracle/oradata/TRCDB2/orpdb/system01.dbf
datafile 10 switched to datafile copy
input datafile copy RECID=20 STAMP=1228854056 file name=/u01/app/oracle/oradata/TRCDB2/orpdb/sysaux01.dbf
datafile 11 switched to datafile copy
input datafile copy RECID=21 STAMP=1228854056 file name=/u01/app/oracle/oradata/TRCDB2/orpdb/undotbs01.dbf
datafile 12 switched to datafile copy
input datafile copy RECID=22 STAMP=1228854056 file name=/u01/app/oracle/oradata/TRCDB2/orpdb/users01.dbf

contents of Memory Script:
{
   set until scn  2618442;
   recover
   clone database
    delete archivelog
   ;
}
executing Memory Script

executing command: SET until clause

Starting recover at 25-MAR-26
using channel ORA_AUX_DISK_1

starting media recovery

channel ORA_AUX_DISK_1: starting archived log restore to default destination
channel ORA_AUX_DISK_1: restoring archived log
archived log thread=1 sequence=23
channel ORA_AUX_DISK_1: reading from backup piece /u01/app/rman/Archive_20260325_0l4jthi8_21_1_1
channel ORA_AUX_DISK_1: piece handle=/u01/app/rman/Archive_20260325_0l4jthi8_21_1_1 tag=TAG20260325T192600
channel ORA_AUX_DISK_1: restored backup piece 1
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:15
archived log file name=/u01/app/oracle/fast_recovery_area/TRCDB2/TRCDB2/archivelog/2026_03_25/o1_mf_1_23_nw7xlll9_.arc thread=1 sequence=23
channel clone_default: deleting archived log(s)
archived log file name=/u01/app/oracle/fast_recovery_area/TRCDB2/TRCDB2/archivelog/2026_03_25/o1_mf_1_23_nw7xlll9_.arc RECID=1 STAMP=1228854069
media recovery complete, elapsed time: 00:00:01
Finished recover at 25-MAR-26
Oracle instance started

Total System Global Area     398458016 bytes

Fixed Size                     9178272 bytes
Variable Size                314572800 bytes
Database Buffers              67108864 bytes
Redo Buffers                   7598080 bytes

contents of Memory Script:
{
   sql clone "alter system set  db_name =
 ''TRCDB2'' 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 =  ''TRCDB2'' 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     398458016 bytes

Fixed Size                     9178272 bytes
Variable Size                314572800 bytes
Database Buffers              67108864 bytes
Redo Buffers                   7598080 bytes
sql statement: CREATE CONTROLFILE REUSE SET DATABASE "TRCDB2" RESETLOGS ARCHIVELOG
  MAXLOGFILES     16
  MAXLOGMEMBERS      3
  MAXDATAFILES     1024
  MAXINSTANCES     8
  MAXLOGHISTORY      292
 LOGFILE
  GROUP     1 ( '/u01/app/oracle/oradata/TRCDB2/redo01.log' ) SIZE 200 M  REUSE,
  GROUP     2 ( '/u01/app/oracle/oradata/TRCDB2/redo02.log' ) SIZE 200 M  REUSE,
  GROUP     3 ( '/u01/app/oracle/oradata/TRCDB2/redo03.log' ) SIZE 200 M  REUSE
 DATAFILE
  '/u01/app/oracle/oradata/TRCDB2/system01.dbf',
  '/u01/app/oracle/oradata/TRCDB2/pdbseed/system01.dbf',
  '/u01/app/oracle/oradata/TRCDB2/orpdb/system01.dbf'
 CHARACTER SET AL32UTF8

contents of Memory Script:
{
   set newname for tempfile  1 to
 "/u01/app/oracle/oradata/TRCDB2/temp01.dbf";
   set newname for tempfile  2 to
 "/u01/app/oracle/oradata/TRCDB2/pdbseed/temp012026-02-07_23-22-00-878-PM.dbf";
   set newname for tempfile  3 to
 "/u01/app/oracle/oradata/TRCDB2/orpdb/temp01.dbf";
   switch clone tempfile all;
   catalog clone datafilecopy  "/u01/app/oracle/oradata/TRCDB2/sysaux01.dbf",
 "/u01/app/oracle/oradata/TRCDB2/undotbs01.dbf",
 "/u01/app/oracle/oradata/TRCDB2/pdbseed/sysaux01.dbf",
 "/u01/app/oracle/oradata/TRCDB2/users01.dbf",
 "/u01/app/oracle/oradata/TRCDB2/pdbseed/undotbs01.dbf",
 "/u01/app/oracle/oradata/TRCDB2/orpdb/sysaux01.dbf",
 "/u01/app/oracle/oradata/TRCDB2/orpdb/undotbs01.dbf",
 "/u01/app/oracle/oradata/TRCDB2/orpdb/users01.dbf";
   switch clone datafile all;
}
executing Memory Script

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

renamed tempfile 1 to /u01/app/oracle/oradata/TRCDB2/temp01.dbf in control file
renamed tempfile 2 to /u01/app/oracle/oradata/TRCDB2/pdbseed/temp012026-02-07_23-22-00-878-PM.dbf in control file
renamed tempfile 3 to /u01/app/oracle/oradata/TRCDB2/orpdb/temp01.dbf in control file

cataloged datafile copy
datafile copy file name=/u01/app/oracle/oradata/TRCDB2/sysaux01.dbf RECID=1 STAMP=1228854108
cataloged datafile copy
datafile copy file name=/u01/app/oracle/oradata/TRCDB2/undotbs01.dbf RECID=2 STAMP=1228854108
cataloged datafile copy
datafile copy file name=/u01/app/oracle/oradata/TRCDB2/pdbseed/sysaux01.dbf RECID=3 STAMP=1228854108
cataloged datafile copy
datafile copy file name=/u01/app/oracle/oradata/TRCDB2/users01.dbf RECID=4 STAMP=1228854108
cataloged datafile copy
datafile copy file name=/u01/app/oracle/oradata/TRCDB2/pdbseed/undotbs01.dbf RECID=5 STAMP=1228854108
cataloged datafile copy
datafile copy file name=/u01/app/oracle/oradata/TRCDB2/orpdb/sysaux01.dbf RECID=6 STAMP=1228854108
cataloged datafile copy
datafile copy file name=/u01/app/oracle/oradata/TRCDB2/orpdb/undotbs01.dbf RECID=7 STAMP=1228854108
cataloged datafile copy
datafile copy file name=/u01/app/oracle/oradata/TRCDB2/orpdb/users01.dbf RECID=8 STAMP=1228854108

datafile 3 switched to datafile copy
input datafile copy RECID=1 STAMP=1228854108 file name=/u01/app/oracle/oradata/TRCDB2/sysaux01.dbf
datafile 4 switched to datafile copy
input datafile copy RECID=2 STAMP=1228854108 file name=/u01/app/oracle/oradata/TRCDB2/undotbs01.dbf
datafile 6 switched to datafile copy
input datafile copy RECID=3 STAMP=1228854108 file name=/u01/app/oracle/oradata/TRCDB2/pdbseed/sysaux01.dbf
datafile 7 switched to datafile copy
input datafile copy RECID=4 STAMP=1228854108 file name=/u01/app/oracle/oradata/TRCDB2/users01.dbf
datafile 8 switched to datafile copy
input datafile copy RECID=5 STAMP=1228854108 file name=/u01/app/oracle/oradata/TRCDB2/pdbseed/undotbs01.dbf
datafile 10 switched to datafile copy
input datafile copy RECID=6 STAMP=1228854108 file name=/u01/app/oracle/oradata/TRCDB2/orpdb/sysaux01.dbf
datafile 11 switched to datafile copy
input datafile copy RECID=7 STAMP=1228854108 file name=/u01/app/oracle/oradata/TRCDB2/orpdb/undotbs01.dbf
datafile 12 switched to datafile copy
input datafile copy RECID=8 STAMP=1228854108 file name=/u01/app/oracle/oradata/TRCDB2/orpdb/users01.dbf

contents of Memory Script:
{
   Alter clone database open resetlogs;
}
executing Memory Script

database opened

contents of Memory Script:
{
   sql clone "alter pluggable database all open";
}
executing Memory Script

sql statement: alter pluggable database all open
Finished Duplicate Db at 25-MAR-26

RMAN>

Step 7: Verify the Duplication

As with the active duplication method, we confirm the second target database is open and check that the test table's row count matches the source.


[oracle@trcdb ~]$ sqlplus / as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Wed Mar 25 20:25:39 2026
Version 19.28.0.0.0

Copyright (c) 1982, 2025, Oracle.  All rights reserved.

Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.28.0.0.0

SQL> show pdbs

    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         2 PDB$SEED                       READ ONLY  NO
         3 ORPDB                          READ WRITE NO

SQL> select name,open_mode from v$database;

NAME      OPEN_MODE
--------- --------------------
TRCDB2    READ WRITE

SQL> sho parameter pfile

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
spfile                               string      /u01/app/oracle/product/19c/db
                                                 home_1/dbs/spfiletrcdb2.ora
SQL> alter session set container=ORPDB;

Session altered.

SQL> select count(*) from company;

  COUNT(*)
----------
         3

SQL>

Both methods produced the same result: a working clone of the source database with the test data intact. Active duplication is faster to set up when the source is reachable over the network, while backup-based duplication is the better choice when you need to clone from an existing backup or when network bandwidth to the source is limited.

Thank you for reading!

I hope this content has been helpful to you. Your feedback and suggestions are always welcome. Feel free to leave a comment or reach out with any queries.

Abhishek Shrivastava

Oracle DBA with hands-on experience managing production Data Guard, RAC, GoldenGate, and APEX environments. I write practical, tested installation and troubleshooting guides based on real deployment work.

📧 Email: oraeasyy@gmail.com
🌐 Website: www.oraeasy.com

Follow Us

Comments