Learn how to a build a cloud-first strategyRegister Now

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 4542
  • Last Modified:

How to set up ODBC for Oracle on Solaris with unixODBC driver manager

I am trying to follow the metalink doc to set up ODBC connections:

But I got the following error:

oracle@ors2di # ./doit
make: Fatal error in reader: /opt/app/oracle/product/10.2.0/db_1/odbc/lib/env_odbc.mk, line 1422: Unexpected end of line seen
./doit: ./odbcsel1: not found
oracle@ors2di #
1 Solution
geotigerAuthor Commented:
Here is what I have done  so far:

1 .Install unixODBC driver
    # pkg-get -i unixodbc
2. Configure DNS
root@ors2di # more odbcinst.ini
Description             = Oracle 10g R2 ODBC driver.
Driver          = /opt/app/oracle/product/10.2.0/db_1/lib/libsqora.so.10.1
Setup           =
FileUsage               =
CPTimeout               =
CPReuse         =
UsageCount              = 1

root@ors2di # more odbc.ini
Application Attributes          = T
Attributes              = W
BatchAutocommitMode             = IfAllSuccessful
CloseCursor             = T
DisableDPM              = F
DisableMTS              = T
Driver          = owb1odbc
DSN             = ora102
EXECSchemaOpt           =
EXECSyntax              = T
Failover                = T
FailoverDelay           = 10
FailoverRetryCount              = 10
FetchBufferSize         = 64000
ForceWCHAR              = F
Lobs            = T
Longs           = T
MetadataIdDefault               = F
QueryTimeout            = T
ResultSets              = T
ServerName              = owb1
SQLGetData extensions           = F
Translation DLL         =
Translation Option              = 0
UserID          = std_rep

root@ors2di #

3. test it
oracle@ors2di # pwd
oracle@ors2di # more doit
export SAMPL
rm -rf $SAMPL".o"
rm -rf $SAMPL
/usr/ccs/bin/make -f cdemo_odbc.mk build OBJS=$SAMPL".o" EXE=$SAMPL

oracle@ors2di # isql -v ora102 scott tiger
[01000][unixODBC][Driver Manager]Can't open lib '/opt/app/oracle/product/10.2.0/db_1/lib/libsqora.so.10.1' : ld.so.1: isql: fatal: /opt/app/oracle/product/10.2.0/db_1/lib/libsqora.so.10.1: wrong ELF class: ELFCLASS64
[ISQL]ERROR: Could not SQLConnect
oracle@ors2di #
To be able to successfully create a two tier connection to a 64-bit Oracle on a 64-bit Solaris machine, include Oracle 32-bit libraries in the PATH.

The binaries are often located in the lib32 directory. For example:
This path should be included in the LD_LIBRARY_PATH to make the two tier connection work in a 64-bit environment.

Also, verify the path is placed before the paths to other Oracle libraries.


Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now