PLSQL Developer 連接Oracle X64版。 報錯如下:
- [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
原因:因為PLSQL developer 沒有支持64位的版本
解決方法:
1.下載oracle提供的32 bit client,下載地址:http://www.oracle.com/technetwork/database/features/instant-client/index-097480.html?ssSourceSiteId=ocomen
下載完成后解壓隨意目錄:如:D:\instantclient_11_2
2.啟動PL/SQL→Tools→Preferences→Oracle→Connection,設置Oracle Home和OCI Library
Oracle Home ------D:\instantclient_11_2
OCI Library--------D:\instantclient_11_2\ocl.dll
3.對系統的環境變量進行配置
主要需要以下兩項:
變量名:TNS_ADMIN.
變量值:Oracle安裝目錄中的 ....../product/11.2.0/dbhome_1/NETWORK/ADMIN.
變量名:NLS_LANG.
變量值:AMERICAN_AMERICA(數據庫字符編碼 ).
(另外以下是安裝Oracle就需要配置的,否則可能會有TNS協議適配器錯誤)
變量名:oracle_sid
變量值:Oracle的數據庫實例
其中數據庫字符編碼可以通過進入SQL PLUS select userenv(‘language’) from dual;來查詢。
這樣重新啟動一下PLSQL Developer,然后就能訪問了。