oracle 修改字符集,ORA-12712错误
今天一台测试机器的oracle服务端,在测试人员建库的时候字符集设置成了WE8MSWIN1252字符集,导致无法保存俄文等其他国家语言。
于是我建议测试将字符集修改为AL32UTF8。
首先查看服务端字符集
select * from v$nls_parameters where parameter = 'NLS_CHARACTERSET'
NLS_CHARACTERSET WE8MSWIN1252
然后用sys用户进行修改
#sqlplus "/as sysdba"
>shutdown immediate;
>startup mount;
>ALTER SESSION SET SQL_TRACE=TRUE;
>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 AL32UTF8;
ORA-12712: new character set must be a superset of old character set
RROR at line 1:
结果报错,提示新字符集必须是老字符集的超集。
于是强制转换
>ALTER DATABASE character set INTERNAL_USE AL32UTF8;
>shutdown immediate;
>STARTUP;
问题解决。
INTERNAL_USE是没有写在文档中的参数,用于强制完成字符集转化
alter database character set internal_use &charset;
alter database national character set internal_use &ncharset;