我正在尝试使用oracle DB中的sql loader加载文件,该文件具有如下特殊字符:
5200504,07ED,,Ãresutjämning,,,Occurrences,,,0.25,,,,,TRUE,100,Ãresutjämning,,,Ãresutjämning,,SEK,,0.00,,, 5200959,07ED,,Ãresutjämning,,,Occurrences,,,0.15,,,,,TRUE,100,Ãresutjämning,,,Ãresutjämning,,SEK,,0.00,,,
5201122,07ED,,Ãresutjämning,,,Occurrences,,,-0.42,,,,,TRUE,100,Ãresutjämning,,,Ãresutjämning,,SEK,,0.00,,,
5203421,07ED,,Ãresutjämning,,,Occurrences,,,-0.05,,,,,TRUE,100,Ãresutjämning,,,Ãresutjämning,,SEK,,0.00,,,
根据我的分析,我已经检查了UTF8
的源文件编码。 Linux机器上的NLS_LANG为American_america.UTF8
和oracle DB设置如下:
NLS_LANGUAGE AMERICAN
NLS_TERRITORY AMERICA
NLS_CURRENCY $
NLS_ISO_CURRENCY AMERICA
NLS_NUMERIC_CHARACTERS .,
NLS_CALENDAR GREGORIAN
NLS_DATE_FORMAT DD-MON-RR
NLS_DATE_LANGUAGE AMERICAN
NLS_CHARACTERSET AL32UTF8
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_NCHAR_CHARACTERSET AL16UTF16
NLS_COMP BINARY
NLS_LENGTH_SEMANTICS BYTE
NLS_NCHAR_CONV_EXCP FALSE
加载后,特殊字符Ãresutjämning
将更改为Öresutjämning
。
load.ctl文件如下:
load data
CHARACTERSET UTF8
infile *
into table SE_TDC_1_BILL_ITEM
TRUNCATE
fields terminated by ","
(BILL_NUMBER,SUBSCRIBER_ID,USAGE_DATE_TIME,USAGE_TYPE,CALLING_NUMBER,CALLED_NUMBER,METRIC,VOLUME_,DURATION_,CHARGE_OPCO_C,SOURCE_COUNTRY,TARGET_COUNTRY,SOURCE_NETWORK,TARGET_NETWORK,CHARGEALE,PCTG_CHARGED,PRODUCT,ROAM_TYPE,MT_MO_INDICATOR,TARIFF_TYPE,CONTRACT_ID,CHARGE_CURRENCY,ITEM_TAX_CODE,ITEM_TAX_RATE,SUBSCRIBER_EMAIL_ADDRESS)
BEGINDATA
5200504,07ED,,Ãresutjämning,,,Occurrences,,,0.25,,,,,TRUE,100,Ãresutjämning,,,Ãresutjämning,,SEK,,0.00,,,
5200959,07ED,,Ãresutjämning,,,Occurrences,,,0.15,,,,,TRUE,100,Ãresutjämning,,,Ãresutjämning,,SEK,,0.00,,,
5201122,07ED,,Ãresutjämning,,,Occurrences,,,-0.42,,,,,TRUE,100,Ãresutjämning,,,Ãresutjämning,,SEK,,0.00,,,
5203421,07ED,,Ãresutjämning,,,Occurrences,,,-0.05,,,,,TRUE,100,Ãresutjämning,,,Ãresutjämning,,SEK,,0.00,,,
请协助。