plsql connects to oracle database for ora 12154 error resolution

  • 2020-12-10 00:54:42
  • OfStack

An plsql connection to the oracle database reported an ora 12154 error
I encountered a problem today. Using sqlplus, I could connect to a remote database, but using plsql, I could not connect. The error was "ES6en-12154: TNS: the specified connection identifier could not be resolved".

The solution is as follows:
1. First, check whether the listening service on the server side is opened. If it is not opened, please start its listening
Client: tnsping < tns_name >
Server Linux:
# > lsnrctl status checks the status of the monitor
# > lsnrctl start starts listening
2. Through Sql Plus connection under 1 a try, if Sql Plus connection can be successful, you are not the tnsnames. ora content had a mistake my question in front of the alias dev_db has a space, this can be achieved by a text editor (Edit Plus, UE, etc.) to see if there is a blank space, as long as there is space that is certainly not, and if the content is in the middle of the file, will lead to all the corresponding connection alias in the file is not successful, If it is at the end and only its own connection alias fails, other connection aliases still succeed. (Note: My ES40en.ora is configured to connect to multiple database instances, so you have multiple connection aliases.)
Such as: the blank space
 
dev_db = 
(DESCRIPTION = 
(ADDRESS_LIST = 
(ADDRESS = (PROTOCOL = TCP)(HOST = 172.168.10.5)(PORT = 1521))) 
(CONNECT_DATA = 
(SID = ora10) 
) 
) 

3. If you are sure that your tnsnames.ora content is free of errors, please delete all the files in the directory %ORACLE_HOME% product\10.2.0\db_1\NETWORK\ADMIN and reconnect. Note 1: The files in that directory were generated dynamically when you made the connection, so don't be afraid to delete them
4. Enter the PLSQL Developer main interface, in the login screen choose cancel not log in to the main interface, and then select menu Tools (tools) - Preferences (preferences), in the Settings window, select Oracle - Connection (connected), the corresponding Settings window, find Oracle Home (Oracle home directory), choose your local installation client version, save Settings, and then restart the PLSQL Developer, then can normal login.
I did it the second way.

Related articles: