In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly shows you the "Oracle appears ora-12154 can not parse the specified connection identifier how to do", the content is easy to understand, clear, hope to help you solve the doubt, the following let Xiaobian lead you to study and learn "Oracle ora-12154 can not parse specified connection identifier how to do" this article.
I believe that people who have used the Oracle database must have encountered the "ORA-12154: TNS: unable to parse the specified connection identifier" error, I would like to make a small summary here.
The way of connecting Oracle database in the program is different from other commonly used databases, such as MySql,Sql Server, these databases can be connected by directly specifying IP, but Oracle needs to connect through the Oracle client to configure the network service name. Otherwise, "ORA-12154: TNS: unable to resolve the specified connection identifier" appears. The detailed steps for configuring the Oracle client are as follows:
After installing the Oracle client, find "Oracle-OraClient10g_home1- > configuration and Migration tool-> Net Manager" in the start menu and open it (Win7,Win8 users need to run in administrator mode if they have not obtained an Administrator account login), expand "Oracle Net configuration-> Local-> Service name" and click "Plus" on the left to configure new network services.
Finally, click "next" to complete. If you don't know or forget the Oracle service name, you can get it by looking at the service. For example, the hostname I configured here is my local machine. Find the oracle-related service in my computer service.
From the name of the service above, you can see that the name of the service I installed is "ORCL", or log in through the sys account through SQL Plus on the server side and enter the command
Show parameter service_name view.
OracleDBConsoleORCL is an Oracle web-side management tool service, the access address is generally "http://127.0.0.1:1158/em/console/logon/logon", if you are not used to using this to manage the database, you do not need to start."
OracleJobSchedulerORCL manages scheduled tasks in Oracle and generally does not need to be started.
OracleOraDb10g_home1iSQL*Plus is a service of SQL Plus, and you don't have to start it if you're not used to operating the database under the command line.
OracleServiceORCL,OracleOraDb10g_home1TNSListener needs to be enabled. The former is the main service and the latter is the listening service.
After configuring the service in the Net Manager in the Oracle client, you can access the Oracle database through the network service name we configured. This configuration essentially adds a line of configuration to D:\ Oracle\ product\ 10.2.0\ client_1\ NETWORK\ ADMIN\ tnsnames.ora (because my Oracle is installed in the D drive Oracle directory, 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 both the Oracle client and the server are installed on the same computer, the same configuration file D:\ Oracle\ product\ 10.2.0\ db_1\ NETWORK\ ADMIN\ tnsnames.ora will exist in the server installation directory. In this case, if we configure the client Net Manager and then connect to the Oracle database, "ORA-12154: TNS: unable to parse the specified connection identifier" may occur. You should wonder, which path do I access the configuration file? You can use the tnsping command at this point
If you configure the network service in the client Net Manager, but the parsed usage parameter file is D:\ Oracle\ product\ 10.2.0\ db_1\ NETWORK\ ADMIN\ sqlnet.ora, then I think you should understand. There are two solutions to this situation:
First: configure the same network service on the Net Manager on the server side, or directly copy the configuration from D:\ Oracle\ product\ 10.2.0\ client_1\ NETWORK\ ADMIN\ tnsnames.ora to D:\ Oracle\ product\ 10.2.0\ db_1\ NETWORK\ ADMIN\ tnsnames.ora. You need to do this every time you configure a new network service, and use the second solution if you don't want to bother.
Second: modify the path value of the system environment variable, and move the path D:\ Oracle\ product\ 10.2.0\ client_1\ bin; to D:\ Oracle\ product\ 10.2.0\ db_1\ bin; once and for all.
Note: the reason for the above situation is that both the oracle client and the database service are installed on the same computer, and the client is installed first, and then the database service is installed. This will not happen if the database service is installed first and then the client is installed.
After configuring oracle according to the above way, I believe that you can connect to the oracle database normally in the program.
When I log in after installing the PLSQL Developer software, there is still "ORA-12154: TNS: unable to parse the specified connection identifier". If it is a Win7,Win8 user, there may even be a white box popping up, so you need to run PLSQL Developer as an administrator, and make sure that your PLSQL Developer is reading the oracle client configuration. Cancel the login directly and find "Tools- > Preferences" in the PLSQL Developer toolbar. Find Oracle Home in the Connection node of Oracle and select OraClient10g_home1. After saving and closing PLSQL Developer, you can log in normally.
It should be noted that when installing PLSQL Developer, it cannot be installed in a parenthesized directory, such as the 64bit system's Program Files (x86) directory, and it will pop up "ORA-12154: TNS: unable to parse the specified connection identifier" no matter how you set it. The same problem can occur in other Oracle database management software, such as Toad for Oracle
"ORA-12154: TNS: unable to parse the specified connection identifier" is one of the more common problems encountered by beginners using Oracle database. As long as we understand how it works and check it calmly, I believe it is easy to find a solution to the problem.
The above is all the contents of this article, "how to specify the connection identifier when ora-12154 appears in Oracle?" Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.