Skip to main content
Support

KB Article #178706

How to configure DB2 connectivity from MBC for Sun sparc OS ?

Problem

In B2Bi DB2 interface are ony present for AIX and Windows but there was no Interface for Sun sparc OS

Resolution

Steps to configure DB2 connectivity from MBC for Sun sparc OS.

step 1: download the DB2 ODBC driver
https://www-945.ibm.com/support/fixcentral/swg/downloadFixes?parent=ibm%2FInformation%20Management&product=ibm/Information+Management/IBM+Data+Server+Client+Packages&release=10.5.*&platform=Solaris+64-bit,SPARC&function=fixId&fixids=DSClients-sun64-odbc_cli-10.5.0.8-FP008&includeRequisites=1&includeSupersedes=0&downloadMethod=http&login=true
(free account required)

This is the DB2 10.5 Solaris CLI and ODBC driver package.
DB2 11.x is not supported on Solaris.

step 2:
extract the .tgz archive you just downloaded from IBM in some directory. Also extract the unixODBC_post_2_2_14.tgz attached to this incident.


step 3:
Edit unixODBC_post_2_2_14/etc/odbc.ini to add:

[YOURDBNAME]
Driver = /some/path/odbc_cli/clidriver/lib/libdb2o.so.1
Description = Write some description here

Replace YOURDBNAME with a short name; it will be used in the DATABASE OPEN statements in your MBCs to identify the DB2 database.
Change the path in the Driver= line to the correct path for the libdb2o.so.1 file you extracted from the IBM .tgz.


step 4:

create a new odbc_cli/clidriver/cfg/db2cli.ini file with the following contents, which you will need to edit as noted below:

[YOURDBNAME]
; YOURDBNAME must match the one in step 3; it need not reflect anything on the DB2 server
; autocommit is optional, depending on how you want to write data to DB2; IBM documentation has explanation for all the options
autocommit=0
hostname=write.the.db2.server.hostname.here
; 50000 is the default port, change it if your DB2 server listens on a different port
port=50000
protocol=TCPIP
; one DB2 server instance manages one or more databases, each stored in its own directory; make sure the database name is written correctly below
database=WRITEDBNAMEHERE
authentication=server
uid=writedb2usernamehere
pwd=writedb2passwordhere
; two more optional parameters, for example I want to see the tables from one particular schema without prefixing them with the name of the schema
currentschema=mydefaultschema
longdatacompat=1


step 5:
edit the B2Bi file $CORE_ROOT/config/environment.dat.
Add the environment variable ODBCINI which must contain the full path to the odbc.ini file you edited in step 3. Example:
ODBCINI=/xib/3rdpart/db/unixODBC_post_2_2_14/etc/odbc.ini
This $CORE_ROOT/config/environment.dat already includes a LD_LIBRARY_PATH variable. It contains paths separated with colons. You need to add one more path, the lib directory extracted from the unixODBC .tgz. Example:
/xib/3rdpart/db/unixODBC_post_2_2_14/lib
Optionally, you can add a codepage variable. For example,
DB2CODEPAGE=1208
indicates strings used with the DB2 connection are in UTF-8.
These variables will take effect only on restart of B2Bi; or, at least, on restart of the procengine tasks that will connect to DB2.


step 6:
Place the attached odbc3_UnixODBC_post_2_2_14.db file in $CORE_ROOT/4edi/dbload.
MBCs connecting to a DB2 database should use the following syntax for DATABASE OPEN:
DATABASE OPEN "YOURDBNAME" TYPE "Odbc_3_UnixODBC_post_2_2_14" DBID $dbidForDB2Connection;
If you want to use a different username or password, the syntax is:
DATABASE OPEN "YOURDBNAME/username/password" TYPE "Odbc_3_UnixODBC_post_2_2_14" DBID $dbidForDB2Connection;