oracle SQL 错误:ORA-12712:新字符集必须是旧字符集的超集
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/7352304/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
SQL Error: ORA-12712: new character set must be a superset of old character set
提问by Dawood
I want to change character set of oracle database from 'WE8MSWIN1252' to 'AL32UTF8'
我想将 oracle 数据库的字符集从“WE8MSWIN1252”更改为“AL32UTF8”
I tried to execute following steps from the link (http://download.oracle.com/docs/cd/B10501_01/server.920/a96529/ch10.htm#1009580):
我尝试从链接(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:
使用 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;
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
SQL 错误:ORA-12712:新字符集必须是旧字符集的超集
Can anyone please help me in resolving this issue.
任何人都可以帮助我解决这个问题。
回答by NullUserException
For an ALTER DATABASE CHARACTER SET
statement to execute successfully, two conditions must be fulfilled:
一条ALTER DATABASE CHARACTER SET
语句要成功执行,必须满足两个条件:
- Each and every character in the current character set is available in the new character set.
- Each and every character in the current character set has the same code point value in the new character set. (ie: the old charset must be a subset of the new one)
- 当前字符集中的每个字符都可以在新字符集中使用。
- 当前字符集中的每个字符在新字符集中都具有相同的代码点值。(即:旧字符集必须是新字符集的子集)
Because WE8MSWIN1252
is not a strict subset of AL32UTF8
this statement will fail (example: the pound sign is A3
in hex in WE8MSWIN1252
, but in AL32UTF8
it is C2 A3
).
因为WE8MSWIN1252
不是AL32UTF8
这个语句的严格子集会失败(例如:英镑符号A3
在十六进制中是WE8MSWIN1252
,但在AL32UTF8
它是C2 A3
)。
You'll need to use CSALTER
to do this migration.
您需要使用CSALTER
来执行此迁移。
Refer to: Character Set Migration.
请参阅:字符集迁移。
回答by Walter Colchado
The Easiest way: (Shutdown neccesary):
最简单的方法:(需要关机):
First, Connect as sysdba:
首先,以 sysdba 身份连接:
sqplus / as sysdba
Next, execute the following script:
接下来,执行以下脚本:
alter system set nls_length_semantics=CHAR scope=both;
shutdown;
startup restrict;
alter database character set INTERNAL_USE WE8ISO8859P1;
shutdown;
startup;
It worked for me in a Oracle 12c Standard Two Edition
它在 Oracle 12c 标准二版中对我有用
Taken from: http://www.blogdelpibe.com/2015/05/como-solucionar-el-error-ora-12899.html
摘自:http: //www.blogdelpibe.com/2015/05/como-solucionar-el-error-ora-12899.html
回答by Amir
replace line 6 by
将第 6 行替换为
ALTER DATABASE CHARACTER SET INTERNAL_USE AL32UTF8;
ALTER DATABASE CHARACTER SET INTERNAL_USE AL32UTF8;
this solved my problem.
这解决了我的问题。