Here is my use case:
- We are using virtual machine. Couple of days ago I have created new Oracle database. I cloned this machine and it got different IP address.
- Today I wanted to connect to the database using SQLPlus but I go connection timeout. I have tried tnsping command and here is the output of that command:
C:\Users\Administrator>tnsping clm
TNS Ping Utility for 64-bit Windows: Version 11.2.0.1.0 – Production on 09-JAN-2
014 08:36:31Copyright (c) 1997, 2010, Oracle. All rights reserved.
Used parameter files:
C:\app\Administrator\product\11.2.0\dbhome_1\network\admin\sqlnet.oraUsed EZCONNECT adapter to resolve the alias
Attempting to contact (DESCRIPTION=(CONNECT_DATA=(SERVICE_NAME=))(ADDRESS=(PROTO
COL=TCP)(HOST=9.142.60.187)(PORT=1521)))
TNS-12535: TNS:operation timed out
What is weird, that the current database address is different than 9.142.60.187. sqlnet.ora also does not contain any interesting data:
SQLNET.AUTHENTICATION_SERVICES= (NTS)
NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT)
?
ADR_BASE = C:\app\Administrator\product\11.2.0\dbhome_1\log
How can I make my connection to sqlplus available?
What is interesting, I am able to connect to the database using jdbc driver and it works fine.
Best Answer
Your sqlnet.ora is configured to first try to use TNSNAMES (tnsnames.ora in your TNS_ADMIN directed folder as defined in registry, environment variable or taken from default location) to resolve
clm
to a path through your network mapping SQL*Net to TCP/IP and possibly others.From your tnsping that seems not to resolve. Therefore, SQL*Net tries the second one: EZCONNECT. See Oracle docs on that one.
Probably you are using somewhere an EZCONNECT connection string like user/pwd@//9.142.60.187 without service name and port. Or my knowledge of EZCONNECT is too simple; somehow it seems to translate
clm
into//9.142.60.187
. That might be explained by the answer to the following question: Do you have a hostnameclm
in DNS or hosts file mapping to 9.142.60.187?I do not recommend using EZCONNECT, I always like to have tnsnames.ora hard coded, specifying everything needed. EZCONNECT can work nonetheless.
Can you include IP address of clone in your sample?
Can you include outcome of
ping clm
andnslookup clm
in your sample?