用sqlloader匯入中文及數字到公司測試資料庫pd

wisdomone1發表於2010-07-04

1,配置secure crt及rhel5上面的NLS_LANG內容如下:

-bash-3.1$ env|grep LANG
NLS_LANG=SIMPLIFIED CHINESE_CHINA.utf8
LANG=en_US.UTF-8

 

2,sqlloader匯入資料的控制檔案內容如下:

-bash-3.1$ more insert_batch.ctl
load data
infile '/oracle/from_gbk_utf8.txt'
append into table e_schoolinfo
fields terminated by ','
(schoolid,schoolname,city,district)

 

3,用sqlloader進入匯入資料

sqlldr userid=pd/system control=/oracle/insert_batch.ctl log=/oracle/sqlload1.log

SQL*Loader: Release 10.2.0.4.0 - Production on 星期五 7月 2 07:04:12 2010

Copyright (c) 1982, 2007, Oracle.  All rights reserved.

Commit point reached - logical record count 64
Commit point reached - logical record count 128
Commit point reached - logical record count 192
Commit point reached - logical record count 256
Commit point reached - logical record count 320
Commit point reached - logical record count 384
Commit point reached - logical record count 448
Commit point reached - logical record count 512
Commit point reached - logical record count 576
Commit point reached - logical record count 640
Commit point reached - logical record count 704
Commit point reached - logical record count 768
Commit point reached - logical record count 832
Commit point reached - logical record count 896
Commit point reached - logical record count 960
Commit point reached - logical record count 1024
Commit point reached - logical record count 1088
Commit point reached - logical record count 1152
Commit point reached - logical record count 1216
Commit point reached - logical record count 1280
Commit point reached - logical record count 1344
Commit point reached - logical record count 1408
Commit point reached - logical record count 1472
Commit point reached - logical record count 1536
Commit point reached - logical record count 1600
Commit point reached - logical record count 1664
Commit point reached - logical record count 1728
Commit point reached - logical record count 1792
Commit point reached - logical record count 1856
Commit point reached - logical record count 1920
Commit point reached - logical record count 1984
Commit point reached - logical record count 2048
Commit point reached - logical record count 2112
Commit point reached - logical record count 2176
Commit point reached - logical record count 2240
Commit point reached - logical record count 2304
Commit point reached - logical record count 2368
Commit point reached - logical record count 2432
Commit point reached - logical record count 2496
Commit point reached - logical record count 2560
Commit point reached - logical record count 2624
Commit point reached - logical record count 2688
Commit point reached - logical record count 2752
Commit point reached - logical record count 2816
Commit point reached - logical record count 2880
Commit point reached - logical record count 2944
Commit point reached - logical record count 3008
Commit point reached - logical record count 3072
Commit point reached - logical record count 3136
Commit point reached - logical record count 3200
Commit point reached - logical record count 3264
Commit point reached - logical record count 3315

4,查對匯入的資料來源檔案為from_gbk_utf8.txt
 from_gbk_utf8.txt  -bash-3.1$

 

注:要匯入的資料來源檔案為以csv為源,轉為txt另存為utf8字符集轉化而來

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/9240380/viewspace-667149/,如需轉載,請註明出處,否則將追究法律責任。

相關文章