Page 1 of 1
TNS_ADMIN Environment not recognized
Posted: Tue 24 Jun 2008 06:46
by keckhard
hello,
We tested Odac 6.25 in combination with oracle instant client 10.2.0.4. When we used a own tnsnames.ora in the instant client directory and setup an environment variable TNS_ADMIN which point's to this directory sqlplus and other oracle tools seem to work. Odac also work if there is only the instant client on the workstation. But if there is also installed a fat client (registry settings for it), there is always used the tnsnames.ora out of this directory.
Do we miss some odac settings?
How possible to use our own tnsnames.ora instead of an already installed one.
thx and br, klaus.
Posted: Tue 24 Jun 2008 11:27
by Challenger
Please check whether you have the tnsnames.ora file in the folder to which points the TNS_ADMIN variable.
Posted: Wed 25 Jun 2008 07:08
by keckhard
hi,
TNS_ADMIN is set and tnsnames.ora is in the directory TNS_ADMIN points to.
Posted: Thu 26 Jun 2008 13:34
by Challenger
No, ODAC always tries to get the TNS_ADMIN environment variable and use its value. Please contact us by e-mail at odac*devart*com. We will send you a test sample to detect why ODAC does not use TNS_ADMIN.
Posted: Fri 27 Jun 2008 06:44
by jfudickar
Woudn't it make sence to include this test program into the default distribution.
It could happen more often that a customer can't get a connection, and then such a program would be helpfull.
Greetings
Jens
Posted: Tue 09 Sep 2008 10:02
by keckhard
hi challanger,
we tested your exe and the outcome is, that your exe recognises the tns_admin variable we set before in a bat-file. when we use the same bat-file and just replace the project1.exe with our exe, the connect still fails.
- we use oracle instant client for our application to be independent from unpredictable registry settings
- the connect fails (with unable to resolve service name) on clients with an additionaly installed non instant-oracle client (but your project1.exe recognises the correct tns_admin variable)
- we use TOraSession with the default settings and don't use direct connection
- we set the connectstring at application start (value adjusted in an ini-file)
- our start script:
set TNS_ADMIN=%PIT_BG_BDE_PATH%\OraClient\tns_admin
set ORACLE_HOME=%PIT_BG_BDE_PATH%\OraClient
set PATH=%PIT_BG_BDE_PATH%\OraClient
cd %PIT_BG_BDE_PATH%\Client
start /D%PIT_BG_BDE_PATH% %PIT_BG_BDE_PATH%\client\bde.exe
it seems that for some reason(s) the registry settings are used instead of the environment variables.
are there some special settings of the TOraSession object we have overseen till now?
thx and best regards, klaus eckhardt.
Posted: Mon 15 Sep 2008 06:57
by keckhard
hi,
i know i didn't reply the outcome of running your test-project for a long time (holidays and after that lots of other things to do), but i really need a solution for the problem with the ORACLE_HOME and TNS_ADMIN resolution.
thx and best regards, klaus.
Posted: Tue 16 Sep 2008 08:38
by Plash
When several clients are installed, ODAC requeres the correct path to oci.dll. This path cannot be received from the TNS_ADMIN or ORACLE_HOME environment variables.
The current version of ODAC uses only registry to select the default Oracle home. To make ODAC use instant client you should add a value like the following
OCIDLL=C:\InstantClient\oci.dll
to the HKEY_LOCAL_MACHINE\Software\Oracle.
Posted: Tue 16 Sep 2008 09:02
by jfudickar
What about adding an option to change this at runtime maybe via a commandline parameter.
Greetings
Jens
Posted: Wed 17 Sep 2008 07:22
by Plash
The OraCall unit has the OCIDLL global variable. You can set this variable in your application before you open the first connection. In this case the value in the registry is not required.
Posted: Wed 17 Sep 2008 07:24
by keckhard
hi plash,
thx for your answer. this are really bad news. we currently run applications which are requiring different versions of the oracle client. the oldest version of oracle client we are using is 8.0.6 (for a oracle forms application). we have had many problems in the past with multiple oracle homes (clients) on the windows workstations of our users. and so we are quite sure, that if we set this registry key, we are running into big troubles with already existing applications. for our new application the idea is to rollout it with the instant client and get all settings via environment variables. could you please change the behaviour of odac to primary get oracle setting from the environment and if the environment is not set get the oracle setting from the registry?
br, klaus.
Posted: Wed 17 Sep 2008 08:16
by keckhard
hi,
you made my day. by setting the ocidll variable and using the new oracle naming method (so we don't need the TNS_ADMIN) we can now rollout our application without any changes of the registry.
thx and br, klaus.