zoukankan      html  css  js  c++  java
  • Win7 x64 PL/SQL 连接 Oralce 提示 Could not initialize "%ORACLE_HOME%\bin\oci.dll"

    在 x64 的 Win7 上重新安装了 Oralce 后,通过 PL/SQL 连接数据库时,提示如下错误信息

    环境

    windows7 64bit

    Oracle win64 11gR2

    PL/SQL v9.0

    详细错误信息

    Initialization error  
    Could not initialize "C:\oracle\product\11.2.0\dbhome_1\bin\oci.dll"  
    Make sure you have the 32 bits Oracle Client installed.  
      
    OCIDLL forced to C:\oracle\product\11.2.0\dbhome_1\bin\oci.dll  
    LoadLibrary(C:\oracle\product\11.2.0\dbhome_1\bin\oci.dll) returned 0 

    问题原因

    安装的Oracle是64位的,PLSQL Developer只提供了32位应用程序,无法加载64位Oracle的oci.dll。

    解决方案

    1. 从 http://www.oracle.com/technetwork/database/features/instant-client/index-097480.html 下载Oracle Client Package。 我下载的是Instant Client for Microsoft Windows (32-bit) 【instantclient-basic-nt-11.2.0.2.0.zip】 
    2. 将 instantclient-basic-nt-11.2.0.2.0.zip 解压至 c:\oracle, oci.dll 所在目录为:c:\oracle\instantclient_11_2\
    3. 设置环境变量
        TNS_ADMIN=c:\oracle\product\11.2.0\dbhome_1\NETWORK\ADMIN
        NLS_LANG=AMERICAN_AMERICA.ZHS16GBK (注:NLS_LANG前半部分必须是AMERICAN_AMERICA,因为instant client不支持其他语言;而后半部分可以根据你数据库的字符集调整,如果数据库采用AL32UTF8,则可以设置AL32UTF8
    4. 启动PL/SQL Developer ,点击“取消”不要登录,菜单 --> Tools --> Perferences --> Connection 修改 Oracle_Home 和 OCI Library 的配置:
        OracleHome: OraDb11g_home1
        OCI library: C:\oracle\instantclient_11_2\oci.dll
    5. 重新启动 PL/SQL并登录对应的数据库,连接正常,问题成功解决!
  • 相关阅读:
    段间跳转之陷阱门
    段间跳转之中断门
    段间跳转之调用门
    代码段段间跳转流程
    Window内核学习之保护模式基础
    回顾2020,展望2021
    内存管理之堆
    Windows进程间通讯(IPC)----信号量
    线程本地存储(动态TLS和静态TLS)
    Windows进程间通讯(IPC)----套接字
  • 原文地址:https://www.cnblogs.com/hefeisf/p/4834809.html
Copyright © 2011-2022 走看看