Learn how to a build a cloud-first strategyRegister Now

x
  • 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:
https://metalink.oracle.com/metalink/plsql/f?p=130:14:7406918959791655811::::p14_database_id,p14_docid,p14_show_header,p14_show_help,p14_black_frame,p14_font:NOT,363899.1,1,0,1,helvetica

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 #
0
geotiger
Asked:
geotiger
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
[owb1odbc]
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
[ora102]
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
/opt/app/oracle/product/10.2.0/db_1/odbc/demo/cdemo
oracle@ors2di # more doit
#!/bin/sh
SAMPL=odbcsel1
export SAMPL
rm -rf $SAMPL".o"
rm -rf $SAMPL
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/local/lib
export LD_LIBRARY_PATH
/usr/ccs/bin/make -f cdemo_odbc.mk build OBJS=$SAMPL".o" EXE=$SAMPL
./$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 #
0
 
schwertnerCommented:
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:
/opt/oracle/9.2.0/lib32
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.

0

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