AI智能
改变未来

修改oracle字符编码时 报错ORA-12712: new character set must be a superset of old character set

toad连接数据库
select userenv(\’language\’) from dual;

显示SIMPLIFIED CHINESE_CHINA.AL32UTF8
需要修改为 SIMPLIFIED CHINESE_CHINA.ZHS16GBK
执行
ALTER DATABASE CHARACTER SET ZHS16GBK; 

报错 ORA-12712: new character set must be a superset of old character set

–ssh连接数据库

su – oracle  –切换到oracle 用户

sqlplus /as sysdba

>shutdown immediate;  停止数据库
>startup mount; 把database重启到可更改状态 装载数据库,打开控制文件
>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 ZHS16GBK;

ORA-12712: new character set must be a superset of old character set
RROR at line 1:

结果报错,提示新字符集必须是老字符集的超集。

于是强制转换

>ALTER DATABASE character set INTERNAL_USE ZHS16GBK;

>shutdown immediate; 停止数据库

>startup 启动数据库

赞(0) 打赏
未经允许不得转载:爱站程序员基地 » 修改oracle字符编码时 报错ORA-12712: new character set must be a superset of old character set