Again this bored problem, although the problem sesame dot big, but let us find Ah!
For a long time without Oracle installed, today when installing 11g, with Plsql developer connection, there is this vulgar problem: ORA-12154 TNS cannot parse the specified connection identifier. I think the installation of time has been very cautious, the result is still a mistake, so, I hold the resolve to not solve the problem until the determination to start a step-by-step troubleshooting, Kung Fu is not a conscientious, eventually resolved.
Here I give you a detailed introduction to the problem-solving ideas:
The first thing to figure out is that there are two main subjects: Oracle services and Plsql Developer.
First, troubleshoot the Oracle service side.
1. Open Service and monitor
Command Line input: Lsnrctl start
or right-click on the interface operation My Computer----services and apps--services, right clicking on the Oracleoradb11g_home1tnslistener--> Startup type--auto (delayed start), The benefit of this startup is that it only starts when you are listening with the Oracle service, saving memory. Of course, start the service after you start the service listener. Right-click on the ORACLESERVICEORCL to do the same as above.
Monitoring details can be viewed after the listener has started. Command line input: Lsnrctl status.
Monitoring and service are started successfully, and then with Plsql Developer Connection test, if possible, the following steps can be omitted, if not, please see the second step below.
2. Test connection with Sqlplus
Command Line input: Sqlplus/nolog
Re-enter: Conn User name/password @ instance as sysdba. Example: Conn Sys/[email protected] as SYSDBA or conn System/[email protected] as SYSDBA.
Description: User name and password is when the installation of Oracle will end, there is a password management option to enter the settings, there are many user names, such as Sys,system,scott, but the password to set itself.
If you can connect, you can continue to read the following, if not connected, you can stop, to investigate where the Oracle installation problems.
To detect more insurance, we can also ping Oracle services. Command line input: Tnsping LOCALHOST:1521/ORCL. If the word "OK" appears, you can indicate a ping.
Try Plsql developer to continue the connection, if it is not connected, continue to the following.
Carefully check the contents of the Tnsnames.ora file in D:\app\Administrator\product\11.2.0\dbhome_2\NETWORK\ADMIN for errors, such as more space Ah what, especially the address point. However, it is generally not necessary to change the contents of the first time. Note here that after the Oracle 11g is installed, there will be two dbhome in the installation directory. Dbhome_1 and Dbhome_2, two of them have tnsnames.ora inside. We're going to check the Tnsnames.ora in the Dbhome_2 folder.
Second, Plsql Developer
If the above process is smooth, the basic problem of Oracle services can be ruled out. We turn the problem to Plsql Developer.
1, open Plsql Developer, first do not login, click Cancel, then we have entered the operation of the main interface, click on the menu bar----preferences--Connect, select the Oracle client on the right, select the one you installed, then click Apply, OK.
2. Log in again and fill in the username, password, and instance of the Oracle service you just ping. Again, if the connection is not connected, add the database instance to the hostname and port number. Example: LOCALHOST:1521/ORCL, which is configured to correspond to Tnsnames.ora configuration one by one. Reconnect try, must succeed, no success, that is beyond my personal ability range, hehe ~
The following is an original configuration format for Tnsnames.ora:
# Tnsnames.ora Network Configuration file:d:\app\administrator\product\11.2.0\dbhome_2\network\admin\tnsnames.ora# Generated by Oracle configuration tools. LISTENER_ORCL = ( ADDRESS = (PROTOCOL = TCP) (HOST = localhost) (PORT = 1521)) Oraclr_connection_data = (DESCRIPTION = (address_list = ( ADDRESS = (PROTOCOL = IPC) (KEY = EXTPROC1521)) ) (Connect_data = (SID = Clrextproc) (PRESENTATION = RO) ) ORCL = (DESCRIPTION = ( ADDRESS = (PROTOCOL = TCP) (HOST = localhost) (PORT = 1521)) (Connect_data = (SERVER = dedicated) (service_name = ORCL) ) )
View Code
Description
1, if we can configure multiple DB instances, ORCL is one of them. Of course we can continue to add different instances by adding code such as the following in Tnsnames.ora:
ORCL2 = (DESCRIPTION = ( ADDRESS = (PROTOCOL = TCP) (HOST = localhost) (PORT = 1521)) (Connect_data = (SERVE R = dedicated) (service_name = ORCL)))
View Code
So we have a Orcl2 instance on the local service, we can try it.
2, of course, we can also configure the remote Oracle services, the same principle, just modify the host and port number, the code is as follows:
Remoteorcl= (DESCRIPTION = ( ADDRESS = (PROTOCOL = TCP) (HOST = 192.168.2.105) (PORT = 1521)) (connect_data = (SERVER = dedicated) (service_name = ORCL) ) )
View Code
So at the time of login, fill in the corresponding instance, user name and password is done.
ORA-12154 TNS cannot parse the specified connection identifier