I. Implementation Environment
Oracle Database Server 172.16.4.165 Windows Server 2008-64bit Oracle11g R2
DB2 database Server 172.16.4.165 Windows Server 2008-64bit DB2 V9.7
Oracle gateways11g R2 transparent gateway Server 172.16.4.20.windows Server 2003-32bit
2. Install the oracle transparent gateway server (172.16.4.20)
Download the installation package win32_11gR2_gateways from the official Oracle website,
Then install the software on the transparent gateway server.
Oracle Database Gateway for ODBC 11.1.0.6.0. component, we use the ODBC connection to implement the function of accessing the DB2 Database from the Oracle Database.
3. Install the DB2 Client Program (172.16.4.20)
Install the DB2 client on the transparent gateway Server
After the installation is complete, Open Control Panel-Administrative Tools-ODBC data source, and configure the connection between the DB2 client and the DB2 server.
Open the ODBC data source management tool, open the page system DSN, click Add button, select IBM DB2 odbc driver, click Finish, enter the data source name, and then add the database alias. In CLI/ODBC settings, enter:
Database Name: YCQDB
Database alias: YCQDB2 (any)
Host Name: 172.16.4.165
Port: 50000
After setting, click OK. So far, the ODBC data source configuration between the DB2 client and the server is complete.
This section can also be configured by installing the configuration Assistant in the DB2 client.
4. Configure the transparent gateway server (172.16.4.20)
Open the main directory C: \ product \ 11.2.0 \ tg_1 \ hs \ admin installed by win32_11gR2_gateways
This directory contains the initdg4odbc. ora configuration file,
# This is a sample agent init file that contains the HS parameters that are
# Needed for the Database Gateway for ODBC
#
# HS init parameters
#
HS_FDS_CONNECT_INFO = <odbc data_source_name>
HS_FDS_TRACE_LEVEL = <trace_level>
#
# Environment variables required for the non-Oracle system
#
# Set <envvar >=< value>
Copy the initdg4odbc. ora file and rename it initYCQDB. ora (the red part is renamed). The changes are as follows:
# This is a sample agent init file that contains the HS parameters that are
# Needed for the Database Gateway for ODBC
#
# HS init parameters
#
HS_FDS_CONNECT_INFO = ycqdb (ODBC data source name)
HS_FDS_TRACE_LEVEL = off
#
# Environment variables required for the non-Oracle system
#
# Set <envvar >=< value>
After the initialization file is configured, go to the C: \ product \ 11.2.0 \ tg_1 \ NETWORK \ ADMIN configuration listening file listener. ora and add the following information:
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = YCQDB)
(ORACLE_HOME = C: \ product \ 11.2.0 \ tg_1)
(PROGRAM = dg4odbc)
)
)
-- Note: The red font corresponds to the red part in initYCQDB. ora.
Now that the transparent gateway server is configured, open the system service window, find the OracleOraGtw11g_home1TNSListener service, click stop, and then click Start.