While runnig duplicate database, oracle can give ORA-17627, ORA-12154, ORA-17629 errors.
Error
[oracle@oracle19cdg2 admin]$ rman target sys@ORA19C auxiliary sys@DG2
Recovery Manager: Release 19.0.0.0.0 – Production on Sat Jul 6 14:21:44 2024
Version 19.22.0.0.0Copyright (c) 1982, 2019, Oracle and/or its affiliates. All rights reserved.
target database Password:
connected to target database: ORA19C (DBID=1219995577)
auxiliary database Password:
connected to auxiliary database: ORA19C (not mounted)RMAN> duplicate target database for standby from active database dorecover nofilenamecheck;
Starting Duplicate Db at 06-JUL-24
using target database control file instead of recovery catalog
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=7 device type=DISK
current log archivedcontents of Memory Script:
{
backup as copy reuse
passwordfile auxiliary format ‘/oracle/db/19/db_home/dbs/orapwDG2’ ;
}
executing Memory ScriptStarting backup at 06-JUL-24
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=28 device type=DISK
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of Duplicate Db command at 07/06/2024 14:22:00
RMAN-05501: aborting duplication of target database
RMAN-03015: error occurred in stored script Memory Script
RMAN-03009: failure of backup command on ORA_DISK_1 channel at 07/06/2024 14:22:00
ORA-17627: ORA-12154: TNS:could not resolve the connect identifier specified
ORA-17629: Cannot connect to the remote database server
Solution
You have to change tnsnames.ora file on standby server. You have to use SID instead of SERVICE_NAME.
DG2=
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = oracle19cdg2.fatihacar.com)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SID = DG2)
)
)