I am troubleshooting a freshly reimaged backup server Win2000 / Oracle 10.1.0.5.0.
Here's what I did:
- Installed Oracle 10g by copying Basic Instant Client package and ODBC package into same directory, then running odbc_install.exe.
- Copied
tnsnames.ora
from the original Win2000 server (where the DB connection works just fine) - Updated Environment variables :
PATH
,TNS_ADMIN
and rebooted Windows
When I run the end-user application, I get an error:
ORA-12545 : Connect failed, because target host or object does not exist.
Looking more into this, many sources (e.g. http://www.orafaq.com/wiki/ORA-12545 ) recommend using the traceroute
command. But I can't seem to find the \bin
directory with that command anywhere (and obviously, command is not recognized), which leads me to believe that the instant client does not have this command? I do not have the installation package for the Administrator, so how can I do more troubleshooting under Instant Client?
At an OS-level e.g. from command-line, both ping and tracert work just fine with the DB server name). Oracle's traceroute should (supposedly, as per Oracle docs) give me the full error stack (instead of a single-line error) – hence it would give me additional hint why the DB connection on a recently reimaged server does not work.
As far as I can say, both Primary and Backup server are identical (I didn't work here 10 yrs ago though). Is there perhaps a package of admin tools I could download? Or just somehow unlock it within Instant Client? Are there any Oracle logs of the DB transactions / connection attempts?
From the command line I can ping the destination DB (defined in tnsnames.ora
) just fine, so I believe I can completely rule out the networking (e.g. DNS/firewall/accessibility). Of course, before the server reimage, the DB connection worked just fine, so there is clearly something else missing in the first-time configuration.
I cannot seem to find any info on command line troubleshooting under instant client. Does one really need Administrator installation to do basic command line troubleshooting?
Best Answer
There is no
trcroute
for the instant client, but even if you had the full administrator client,trcroute
may not return anything useful.And that is the mistake people usually make, based on a false assumption. Just because you can ping, let's say, even
tnsping
the database server, does not mean at all you will be able to connect or name resolution works properly. Ping andtnsping
checks work only up to the first entry point in a database connection, and they stop there, these tools alone are not enough for testing database connections.Based on my experience,
ORA-12545
/TNS-12545
is a result of indirect name resolution problems. Even the official description suggests trying IP addresses instead of host names:Whenever you connect through a listener, the listener may forward your request to another address that a participant does not understand =>
ORA-12545
.Make sure your client and server can resolve all addresses specified in the connection string, especially the addresses that appear in the output of
lsnrctl services
on the database server.And below is an example.
My client:
My TNS entry:
Run some checks:
I can ping the host in my TNS entry, even tnsping works, so I will be able to connect, right? Well, no:
So let's check what
trcroute
says:No errors, everything should be OK, still, I can't connect. So much for
trcroute
.Now let's do some real troubleshooting, and check the server side. The address I am connecting to:
And the services registered here:
Notice in the above output, the
mindb
service has 2 instances/handlers, with different addresses. Whenever I connect too6ca-scan.balazs.vm
, my requests will be forwarded too6ca1-vip.balazs.vm
oro6ca2-vip.balazs.vm
. My client can't understand those addresses, but if I fix it:The above is a very common mistake when using Oracle RAC. But
ORA-12545
is not specific to RAC, that can happen in single instance environments as well. All you need is a shared server configuration, and name resolution problems on the database server. Same story short:I have a dispatcher listening on
o61.balazs.vm
. If I request a shared server connection, and the listener tries to forward the request too61.balazs.vm
, but can not resolve that address, that will result anORA-12545
as well.