Character Set Scanner Utility - CSSCAN
Logan Palanisamy, February 24, 2003 - 5:13 pm UTC
How about using the Character Set Scanner Utility (CSSCAN) available in 9i.
</code>
http://download-west.oracle.com/docs/cd/A91202_01/901_doc/server.901/a90236.pdf <code>
You specify the FROMCHAR and TOCHAR sets. It will tell you whether the data is convertible. If not convertible, it will tell you which tables and which columns have the problem data. You fix the data or increase the column width etc.
Hope that helps
TH8TISASCII to AL32UTF8
Alvin, May 11, 2005 - 11:00 pm UTC
I was given an import dumpfile who has a Thai charset (TH8TISASCII) and our current db charset is AL32UTF8.
We are currently using oracle 9i. What i did was changed the environment variable in the OS in the .bash_profile to
export NLS_LANG=THAI_THAILAND.TH8TISASCII
and tried to import it in a schema. And according to oracle documentation the db charset is as follows:
AL32UTF8 Unicode 3.1 UTF-8 Universal character set
MB, ASCII, EURO
My import errors are:
import done in TH8TISASCII character set and AL16UTF16 NCHAR character set
import server uses AL32UTF8 character set (possible charset conversion)
export server uses TH8TISASCII NCHAR character set (possible ncharset conversion)
. importing DBA_HO's objects into B2BTHAI
. . importing table "SUPPLIER"
IMP-00019: row rejected due to ORACLE error 1401
IMP-00003: ORACLE error 1401 encountered
ORA-01401: inserted value too large for column
Column : AAAGQ9AAJAAAbPDAAA
Column : 14196
Column : -1
Column : 9
My NLS_DATABASE_PARAMETERS
PARAMETER VALUE
------------------------------ ------------------------------
NLS_LANGUAGE AMERICAN
NLS_TERRITORY AMERICA
NLS_CURRENCY $
NLS_ISO_CURRENCY AMERICA
NLS_NUMERIC_CHARACTERS .,
NLS_CHARACTERSET AL32UTF8
NLS_CALENDAR GREGORIAN
NLS_DATE_FORMAT DD-MON-RR
NLS_DATE_LANGUAGE AMERICAN
NLS_SORT BINARY
NLS_TIME_FORMAT HH.MI.SSXFF AM
NLS_TIMESTAMP_FORMAT DD-MON-RR HH.MI.SSXFF AM
NLS_TIME_TZ_FORMAT HH.MI.SSXFF AM TZR
NLS_TIMESTAMP_TZ_FORMAT DD-MON-RR HH.MI.SSXFF AM TZR
NLS_DUAL_CURRENCY $
NLS_COMP BINARY
NLS_LENGTH_SEMANTICS BYTE
NLS_NCHAR_CONV_EXCP FALSE
NLS_NCHAR_CHARACTERSET AL16UTF16
NLS_RDBMS_VERSION 9.2.0.4.0
May 12, 2005 - 7:43 am UTC
You are going from a single byte characterset to a multi-byte characterset.
every character in the import file might take 1, 2, 3 or more bytes in the database.
So, you could have a varchar2(10) that held 10 characters in the single byte characterset - it might only be able to hold 2 or 3 characters in the multi-byte representation.
It is a fact of multi-byte charactersets. You need to make the columns be able to hold more bytes. You can use
column_name varchar2(30 CHAR)
to let it hold 30 characters in the characterset, instead of 30 bytes.
I read Note:99120.1
Alvin, May 12, 2005 - 10:30 pm UTC
So basically i've 2 alternative.
1. Fastest way - Since i'm importing the data for Developmental testing (dev. db)it would be much much faster and painless to just create another db with a similar charset.
2. Extract the DDL and painfully-painfully change all the varchar columns.
(Desperately lazy and hoping) Can't i just change the NLS_LENGTH_SEMANTICS then import the dump file ??
May 13, 2005 - 9:12 am UTC
yes -- as long as the tables do not exist and import creates them, this will consider varchar2(20) to be varchar2(20 char)
now, the maximum length of a varchar2 is 4000 bytes -- regardless (and char is 2000 bytes -- regardless). be aware of that, this means a long text string could still be problematic.
Nagy Gabor, July 05, 2005 - 7:29 am UTC