Unix System

Configure unixODBC in Linux

Configuring unixODBC on Linux, can be  a general requirement for Peoplesoft or many Application to connect to Oracle database.

Check whether all required RPMs present or Not…as follows.

 

[root@SAMOEL47UAT2 unixODBC-2.2.14]# rpm -q unixODBC
unixODBC-2.2.11-1.0.1.RHEL4.1
[root@SAMOEL47UAT2 unixODBC-2.2.14]# rpm -q qt
qt-3.3.3-13.RHEL4
[root@SAMOEL47UAT2 unixODBC-2.2.14]# rpm -q unixODBC-kde
unixODBC-kde-2.2.11-1.0.1.RHEL4.1
Output of following command should be /usr

[root@SAMOEL47UAT2 unixODBC-2.2.14]# odbc_config --prefix

Result of above ccommand on Oracle Enterprise Linux is:
/usr
Now copy the unixODBC-2.2.14.tar to /u01

then extract it using tar -xvf unixODBC-2.2.14.tar which will create a folder called unixODBC-2.2.14

Now go to that folder execute the following commands in the appropriate order

cd unixODBC-2.2.14
./configure --prefix=/u01/unixODBC-2.2.14/ --exec-prefix=/u01/unixODBC-2.2.14/ --enable-gui=no
make
make install

After the above command "make install" completed, Go for a tea Break, come back and fire following commands again
Result of following command on Oracle Enterprise Unix should be :

[root@SAMOEL47UAT2 unixODBC-2.2.14]# odbc_config --prefix
/usr/local

[root@SAMOEL47UAT2 unixODBC-2.2.14]# odbc_config --odbcinstini
/usr/local/etc/odbcinst.ini

[root@SAMOEL47UAT2 unixODBC-2.2.14]# odbc_config --odbcini
/usr/local/etc/odbc.ini

[root@SAMOEL47UAT2 unixODBC-2.2.14]# odbcinst -j

unixODBC 2.2.14
DRIVERS............: /usr/local/etc/odbcinst.ini
SYSTEM DATA SOURCES: /usr/local/etc/odbc.ini
FILE DATA SOURCES..: /usr/local/etc/ODBCDataSources
USER DATA SOURCES..: /root/.odbc.ini
SQLULEN Size.......: 4
SQLLEN Size........: 4
SQLSETPOSIROW Size.: 2
Put the following environment variables in your $HOME/.bash_profile (e.g. vi /home/psoft/.bash_profile)

export DM_HOME=/u01/unixODBC-2.2.14/
export PATH=$DM_HOME/bin:$PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$DM_HOME/lib:$LD_LIBRARY_PATH

Edit the following lines in /usr/local/etc/odbcinst.ini ..(The following lines will create an ODBC oracle Driver of name “Oracle_ODBC_Driver” )

[ODBC]
Trace = No
TraceFile = /tmp/sql.log
ForceTrace = No
Pooling = No

[Oracle_ODBC_Driver]
Description = Oracle 10g R2 ODBC driver.
Driver = /u01/oracle/pshome/client_1/lib/libsqora.so.10.1
Setup =/u01/unixODBC-2.2.14/DRVConfig/Oracle/.libs/liboraodbcS.so
FileUsage =
CPTimeout =
CPReuse =

Till this STEP All above things need to be done as ROOT User.
After This STEP

Edit the following lines in $HOME/.odbc.ini
Where
TESTDSN is the name of Data Source Name,
DB,ServerName parameters are your SERVICE NAME from tnsnames.ora USER,
UserID is the username for database,
Driver name should be same as the name from previous step i.e.”Oracle_ODBC_Driver” (From /usr/local/etc/odbcinst.ini)
NOTE: For multiple connections you can create multiple DSNs in one file i.e. $HOME/.odbc.ini

[TESTDSN]
Description = MY_ODBC
Driver = Oracle_ODBC_Driver
DB = PSDEVI
USER = sysadm
PASSWORD = prodadm1
ORACLE_HOME = /u01/oracle/pshome/client_1/
TNS_ADMIN = /u01/oracle/pshome/client_1/network/admin/
DSN = TESTDSN
ServerName = PSDEVI
UserID = sysadm

Now you can use isql to test the connection

isql -v TESTDSN
+—————————————+
| Connected! |
| |
| sql-statement |
| help [tablename] |
| quit |
| |
+—————————————+

Saumya

Share
Published by
Saumya

Recent Posts

Exploring Oracle Hybrid Columnar Compression (HCC): A Hands-On Lab with Real Results (Repost)!

Explore Oracle Hybrid Columnar Compression (HCC) through a hands-on lab comparing OLTP, Query, and Archive…

1 week ago

Oracle 19c Automatic Indexing: A Hands-On Workshop (Repost!)

Revisit my popular, hands-on workshop guiding you through Oracle 19c's Automatic Indexing! I'll show you…

2 weeks ago

Seamless Transition: Converting Oracle 19c Non-CDB to Pluggable Database (PDB)

Unlock the power of Oracle 19c's multitenant architecture by converting your existing non-CDB databases into…

2 weeks ago

Refine Permissions with Precision: Mastering Privilege Analysis in Oracle 19c – A Revision

Learn how Oracle 19c simplifies privilege management with its built-in analysis tools, ensuring a 'least…

2 weeks ago

The Simple, Reliable Way to Back Up Your WordPress Blog: A DIY Script for Peace of Mind

Struggling with WordPress backups? Learn how to set up an automated, custom shell script for…

2 weeks ago

My Journey Through Oracle Database World and Cloud world 2025: A Dive into the Future of Data and AI – And a Fresh Start!

After 18 enriching years in the tech world, I recently took a deliberate break, a…

2 weeks ago