Page 1 of 1

Cannot find OCI dll.

Posted: Fri 13 Jun 2014 02:41
by cliffchan512
Hi,

Starting from version 9.2.5 to latest version 9.3.9, I encountered an issue which is error 'cannot find OCI dll' when connecting with Oracle instant clients. Prior to version 9.2.5, connection is ok with instant clients in my working environment. Please advice.

Thanks,
Cliff

Re: Cannot find OCI dll.

Posted: Fri 13 Jun 2014 08:16
by AlexP
Hello,

Please specify where and how you "registered" instant clients: registry, environmental variables, etc.

Re: Cannot find OCI dll.

Posted: Mon 16 Jun 2014 02:19
by cliffchan512
Hi Alex,

I just have oracle instant client path variables in environment path only.

Thanks,
Cliff

Re: Cannot find OCI dll.

Posted: Mon 16 Jun 2014 10:01
by AlexP
We cannot reproduce the problem. If you have specified the correct path (to the oci.dll library folder) in the system environmental variable PATH, ODAC will find and load this library. Please make sure the path really exists in this variable by executing the following command in the console:

>echo %path%

P.S. It is desirable that the path to the Oracle client is the first in this variable.

Re: Cannot find OCI dll.

Posted: Tue 17 Jun 2014 02:06
by cliffchan512
Hi Alex,

I traced into the source code and found that there is a procedure AddToOracleHomes() in the OraCall, the below code returns false so that no entry of instant client path is added to variable FHomes. Then the FDefault was set to nil in the procedure GetDefaultHome(). This is what I know so far, thanks!

Success := RegQueryValueEx(hOracleReg, 'OCIDLL', nil, nil, @HomePath, @Len) = ERROR_SUCCESS

Re: Cannot find OCI dll.

Posted: Tue 17 Jun 2014 10:12
by AlexP
If a correct path to the folder containing the instant client is specified in the system environmental variable, then the method GetDefaultHome (if no record was found in the registry before) searches in the PATH environmental variable. If you register instant client in the registry, you should add a OCIDLL parameter and specify the path to the library in this parameter.

Re: Cannot find OCI dll.

Posted: Wed 18 Jun 2014 04:28
by cliffchan512
Hi,

I do not register instant clients in the registry and am sure that correct paths are specified in the system environmental path. I see that the paths are returned in GetEnvironmentPathVariable in GetDefaultHome, however the below condition returns false since the FHomes do not contain instant client path. Then, FDefault is set to nil.

Home := TOracleHome(FHomes);
if ((AnsiStrIComp(PChar(Home.Path + '\'), PChar(Str)) = 0) or
(AnsiStrIComp(PChar(Home.Path + '\bin\'), PChar(Str)) = 0)) and
CheckHomePath(Home.Path)

My oracle client setting works in ODAC version 9.1.4, 8.6.1 those I was trying to update and version 8.1.6 that I was using. But it fails in any versions after 9.1.4.

Re: Cannot find OCI dll.

Posted: Thu 19 Jun 2014 10:05
by AlexP
The provided code will be executed in the only case - if the FHomes.Count property is not null. Information is added in the AddToOracleHomes method only in case when there are records in the registry. If there are no records and FHomes.Count is null, then the following code is executed:

Code: Select all

  if CheckHomePath(Str) then begin
    FDefault := Add('', Str, '', '', False);
    exit;
  end;
where Str is the path retrieved from the environmental variable, that is checked for presence of oci.dll or ociw32 at this path, and if these files are detected - the path is added to the Homes list and becomes default, from which the DLL is loaded.

Re: Cannot find OCI dll.

Posted: Fri 20 Jun 2014 02:09
by cliffchan512
Hi,

FHome is not null and there are records in since there are also installed oracle client in my machine.

Re: Cannot find OCI dll.

Posted: Fri 20 Jun 2014 03:48
by cliffchan512
Hi,

It is the case that if there are both installed and instant oracle clients (don't register in the registry) installed in a machine, the instant client path would not be picked up to be used in this case. Is that correct?

Re: Cannot find OCI dll.

Posted: Fri 20 Jun 2014 08:51
by AlexP
Yes, currently, if a record about at least one Oracle client is found in the registry, then the path to the client (not registered in the registry) will be ignored in the environmental variables. We will change this behavior in the next version.

Re: Cannot find OCI dll.

Posted: Fri 20 Jun 2014 09:15
by cliffchan512
Hi,

When will be the next version probably? Since we are going to upgrade from 8.1.6 to a newer version but not yet decided.

Re: Cannot find OCI dll.

Posted: Fri 20 Jun 2014 11:18
by AlexP
We plan to release the new version next month.