设置PLSQL+Developer访问本机64位Oracle+服务器

来源:互联网 发布:软件测试可以自学吗 编辑:程序博客网 时间:2024/06/05 14:27

转自:http://carltao.blog.51cto.com/856514/196838 

 

由于在本机Vista X64上安装了64位的Oracle,结果试图使用PLSQL Developer去访问它的时候,报告说无法加载oci.dll文件。原来oci.dll是64位的,32位应用程序PLSQL Developer自然无法加载了。
试验了下,解决办法如下:

  • 1. 下载32位Oracle InstantClient,并展开到某目录,例如C:\oracle\instantclient_10_2;
  • 2. 将系统的tnsnames.ora拷贝到该目录下;
  • 3. 在PLSQL Developer中设置Oracle_Home和OCI Library,如下图所示

 

  • 4. 在PLSQL Developer目录下编辑如下bat文件,替换其快捷方式,启动PLSQL Developer:
@echo off
set path=C:\oracle\instantclient_10_2
set ORACLE_HOME=C:\oracle\instantclient_10_2
set TNS_ADMIN=C:\oracle\instantclient_10_2
set NLS_LANG=AMERICAN_AMERICA.ZHS16GBK
start plsqldev.exe

  注:NLS_LANG前半部分必须是AMERICAN_AMERICA,因为instant client不支持其他语言;而后半部分可以根据你数据库的字符集调整,如果数据库采用AL32UTF8,则可以设置AL32UTF8。

 

其他:

Quick post: I was trying to connect to a 64-bit Oracle database using PL/SQL Developer. Despite ORACLE_HOME being set the right values and oci.dll available, PL/SQL Developer could not connect to the database.

Further probing indicated that the Oracle installation was a 64-bit one, and PL/SQL Developer is incapable of loading 64-bit version of oci.dll file. To fix this, download the 32-bit version ofOracle Instant Client, extract it to a directory such as \instant_client.

Next, configure PL/SQL Developer to use this version by clicking on Tool menus -> Preferences. Under Oracle Home, point to the location where you had extracted Instant client (\instant_client, in this case)  and under location of OCI Library, point to the oci.dll file present in location where you had extracted Instant client ( \instant_client\oci.dll). Restart PL/SQL Developer and you should be able to connect now.

 


方法可行~