If you got this error in the RMAN active duplication of RAC database fails on restart operation with the following error messages:
RMAN-03002: failure of Duplicate Db command at 02/17/2021 15:12:11 RMAN-05501: aborting duplication of target database RMAN-03015: error occurred in stored script Memory Script RMAN-03009: failure of backup command on t0 channel at 02/17/2021 15:11:48 ORA-17629: Cannot connect to the remote database server ORA-17627: ORA-12154: TNS:could not resolve the connect identifier specified ORA-17629: Cannot connect to the remote database server
ORA-12154 is raised whenever the TNS alias is not found on tnsnames.ora
After verification of tnsanames.ora files from both installations on Target and Auxiliary we see all the proper entries are there
Still the RMAN duplicate command fails on ORA-12154
The reason for ORA-12154 being raised is because the process is looking for tnsnames.ora in a different ORACLE_HOME on the Auxiliary side. This different ORACLE_HOME on Auxiliary side is usually the GRID HOME.
On 11G RAC Customers can configure SCAN Listener to handle failover connections on DB and ASM instances.
When RMAN duplicate is executed it needs to shutdown/startup the database several times. Once the DB is down, a TNS connection can get lost on next startup since the corresponding service associated with the instance is no longer available. The connection from RMAN thus fails when looking for the tnsnames.ora file under the wrong home.
To solve this error, There are two ways to workaround this problem
1) Copy the tnsnames.ora file form the RDBMS Home to the GRID Home
or
2) Establish a direct connection instead of using a TNS alias. For example:
RMAN> connect auxiliary sys/<password>@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=<hostname>)(PORT=1521))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=<service name>)(UR=A)))
MOS docs recommended to type TNS in a line without any blanks, and add (UR=A) in Standby TNS.