Oracle Connection appears ora-12154
After the RAC is configured, two nodes can ping with tnsping, but the following error occurs with the Sqlplus connection, and I don't know where the problem is.
[Oracle@rac2 admin]$ lsnrctl Status
Lsnrctl for linux:version 9.2.0.4.0-production on 04-mar-2008 08:32:26
Copyright (c) 1991, 2002, Oracle Corporation. All rights reserved.
Connecting to (description= address= (protocol=tcp) (HOST=RAC2) (port=1521))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version Tnslsnr for Linux:version 9.2.0.4.0-production
Start Date 04-mar-2008 08:29:03
Uptime 0 days 0 hr. 3 min sec
Trace level off
Security off
SNMP off
Listener Parameter File/home/oracle/9.2.0.4/network/admin/listener.ora
Listener Log File/home/oracle/9.2.0.4/network/log/listener.log
Listening Endpoints Summary ...
(Description= (address= (protocol=tcp) (HOST=RAC2) (port=1521))
Services Summary ...
Service "Plsextproc" has 1 instance (s).
Instance "Plsextproc", Status UNKNOWN, has 1 handler (s) for the This service ...
Service "Esal" has 2 instance (s).
Instance "Rac1", Status READY, has 1 handler (s) for the This service ...
Instance "Rac2", Status READY, has 1 handler (s) for the This service ...
The command completed successfully
[Oracle@rac2 admin]$ Lsnrctl Service
Lsnrctl for linux:version 9.2.0.4.0-production on 04-mar-2008 08:32:32
Copyright (c) 1991, 2002, Oracle Corporation. All rights reserved.
Connecting to (description= address= (protocol=tcp) (HOST=RAC2) (port=1521))
Services Summary ...
Service "Plsextproc" has 1 instance (s).
Instance "Plsextproc", Status UNKNOWN, has 1 handler (s) for the This service ...
Handler (s):
"Dedicated" established:0 refused:0
Local SERVER
Service "Esal" has 2 instance (s).
Instance "Rac1", Status READY, has 1 handler (s) for the This service ...
Handler (s):
"Dedicated" established:0 refused:0 State:ready
REMOTE SERVER
(Address= (PROTOCOL=TCP) (HOST=RAC1) (port=1521))
Instance "Rac2", Status READY, has 1 handler (s) for the This service ...
Handler (s):
"Dedicated" established:0 refused:0 State:ready
Local SERVER
The command completed successfully
[Oracle@rac2 admin]$ Sqlplus cy/zh@esal
Sql*plus:release 9.2.0.4.0-production on Tue Mar 4 08:32:45 2008
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
ERROR:
Ora-12154:tns:could not resolve service name
Enter User-name:
ERROR:
Ora-01017:invalid Username/password; Logon denied
Enter USER-NAME:CY/ZH@RAC1
ERROR:
Ora-12154:tns:could not resolve service name
Sp2-0157:unable to CONNECT to ORACLE after 3 attempts, exiting Sql*plus
[Oracle@rac2 admin]$ Sqlplus Cy/zh@rac2
Sql*plus:release 9.2.0.4.0-production on Tue Mar 4 08:32:59 2008
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
ERROR:
Ora-12154:tns:could not resolve service name
Enter User-name:
The following procedures are generally available to deal with:
Open cmd in virtual machine, use LSNRCTL status to view the service of listener listening
If you see the listening service "ORCL", then in the local TNS configuration (service_name = ORCL) must write ORCL, if you want to customize, in the virtual machine in the listener configuration to join the custom service name, remember to restart the listening service: Lsnrctl Reload
The resulting configuration file is as follows
Virtual Machine Listener:
Sid_list_listener =
(Sid_list =
(Sid_desc =
(global_dbname = test) Custom Service name
(Oracle_home = e:oracleproduct10.2.0db_1) db_home
(sid_name = test)
)
(Sid_desc =
(program = Extproc)
(Sid_name = Plsextproc)
(Oracle_home = e:oracleproduct10.2.0db_1) # #这个服务保证你可以使用外部过程, such as C program
)
)
This machine TNS:
Orcl_xnj =
(DESCRIPTION =
(Address_list =
(address = (PROTOCOL = TCP) (HOST = 182.12.15.232) (PORT = 1521))
)
(Connect_data =
(service_name = test) corresponds to the custom service name
)
)
Connect again, problem solved!
Remember, must be from the simplest reason to find, do not see on the internet on what to change the process number, registry, and so on, to think about why the function of the network is not good, or positioning problems.
VS2008 Connection Oracle Error ora-12154 TNS could not resolve the specified connection identifier
Under the premise that your code has no errors:
(i) Check the Oracleoradb10g_home1tnslistener service is not started, that is, monitoring services
(ii) Check Tnsnames.ora whether to add a connection string (recommended Sqlplus or Pl/sql test), the path is generally:%oracle_home%product10.2.0db_1networkadmintnsnames.ora
The above answer for reference