Solution to ora12154 error reported when plsql is connected to the oracle database

Source: Internet
Author: User
If you encounter a problem today when connecting to the oracle database with plsql, the error ora12154 is reported. This article will introduce you in detail how to solve these problems.

If you encounter a problem today, the ora 12154 error is reported when connecting to the oracle database using plsql. This article will introduce you in detail how to solve these problems.

The ora 12154 error is reported when plsql is connected to the oracle database.
Today I encountered a problem that sqlplus can be used to connect to a remote database, but plsql cannot be used to connect, error "ORA-12154: TNS: Unable to parse the specified connection identifier"

The solution is as follows::
1. Check whether the server listening service is enabled. If not, enable the listener.
Client: tnsping
In Server Linux:
#> Lsnrctl status check the listening status
#> Lsnrctl start listener
2. try SQL Plus connection. If SQL Plus connection is successful, it indicates your tnsnames. the ora content is incorrect. I have a space in front of the alias dev_db. You can use a text editor (Edit Plus, UE, etc.) to check whether there are spaces, as long as there are spaces, it is definitely not feasible. If the content appears in the middle of the file, all corresponding connection aliases in the file will fail, if the connection alias is not successful at the end, other connection aliases can still be connected successfully. (Note: My tnsnames. ora is configured with the connection of multiple database instances, and all have multiple connection aliases .)
For example, space
The Code is as follows:
Dev_db =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP) (HOST = 172.1610.5) (PORT = 1521 )))
(CONNECT_DATA =
(SID = ora10)
)
)

3. if you make sure that your tnsnames. there is no error in the ora content. delete all the files in the % ORACLE_HOME % \ product \ 10.2.0 \ db_1 \ NETWORK \ ADMIN directory and try again. Note: The files in the directory are dynamically generated when you establish a connection. Do not be afraid of deletion problems.
4. go to the main interface of PLSQL Developer, select cancel on the logon interface to enter the main interface, and then select Tools-Preferences (Preferences) from the menu. In the settings window, select Oracle-Connection. In the corresponding settings window, find Oracle Home (Oracle main directory), select the version of the local client installed, save the settings, and restart PLSQL Developer, then you can log on normally.
I used the second solution.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.