SQL 错误:ORA-12712:新字符集必须是旧字符集的超集

发布于 2024-12-04 01:43:21 字数 610 浏览 1 评论 0原文

我想将 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

吃兔兔 2024-12-11 01:43:22
con 11g funciona
alter system set nls_length_semantics=CHAR scope=both;
shutdown;
startup restrict;
alter database character set INTERNAL_USE WE8ISO8859P1;
shutdown;
startup;
con 11g funciona
alter system set nls_length_semantics=CHAR scope=both;
shutdown;
startup restrict;
alter database character set INTERNAL_USE WE8ISO8859P1;
shutdown;
startup;
花海 2024-12-11 01:43:21

要成功执行 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:

  • 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).

You'll need to use CSALTER to do this migration.

Refer to: Character Set Migration.

意中人 2024-12-11 01:43:21

最简单的方法:(需要关闭)

首先,以 sysdba 身份连接:

sqplus / as sysdba

接下来,执行以下脚本:

alter system set nls_length_semantics=CHAR scope=both;
shutdown;
startup restrict;
alter database character set INTERNAL_USE WE8ISO8859P1;
shutdown;
startup;

它在 Oracle 12c 标准第二版中对我有用

摘自:https://www.elblogdelpibe.com/2015/05/como-solucionar-el-error-ora-12899.html(更新的网址)

The Easiest way: (Shutdown neccesary):

First, Connect as 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

Taken from: https://www.elblogdelpibe.com/2015/05/como-solucionar-el-error-ora-12899.html (updated URL)

胡渣熟男 2024-12-11 01:43:21

下面在 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...

猫性小仙女 2024-12-11 01:43:21

将第 6 行替换为

ALTER DATABASE CHARACTER SET INTERNAL_USE AL32UTF8;

这解决了我的问题。

replace line 6 by

ALTER DATABASE CHARACTER SET INTERNAL_USE AL32UTF8;

this solved my problem.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文