Plsql Connect Oracle Database ora 12154 error
Today encountered a problem, using Sqlplus can connect to the remote database, but the use of plsql but not connected, error "ORA-12154:TNS: Unable to resolve the specified connection identifier"
The workaround is as follows:
1. Check that the server-side listening service is turned on, and if it is not turned on, start its listening
Client: tnsping <tns_name>
Server Linux:
#>lsnrctl Status View listening status
#>lsnrctl Start Start listening
2. Connect through SQL Plus if the SQL plus connection succeeds, it means your tnsnames.ora content is faulty. My problem is in the alias dev_db, which is preceded by a space, which can be done by a text editor (edit Plus,ue, etc.) To see if there are spaces, as long as there are spaces that must not be, and if that piece of content appears in the middle of the file, it will cause all the corresponding connection aliases in the file to be unsuccessful, and if the only connection alias on the last side is not successful, the other connection alias can still connect successfully. (Note: My Tnsnames.ora is configured with multiple database instance connections, all of which have multiple connection aliases.) )
such as: space
Copy Code code as follows:
dev_db =
(DESCRIPTION =
(Address_list =
(address = (PROTOCOL = TCP) (HOST = 172.168.10.5) (PORT = 1521))
(Connect_data =
(SID = ora10)
)
)
3. If you ensure that your Tnsnames.ora content is not wrong, then please delete all the files in the%oracle_home%\product\10.2.0\db_1\network\admin directory, and then reconnect, generally can be resolved. Description: The file in that directory is generated dynamically when you establish the connection, don't be afraid to delete the problem
4. Enter the main interface of the Plsql developer, select Cancel in the login interface to enter the main interface, then select the menu Tools (Tools)-preferences (preferences), in the Settings window, select Oracle-connection (Connection), In the corresponding Settings window, locate the Oracle home directory, select the version of your locally installed client, save the settings, and then restart Plsql Developer, where you can log on normally.
I solved it using the second method.