Configuring the Streams database adapter for Oracle

This procedure is necessary only if you plan to use an Oracle database.

Before you begin

Ensure that the following prerequisites are met.

  • The Oracle 12c client is installed on the machine where the Streams server is installed.
  • Use UnixODBC 2.3.2

Procedure

  1. On the machine where the Streams server is installed, edit the Streamsadmin user's /home/streamsadmin/.bashrc file to add the following environment variable commands.

    Example commands:

    export ORACLE_HOME=/data/DatabaseServer/Oracle12C/product/12.1.0/dbhome_1
    export LD_LIBRARY_PATH=/data/DatabaseServer/Oracle12C/product/12.1.0/dbhome_1
    /lib:/data/DatabaseServer/Oracle12C/product/12.1.0/dbhome_1/lib64:/usr/local
    /lib:/usr/local/lib64
    export ODBCINI=/home/streamsadmin/ODBCINI/odbc.ini
    export STREAMS_ADAPTERS_ODBC_ORACLE=true
    export STREAMS_ADAPTERS_ODBC_INCPATH=/usr/local/include
    export STREAMS_ADAPTERS_ODBC_LIBPATH=/usr/local/lib
    
    Table 1. Environment variables for Oracle on Streams
    Environment variable Example value
    Variables for compiling Streams adapters with Oracle
    STREAMS_ADAPTERS_ODBC_ORACLE True
    STREAMS_ADAPTERS_ODBC_INCPATH /mydir/unixodbc/include
    STREAMS_ADAPTERS_ODBC_LIBPATH /mydir/unixodbc/lib
    Variables for running Streams adapters with Oracle
    ODBCINI /mydir/odbc.ini
    ORACLE_HOME /home/oracle/oracle/112client/oracle/product/11.2.0/client_1
    LD_LIBRARY_PATH
    • If you use static linking:

      /home/oracle/oracle/112client/oracle/product/11.2.0/client_1/lib

    • If you do not use static linking:

      /home/oracle/oracle/112client/oracle/product/11.2.0/client_1/lib:/mydir/unixodbc/lib

  2. Configure UNIX ODBC as follows.
    1. Untar UnixODBC and execute following commands.
      ./configure
      make
      make install
      
    2. Create a file named odbc.ini under /home/streamsadmin/ODBCINI with the following content.
      [Your_Oracle_database_instance_name]
      Driver = Driver_path
      description = description
      ServerName = IP:port/Your_Oracle_database_instance_name
      server = IP
      port = Port_No
      Longs = F
      

      Use the Oracle database instance name, server name, and port appropriate for your environment. You must use the exact name of your Oracle database instance in this file.

      For example, if your Oracle database instance is named orcl, your odbc.ini file would look like this.

      [orcl]
      Driver=/data/DatabaseServer/Oracle12C/product/12.1.0/dbhome_1
      /lib/libsqora.so.12.1
      description = test
      serverName = 11.22.33.44:9002/orcl
      server = 11.22.33.44
      port = 9002
      Longs = F
      
  3. To test your configuration, run the following command as the streamsadmin user.

    Use the Oracle database instance name, user name, and password appropriate for your environment.

    isql Oracle_database_instance_name user_name password

    If the test fails, check your execution of the preceding steps. Remember that names are case-sensitive.