概述
查看数据库当前字符集
SQL> select userenv('language') from dual;
USERENV('LANGUAGE')
----------------------------------------------------
AMERICAN_AMERICA.WE8MSWIN1252
---------------------
将数据库置于restricted mode下
SQL> alter system enable restricted session;
System altered.
修改字符集到ZHS16GBK
SQL> ALTER DATABASE CHARACTER SET ZHS16GBK;
ALTER DATABASE CHARACTER SET ZHS16GBK
*
ERROR at line 1:
ORA-12712: new character set must be a superset of old character set
提示我们的字符集:新字符集必须为旧字符集的超集,这时我们可以跳过超集的检查做更改:
SQL> ALTER DATABASE character set INTERNAL_USE ZHS16GBK;
ALTER DATABASE character set INTERNAL_USE ZHS16GBK
*
ERROR at line 1:
ORA-12721: operation cannot execute when other sessions are active
当前有连接处于active状态,kill掉session或者重启数据库。
SQL> shutdown immediate;
SQL> startup mount;
SQL> alter system enable restricted session;
System altered.
SQL> alter database open;
Database altered.
SQL> ALTER DATABASE character set INTERNAL_USE ZHS16GBK;
Database altered.
SQL> alter system disable restricted session;
System altered.
SQL> select userenv('language') from dual;
USERENV('LANGUAGE')
----------------------------------------------------
AMERICAN_AMERICA.ZHS16GBK
----------------------------------------------------
最后
以上就是失眠黑猫为你收集整理的Oracle 11g默认字符集:WE8MSWIN1252修改为ZHS16GBK的全部内容,希望文章能够帮你解决Oracle 11g默认字符集:WE8MSWIN1252修改为ZHS16GBK所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
发表评论 取消回复