Trying to get the unixODBC to work connecting to an IBM DB2 UDB V8.1. The
DB2 server is running on Red Hat 8 and is tested and confirmed to be
serving connections to Windows 98 clients using the Accpac 5.1 client
program (I would like to find an OpenSource generic ODBC program for
Wiindows that can do simple SQL). An Accpac database was installed and the
Win32 ODBC connection is working.
Trying to connect a Linux client via unixODBC I have tried this on Mandrake
9.0, 9.1, 9.2, 10, Red Hat 8. I have tried the default unixODBC that comes
with these system all of them are version 2.2.3 (Red Hat was 2.2.2
originaly) or newer. I have also downloaded and compiled the 2.2.10 version
of unixODBC.
I have tried the DB2 client that came with the server and I have donwloaded
and tried the FixPak 7 & 6a.
In the process of attempting to make this work I have varified that unixODBC
is working while connecting to a remote PostgreSQL server by using the
PostgreSQL driver library on the client system.
I have found documententaion on the Internet for the IBM DB2 UDB V6 and V7
regarding the required setting for
export DB2INSTANCE=db2inst1
and have set my odbc files as such...
bash$ cat /etc/odbc.ini
[sample]
Description = Test to DB2
Driver = DB2
bash$ cat /etc/odbcinst.ini
[ODBC]
Trace = 1
Trace File = /tmp/odbc.log
[DB2]
Description = DB2 Driver
Driver = /opt/IBM/db2/V8.1/lib/libdb2.so
FileUsage = 1
DontDLClose = 1
From the IBM documentation I found they recomend setting ODBC environment
variables. So I set these values.
export ODBCHOME=/etc
export ODBCSYSINI=/etc/odbc.ini
This only made the isql program not able to find the odbc*.ini files.
I have attempted to connect to the remove DB2 database with this command
isql -v sample db2inst1 password
but constantly receive the error "[[unixODBC][Driver Manager]Driver's
SQLAllocHandle on SQL_HANDLE_HENV failed]"
Where:
sample = name of the DSN as shown above in the /etc/odbc.ini file
db2inst1 = the username on the server that has access to the sample database
password = the password for the db2inst1 on the server
The connection between the DSN name and the database name on the server is
not documented anywhere that I could find.
Running tcpdump on the server shows no network activity from the Linux ODBC
client during the isql command. Attempting to connect from the Windows
system causes a flood of activity in tcpdump when using the Accpac client.
How does the IBM DB2 ODBC client find the server? The Windows systems
required the IP address while using the Java client to add a new database
connection.
I don't know what else to try. It seems as though other people have excelent
success with the same steps I have been following
http://www.unixodbc.org/doc/db2.html
http://www-1.ibm.com/support/docview...id=swg21079056
What next?
--
Roy Souther
Open Support Guild
Bringing Open concepts to IT support
www.OsGuild.com