MySQL: UTF-8 character set Oracle: Al32UTF8 step: 1. Export csv format data from mysql, set default_character_setgbk during export, otherwise garbled 2. Upload
MySQL: UTF-8 character set Oracle: Al32UTF8 step: 1. Export csv format data from mysql, set default_character_set = gbk during export, otherwise garbled 2. Upload
MySQL: UTF-8 character set
Oracle: Al32UTF8
Steps:
1. Export csv data from mysql. When exporting data, set default_character_set = gbk; otherwise, garbled characters will occur.
2. upload to the linux Server (oracle Server) and replace \ r \ n of windows with \ r with the following command:
Sed-I "s/\ r // g" file
3. Convert gbk encoding to utf8 encoding:
Iconv-f gb18030-t UTF-8 file1.txt> file2.txt
4. Compile the SQL loader control file (file. ctl ):
Options (skip = 1)
Load data
CHARACTERSET AL32UTF8
Infile 'terminal.txt'
Badfile 'terminal. err'
Discardfile 'terminal. dis'
Replace into table terminal
Fields terminated by ', 'trailing NULLCOLS
(
Id,
Mobile,
Imsi,
Imei,
Evoketime date "yyyy-mm-dd hh24: mi: ss ",
Province,
City,
Evokenum,
Createtime date "yyyy-mm-dd hh24: mi: ss ",
Project_id,
Carrier,
Ip,
SC,
New_imsi,
New_imei
)
5. Run sqlldr to import data to the oracle database:
Sqlldr user/pass @ db-control = file. ctl