The following errors occur in the trace file when duplicate a database:
MAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of Duplicate Db command at 05/13/2025 21:01:07
RMAN-05501: aborting duplication of target database
RMAN-06004: Oracle error from recovery catalog database: RMAN-20005: target database name is ambiguous
DBGMISC: ENTERED krmkursr [21:01:13.976]
DBGMISC: EXITED krmkursr [21:01:13.976] elapsed time [00:00:00:00.000]
-------------------------------------------------------------------------------
Trace Bucket Dump End: rman trace
RESOLUTION
If the source database is still running, the run the following the sql to get the dbid:
SQL> select dbid, name from v$database;
DBID NAME
---------- ---------
1234567890 TESTDB
Otherwise logon to RMAN catalog database, and
SQL>select rbs.db_key
, rd.name
, RBS.DB_ID
, rbs.bs_key
, rbs.recid
, rbs.stamp
, rbs.backup_type
, rbs.start_time, status
from rc_backup_set rbs, rc_database rd
where rbs.db_key=rd.db_key
and rbs.db_id=rd.dbid
and rd.name='TESTDB' ;
DB_KEY NAME DB_ID BS_KEY RECID STAMP B START_TIM S
---------- -------- ---------- ---------- ---------- ---------- - ---------
86602789 TESTDB 1234567890 104349946 5934 1201017848 L 13-MAY-25 A
Finally, in RMAN script add the following:
set dbid=1234567890;
duplicate database from testdb to devdb until time "TO_DATE('2025-05-05 09:00:00','YYYY-MM-DD HH24:MI:SS'