您的位置:首页 > 数据库 > Oracle

Linux下安装Oracle10g ODBC驱动程序

2008-12-26 00:16 483 查看
Fedora8下安装Oracle10g ODBC驱动程序


1.首先安装unixODBC,步骤如下:

(1). copy the unixODBC*.tar.gz file somewhere you can create files and directories
(2). gunzip unixODBC*.tar.gz
(3). tar xvf unixODBC*.tar

Make the Libraries and Programs

The install now uses the standard GNU autoconf process. So its simply a matter of running

./configure
make
make install

By default the files are installed into /usr/local. As is usual with configure, this location can be changed by altering the prefix option to configure. i.e.

./configure --prefix=/usr/local/unixODBC

This will install the lib, bin, include and etc directories in /usr/local/unixODBC/lib etc.

To conform with the GNU guidelines the odbcinst file is now installed by default in {prefix}/etc, this can be altered using the --sysconfdir option to configure. To install the files in the old default /etc you would run configure like this

./configure --sysconfdir=/etc

The script will attempt to find the directories that are needed for the GUI components, and if they are not found (i.e. you haven't installed QT) the build will continue without the GUI parts.

Dependencies

The GUI components ( ODBCConfig and DataManager ) require Qt 2.2. (安装qt-3.3.8-9.fc8.i386,qt-devel-3.3.8-9.fc8.i386,qt-designer-3.3.8-9.fc8.i386软件包)

The SQI library requires flex and yacc to parse the SQL statement.

The entire distribution depends upon having many of the standard development tools installed such as a C/C++ compiler (currently testing is with egcs). Also; the development platform is mostly RedHat Linux 5.1 with compiler upgrades (to be compatible with RedHat 5.2).

2 ODBC Instant Client

Oracle ODBC Instant Client for Linux complies with ODBC 3.52 specifications. It is based on features of Oracle 10.2.0.3.0 ODBC driver for Windows, without the need for a traditional ORACLE_HOME installation.
Note: See Oracle Call Interface Programmer's Guide for information on OCI Instant Client.

2.1 Pre installation task – Install ODBC DM from unixODBC.org

Please install ODBC Driver Manager after downloading .tar file from http://www.unixodbc.org/

2.2 Installing ODBC Instant Client

Download the Basic Instant Client and ODBC Instant Client packages from the Oracle Technology Network Instant Client page. The two packages must be unzipped into same directory. For example, C:/Oracle/instantclient_10_2.

Basic Instant Client is a prerequisite for installing the ODBC Instant Client.

ODBC Instant Client package has the following file/shared libraries

<!--[if !supportEmptyParas]--> <!--[endif]-->
File name
Description
libsqora.so.10.1
ODBC Driver shared library
ODBCRelnotesUS.htm
Release notes
ODBCRelnotesJA.htm
Japanese release notes
ODBC_IC_Readme_Linux.html
ODBC Instant Client for Linux release notes (this one)
odbc_update_ini.sh
ODBC Instant Client install script to update .ini files
Make sure Basic Instant Client is deployed before running the ODBC install script.

Unzip the ODBC Instant Client package, then execute the odbc_update_ini.sh script with Driver Manager installed directory as a command line argument as follows (where Driver Manager is installed in /home/DriverManager directory):
$ odbc_update_ini.sh /home/DriverManger

The utility “odbc_update_ini.sh” takes four command-line arguments

arg-1 : Complete path where unixODBC DM has been installed.

arg-2 : Complete path of driver install location (optional); if this argument is not passed, the driver path is set to the directory from where the utility is run.

arg-3 : Driver name (optional); if this argument is not passed, driver name is set to “Oracle 10g ODBC driver”.

arg-4 : Data Source Name (optional); if no value is passed, DSN is set to “OracleODBC-10g”.

It will add the DSN entry in $HOME/.odbc.ini and <DriverManager_HOME>/etc/odbcinst.ini with DSN name as OracleODBC-10g

After the installation the environment needs to be configured in the following way:

Add the directory(指的是unixODBC下的lib路径) to the LD_LIBRARY_PATH system environment variable; otherwise, ODBC manager will be not able to load/find the driver.

Define the TNS_ADMIN to point the .ora files directory for OCI

This needs to be set for OCI to resolve the TNS name.

If TNS_ADMIN is not set, OCI will examine an operating system dependent set of directories to find tnsnames.ora. This search path includes looking in the directory $ORACLE_HOME/network/admin/tnsnames.ora. This is the only reason to set the ORACLE_HOME environment variable for Oracle Instant Client. If ORACLE_HOME is set when running Instant Client applications, it must be set to a directory where Instant Client exists.

Set any Oracle globalization variables required for your locale. See the Oracle Database 10g Globalization Support Guide for more information.

For example on Linux to set NLS_LANG:

setenv NLS_LANG JAPANESE_JAPAN.JA16EUC

2.3 Uninstalling ODBC Instant Client

Update ~/.odbc.ini file:

Remove DSN entry (e.g., “OracleODBC-10g”) from [ODBC Data Sources]

Remove complete DSN information for corresponding DSN

Update $DM_HOME/etc/odbcinst.ini file:

Remove driver information for "Oracle 10g ODBC Driver"

Remove Oracle ODBC driver for Linux

Delete libsqora.so.10.1

Reset any environment variables such as PATH and TNS_ADMIN.

2.4 Bugs Fixed

Please refer ODBC Readme.txt.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: