现在的位置: 首页 > 综合 > 正文

解决X64操作系统PL/SQL连接报错问题

2014年12月15日 ⁄ 综合 ⁄ 共 1219字 ⁄ 字号 评论关闭

环境:操作系统windows7 64位,oracle11g client
64为,PL/SQL8

当启动PL/SQL连接数据库时,会提示如下错误:

[Window Title]

(Not logged on)

[Content]

Initialization error

Could not initialize "C:\oracle\product\10.2.0\client_1\bin\oci.dll"

Make sure you have the 32 bits Oracle Client installed.

OracleHomeKey:

OracleHomeDir: C:\oracle\product\10.2.0\client_1

Found: oci.dll

Using: C:\oracle\product\10.2.0\client_1\bin\oci.dll

LoadLibrary(C:\oracle\product\10.2.0\client_1\bin\oci.dll) returned 0

错误产生的原因是PL/SQL可能不支持64位的oci.dll文件,因为安装的oracle客户端软件也是64位的。

解决方法:下载oracle提供的instant client,下载地址:http://www.oracle.com/technetwork/database/features/instant-client/index-097480.html?ssSourceSiteId=ocomen

虽然是64位操作系统,但是可以下载32为即时客户端,下载完成后解压即可。

例如文件解压到D:\Oracle\instantclient_11_2

则启动PL/SQL→Tools→Preferences→Oracle→Connection,设置Oracle
Home和OCI Library

image

之后保存,重新启动PL/SQL,连接数据库,问题解决!


登录报错:

不能登录为 uop_crm2
ORA-12154: TNS:could not resolve the connect identifier specified
变量名:TNS_ADMIN
变量值:Oracle安装目录中的 ....../product/11.2.0/dbhome_1/NETWORK/ADMIN
TNS_ADMIN=c:\oracle\product\11.2.0\dbhome_1\NETWORK\ADMIN

NLS_LANG 在客户端不能被确定字符集转变将造成不可预期的后果
变量名:NLS_LANG
变量值:AMERICAN_AMERICA.ZHS16GBK
NLS_LANG=AMERICAN_AMERICA.ZHS16GBK (注:NLS_LANG前半部分必须是AMERICAN_AMERICA,因为instant client不支持其他语言;而后半部分可以根据你数据库的字符集调整,如果数据库采用AL32UTF8,则可以设置AL32UTF8)


重新登录,OK!

抱歉!评论已关闭.