Thread: unixODBC - Oracle Client How To?


Permlink Replies: 39 - Pages: 3 [ 1 2 3 | Next ] - Last Post: Nov 18, 2008 12:51 AM Last Post By: user10264773 Threads: [ Previous | Next ]
ChrisD

Posts: 8
Registered: 09/23/05
unixODBC - Oracle Client How To?
Posted: Feb 27, 2007 4:50 AM
Click to report abuse...   Click to reply to this thread Reply
I having been trying to get the Oracle Instant Client working together with UnixODBC under Fedora Core 5 connecting to an external Oracle database.

I have been trying for over 3 days. Still without luck. Can anynoe give me a hint?

If more info is needed let me know.

Installed:
unixODBC-2.2.11
OracleInstantClientBasic-10.2.0.3

I installed both. And than extracted instantclient-odbc-linux.zip in the same directory as the Oracle Instant client installed which is:
/usr/lib/oracle/10.2.0.3/client/lib

I than set TNS_ADMIN and LD_LIBRARY_PATH both pointing towards /usr/lib/oracle/10.2.0.3/client/lib

Created a tnsnames.ora in that same path. Which holds :
XE2 =
(DESCRIPTION =
(ADDRESS= (PROTOCOL = TCP)(HOST = QCADES082)(PORT=1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = XE)
)
)

Than ran ./odbc_update_ini.sh which did fill the /.odbc.ini and /etc/odbcinst.ini
.odbc.ini
[XE2]
Application Attributes = T
Attributes = W
BatchAutocommitMode = IfAllSuccessful
BindAsFLOAT = F
CloseCursor = F
DisableDPM = F
DisableMTS = T
Driver = Oracle 10g ODBC driver
DSN = XE2
EXECSchemaOpt =
EXECSyntax = T
Failover = T
FailoverDelay = 10
FailoverRetryCount = 10
FetchBufferSize = 64000
ForceWCHAR = F
Lobs = T
Longs = T
MetadataIdDefault = F
QueryTimeout = T
ResultSets = T
ServerName =
SQLGetData extensions = F
Translation DLL =
Translation Option = 0
DisableRULEHint = T
UserID =

odbcinst.ini
[Oracle 10g ODBC driver]
Description = Oracle ODBC driver for Oracle 10g
Driver = /usr/lib/oracle/10.2.0.3/client/lib/libsqora.so.10.1
Setup =
FileUsage =
CPTimeout =
CPReuse =

When I have that all setup I get the
[unixODBC][Driver Manager] Can't open lib /usr/lib/oracle10.2.0.3/client/lib/libsqora.so.10.1 : libclnth.so.10.1 cannot open shared object file.

I than copy those files to /usr/lib.

I seem to get a little bit further...getting the following error:
Driver's SQLAllocHandle on SQL_HANDLE_HENV failed.

Any suggestions?
user569330

Posts: 2
Registered: 04/13/07
Re: unixODBC - Oracle Client How To?
Posted: Apr 13, 2007 6:59 AM   in response to: ChrisD in response to: ChrisD
Click to report abuse...   Click to reply to this thread Reply
I'm also just struggling trough the jungle. When I checked your text I missed that you installed the Oracle ODBC package, isn't it?

I did it but I'm not successful in connecting the database. I got ora 12514. but I didn't set the TNS-NAMES variable.
user569330

Posts: 2
Registered: 04/13/07
Re: unixODBC - Oracle Client How To?
Posted: Apr 13, 2007 7:30 AM   in response to: user569330 in response to: user569330
Click to report abuse...   Click to reply to this thread Reply
I got it!!
Set servername to the service in the tnsnames.ora and it works.

I found out this in using isql -v service and watching sqlnet.log.

Thank you for the Tip with the TNS_ADMIN variable together with the tnsnames.ora file.
Robert Ham

Posts: 106
Registered: 04/18/06
Re: unixODBC - Oracle Client How To?
Posted: Apr 19, 2007 8:34 AM   in response to: user569330 in response to: user569330
Click to report abuse...   Click to reply to this thread Reply
Where is the relevant sqlnet.log?
Laurenz Albe

Posts: 427
Registered: 10/21/05
Re: unixODBC - Oracle Client How To?
Posted: Apr 19, 2007 11:33 PM   in response to: Robert Ham in response to: Robert Ham
Click to report abuse...   Click to reply to this thread Reply
If you have not set LOG_DIRECTORY_CLIENT in your sqlnet.ora, it is created in the current directory, i.e. the working directory of the program that uses the Oracle client.

Yours,
Laurenz Albe
Jerrec

Posts: 3
Registered: 04/26/07
Re: unixODBC - Oracle Client How To?
Posted: Apr 26, 2007 4:09 AM   in response to: Laurenz Albe in response to: Laurenz Albe
Click to report abuse...   Click to reply to this thread Reply
Hello!

I have the same problem. Could you please post me your configuration in total again, so I can compare it with mine?

Thanks!
Rainer
user573569

