Setting Up an Oracle XStream JDBC Driver

To use the Replication Agent for Oracle with XStream APIs, use the setenv function to set or modify ORACLE_HOME, LD_LIBRARY_PATH, and CLASSPATH environment variables.

Prerequisites
Task
  1. Set the ORACLE_HOME environment variable to the Oracle installation directory for your platform:
    setenv $ORACLE_HOME <install_dir>/oracle/<version>/

    where install_dir is the installation directory and version is the version number of the Oracle database.

    The Oracle installation directory might be different, based on the database version installed on your platform. Set the ORACLE_HOME variable before setting the LD_LIBRARY_PATH and CLASSPATH environment variables.

  2. Add the path of the Oracle XStream JDBC driver to the CLASSPATH environment variable for your platform.

    Add only one version of a JDBC driver in the CLASSPATH; otherwise, Replication Agent will have problems connecting to the primary database.

    On Linux:
    setenv LD_LIBRARY_PATH $ORACLE_HOME/lib:$LD_LIBRARY_PATH
    setenv CLASSPATH $ORACLE_HOME/jdbc/lib/ojdbc6.jar:$ORACLE_HOME/rdbms/jlib/xstreams.jar:$CLASSPATH
    On HP-UX64:
    setenv SHLIB_PATH $ORACLE_HOME/lib:$SHLIB_PATH
    setenv CLASSPATH $ORACLE_HOME/jdbc/lib/ojdbc6.jar:$ORACLE_HOME/rdbms/jlib/xstreams.jar:$CLASSPATH
    On AIX 64:
    setenv LIBPATH $ORACLE_HOME/lib:$LIBPATH
    setenv CLASSPATH $ORACLE_HOME/jdbc/lib/ojdbc6.jar:$ORACLE_HOME/rdbms/jlib/xstreams.jar:$CLASSPATH

    On SUNOS-i86pc:

    setenv LD_LIBRARY_PATH $ORACLE_HOME/lib:$LD_LIBRARY_PATH
    setenv CLASSPATH $ORACLE_HOME/jdbc/lib/ojdbc6.jar:$ORACLE_HOME/rdbms/jlib/xstreams.jar:$CLASSPATH
    On SUNOS-64:
    setenv LD_LIBRARY_PATH_64 $ORACLE_HOME/lib:$LD_LIBRARY_PATH_64
    setenv CLASSPATH $ORACLE_HOME/jdbc/lib/ojdbc6.jar:$ORACLE_HOME/rdbms/jlib/xstreams.jar:$CLASSPATH
    where:
    • Oracle_Home – is the Oracle database installation directory.
    • path_name – is the library path where you installed the JDBC driver:
      • LD_LIBRARY_PATH on UNIX
      • SHLIB_PATH on HP-UX64
      • LIBPATH on AIX
    • driver – is the name of the JDBC driver; for Oracle 11.2.0.3, ojdbc6.jar. The xstreams.jar is the name of the XStream library path.

  3. (On Windows) Set Oracle environment variables in any of these ways:
    Option Description
    Use the Control Panel
    • Select Start > Settings > Control Panel > System > Advanced System Settings > Environment Variables.
    • Click New in the User variables pane.
    • In the New User Variable dialog, enter:
      • Variable name – is the environment variable that you want to set. For example, ORACLE_HOME, PATH, and CLASSPATH.
      • Variable value – is the directory path that you want to set for the environment variable. For example, c:\oracle\version (installation directory), C:\ORACLE_HOME\bin (the library path), and C:\ORACLE_HOME\jdbc\lib\ojdbc6.jar (the JDBC driver path).
    Edit the existing variables
    • Select the PATH and CLASSPATH environment variables in the System variables pane, and click Edit.
    • In the Edit System Variable dialog, using the semicolon (;) path separator, enter the variable value for:
      • Path – %ORACLE_HOME%\bin;%ORACLE_HOME%\LIB;%path%

      • CLASSPATH – %ORACLE_HOME%\jdbc\lib\ojdbc6.jar;%ORACLE_HOME%\rdbms\jlib\xstreams.jar;%CLASSPATH%

    In the command line prompt Enter:
    set CLASSPATH=ORACLE_HOME\jdbc\lib\ojdbc6.jar;ORACLE_HOME\rdbms\jlib\xstreams.jar