The Q Apply program must be able to connect to the Oracle
target database to apply transactions, and the Replication Center
must be able to connect to Oracle to create Q Apply control tables.
- The Oracle JDBC driver is required for the Replication Center
to connect to the Oracle database. This driver must be installed on
any system where the Replication Center is running. You can download
the driver at from the following URL: http://www.oracle.com/technetwork/database/features/jdbc/index-091264.html.
Install the driver file in the %DB2PATH%/tools directory.
For Oracle 10g copy the ojdbc6.jar file into
the %DB2PATH%/tools directory; for 11g or later
copy the ojdbc14.jar file.
- Both the Replication Center and Q Apply program use the Oracle
client libraries to access the Oracle database. The library path ($LIBPATH/$LD_LIBRARY_PATH)
must include the path to the Oracle OCI libraries. During an Oracle
client install, the library path should be set. When using the Oracle
instant client the library path must be set to the location of the
OCI libraries. For more information, see Oracle client support for Q Replication.
- Set the $TNS_ADMIN environment variable
to the directory that contains the tnsnames.ora file,
and also to the Oracle home directory.
- Add an entry to the tnsnames.ora file
that specifies the name of the Q Apply server (from the apply_server parameter),
connection details to the Oracle target database such as PROTOCOL,
HOST, and PORT, and the service name for the Oracle target database.
The following sample shows the tnsnames.ora entry
for a Q Apply program where apply_server=ORAUTF8
and the service name is orautf8.sds.
ORAUTF8 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = hostname)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orautf8.sds)
)
)
- Ensure that the following environment variables are set
in your .profile file. Alternatively, you can
create a setenv file and specify it as part of
the login process. Here are the contents of a sample setenv file
that uses db2inst1 as the DB2® instance
owner ID. You will need to customize the file according to the shell
that you use:
export ORACLE_HOME=/opt/oemclient/oracle/10client
export TNS_ADMIN=/home/db2inst1
PATH=/home/db2inst1/sqllib/bin:$ORACLE_HOME/bin:/home/db2inst1/sqllib/java/jdk64/jre/bin:$PATH
export PATH
LD_LIBRARY_PATH=/home/db2inst1/sqllib/lib:/home/db2inst1/java/jdk64/lib:/home/db
2inst1/java:$ORACLE_HOME/lib:$LD_LIBRARY_PATH
LD_LIBRARY_PATH=/opt/mqm/lib64:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH
export DB2LIBPATH=/opt/mqm/lib64
- Create a password file by using the asnpwd command.
The file should specify the user ID and password for connecting to
the Oracle database. When you start Q Apply, specify the pwdfile initialization
parameter.
- Check the connectivity to the Oracle database by using
the SQL*Plus interface. Use the following command:
sqlplus user_ID/password@Oracle_database_name