PL/SQL Developer 串連64位元據庫出現亂碼錯誤,pldeveloper

來源:互聯網
上載者:User

PL/SQL Developer 串連64位元據庫出現亂碼錯誤,pldeveloper

原創作品,出自 “深藍的blog” 部落格,歡迎轉載,轉載時請務必註明以下出處,否則追究著作權法律責任。

深藍的blog:http://blog.csdn.net/huangyanlong/article/details/41479997

安裝64bit oracle11g資料庫後,使用PL/SQL串連資料庫,解決“中文字元”亂碼問題

現場環境

作業系統

WINDOWS 2008 64bit

資料庫版本

Oracl11g 64bit 11.2.0.3

PL/SQL版本

10.0.2.1697

說明:PL/SQL軟體只能串連32位元據庫,所以實際工作中如果需要用其串連64位元據庫,需要安裝32位用戶端。

實施操作

實現使用PL/SQL串連oracle11g資料庫。

部署時我參考的我以往的一篇經驗總結:http://blog.csdn.net/huangyanlong/article/details/18466053

但這次生產庫出現了錯誤。

使用時出現錯誤,如下現象:

錯誤現象:出現亂碼。

解決方案

檢查資料庫語言設定:

SQL> select userenv('language') nls_lang from dual;

NLS_LANG

----------------------------------------------------

SIMPLIFIED CHINESE_CHINA.ZHS16GBK

右擊"我的電腦" - "屬性" - "進階" - "環境變數" - "系統內容變數":

1>.選擇"Path" - 點擊"編輯", 把 " D:\soft\app\Administrator\product\ instantclient_11_2;" 加入;

2>.點擊"建立", 變數名設定為"TNS_ADMIN", 變數值設定為" D:\soft\app\Administrator\product\ instantclient_11_2;", 點擊"確定";

3>.點擊"建立", 變數名設定為"NLS_LANG", 變數值設定為"SIMPLIFIED CHINESE_CHINA.ZHS16GBK", 點擊"確定";

再次執行PL/SQL Developer,中文已經正確顯示出來,如下所示:

總結

使用PL/SQL Developer通過安裝32位用戶端,成功解決串連64位元據庫,但出現中文字元亂碼問題,原來是WINDOWS系統下,還需要設定相應的環境變數。

後續網路尋找資料

下面是在網上找的一篇關於使用PL/SQL Developer串連64位元據庫的方法,總結已經很全面了,在這裡轉載過來,分享給朋友們。

下面為轉載:

1)安裝Oracle 11g 64位

2)安裝32位的Oracle用戶端( instantclient-basic-win32-11.2.0.1.0)

:http://www.oracle.com/technetwork/cn/topics/winsoft-095945-zhs.html

 

下載instantclient-basic-win32-11.2.0.1.0.zip (一定得是32位的,不要下錯了版本,Oracle官網有下載),將其解壓至Oracle安裝目錄的Product下(本機命名為:instantclient_11_2):D:\app\ZC\product\instantclient_11_2。

 

拷貝資料庫安裝根目錄下的一個目錄D:\app\ZC\product\11.2.0\dbhome_1\NETWORK到Oracle用戶端目錄下D:\app\ZC\product\instantclient_11_2(其實只需要 NETWORK\ADMIN\tnsnames.ora)

3)安裝PL/SQL Developer

安裝 PL/SQL Developer,在perference->Connection裡面設定OCI Library和Oracle_Home,例如本機設定為:

Oracle Home :D:\app\ZC\product\instantclient_11_2

OCI Library :D:\app\ZC\product\instantclient_11_2\oci.dll

4) 設定環境變數(修改PATH和TNS_ADMIN環境變數) 對於NLS_LANG環境變數, 最好設定成和資料庫端一致, 首先從資料庫端查詢字元集資訊:

SQL> select userenv('language') nls_lang from dual;

NLS_LANG

----------------------------------------------------

SIMPLIFIED CHINESE_CHINA.ZHS16GBK

右擊"我的電腦" - "屬性" - "進階" - "環境變數" - "系統內容變數":

1>.選擇"Path" - 點擊"編輯", 把 "D:\app\ZC\product\instantclient_11_2;" 加入;

2>.點擊"建立", 變數名設定為"TNS_ADMIN", 變數值設定為"D:\app\ZC\product\instantclient_11_2;", 點擊"確定";

3>.點擊"建立", 變數名設定為"NLS_LANG", 變數值設定為"SIMPLIFIED CHINESE_CHINA.ZHS16GBK", 點擊"確定";

最後點擊"確定"退出。

啟動 PL/SQL Developer ,運行無問題。

 

原創作品,出自 “深藍的blog” 部落格,歡迎轉載,轉載時請務必註明以下出處,否則追究著作權法律責任。

深藍的blog:http://blog.csdn.net/huangyanlong/article/details/41479997

相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.