Connect to the DB2 database using Oracle transparent gateway in Linux

Source: Internet
Author: User

Server 1

OS: AIX 5.3

Ip: 192.168.0.1

Db: Oracle 11gR2

Server 2:

OS: AIX

IP: 192.168.0.5

Db: DB2 v9.7

Main purpose:

By building a transparent gateway in Server 1, you can connect to the DB2 database in Server 2 in the oracle database.

Oracle ---> dg4odbc driver -- à unixODBC driver manager -- à db2 dedicated odbc driver

Recommended reading:

DB2 database performance adjustment and optimization (1st and 2) PDF

DB2 database performance optimization

Implementation steps:

1. Install the unixODBC driver in Server 1.

A) download the unixODBC driver source code package from the official website: http: // www.unixodbc.org.

B) Import several necessary environment variables:

Export OBJECT_MODE = 64 (ensure that the compiled unixODBC program is a 64-bit executable program. If the database is 32, replace 64 with 32)
Export PATH = $ PATH:/usr/vacpp/bin (this is the compiler installation address)
Export CC = xlc_r
Export CCC = xlC_r

C) enter the unzipped unixODBC directory, as shown in the following figure:

./Configure -- prefix =/usr/local/unixODBC
./Make
./Makeinstall

D) Add the following lines to oracle. profile:

Export ODBCHOME =/usr/local/unixODBC/etc
Export ODBCINI = $ ODBCHOME/odbc. ini
Export PATH = $ PATH:/usr/local/unixODBC/bin

Export LD_LIBRARY_PATH =/usr/local/unixODBC/lib

E) Go to the/usr/local/unixODBC/lib directory and execute the following commands:

Ar-x-X any libodbc.
Ar-x-X any libodbcr.
Ar-x-X any libodbcinst.

Ln-slibodbc. so.2 libodbc. so
Ln-slibodbcr. so.2 libodbcr. so
Ln-slibodbcinst. so.2 libodbcinst. so

For more details, please continue to read the highlights on the next page:

  • 1
  • 2
  • Next Page

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.