Help Q Replication and Event Publishing

Connecting to the Oracle target database

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.

  1. Set the $TNS_ADMIN environment variable to the directory that contains the tnsnames.ora file, and also to the Oracle home directory.
  2. 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)
      )
    )
  3. 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
  4. 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.
  5. Check the connectivity to the Oracle database by using the SQL*Plus interface. Use the following command:
    sqlplus user_ID/password@Oracle_database_name


Send your feedback | Information roadmap | The Q+SQL Replication Forum

Update icon Last updated: 2013-10-25