SQL 错误:ORA-12712:新字符集必须是旧字符集的超集
我想将 oracle 数据库的字符集从“WE8MSWIN1252”更改为“AL32UTF8”
我尝试从链接执行以下步骤(http://download.oracle.com/docs/cd/B10501_01/server.920/a96529/ch10 .htm#1009580):
使用 SHUTDOWN IMMEDIATE 或 SHUTDOWN NORMAL 语句。对数据库进行完整备份,因为 ALTER DATABASE CHARACTER SET 语句无法回滚。 完成以下陈述:
STARTUP MOUNT;
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;
但是当我执行上述语句时,出现以下错误
SQL 错误:ORA-12712:新字符集必须是旧字符集的超集
任何人都可以帮助我解决此问题。
I want to change character set of oracle database from 'WE8MSWIN1252' to 'AL32UTF8'
I tried to execute following steps from the link (http://download.oracle.com/docs/cd/B10501_01/server.920/a96529/ch10.htm#1009580):
Shut down the database, using either a SHUTDOWN IMMEDIATE or a
SHUTDOWN NORMAL statement. Do a full backup of the database because
the ALTER DATABASE CHARACTER SET statement cannot be rolled back.
Complete the following statements:
STARTUP MOUNT;
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;
But when i execute the above statement, I am getting the following error
SQL Error: ORA-12712: new character set must be a superset of old character set
Can anyone please help me in resolving this issue.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
要成功执行 ALTER DATABASE CHARACTER SET 语句,必须满足两个条件:
因为
WE8MSWIN1252
不是AL32UTF8
的严格子集,此语句将失败(例如:井号为 <在WE8MSWIN1252
中,十六进制代码>A3,但在AL32UTF8
中,它是C2 A3
)。您需要使用
CSALTER
来执行此迁移。参考:字符集迁移
For an
ALTER DATABASE CHARACTER SET
statement to execute successfully, two conditions must be fulfilled:Because
WE8MSWIN1252
is not a strict subset ofAL32UTF8
this statement will fail (example: the pound sign isA3
in hex inWE8MSWIN1252
, but inAL32UTF8
it isC2 A3
).You'll need to use
CSALTER
to do this migration.Refer to: Character Set Migration.
最简单的方法:(需要关闭):
首先,以 sysdba 身份连接:
接下来,执行以下脚本:
它在 Oracle 12c 标准第二版中对我有用
摘自:https://www.elblogdelpibe.com/2015/05/como-solucionar-el-error-ora-12899.html(更新的网址)
The Easiest way: (Shutdown neccesary):
First, Connect as sysdba:
Next, execute the following script:
It worked for me in a Oracle 12c Standard Two Edition
Taken from: https://www.elblogdelpibe.com/2015/05/como-solucionar-el-error-ora-12899.html (updated URL)
下面在 19C 为我工作。
问题
导入以 AL32UTF8 字符集和 AL16UTF16 NCHAR 字符集完成
导出以 WE8MSWIN1252 字符集和 AL16UTF16 NCHAR 字符集完成
警告:字符集转换中可能会丢失数据
步骤
数据库在限制模式下启动。
SQL>从nls_database_parameters中选择*,其中参数='NLS_CHARACTERSET';
参数
值
NLS_CHARACTERSET
AL32UTF8
SQL>更改数据库字符集WE8MSWIN1252;
更改数据库字符集WE8MSWIN1252
*
第 1 行错误:
ORA-12712: 新字符集必须是旧字符集的超集
SQL>更改数据库字符集INTERNAL_USE WE8MSWIN1252;
数据库已更改。
SQL>从nls_database_parameters中选择*,其中参数='NLS_CHARACTERSET';
参数
值
NLS_CHARACTERSET
WE8MSWIN1252
SQL>
干杯!
拉吉...
Below worked for me in 19C.
Issue
import done in AL32UTF8 character set and AL16UTF16 NCHAR character set
export done in WE8MSWIN1252 character set and AL16UTF16 NCHAR character set
Warning: possible data loss in character set conversions
Steps
Database started in Restriction mode.
SQL> select * from nls_database_parameters where parameter='NLS_CHARACTERSET';
PARAMETER
VALUE
NLS_CHARACTERSET
AL32UTF8
SQL> alter database character set WE8MSWIN1252;
alter database character set WE8MSWIN1252
*
ERROR at line 1:
ORA-12712: new character set must be a superset of old character set
SQL> alter database character set INTERNAL_USE WE8MSWIN1252;
Database altered.
SQL> select * from nls_database_parameters where parameter='NLS_CHARACTERSET';
PARAMETER
VALUE
NLS_CHARACTERSET
WE8MSWIN1252
SQL>
Cheers!
RaJ...
将第 6 行替换为
ALTER DATABASE CHARACTER SET INTERNAL_USE AL32UTF8;
这解决了我的问题。
replace line 6 by
ALTER DATABASE CHARACTER SET INTERNAL_USE AL32UTF8;
this solved my problem.