Monday, 4 May 2020

ORA-02374: conversion error loading table,ORA-12899: value too large for column


When you run import dump into a database you may get below error.

ORA-02374: conversion error loading table "DATA"."TEST_TABLE"
ORA-12899: value too large for column AT_TEXT (actual: 2001, maximum: 2000)
ORA-02372: data for row: AT_TEXT : '999999934389384734HUKL83434JJ'

Reason: you can observe the error messages saying column length of the table is not sufficient to import the data, its saying column length is 2000 characters but value to be loaded into the column is 2001. how its possible?, how the table in source is having more characters in the column?.

Its due to character set change from source to target, you may find the message in import log as below.

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

in the above message its clearly saying export is done in  WE8MSWIN1252 and doing import in AL32UTF8

Solution:
1. you can import the only metadata of the table first and increase column length and import it, make sure the data is validated in this case, because you may get strange characters in the data. to avoid this you may regenerate data.
2. character set conversion, before importing to the target database, you need to import into a dummy database which is in the same character set as source then convert into target database character set by using tools like DMU tool, CSALTER etc.

you can check here how to convert character set using CSALTER


No comments:

Post a Comment