pl/sql developer 編碼格式設定
一、pl/sql developer 中文欄位顯示亂碼
原因:因為資料庫的編號格式和pl /sql developer的編碼格式不統一造成的。
二、檢視和修改oracle資料庫字符集:
select userenv('language') from dual;
查詢結果:
SIMPLIFIED CHINESE_CHINA.AL32UTF8
--修改oracle資料庫字符集:(在SQL Plus中)
sql> conn / as sysdba;
sql> shutdown immediate;
database closed.
database dismounted.
oracle instance shut down.
sql> startup mount;
oracle instance started.
total system global area 135337420 bytes
fixed size 452044 bytes
variable size 109051904 bytes
database buffers 25165824 bytes
redo buffers 667648 bytes
database mounted.
sql> alter system enable restricted session;
system altered.
sql> alter system set job_queue_processes=0;
system altered.
sql> alter system set aq_tm_processes=0;
system altered.
sql> alter database open;
database altered.
sql> alter database character set internal_use JA16SJIS;
sql> shutdown immediate;
sql> startup;
三、修改pl/sql developer 的編碼格式:
在windows中創 建一個名為“NLS_LANG”的系統環境變數,設定其值為“SIMPLIFIED CHINESE_CHINA.ZHS16GBK”,
然後重新啟動 pl/sql developer,這樣檢索出來的中文內容就不會是亂碼了。如果想轉換為UTF8字符集,可以賦予“NLS_LANG”為 “AMERICAN_AMERICA.UTF8”,然後重新啟動 pl/sql developer。其它字符集設定同上