PL/SQL database character set(AL32UTF8) and Client character set(ZHS16GBK) are different
Posted 眾尋
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了PL/SQL database character set(AL32UTF8) and Client character set(ZHS16GBK) are different相关的知识,希望对你有一定的参考价值。
转自:http://blog.163.com/magicc_love/blog/static/18585366220123111128283/
修改部分为红色部分,原作者写错了
启动PL/SQL Developer 报字符编码不一致错误
Database character set (AL32UTF8) 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_Oracle_10g.
1、打开注册表,通过命令regedit。找到到文中提示的路径,发现NLS_LANG键的值为:
SIMPLIFIED CHINESE_CHINA.ZHS16GBK
修改为:SIMPLIFIED CHINESE_CHINA.AL32UTF8即可
2、还有一种可能是由于安装11g的时候没选择自定义安装造成的
SIMPLIFIED CHINESE_CHINA.ZHS16GBK 包含 AMERICAN_AMERICA.AL32UTF8.
这可是个麻烦事,不是改客户端字符集的问题。要改数据库的字符集:
SQL> conn /as sysdba
SQL> shutdown immediate;
SQL> startup mount
SQL> ALTER SYSTEM ENABLE RESTRICTED SESSION;
SQL> ALTER SYSTEM SET JOB_QUEUE_PROCESSES=0;
SQL> ALTER SYSTEM SET AQ_TM_PROCESSES=0;
SQL> alter database open;
SQL> ALTER DATABASE CHARACTER SET AL32UTF8;
ORA-12712: new character set must be a superset of old character set
提示我们的字符集:新字符集必须为旧字符集的超集,这时我们可以跳过超集的检查做更改:
SQL> ALTER DATABASE character set INTERNAL_USE AL32UTF8;
--我们看到这个过程和之前ALTER DATABASE CHARACTER SET操作的内部过程是完全相同的,也就是说INTERNAL_USE提供的帮助就是使Oracle数据库绕过了子集与超集的校验.
SQL> select * from v$nls_parameters;
SQL> shutdown immediate;
SQL> startup
SQL> select * from v$nls_parameters;
以后安装oracle11g的时候记得选择自定义安装,把这个字符集的事情事先弄好
以上是关于PL/SQL database character set(AL32UTF8) and Client character set(ZHS16GBK) are different的主要内容,如果未能解决你的问题,请参考以下文章
启动PL/SQL Developer 报字符编码不一致错误 Database character set (AL32UTF8) and Client character set (ZHS16GBK)
关于PL/SQL打开库表报“ORA-29275: partial multibyte character”的解决方法
如何使用非默认 NLS_NUMERIC_CHARACTERS 在 Oracle PL/SQL 中有效地将文本转换为数字?
PL/SQL Developer import and export database method and illustrate