ORA-12154: TNS: Unable to parse the specified connection identifier

Source: Internet
Author: User

I believe that people who have used Oracle databases must have encountered the "ORA-12154: TNS: unable to resolve the specified connection identifier" error, I would like to make a small summary here.

The connection to the Oracle database in a program is different from that to other common databases, such as MySQL and SQL server. These databases can be connected by specifying IP addresses directly, however, Oracle needs to configure the network service name through the Oracle client to connect. Otherwise,"ORA-12154: TNS: Unable to parse the specified connection identifier". The procedure for configuring the Oracle client is as follows:
After the Oracle client is installed, go to "oracle-connector lient10g_home1-> Configure and port tools-> net manager" in the Start menu and open (win7, if the Win8 user does not obtain the Administrator Account Login, run it as an administrator.) Expand "Oracle Net configuration-> Local-> service name" and click "plus sign" on the left to configure the new network service.

Finally, click "Next". If you do not know or forget the Oracle service name, you can view the service. For example, the host name configured here is my local host, find Oracle-related services in my computer services

The above service name shows that the service name I installed is "orcl", or log on to the server using SQL plus using the sys account and enter the command
Show parameter SERVICE_NAME.
Oracledbconsoleorcl is a service for Oracle Web Page Management tools. Its access address is generally "http: // 127.0.0.1: 1158/EM/console/logon ", if you are not used to using this to manage databases, you do not need to start the database.
Oraclejobschedulerorcl is used to manage tasks scheduled in Oracle and generally does not need to be started.
Oracleoradb10g_home1isql * Plus is an SQL plus service. If you are not used to operating the database under the command line, you do not need to start it.
Both oracleserviceorcl and oracleoradb10g_home1tnslistener must be enabled. The former is the primary service and the latter is the listener service.

After configuring the net manager service in the Oracle client, you can access the Oracle database through the network service name we configured. In this configuration, D: \ oracle \ product \ 10.2.0 \ client_1 \ Network \ admin \ tnsnames. add a line of configuration in ora (because my oracle is installed in the Oracle directory of drive D, the specific path depends on the path selected during installation ).

 #  tnsnames. ora network configuration file: D: \ oracle \ product \ 10.2.0 \ client_1 \ Network \ admin \ tnsnames. ora  #  generated by Oracle configuration tools.   orcl  =  (description  =  (address_list  =  (address  = (Protocol = TCP) (host = 127.0.0.1) (Port = 1521  ))) (CONNECT_DATA  =  (SERVICE_NAME  =  orcl)  

If the Oracle client and server are installed on the same computer at the same time, the same configuration file D will also exist in the installation directory of the server: \ oracle \ product \ 10.2.0 \ db_1 \ Network \ admin \ tnsnames. ora. In this case, if we have configured the client net manager and connected to the Oracle database,"ORA-12154: TNS: Unable to parse the specified connection identifier"At this time, you should suspect that the configuration file under which path is accessed? In this case, you can use the tnsping command

If you configure the network service in the net manager client, but the resolved parameter file is D: \ oracle \ product \ 10.2.0 \ db_1 \ Network \ admin \ sqlnet. ora, so I think you should understand. There are two solutions to this problem:
first, configure the same network service for the net manager on the server side, or directly Copy D: \ oracle \ product \ 10.2.0 \ client_1 \ Network \ admin \ tnsnames. configure to D: \ oracle \ product \ 10.2.0 \ db_1 \ Network \ admin \ tnsnames in ora. ora, you need to do this every time you configure a new network service. If you don't want to be so troublesome, use the second solution.
2: Modify the PATH value of the system environment variable, and move D: \ oracle \ product \ 10.2.0 \ client_1 \ bin; Path to D: \ oracle \ product \ 10.2.0 \ db_1 \ bin.
note: the reason for this problem is that the Oracle client and Database Service are installed on a computer, this problem occurs when you first install the client and then install the database service. If you install the database service first, then install the client.
After configuring oracle in the preceding method, we believe that the Oracle database can be connected normally in the program.

When I installed PLSQL developer and logged on to the system,"ORA-12154: TNS: Unable to parse the specified connection identifier", If it is win7, Win8 users can even pop up a white box, then you need to run PLSQL developer as an administrator, make sure that your PLSQL developer is reading the Oracle client configuration and directly cancels the login. In the PLSQL developer toolbar, find "tools-> Preferences ", on the connection node of Oracle, find Oracle Home and select oraclient10g_home1. After saving and close PLSQL developer, you can log on normally.

Note that PLSQL developer cannot be installed in a directory with parentheses, such as the 64bit system's program files (x86) directory, it keeps popping up"ORA-12154: TNS: Unable to parse the specified connection identifier". The same problem may occur in other Oracle database management software, such as toad for Oracle.

"ORA-12154: TNS: Unable to parse the specified connection identifier"It is one of the most common problems for beginners who use Oracle databases. As long as we understand how it works and troubleshoot it calmly, we believe it is easy to find a solution to the problem.

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.