Oracle ODBC driver Linux and UNIX Getting Started Guide

This guide shows you how to download, install, and license the Oracle ODBC driver.

At the end, you'll be able to access your Oracle databases from a Linux or UNIX system using isql, an interactive SQL tool installed with unixODBC, the open-source Driver Manager that's included in the ODBC driver distribution.

If you're installing to evaluate the ODBC driver, the guide will show you how to obtain a free trial license.

Assumptions

Before you begin

What you need to know

Obtain this information from your Oracle Database Administrator:

Prerequisites

Easysoft provide two variants of the Oracle ODBC driver: an OCI driver and a Wire Protocol (WP) driver. The OCI driver uses Oracle client software to access Oracle. If you are using the OCI driver, refer to the following section for information about obtaining, installing, and testing this prerequisite client software. The WP driver does not use Oracle client software. If you are using the WP driver, skip the client software section and follow the instructions in Downloading, installing, and testing the ODBC driver.

Oracle client software

Although the OCI driver is compatible with both the standard Oracle client and the Instant Client, this guide describes how to use the driver with the Instant Client. This is because the Instant Client:

If you want to use the standard Oracle Client (for example, you will be installing the ODBC driver on a machine where the Oracle Client is already installed), you can still follow the instructions in this guide. The process is the same for both versions of the client, unless noted otherwise in Notes on the standard Oracle Client.

To install and test the Oracle Instant Client:

  1. Visit the Oracle web site and login. If you have not yet done so, you need to register first.

    You need to be a registered Oracle user to download the Instant Client.

  2. Download the Instant Client for your client platform.
  3. Download the Basic and SQL*Plus Instant Client Packages.

    These packages contain the Instant Client and a version of SQL*Plus that is compatible with the Instant Client. SQL*Plus lets you test that you can access Oracle with the Instant Client.

  4. On the machine from which you want to access Oracle, extract the Instant Client and SQL*Plus files. For example:
    cd /tmp
    unzip instantclient-basic-linux32-10.2.0.2-20060331.zip -d /usr/lib
    unzip instantclient-sqlplus-linux32-10.2.0.2-20060331.zip -d /usr/lib
  5. Add the Instant Client directory path to the LD_LIBRARY_PATH environment variable and export LD_LIBRARY_PATH. For example:
    LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/instantclient_10_2
    export LD_LIBRARY_PATH

    Replace /usr/lib with the directory where you extracted the Instant Client.

    Note On AIX, replace LD_LIBRARY_PATH with LIBPATH.

  6. Use SQL*Plus to test that you can access Oracle. For example:
    cd /usr/lib/instantclient_10_2
    ./sqlplus user_name/password@//machine_name:port/database_name

    where:

    • user_name and password are the database user name and password.
    • machine_name is the host name or IP address of the Oracle database server.
    • port is the Oracle listener port.
    • database_name is the service name associated with the database you want to access.

    Note If you are unable to connect to Oracle with SQL*Plus, contact your Oracle Database Administrator. If you cannot access your Oracle database with SQL*Plus, you will not be able to access the database with the OCI driver.

  7. At the prompt, enter a SELECT statement to test that you can retrieve some data:
    select * from dual;

    To exit SQL*Plus, enter exit.

Downloading, installing, and testing the ODBC driver

The process has four steps:

  1. Log in to the Easysoft web site.
  2. Download the ODBC driver software.
  3. Install and configure the ODBC driver.
  4. Access your data sources.

Step 1: Download the ODBC driver software

  1. Download the ODBC driver.
  2. Save the distribution file to a temporary directory on the target machine.

Step 2: Install and configure the ODBC driver

  1. Log into your Linux or UNIX system and change to the directory where you have saved the distribution.
  2. Untar the distribution file using the following command, substituting the version number and platform from your distribution filename. For example:
    tar -xvf odbc-oracle-version-platform.tar
  3. cd into the directory created by unpacking the distribution file. For example:
    cd odbc-oracle-version-platform
  4. As root, enter ./install to start the install. After you have accepted the License Agreement, accept the defaults throughout the installation.
  5. When prompted to choose a product to license, choose the ODBC driver by typing its option number. For example:
    [0] Exit
    [1] View existing licenses
    [2] Oracle ODBC driver V3.10
    
    Please choose the product you would like a license for by entering its
    item number or enter one of the other options.
    
    Option: 2

    Next, you need to supply:

    1. Your full name.
    2. Your company name.
    3. An email contact address. This must be the email address you registered on the Easysoft web site.
    4. Your telephone number (you need to specify this if you telephone the license request to us).
    5. A reference number. When requesting a trial license just press Enter. This field is used to enter a reference number we will supply you for full (paid) licenses.

    The license client asks you to choose a method for obtaining the license. To obtain a license automatically, you need to be connected to the Internet and allow outgoing connections to license.easysoft.com on port 8884. If you are not connected to the Internet or do not allow outgoing connections through port 8884, the license client can create a license request file, which you can:

    1. Enter at the Easysoft web site to obtain your license.
    2. Supply to Easysoft by email or telephone.

    If you choose option [2], the license request is written to a file named license_request.txt and you should exit the license client (option [0]) and complete the installation. Once you have emailed or telephoned the license request to us, we will return a license key. Add this to the end of the file /usr/local/easysoft/license/licenses.

  6. When prompted to create the sample data source, enter:
    • The host name or IP address of the Oracle database server.
    • The service name that identifies the database you want to connect to.
    • The Oracle listener port.
    • The Oracle database user name and password.

    At the end of the installation, you will have installed and licensed the ODBC driver, installed the unixODBC Driver Manager, and created an ODBC data source.

  7. Set and export the LD_LIBRARY_PATH environment variable:
    EASYSOFT=/usr/local/easysoft
    LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$EASYSOFT/lib
    LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$EASYSOFT/unixODBC/lib
    export LD_LIBRARY_PATH

    Note On AIX, replace LD_LIBRARY_PATH with LIBPATH.

  8. If you're using the OCI version of the ODBC driver, set LD_LIBRARY_PATH to include the driver directory and the Instant Client directory. For example:
    LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$EASYSOFT/oracle
    LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/instantclient_10_2
    export LD_LIBRARY_PATH

Step 3: Access your data sources

What next?

Further support

Notes on the standard Oracle client

Refer to this section if you want to use the OCI version of the ODBC driver with the standard Oracle client.