Oracle Connection with OCI Mode

Discussion of open issues, suggestions and bugs regarding usage of dbExpress drivers for Oracle in Delphi and C++Builder
Post Reply
eliseu_corrona
Posts: 11
Joined: Wed 18 Mar 2009 19:25
Location: Brazil

Oracle Connection with OCI Mode

Post by eliseu_corrona » Mon 20 Feb 2012 13:26

Hi, all fine friends?
I need to make a oracle connection with delphi in OCI mode. Connecting directly by Devart, works perfectly, however, the OCI could not do so yet.

I have an installation of Oracle 10g installed on our server. I need to do some testing mode OCI because our client has a redundant layout of the installation of Oracle, where the IP of Oracle server can change.

I need connect to the Alias ​​and not the server IP (directly).

In tests. I installed Oracle Client, configured it (environment variables), all right. But the moment I turn on the connection (TSQLConnection) the following error occurs:

"Can not initialize oci.dll. Error: -1"

Could anyone help me?

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Post by AlexP » Tue 21 Feb 2012 09:44

Hello,

Please provide the following information:
- the exact version of dbExpress driver for Oracle;
- the exact version of your IDE;
- the exact version of your OS;
- the exact version of your Oracle client and Server;

eliseu_corrona
Posts: 11
Joined: Wed 18 Mar 2009 19:25
Location: Brazil

Post by eliseu_corrona » Tue 21 Feb 2012 14:00

Hi AlexP, all fine?
Thanks for your answer.

I do to make the connection.
After several tests, could make a connection through OCI.
The problem was my version of windows, for some reason, was not loading the oci.dll.

After creating a new virtual machine (virtual box) the connection was successful.

Only for information, my settings are:

- Oracle DBExpress Driver (latest version);
- Windows XP;
- Delphi XE Update 2;
- Oracle "10.2g" and Oracle Client "11.02".

The Steps, for future view, the with connect in Oci mode is:

1) Installing (uncompress) Oracle Client in any Folder, in this sample, in "c:\Oracle\InstantClient"

2) In Enviroment Options of windows, in "Path" variable, set the Oracle Instant Client Folder.

2.1) Create a User Variable called "TNS_ADMIN" and set the Oracle Instant Client Folder.


Now everything is working perfectly.

Thanks and sorry for the inconvenience, it had already tried everything and could not connect.

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Post by AlexP » Wed 22 Feb 2012 13:32

Hello,

Besides the steps you adjusted, for working with Oracle Instant Client, you also can add the following data to the registry

[HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE\InstanctClient]
"ORACLE_HOME_NAME"="InstanctClient"
"ORACLE_HOME_KEY"="SOFTWARE\ORACLE\InstanctClient"
"ORACLE_HOME"="С:\Oracle\InstantClient"

and place the Oracle Instatnt Client libraries to С:\Oracle\InstantClient\Bin, and the tnsnames.ora file - to the С:\Oracle\InstantClient\Network\Admin
folder.

In addition, if you don't want to change the registry or the environment variables, you can just copy the Oracle Instatnt Client libraries and the tnsnames.ora file to the folder with an application

eliseu_corrona
Posts: 11
Joined: Wed 18 Mar 2009 19:25
Location: Brazil

Post by eliseu_corrona » Wed 22 Feb 2012 18:43

Hi AlexP, fine?
Thanks for your tips. Very intersting.

I'm saved your sugesttions and will testing soon.

Thanks for your attention friend.

Regarsts,

Eliseu Corrona.
JB Software Ltda
Brazil.

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Post by AlexP » Thu 23 Feb 2012 10:28

Hello,

If you have any other questions, feel free to contact us.

sharmavd1983
Posts: 6
Joined: Fri 31 Aug 2012 03:59

Re: Oracle Connection with OCI Mode

Post by sharmavd1983 » Fri 31 Aug 2012 04:07

Hi

I am new to OCI mode. I have downloaded dbForge professional trial version.
On database connection screen, Direct checkbox is disabled.

When it can be enabled?
What I need to do to make OCI connection?

please provide me details how to setup OCI connection and how to configure oracle client with dbForge?

Many thanks in advance.....

alexa

Re: Oracle Connection with OCI Mode

Post by alexa » Fri 31 Aug 2012 09:54

Direct checkbox is disabled when Oracle client is not detected by dbForge. This can be due to Oracle client being not installed or when it's not properly installed. Please also make sure you are using 64-bit Oracle client but not a 32-bit one in case you are running 64-bit operating system.

Please refer to the following article explaining how to correctly configure your Oracle Instant Client so our tools can work with it: http://blogs.devart.com/dbforge/how-to- ... lient.html

Also, please add new posts concerning dbForge products to the relevant forum at: http://forums.devart.com/viewforum.php?f=40

sharmavd1983
Posts: 6
Joined: Fri 31 Aug 2012 03:59

Re: Oracle Connection with OCI Mode

Post by sharmavd1983 » Fri 31 Aug 2012 12:35

Thank you so much....

jub@geb
Posts: 3
Joined: Wed 20 Apr 2016 11:21

Re: Oracle Connection with OCI Mode

Post by jub@geb » Wed 04 May 2016 06:49

Hi all,
Alex P mentioned that
AlexP wrote:you can just copy the Oracle Instatnt Client libraries and the tnsnames.ora file to the folder with an application
.
I installed Oracle Client 12 and am wondering which library files I have to copy?
Is it possible to run in OCI Mode on an other PC without installing the Oracle Client there if I copy those files?
This would save the overhead of installing and administering the Client on all PCs.

Hope you can help me
Greetings jub :)

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: Oracle Connection with OCI Mode

Post by AlexP » Thu 05 May 2016 05:45

hello,

You can use Oracle Database Instant Client hhttp://www.oracle.com/technetwork/database/fea ... 97480.html that doesn't require installation. The detailed description about deployment and configuration of this client can be found on the developers' website or on our blog: http://blog.devart.com/how-to-configure ... lient.html .

Post Reply