To create a database link between Oracle and DB2 you need to install and use a Database Gateway.
For Db2 there are 2 alternatives -
- Database Gateway for DRDA (DG4DRDA)
- Database Gateway for ODBC (DG4ODBC)
The following note available in My Oracle Support has links to further details, information, documentation and setup notes -
Master Note for Oracle Gateway Products (Doc ID 1083703.1)
but also look at these notes for the differences in the gateways - Note.233876.1 Options for Connecting to Foreign Data Stores and Non-Oracle Databases (Doc ID 233876.1) Note.252364.1 Functional Differences Between DG4ODBC and Specific Database Gateways (Doc ID 252364.1) Note.232482.1 Gateway and Generic Connectivity Licensing Considerations (Doc ID 232482.1)
Please have a look at this information and get back with any further questions.
Let us know on which platforms Oracle and DB2 are installed and we can be more specific about which notes you need for setup help.
you can set up 2 different gateways, DG4ODBC which is a generic gateway using 3rd party ODBC drivers or the dedicated DB 2 gateway which is called Database gateway for DRDA and which requires an additional license. Both gateways are available for Windows and Linux.
As Mike stated already,
please have a look at My Oracle Support notes (http://support.oracle.com): Note.233876.1 Options for Connecting to Foreign Data Stores and Non-Oracle Databases (Doc ID 233876.1) Note.252364.1 Functional Differences Between DG4ODBC and Specific Database Gateways (Doc ID 252364.1) Note.232482.1 Gateway and Generic Connectivity Licensing Considerations (Doc ID 232482.1)
To get more information.
When you want to configure DG4ODBC on 64bit Linux you first need a 64bit ODBC driver which is able to connect to your DB2 UDB database. Do you already have an ODBC driver which is able to connect? If not, please check with IBM if they provide a 64bit ODBC driver for Linux which is able to connect to the DB3 database on Windows.
Once you have a working ODBC connection, then check out the My Oracle Support Note:
How to Configure DG4ODBC on 64bit Unix OS (Linux, Solaris, AIX, HP-UX Itanium) to Connect to Non-Oracle Databases Post Install [Document 561033.1]
IBM is providing them, please have a look at: http://publib.boulder.ibm.com/infocenter/db2luw/v9/index.jsp?topic=%2Fcom.ibm.db2.udb.apdv.cli.doc%2Fdoc%2Ft0023867.htm
You can also purchase a commercial ODBC driver from 3rd party vendors like DataDirect, Easysoft or OpenLink.
I have configure based on above document,i have test the connection,but i have error below mentioned
[oradev@testebs bin]$ isql dblink4db2 -v
[S1009][unixODBC][IBM][CLI Driver] CLI0124E Invalid argument value. SQLSTATE=S1009
[ISQL]ERROR: Could not SQLConnect
You're currently having an issue with the ODBC driver connecting to the DB2 database.
You can post the odbc.ini file so that Mike or I can have a look at it, but it would be also good to get in touch with the ODBC vendor (IBM?) and ask the vendor how to resolve the issue.
Not sure, but it looks like you mixed some configurations. The ODBC driver libdb2.so is commonly used to connect to a DB2 UDB on LUW platforms, but the parameters
DefaultPkgLibrary = QGPL
DefaultPackage = A/DEFAULT(IBM),2,0,1,0,512
sound like they belong to the AS400 ODBC driver.
Earlier you've stated that you want to connect to the UDB DB2 on Windows, so the driver is correct - but the odbc.ini entries aren't.
The LUW odbc driver is configured using the config file db2dsdriver.cfg => see http://publib.boulder.ibm.com/infocenter/db2luw/v9r5/index.jsp?topic=%2Fcom.ibm.swg.im.dbclient.config.doc%2Fdoc%2Fc0054555.html
Once you called the utility, please post the file db2dsdriver.cfg, your modified odbc.ini and also do not forget to test the database link using isql and this syntax: isql -v dblink4db2 db2admin nilgiris