作者:玻璃里的鱼鱼 | 来源:互联网 | 2014-07-13 17:52
oracle修改字符集查看oracle服务端编码:select*fromsys.nls_database_parameters;查看client编码:select*fromsys.nls_session_parameters;修改客户端编码:翻开运转器进入注册表编辑运转--》reged...
oracle修改字符集
查看oracle服务端编码:select * from sys.nls_database_parameters;
查看client编码:select * from sys.nls_session_parameters;
修改客户端编码:
翻开运转器进入注册表编辑
运转--》regedit
找到
HKEY_LOCAL_MACHINE/
SOFTWARE/ www.2cto.com
ORACLE/KEY_OraDb10g_home1
的变量NLS_LANG的值
SIMPLIFIED CHINESE_CHINA.ZHS16GBK
改动成以下的值
SIMPLIFIED CHINESE_CHINA.AL32UTF8(效劳端编码)
服务端:
1. 在你的listener配置文件中增加实例信息
SID_LIST_LISTENER =
(SID_LIST =
(
SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = F:\oracle\product\10.1.0\Db_1)
(PROGRAM = extproc)
)
(
SID_DESC =
(SID_NAME = orcl)
(ORACLE_HOME = F:\oracle\product\10.1.0\Db_1)
)
)
2. 修改oracle字符集
SQL> startup mount;
SQL> alter system enable restricted session;
SQL> alter system set job_queue_processes=0;
SQL> alter database open; www.2cto.com
SQL> alter database character set internal_use UTF8;
SQL> shutdown immediate;
SQL> startup
oracle查看字符集
select userenv('language') from dual;
connect system as sysdba ;
shutdown immediate ;
startup mount ;
alter system enable restricted session ;
alter system set JOB_QUEUE_PROCESSES=0;
alter system set AQ_TM_PROCESSES=0;
alter database open ;
alter database character set internal_use ZHS16GBK ;
shutdown immediate ;
startup ;
老版本可以参考
STARTUP MOUNT;
ALTER SYSTEM ENABLE RESTRICTED SESSION;
ALTER SYSTEM SET JOB_QUEUE_PROCESSES=0;
ALTER SYSTEM SET AQ_TM_PROCESSES=0;
ALTER DATABASE OPEN;
ALTER DATABASE CHARACTER SET UTF8;
ALTER DATABASE national CHARACTER SET UTF8;
SHUTDOWN IMMEDIATE;
STARTUP; www.2cto.com
Database character set (UTF8) and Client character set (ZHS16GBK) are different.
Character set conversion may cause unexpected results.
Note: you can set the client character set through the NLS_LANG environment variable or the NLS_LANG registry key in
HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE\KEY_OraDb11g_home1.
1)C:\Documents and Settings\Administrator>set NLS_LANG=american_america.AL32UTF8
2)
C:\Documents and Settings\Administrator>set NLS_LANG=SIMPLIFIED CHINESE_CHINA.ZHS16GBK
SIMPLIFIED CHINESE_CHINA.ZHS16GBK
注册表 HKEY_LOCAL_MACHINE->software->oracle-》key_oradb11g_home1左侧的NLS_Lang
SIMPLIFIED CHINESE_CHINA.ZHS16GBK与SIMPLIFIED CHINESE_CHINA.AL32UTF8
作者 jianhuili