1)导入时报错,如图
ORA-02374: conversion error loading table "ITMUSER"."K17DOSINF1"
ORA-12899: value too large for column LabelName (actual: 36, maximum: 32)
ORA-02372: data for row: LabelName : 0X'CFB5CDB3B1A3C1F42020202020202020202020202020202020'
USERENV('LANGUAGE')
----------------------------------------------------
SQL> select userenv('language') from dual;
USERENV('LANGUAGE')
----------------------------------------------------
SQL>ALTER SYSTEM ENABLE RESTRICTED SESSION;
SQL>ALTER SYSTEM SET JOB_QUEUE_PROCESSES=0;
SQL>ALTER SYSTEM SET AQ_TM_PROCESSES=0;
SQL>ALTER DATABASE OPEN;
SQL>ALTER DATABASE CHARACTER SET INTERNAL_USE ZHS16GBK; //跳过超子集检测
ORA-02374: conversion error loading table "ITMUSER"."K17DOSINF1"
ORA-12899: value too large for column LabelName (actual: 36, maximum: 32)
ORA-02372: data for row: LabelName : 0X'CFB5CDB3B1A3C1F42020202020202020202020202020202020'
2)通过查两边库发现字符集不一样
导出库:
SQL> select userenv('language') from dual;USERENV('LANGUAGE')
----------------------------------------------------
AMERICAN_AMERICA.ZHS16GBK
SQL> select userenv('language') from dual;
USERENV('LANGUAGE')
----------------------------------------------------
AMERICAN_AMERICA.AL32UTF8
3)修改导入库的字符集
SQL>STARTUP MOUNT;
SQL>ALTER SYSTEM ENABLE RESTRICTED SESSION;
SQL>ALTER SYSTEM SET JOB_QUEUE_PROCESSES=0;
SQL>ALTER SYSTEM SET AQ_TM_PROCESSES=0;
SQL>ALTER DATABASE OPEN;
SQL>ALTER DATABASE CHARACTER SET INTERNAL_USE ZHS16GBK; //跳过超子集检测
SQL>shutdown immediate;
SQL>STARTUP;
本文介绍了解决在Oracle数据库中因字符集不一致导致的数据导入错误的方法。具体包括遇到的ORA-02374及ORA-12899等错误提示,通过检查源目标库字符集差异,最终通过调整目标库字符集实现数据成功导入的过程。
4228

被折叠的 条评论
为什么被折叠?



