文章详情

短信预约-IT技能 免费直播动态提醒

请输入下面的图形验证码

提交验证

短信预约提醒成功

Oracle Sqlldr optionally enclosed by

2024-04-02 19:55

关注

Oracle Sqlldr optionally enclosed by(GCH)

In all, when you edit the control file,you would rather add theclause “optionally enclosed by” inensurance.

The following example is that not use the clause “optionallyenclosed by”.

As follows, never use the clause “optionally enclosed by”in the control file.

OPTIONS(skip=1)

LOADDATA

INFILE"/home/oracle/sqlldr/MB_PERFORMANCE_TD_CELL.csv"

APPENDINTO TABLE MB_PERFORMANCE_TD_CELL

Fieldsterminated by ","

trailingnullcols

(EVENT_DAYtimestamp "yyyy-mm-dd hh34:mi:ss",

 HOUR_P,

 CITY_NAME,

 COUNTRY_NAME,

 VENDOR,

 CELL_NAME,

 CGI,

 RLC_THRPUT ,

 UTRAN1_NUM,

 UTRAN2_NUM ,

 RECORD_TIME"to_timestamp(to_char(sysdate,'yyyymmdd hh34:mi:ss'),'yyyymmddhh34:mi:ss')",

 VERSION_ID constant "3"

)

 

Next import data

[oracle@daidaisqlldr]$ sqlldr daidai/love8013control=MB_PERFORMANCE_TD_CELL.CTL

 

SQL*Loader:Release 11.2.0.4.0 - Production on Tue Jun 14 22:35:52 2016

 

Copyright(c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.

 

Commitpoint reached - logical record count 64

Commitpoint reached - logical record count 128

Commitpoint reached - logical record count 192

Commitpoint reached - logical record count 256

Commitpoint reached - logical record count 320

Commitpoint reached - logical record count 384

Commitpoint reached - logical record count 448

Commitpoint reached - logical record count 512

Commitpoint reached - logical record count 576

Commitpoint reached - logical record count 640

Commitpoint reached - logical record count 704

Commitpoint reached - logical record count 768

Commitpoint reached - logical record count 832

Commitpoint reached - logical record count 896

Commitpoint reached - logical record count 960

Commitpoint reached - logical record count 1024

Diagnose

Scan import log

……

Record96: Rejected - Error on table MB_PERFORMANCE_TD_CELL, column UTRAN2_NUM.

ORA-01722:invalid number

 

Record119: Rejected - Error on table MB_PERFORMANCE_TD_CELL, column UTRAN2_NUM.

ORA-01722:invalid number

 

Record126: Rejected - Error on table MB_PERFORMANCE_TD_CELL, column UTRAN2_NUM.

ORA-01722:invalid number

…….

  From the import log, it is the conclusionthat some were imported successfully. I select from database. Samples are asfollows:


  Therefore, the columns in the control filecorrespond to th

e columns of goal table. However, there were still a fewrecords that were not imported into table.

Oracle Sqlldr optionally enclosed by

Scan bad record.

[oracle@daidaisqlldr]$ cat MB_PERFORMANCE_TD_CELL.bad

2016-06-0700:00:00,,达州,渠县,华为,SDZ6NR5:渠县涌兴_2,460-00-61844-12098,,,

2016-06-0700:00:00,,内江,内江归属未知,华为,SNJ6NR2DX:田家十中_1,460-00-61811-34907,,,

2016-06-0700:00:00,,资阳,资阳归属未知,华为,SZY6NR3:乐至大佛二站_1,460-00-61889-40577,,,

2016-06-0700:00:00,,资阳,资阳归属未知,华为,SZY4NR3:乐至仲良中学_1,460-00-61889-35687,,,

2016-06-0700:00:00,,内江,内江归属未知,华为,SNJ5NR5WY:城北_3,460-00-61812-36239,,,

2016-06-0700:00:00,,达州,宣汉县,华为,SDZ6NR3:宣汉普光105_1,460-00-61841-24707,,,

2016-06-0700:00:00,,达州,渠县,华为,SDZ6NR5:渠县望江庭_1,460-00-61844-60867,,,

Then, I think of keyword ‘optionallyenclosed by’.

Solve the proplem.

Modify the control file.

cat MB_PERFORMANCE_TD_CELL.CTL

OPTIONS(skip=1)

LOAD DATA

 

INFILE"/home/oracle/sqlldr/MB_PERFORMANCE_TD_CELL.csv"

APPEND INTO TABLE MB_PERFORMANCE_TD_CELL

Fields terminated by "," optionlly enclosed by " "

trailing nullcols

(EVENT_DAY timestamp "yyyy-mm-ddhh34:mi:ss",

 HOUR_P,

 CITY_NAME,

 COUNTRY_NAME,

 VENDOR,

 CELL_NAME,

 CGI,

 RLC_THRPUT ,

 UTRAN1_NUM,

 UTRAN2_NUM ,

 RECORD_TIME"to_timestamp(to_char(sysdate,'yyyymmdd hh34:mi:ss'),'yyyymmddhh34:mi:ss')",

 VERSION_ID constant "3"

)

Import data successfully.

SQL> select count(*) fromMB_PERFORMANCE_TD_CELL

 2  ;

 

 COUNT(*)

----------

    50908


阅读原文内容投诉

免责声明:

① 本站未注明“稿件来源”的信息均来自网络整理。其文字、图片和音视频稿件的所属权归原作者所有。本站收集整理出于非商业性的教育和科研之目的,并不意味着本站赞同其观点或证实其内容的真实性。仅作为临时的测试数据,供内部测试之用。本站并未授权任何人以任何方式主动获取本站任何信息。

② 本站未注明“稿件来源”的临时测试数据将在测试完成后最终做删除处理。有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341

软考中级精品资料免费领

  • 历年真题答案解析
  • 备考技巧名师总结
  • 高频考点精准押题
  • 2024年上半年信息系统项目管理师第二批次真题及答案解析(完整版)

    难度     807人已做
    查看
  • 【考后总结】2024年5月26日信息系统项目管理师第2批次考情分析

    难度     351人已做
    查看
  • 【考后总结】2024年5月25日信息系统项目管理师第1批次考情分析

    难度     314人已做
    查看
  • 2024年上半年软考高项第一、二批次真题考点汇总(完整版)

    难度     433人已做
    查看
  • 2024年上半年系统架构设计师考试综合知识真题

    难度     221人已做
    查看

相关文章

发现更多好内容

猜你喜欢

AI推送时光机
位置:首页-资讯-数据库
咦!没有更多了?去看看其它编程学习网 内容吧
首页课程
资料下载
问答资讯