Print Thread
Connect using Oracle instant client
#50707 02/12/15 03:41 PM
Joined: Feb 2015
Posts: 7
M
Member
OP Offline
Member
M
Joined: Feb 2015
Posts: 7
Hi,
I'm looking for connect to database using Oracle instant client
Can I use DOA components?

Thanks, Martin

Re: Connect using Oracle instant client
Martin Ben #50711 02/12/15 04:54 PM
Joined: Aug 1999
Posts: 22,220
Member
Offline
Member
Joined: Aug 1999
Posts: 22,220
Yes, that is possible. To use the Instant Client you need to set the following environment variables:
  • PATH
    Needs to include the Instant Client directory (where oci.dll is located).
  • TNS_ADMIN
    Needs to point to the directory where tnsnames.ora is located.
  • NLS_LANG=language_territory.characterset
    Defines the language, territory, and character set for the client.


Marco Kalter
Allround Automations
Re: Connect using Oracle instant client
Marco Kalter #50714 02/12/15 06:58 PM
Joined: Feb 2015
Posts: 7
M
Member
OP Offline
Member
M
Joined: Feb 2015
Posts: 7
Thanks. Can I use tnsnames.ora in directory where my application is? Instead of environment variable TNS_NAMES.

Re: Connect using Oracle instant client
Martin Ben #50717 02/13/15 10:15 AM
Joined: Aug 1999
Posts: 22,220
Member
Offline
Member
Joined: Aug 1999
Posts: 22,220
That will work if, during application start-up, you set the TNS_ADMIN environment variable to the application directory.


Marco Kalter
Allround Automations
Re: Connect using Oracle instant client
Marco Kalter #50733 02/16/15 12:36 PM
Joined: Feb 2015
Posts: 7
M
Member
OP Offline
Member
M
Joined: Feb 2015
Posts: 7
I used your recommendation, but I cannot log on Oracle. I got this exception message:
Code
Initialization error
Oracle Client not properly installed

OracleHomeKey: 
OracleHomeDir: 

Re: Connect using Oracle instant client
Martin Ben #50734 02/16/15 01:40 PM
Joined: Aug 1999
Posts: 22,220
Member
Offline
Member
Joined: Aug 1999
Posts: 22,220
Can you let me know your exact Direct Oracle Access version?


Marco Kalter
Allround Automations
Re: Connect using Oracle instant client
Marco Kalter #50735 02/16/15 01:47 PM
Joined: Feb 2015
Posts: 7
M
Member
OP Offline
Member
M
Joined: Feb 2015
Posts: 7
4.1.2.0

Re: Connect using Oracle instant client
Martin Ben #50737 02/16/15 03:21 PM
Joined: Aug 1999
Posts: 22,220
Member
Offline
Member
Joined: Aug 1999
Posts: 22,220
It should work fine. Can you add the instant client directory as the first entry in the PATH? For example:

PATH=C:\Oracle\InstantClien11g;C:\Windows;C:\Windows\System;...


Marco Kalter
Allround Automations
Re: Connect using Oracle instant client
Marco Kalter #50740 02/16/15 04:00 PM
Joined: Feb 2015
Posts: 7
M
Member
OP Offline
Member
M
Joined: Feb 2015
Posts: 7
There was a bug in tnsnames.ora blush

Now it works perfectly. Thanks a lot for your help.


Moderated by  support 

Link Copied to Clipboard
Powered by UBB.threads™ PHP Forum Software 7.7.4
(Release build 20200307)
Responsive Width:

PHP: 7.1.33 Page Time: 0.058s Queries: 13 (0.031s) Memory: 2.5346 MB (Peak: 3.0425 MB) Data Comp: Off Server Time: 2024-05-19 00:23:25 UTC
Valid HTML 5 and Valid CSS