Posts: 1
Registered: 05/08/07
Re: unixODBC - Oracle Client How To?
Posted: May 8, 2007 5:24 PM   in response to: Jerrec in response to: Jerrec
Click to report abuse...   Click to reply to this thread Reply
Try setting the TWO_TASK environment variable to the TSN name (http://forums.oracle.com/forums/thread.jspa?messageID=1616427). The black magic worked for me. :-)
Robert Ham

Posts: 106
Registered: 04/18/06
Re: unixODBC - Oracle Client How To?
Posted: Jun 18, 2007 1:46 AM   in response to: Laurenz Albe in response to: Laurenz Albe
Click to report abuse...   Click to reply to this thread Reply
Laurenz,

I meant where is user569330's log file; ie, what was the information he used to solve the problem many others are facing?

Robert
Jonah H. Harris

Posts: 786
Registered: 04/24/01
Re: unixODBC - Oracle Client How To?
Posted: Jun 18, 2007 7:40 AM   in response to: ChrisD in response to: ChrisD
Click to report abuse...   Click to reply to this thread Reply
XE2 =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = QCADES082)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = XE)
)
)
Laurenz Albe

Posts: 427
Registered: 10/21/05
Re: unixODBC - Oracle Client How To?
Posted: Jun 19, 2007 1:31 AM   in response to: Jonah H. Harris in response to: Jonah H. Harris
Click to report abuse...   Click to reply to this thread Reply
I know that there is another thread that claims that adding an ADDRESS_LIST around his ADDRESS solved his problem, but - frankly - this is more than questionable. At least it makes no difference on my systems. Have you tried it?

The documentation confirms that you can have ADDRESS in a DESCRIPTION:
http://download-uk.oracle.com/docs/cd/B19306_01/network.102/b14213/protocoladd.htm#sthref286

Yours,
Laurenz Albe
Jonah H. Harris

Posts: 786
Registered: 04/24/01
Re: unixODBC - Oracle Client How To?
Posted: Jun 19, 2007 4:50 AM   in response to: Laurenz Albe in response to: Laurenz Albe
Click to report abuse...   Click to reply to this thread Reply
True, the docs do show that. But, I've run into various inconsistencies in Oracle TNS parsing. Whether or not this fixes it for ChrisD is unknown at this point.

However, re-reading this thread, it appears quite obvious that this is a path issue. I'm hoping that ChrisD mistyped:

libclnth.so.10.1 cannot open shared object file.

Which should've been libclntsh... so I think we need a ldd on the ODBC driver shared object to see what's actually going on.
user596305

Posts: 1
Registered: 09/21/07
Re: unixODBC - Oracle Client How To?
Posted: Sep 21, 2007 9:03 AM   in response to: ChrisD in response to: ChrisD
Click to report abuse...   Click to reply to this thread Reply
After two days of googling and browsing forum posts I finally got it to work, so I want to share how I got around the errors:

1)

Error: [unixODBC][Oracle][ODBC][Ora]ORA-12545: Connect failed because target host or object does not exist

Solution: Just set the TWO_TASK environment to the value of your SID.

2)

Error: [unixODBC][Driver Manager]Specified driver could not be loaded

Solution: I run a x86_64 system and so I had the 64bit version of unixODBC installed. After I switched to the 32bit version (of unixODBC and the instantclient files) it finally worked as expected.

Hope this saves someone the time I had to spend to find it out.

Jonah H. Harris

Posts: 786
Registered: 04/24/01
Re: unixODBC - Oracle Client How To?
Posted: Sep 21, 2007 9:55 AM   in response to: user596305 in response to: user596305
Click to report abuse...   Click to reply to this thread Reply
So, were you previously using Instant Client for x86 or x86-64? Because you can't mismatch the driver and driver manager platform and expect it to work. So, it looks like you were using the 32-bit instant client with the 64-bit unixODBC... or did you try the x86-64 instant client before reverting to changing the driver manager itself?
Sudheendra

Posts: 262
Registered: 01/10/01
Re: unixODBC - Oracle Client How To?
Posted: Sep 22, 2007 9:01 AM   in response to: user596305 in response to: user596305
Click to report abuse...   Click to reply to this thread Reply
The following thread has the ODBC supported platforms details
Sudheendra

Posts: 262
Registered: 01/10/01
Re: unixODBC - Oracle Client How To?
Posted: Sep 22, 2007 9:02 AM   in response to: user596305 in response to: user596305
Click to report abuse...   Click to reply to this thread Reply
The following thread has the ODBC supported platforms details
http://forums.oracle.com/forums/thread.jspa?threadID=340030&tstart=0
Legend
Guru Guru : 2500 - 1000000 pts
Expert Expert : 1000 - 2499 pts
Pro Pro : 500 - 999 pts
Journeyman Journeyman : 200 - 499 pts
Newbie Newbie : 0 - 199 pts
Oracle ACE Director
Oracle ACE Member
Oracle Employee ACE
Helpful Answer (5 pts)
Correct Answer (10 pts)

Point your RSS reader here for a feed of the latest messages in all forums