By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,610 Members | 2,155 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,610 IT Pros & Developers. It's quick & easy.

unixODBC client problems

P: n/a
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
Nov 12 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Found my own solution.

On the client system login as db2inst1 and run db2
Inside the db2 system shell run these commands

CATALOG TCPIP NODE sample REMOTE serverip SERVER portnumber
CATALOG DATABASE sample AT NODE sample

Where sample is the name of the database on the server, the alias for it and
the DSN name on the client side, serverip is the TCP/IP address for the
server, and portnumber is 500000 the default port number for the DB2
server.

I must be missing some documentation because I don't remember reading this
anywhere in the hundreds of documentation files that came with the
software.

Roy Souther wrote:
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
Nov 12 '05 #2

P: n/a
ODBC connects to a database "defined on the system where it's running".
Your ODBC setup connected to a UDB database that wasn't defined on the
system until you implemented your solution.

Many (all?) ODBCs support an ODBC to ODBC connection to a remote system.
You could use that to connect through ODBC running on the server system.
My personal preference is to use the UDB client connection for
inter-systems communication.

Phil Sherman

Roy Souther wrote:
Found my own solution.

On the client system login as db2inst1 and run db2
Inside the db2 system shell run these commands

CATALOG TCPIP NODE sample REMOTE serverip SERVER portnumber
CATALOG DATABASE sample AT NODE sample

Where sample is the name of the database on the server, the alias for it and
the DSN name on the client side, serverip is the TCP/IP address for the
server, and portnumber is 500000 the default port number for the DB2
server.

I must be missing some documentation because I don't remember reading this
anywhere in the hundreds of documentation files that came with the
software.


Nov 12 '05 #3

P: n/a
Hi Roy !!!
You were the one that helped me with your solution !!!
I tried this 2 weeks. Now your solution worked for me !!!

Thank you very much !!!

Cu,

Fabian

"Roy Souther" <ro*@OsGuild.com> schrieb im Newsbeitrag
news:D5gdd.21183$cr4.19005@edtnps84...
Found my own solution.

On the client system login as db2inst1 and run db2
Inside the db2 system shell run these commands

CATALOG TCPIP NODE sample REMOTE serverip SERVER portnumber
CATALOG DATABASE sample AT NODE sample

Where sample is the name of the database on the server, the alias for it and the DSN name on the client side, serverip is the TCP/IP address for the
server, and portnumber is 500000 the default port number for the DB2
server.

I must be missing some documentation because I don't remember reading this
anywhere in the hundreds of documentation files that came with the
software.

Roy Souther wrote:
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

Nov 12 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.