How does connection to host really work?
661470Sep 29 2008 — edited Sep 30 2008I've been trying to debug this myself, but there seems to be a missing piece, and I'd like some help understanding the components and sequence of the process.
My immediate issue is, how do I get past the"ORA-12170: TNS:Connect timeout occurred" error shown below? It seems that hostname "hcm" is recognized as valid but then points to nowhere.
Environment: Windows 2000, Oracle 10g rel 2, localhost (IP starts with 127), MS loopback adaptor (IP starts with 192), computer name dimension4100, primary dns suffix ora.newmiddleclass.com, database name (same as SID) is hcm.
etc\hosts file:
127.0.0.1 dimension4100.ora.newmiddleclass.com localhost
192.168.255.255 dimension4100.ora.newmiddleclass.com dimension4100
192.168.255.255 dimension4100.ora.newmiddleclass.com hcm
192.168.255.255 dimension4100.ora.newmiddleclass.com hcm2
192.168.255.255 dimension4100.ora.newmiddleclass.com hcm3
192.168.255.255 dimension4100.ora.newmiddleclass.com no-tns
I'm trying to connect via sqlplus with this syntax:
sqlplus SYS/pw@hcm
ORA-12154: TNS:could not resolve the connect identifier specified
when I try to connect via @ using anything other than localhost or dimension4100 or a host name specified in the hosts file.
- Implies that this is the first step in the process
...so using host string @hcm as shown above avoids the 12154 error. Next, one of two things happens:
ORA-12541: TNS:no listener
Only with localhost or dimension4100. e.g.
sqlplus SYS/pw@dimension4100
- or -
ORA-12170: TNS:Connect timeout occurred
Only with hostnames that are mapped to 192 in hosts file (except for dimension4100). Doesn't matter if the hostname is in tnsnames.ora. e.g.
sqlplus SYS/pw@hcm
sqlplus SYS/pw@hcm2
sqlplus SYS/pw@no-tns ("no-tns" is not defined in tnsnames.ora)
Note:
- I've verified that the hosts and ora files I've edited are really the files that the system is reading.
- I can ping any hostname in the hosts file and get the correct IP address.
- I can connect via sqlplus / as sysdba
- I have to start the listener manually via lsnrctl start. It listens via protocol tcp on the loopback IP (192) on port 1521, as well as protocol ipc (EXTPROC1ipc)
- lsnrctl services:
LSNRCTL for 32-bit Windows: Version 10.2.0.1.0 - Production on 29-SEP-2008 09:22:40
Copyright (c) 1991, 2005, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1)))
Services Summary...
Service "PLSExtProc" has 1 instance(s).
Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
Handler(s):
"DEDICATED" established:0 refused:0
LOCAL SERVER
The command completed successfully
(Is this a problem? Should it be using the TCP protocol?)
- Services via control panel:
(started)
OracleOraDb10g_home1iSQL*Plus
OracleOraDb10g_home1TNSListener
OracleServiceHCM
(disabled)
OracleJobSchedulerHCM
- tnsnames.ora:
HCM3 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.255.255)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = OracleServiceHCM)
)
)
HCM2 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.255.255)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = HCM.ora.newmiddleclass.com)
)
)
HCM =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.255.255)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = HCM.ora.newmiddleclass.com)
)
)
EXTPROC_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
)
(CONNECT_DATA =
(SID = PLSExtProc)
(PRESENTATION = RO)
)
)
...so....how do I get past the"ORA-12170: TNS:Connect timeout occurred" error?
Thanks.