sqlldr导入

编写control文件:

1. 普通加载DM_F_SCREEN_DCARD_GR_M.ctl

OPTIONS(ROWS=1000000,bindsize=409600000)

LOAD DATA

CHARACTERSET UTF8

APPEND

INTO TABLE DM_F_SCREEN_DCARD_GR_M

FIELDS TERMINATED BY '\t'    --以\t制表符分隔

TRAILING NULLCOLS

(month_id,PROVINCE_ID,REGION_ID,

DCARD_USR_CNT "NULLIF(:DCARD_USR_CNT,'NULL')",  --将NULL转为空

OTNET_USR_CNT "NULLIF(:OTNET_USR_CNT,'NULL')",

OTNET_ARPU"NULLIF(:OTNET_ARPU,'NULL')",

MONET_ARPU"NULLIF(:MONET_ARPU,'NULL')"

)

2. 优化,并行加载,并行加载会破坏表的索引

OP_RE_ST_LTE_EC.ctl

OPTIONS(skip=1,DIRECT=TRUE,PARALLEL=TRUE,ROWS=1000000,date_cache=1000000,bindsize=20971520,readsize=20971520)

UNRECOVERABLE

LOAD DATA

CHARACTERSET UTF8

INFILE'/opt1/FTPDATA/data/KPI/2017102004/LTE_AH_perf_eutrancell_20171020040000.csv'

INFILE'/opt1/FTPDATA/data/KPI/2017102004/LTE_BJ_perf_eutrancell_20171020040000.csv'

INFILE '/opt1/FTPDATA/data/KPI/2017102004/LTE_GS_perf_eutrancell_20171020040000.csv'

APPEND

INTO TABLE OP_RE_ST_LTE_EC

WHEN START_TIME<>'START_TIME'     --过滤掉START_TIME=’start_time’

FIELDS TERMINATED BY '|'

TRAILING NULLCOLS

(Province_id                 ,

city_id                      ,

related_nodeb                ,

oid                          ,

Start_time  "to_date(:START_TIME,'yyyy/mm/ddhh24:mi:ss')",

Indicatorid                  ,

nbrRrcAttConnEstab           ,

LOAD_TIME SYSDATE 

)


3. 导入

sqlldr cachedb/cachedb@obidb_new  control=${CTL_DIR}/${table}.ctl skip=1  log=${LOG_DIR}/${D_DIR}/LTE_*_${table_name}_${D_DIR}.log bad=${BAD_DIR}/${D_DIR}/LTE_*_${table_name}_
${D_DIR}.bad


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值