Thursday, December 29, 2022

ORA-17627: ORA-12154: TNS:could not resolve the connect identifier specified


SQL> Create pluggable database new_pdb from remote_pdb@clone_link keystore identified by my_keystore_password
Create pluggable database new_pdb from remote_pdb@clone_link keystore identified by my_keystore_password
*
ERROR at line 1:
ORA-65169: error encountered while attempting to copy file
+ORADATA/REMOTE_PDB/F3B8A7FE0E57B5A6E053BB5554646F41/DATAFILE/users_dbfile.
239.2225469957
ORA-17627: ORA-12154: TNS:could not resolve the connect identifier specified
ORA-17629: Cannot connect to the remote database server

Above error is related to database link and it may appear during a pluggable database clone, as in above example, or during any other distributed operation being performed using a database link.

The reason of this error is TNS string used in the database link. You have two ways to create a database link. You can use a full connect string, or you can use a TNS service entry from TNSNAMES.ORA file. Following are examples of both of these methods.

Example 1 (Using full connect string)
create database link clone_link
connect to myuser identified by mypassword
using 'myhost.mydomain.com:1521/mydbservice.mydomain.com’;
 
Example 2 (Using TNS service name)
create database link clone_link
connect to myuser identified by mypassword
using 'my_tns_service’;

You will not face this issue if you created the database link using example 1, however, if you are using method demonstrated in example 2, you may face this error in a RAC environment unless you create TNS service (my_tns_service in this example) on all nodes of the RAC.

So the conclusion is that major cause of this error is to not having TNS service created on all RAC nods that was used in the database link. OR the safest way is to use a full connect string while creating a database link.


No comments:

Post a Comment

Popular Posts - All Times