PL/SQL Developer Rare ORA-12154 Error

This is the case of a interesting error I encountered regarding PL/SQL Developer connectivity.

I had both SQL Developer and PL/SQL Developer installed in my computer.
Oracle client 12c with its TNSNAMES.ora file were working fine.

One day without any change, the connection to the databases via PL/SQL Developer stopped working with the error ORA-12154 TNS: could not resolve the connect identifier specified.

Nikos Minaidis - Art of Coding

The curious thing was, that the connection to the databases via SQL Developer continued to work successfully.

After a lot of research I found several answers on how to fix it:

1)Moving the PLSQL Developer folder from the «Program Files (x86) into the «Program Files» folder (in my case it was already installed there) –DID NOT WORK

2)Make sure that the TNSNAMES.ORA file exists and is in the correct directory.
(My file was obviously in the right directory)

3)Check the contents of tnsnames.ora file.
Check that instance name has been entered correctly in tnsnames.ora.
There should be no control characters at the end of the instance or database name.
All parenthesis around the TNS entry should be properly terminated.
Make sure that there are no syntax errors in the TNSNAMES.ORA file. For example, if there are unmatched parentheses in the file (ie: open bracket without the corresponding close bracket), the file will be rendered unusable.
(All the above were checked and were correct) –DID NOT WORK

4)Check the sqlnet.ora
Domain name entry in sqlnet.ora should not be conflicting with full database name.
Make sure that “TNSNAMES” is listed as one of the values of the NAMES.DIRECTORY_PATH parameter in the Oracle Net profile (SQLNET.ORA).
Verify that “EZCONNECT” is listed as one of the values of the NAMES.DIRETORY_PATH parameter in the Oracle Net profile (SQLNET.ORA).
Make sure the host, port and service name specified are correct.
Try enclosing the connect identifier in quote marks.
(All the above were checked and were correct) –DID NOT WORK

5)I entered a new TNS entry in the file. The entries were refreshed successfully in the PL/SQL Developer, but again it could not again to connect giving the same error. –DID NOT WORK


The solution that worked for me was:

Removing and replacing the TNSNAMES.ora file with a backup tns file that I had and it worked successfully.

(My guess is, that some character e.g. newlines, could not be rendered from the PL/SQL Developer)

Written by Nikos Minaidis
26/01/2021

Σχολιάστε