你好,游客 登录 注册 搜索
背景:
阅读新闻

Linux 配置 unixODBC 访问 Oracle 说明

[日期:2012-03-05] 来源:csdn  作者:tianlesoftware [字体:大 中 小]

二.下载安装unixODBC 连接Oracle 的驱动

ODBC Drivers 下载地址:

http://www.easysoft.com/developer/interfaces/odbc/index.html

这里的驱动也分两种,需要Oracle 客户端的ODBC-Oracle Driver (OCI version)和不需要Oracle客户端的ODBC-OracleDriver (WP version),

The EasysoftODBC-Oracle Driver (OCI version) uses Oracleclient software to access the Oracle database. 

The EasysoftODBC-Oracle Driver (WP version), which does not use Oracle client software,provides direct access to Oracle, for use in solutions where minimising theclient footprint is a requirement.

因为我的测试环境上已经安装了oracle,所以我这里选择需要客户端的驱动。

[root@rac1 u01]# ls

app backup  odbc-oracle-3.3.0-linux-x86-64-ul64.tar  oswbb oswbb4.0.tar

 

安装odbc 驱动:

[root@rac1 u01]# tar -xvf odbc-oracle-3.3.0-linux-x86-64-ul64.tar

 

[root@rac1 u01]# cd odbc-oracle-3.3.0-linux-x86-64-ul64

[root@rac1odbc-oracle-3.3.0-linux-x86-64-ul64]# ls

all.tar                 install_check_root      install_versioned        tee

all.tar.md5sum          install_check_tools     licclient                testlib

all.tar.sum             install_init            licenses_template        unixodbc.tar

check_root.txt          install_intro           license.txt              unixodbc.tar.md5sum

cmpver                  install_license         licshell                 unixodbc.tar.sum

drv_template            install_linkpaths       names                    unixODBC_version.txt

ident                   install.ORACLE          ORACLE_intro.txt         uodbc

install                 install_other_products  ORACLE_uodbcinstall.txt  versioned

install_check_linux     install_paths           OSname.txt

install_check_products  INSTALL.txt             postinstall

 

--使用root用户安装,因为安装过程中需要root权限:

[root@rac1odbc-oracle-3.3.0-linux-x86-64-ul64]# ./install

--安装过程中要看很多问题,不想看的直接按回车跳过。

….

 

Option: 1

No valid licenses found on this machine

in /usr/local/easysoft//license/licenses

 

[0] Exit

[1] View existing licenses

[2] Oracle ODBC Driver V3.3

 

Please choose the product you would like alicense for by entering its item number or enter one of the other options.

--这里有3个选项,2是需要购买的,我们选择0退出:

Option: 0

 

Access to the ODBC Driver is performedutilising the unixODBC Driver Manager.

 

The Driver Manager is made aware of thelocation of the Easysoft ODBC-Oracle Driver via data sources.

 

The following section will create an Oracledata source based on the information entered at the following prompt.

--会提示我们创建一个基本的data source:

The created data source will be called'ORACLE'.

 

Do you wish to create a data source at thistime? (y/n) [y]: 

 

It seems that you do not have ORACLE_HOMEdefined at this time

Is this because you intend to use an Oracle10g Instant Client (y/n) [y]:

 

Enter the name or IP address of the Oracleserver (i.e. server): 192.168.3.116

Enter the port the Oracle server islistening on (default 1521):

Enter the Oracle Service Name (i.e. test):DAVE

Enter an Oracle user name (i.e. system):system

Enter the Oracle password for system (i.e.manager): oracle

Writing new/usr/local/easysoft/oracle/dsn_template for Instant Client

 

Installing entry in odbcinst.ini file

 

Drivers already installed for unixODBC are:

[PostgreSQL]

[MySQL]

[ORACLE]

 

*****

WARNING:

It appears the Easysoft ODBC-Oracle Driverdriver is already registered

with unixODBC.

If you are reinstalling the ORACLE to adifferent install path you

may have to edit your odbcinst.ini file tocorrect it as the

following odbcinst commands to install thedriver will simply increase

the usage count and not affect the paths.

*****

Press the return key to continue

 

Running odbcinst command:

/usr/local/easysoft/unixODBC/bin/odbcinst-i -d -f drv_template

==========

odbcinst: Driver installed. Usage countincreased to 2.

   Target directory is /etc

==========

You can now install a [ORACLE] data sourcefor unixODBC and

Easysoft ODBC-Oracle Driver.

However, unixODBC currently requires anodbc.ini file to exist before a

datasource can be added. This install willcreate /etc/odbc.ini if you

request the datasource to be created.

 

Install unixODBC/Easysoft ODBC-OracleDriver data source (y/n) [y]:

Running odbcinst command:

/usr/local/easysoft/unixODBC/bin/odbcinst-s -i -f /usr/local/easysoft/oracle/dsn_template

==========

==========

 

Congratulations. You have now completed theinstallation of the Easysoft

ODBC-Oracle Driver.

 

The full manual is available as a PDF orHTML from:

ftp://ftp.easysoft.com/pub/docs/oracle

 

and in /usr/local/easysoft/oracle/doc.

 

The HTML version of the manual is availableonline at:

http://www.easysoft.com/products/data_access/odbc_oracle_driver

 

NOTE:

If you installed this software as anon-root user you need to:

1. set the EASYSOFT_ROOT environmentvariable to

  /usr/local/easysoft.

2. Set up your dynamic linker search pathto include

  /usr/local/easysoft/lib

  /usr/local/easysoft/unixODBC/lib

 

 

切换到oracle 用户,在~/.bashrc中添加如下环境变量:

exportLD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib

export SHLIB_PATH=/usr/local/easysoft/lib

export LIBPATH=/usr/local/easysoft/lib

 

--source 使修改生效:

rac1:/home/oracle> source ~/.bashrc

linux
相关资讯       oracle数据库教程 
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款