linux oracle odbc 驱动安装配置

  1. odbc安装略过...

  2. oracle 官网 http://www.oracle.com/technetwork/topics/linuxx86-64soft-092277.html 下载:

     oracle_instantclient11.2-basic-11.2.0.3.0-1.x86_64.rpm

     oracle_instantclient11.2-odbc-11.2.0.3.0-1.x86_64.rpm

      oracle_instantclient11.2-sqlplus-11.2.0.3.0-1.x86_64.rpm

       直接rpm -ivh 安装

   3.  odbc 的配置文件 在/usr/local/etc路径,

      odbc.ini 文件

    [ODBC Data Sources]
    lim = LIM ORACLE
    [lim]
    Description = lim
    Driver      = Oracle
    UserID      = lim
    Password    = lim
    Database  = ora11
    ServerName = testotporacle
    DSN = Oracle

      odbcinst.ini 文件

    [Oracle]
    Description = oracle
    Driver = /usr/lib/oracle/11.2/client64/lib/libsqora.so.11.1

4. 创建etc/oracle 目录,添加tnsnames.ora 文件,配置如下:

   testotporacle =
 (DESCRIPTION =
  (ADDRESS_LIST =
   (ADDRESS =
    (PROTOCOL = TCP)
    (Host = 10.99.76.210)
    (Port = 1521)
   )
  )
 
  (CONNECT_DATA =
   (SID = ora11)
  )
 )

5.环境变量修改

export TNS_ADMIN=/etc/oracle
export ORACLE_HOME=/usr/lib/oracle/11.2/client64/
export LD_LIBRARY_PATH=LD_LIBRARY_PATH:/usr/lib/oracle/11.2/client64/lib/

6. isql -v lim

+---------------------------------------+
| Connected!                            |
|                                       |
| sql-statement                         |
| help [tablename]                      |
| quit                                  |
|                                       |
+---------------------------------------+
SQL> quit;


遇到错误:

[28000][unixODBC][Oracle][ODBC][Ora]ORA-01017: invalid username/password; logon denied


解决:

查看 cat /etc/hosts

127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6

cat /etc/sysconfig/network

NETWORKING=yes
HOSTNAME=LIM_DEV52.ESS.CN01

在 /etc/hosts文件中添加

10.99.76.44 LIM_DEV52.ESS.CN01

修改后 cat /etc/hosts

127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
10.99.76.44 LIM_DEV52.ESS.CN01

 10.99.76.44 为本机ip.


你可能感兴趣的:(linux oracle odbc 驱动安装配置)