![]() ![]() SQL> select count(*) from sysibm.systables īy default isql is a 64-bit binary which cannot access 32-bit libdb2.so. home/dbinst1: isql -v SAMPLE db2inst1 123456 Optional: Add 32-bit DSN for 32-bit applicationĭriver= /opt/ibm/db2/dsdriver /lib32/libdb2.soĭescription=Sample 32-bit DB2 ODBC Databaseĥ) Test the connectivity via "isql" to confirm the ODBC has been setup correctly and can connect to the remote database SAMPLE. For our purposes the User DSN's contents are identical to the System DSN.ĭriver= /opt/ibm/db2/dsdriver /lib64/libdb2.soĭescription=Sample 64-bit DB2 ODBC Database Thus this step is optional if the System DSN already contains the database name. (c) OPTIONAL: If the SAMPLE database is not found in the System DSN, it will search for the User Data Source file. Our DSN is called "SAMPLE" which is the name of the database. Root is required if the DS driver was installed in /opt/ibm/db2/dsdriver.ĭriver=/opt/ibm/db2/dsdriver/lib/libdb2o.so (a) Edit the ODBC driver manager configuration file (/usr/local/etc/odbcinst.ini) to point to the location of the DS Driverĭriver = /opt/ibm/db2/dsdriver/lib/libdb2o.so odbc.ini are output from the "odbcinst -j" from step #1. (4) Configure ODBC, System and User Data Sources files. Note: There is a sample file called /cfg/ for reference. ![]() In our example the remote DB2 database server is located on which is listening on port 50000. There are two entries for each database entry. (c) Install the DS driver, in this example we install it in /opt/ibm/db2/dsdriver.Įdit db2dsdriver.cfg and place the following inside it. (b) Select the platform and download "IBM Data Server Driver Package". (a) Select "Data Server Driver Package" for the DB2 release. Reference: Please refer to link "Setting Up ODBC Environment" bashrc, source the profile again or exit and login again for the new environment variables to take effect. The ODBC libraries are usually located in the path below:Īfter editing. # chmod 755 /opt/ibm/db2/dsdriver/db2profile # Source DB2 profile from IBM Data Server DriverĮxport LD_LIBRARY_PATH=/usr/lib64/libodbc.soĮnsure /opt/ibm/db2/dsdriver/db2profile has permission to execute db2profile. (b) Later, we will create and configure the System and User DSN files (odbc.ini and. USER DATA SOURCES.: /home/db2inst1/.odbc.ini SYSTEM DATA SOURCES: /usr/local/etc/odbc.iniįILE DATA SOURCES.: /usr/local/etc/ODBCDataSources Get ODBC configuration file locations and make note of the System and User Data Sources file locations.ĭRIVERS.: /usr/local/etc/odbcinst.ini For User Data Sources, it will look for a hidden file in the current user's home directory called. (a) Install the ODBC Driver Manager as per link below:įor step #3 in the link above, run the "odbcinst -j" command to find the location of the configuration files for SYSTEM/USER DATA SOURCES. The DS Driver can be installed in the user's home directory as well such as /home/db2inst1/dsdriver.ġ) Install & Configure ODBC Driver Manager Root id will be required to configure the ODBC driver manager configuration files and the IBM Data Server (DS) Driver if it is installed in /opt/ibm/db2/dsdriver as per our example. This example assumes the application requiring ODBC connectivity will be run with the userid "db2inst1" and will connect to: ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |