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
- The ODBC driver is to be installed on a Linux or UNIX system on which you have
root
access.
Before you begin
What you need to know
Obtain this information from your Oracle Database Administrator:
- 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.
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:
- Is quick to download and easy to install.
- Is available for more platforms than the standard client.
- Uses significantly less disk space than the standard 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:
- 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.
- Download the Instant Client for your client platform.
- 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.
- 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
- Add the Instant Client directory path to the
LD_LIBRARY_PATH
environment variable and exportLD_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
withLIBPATH
. - 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
andpassword
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.
- 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:
- Log in to the Easysoft web site.
- Download the ODBC driver software.
- Install and configure the ODBC driver.
- Access your data sources.
Step 1: Download the ODBC driver software
- Download the ODBC driver.
- Save the distribution file to a temporary directory on the target machine.
Step 2: Install and configure the ODBC driver
- Log into your Linux or UNIX system and change to the directory where you have saved the distribution.
- 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
cd
into the directory created by unpacking the distribution file. For example:cd odbc-oracle-version-platform
- As root, enter
./install
to start the install. After you have accepted the License Agreement, accept the defaults throughout the installation. - 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:
- Your full name.
- Your company name.
- An email contact address. This must be the email address you registered on the Easysoft web site.
- Your telephone number (you need to specify this if you telephone the license request to us).
- 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:- Enter at the Easysoft web site to obtain your license.
- 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
. - 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.
- 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
withLIBPATH
. - 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
- Use isql to test the new data source:
cd /usr/local/easysoft/unixODBC/bin ./isql -v <sample_oracle_dsn>
At the prompt, enter
help
to display a list of tables. To exit, pressReturn
in an empty prompt line.
What next?
- You are now ready to use the Oracle ODBC driver with your own applications or development tools.
Further support
- The ODBC driver product manual.
- The Oracle ODBC driver Knowledge Base.
- To contact the Easysoft support team, send an email message to .
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.
-
Obtain this information from your Oracle Database Administrator:
- The
tnsnames.ora
service name for the Oracle database. - The Oracle database user name and password.
- The
- Download the standard client from the Oracle web site.
Alternatively, contact your Oracle Database Administrator for the Oracle distribution CD. The Oracle Client is included in the Oracle distribution.
For installation instructions, refer to the relevant Oracle Client Installation Guide. (To access this manual at the Oracle web site, search the Oracle documentation for "Client Installation Guide.")
- When prompted to create an ODBC data source during the Easysoft Oracle ODBC driver installation, enter:
- The
tnsnames.ora
service name for the Oracle database. - The Oracle database user name and password.
- The
- Set and export
ORACLE_HOME
rather thanLD_LIBRARY_PATH
to specify the directory where the Oracle client is installed. For example:ORACLE_HOME=/home/oracle/OraHome1 export ORACLE_HOME
- You need to include
$ORACLE_HOME/lib
when settingLD_LIBRARY_PATH
. For example:EASYSOFT=/usr/local/easysoft LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/lib LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$EASYSOFT/lib LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$EASYSOFT/oracle LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$EASYSOFT/unixODBC/lib export LD_LIBRARY_PATH