测试库中文字符集乱码
PLsql报错中有乱码、有问好???等问题,是字符集导致
sqlplus /nolog
conn / as sysdba
startup
1.查询数据库中的字符集设置
SQL> select userenv(‘language‘) from dual;
USERENV(‘LANGUAGE‘)
AMERICAN_AMERICA.WE8MSWIN1252
2.修改数据库的字符集
SQL> ALTER DATABASE character set INTERNAL_USE ZHS16GBK;
ALTER DATABASE character set INTERNAL_USE ZHS16GBK
*
ERROR at line 1:
ORA-12719: operation requires database is in RESTRICTED mode
3.需要将数据库设置为RESTRICTED mode
将数据库置于restricted mode下,是为了防止数据库有新的非dba权限的连接
SQL> alter system enable restricted session;
4.修改字符集到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
提示:新字符集必须为旧字符集的超集,这时可以跳过超集的检查做更改:
5.强制修改数据库字符集
SQL> ALTER DATABASE character set INTERNAL_USE ZHS16GBK;
然后重启数据库,就可以了,如果有报错可以下面留言
原文地址:https://blog.51cto.com/7794482/2434165