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 hh24: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 hh24:mi:ss'),'yyyymmddhh24: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.

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-ddhh24: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 hh24:mi:ss'),'yyyymmddhh24:mi:ss')",

VERSION_ID constant "3"

)

Import data successfully.

SQL> select count(*) fromMB_PERFORMANCE_TD_CELL

2  ;

COUNT(*)

----------

50908

oracle sqlload 704,Oracle Sqlldr optionally enclosed by相关推荐

  1. Oracle 的SQL*LOADER中optionally enclosed的作用

    表示数据应由特殊字符括起来.也可以括在TERMINATED字符内.使用OPTIONALLY要同时用TERMINLATED. ENCLOSED 指两个分界符内的数据.如果同时用 ENCLOSED和TER ...

  2. oracle sqlload速度加快,oracle,sql loader 及 快速生成大量数据 CSV文件sqlldr

    要测试sql loader 以及快速产生大量测试数据 生成大量测试数据思路. 一,用plsql developer 生成csv 文件 二,用>>输出重定向,追加到一个cvs 文件里. 三, ...

  3. 能够sqlload到ORACLE的全国区号

    从GOOGLE上找了很久都没有找到完整的.能够直接导入数据库的全国电话号码区号的文件,只有自己写一个啦,相对来说还算是比较全,但是好像少了899等少数几个新区号.   放到网上给大家共享,记得感谢我哦 ...

  4. 2013/07/20 SQLLDR 关于OPTIONALLY ENCLOSED BY

    1.尝试CSV中左右单个双引号和双引号的区别.(所有文件都在桌面;CD C:\Documents and Settings\XPMUser\桌面) 数据: 张三,工程师,1200,"aba& ...

  5. oracle load 用法,Oracle中SQL*LOADER使用方法总结

    Oracle数据库中SQL*LOADER使用方法总结(一) sqlldr 有两种使用方法: 1.使用一个控制文件和一个数据文件. 2.只有一个控制文件,控制文件中包含数据. 分别对两种方法用例子进行说 ...

  6. su - oracle和su oracle有什么区别

    su - oracle,相当于重新登陆,此时用户的家目录和PATH等信息会发生改变 su oracle,切换到oracle身份后用户的家目录和PATH仍然是原先用户的家目录和PATH ******** ...

  7. oracle load select,Oracle数据库的Load详解

    --常规load方式----load.ctl文件load datainfile --常规load方式 ----load.ctl文件 load data infile 'c:\1.txt' into t ...

  8. Oracle学习笔记 --- Oracle ORA错误解决方案

    今天在Debug的时候报错了如下信息: 后来综合了网上的东西,总结如下: ORA-00001: 违反唯一约束条件 (.) 错误说明:当在唯一索引所对应的列上键入重复值时,会触发此异常. ORA-000 ...

  9. Oracle Study之--Oracle等待事件(3)

    Oracle Study之--Oracle等待事件(3) Db file parallel read 这是一个很容易引起误导的等待事件,实际上这个等待事件和并行操作(比如并行查询,并行DML)没有关系 ...

最新文章

  1. 几个表示“光”的概念
  2. 为Exchange Server 申请有效期超过2年的证书
  3. Python----Requests库基本使用
  4. linux WiFi源码解析,Wifi移植浅析
  5. 浏览器上请求URL的全部过程
  6. python字符串命名_python-字符串及其常用方法
  7. colab清理gpu缓存_安卓手机为什么会变卡?强制GPU渲染手机就能变流畅?你真的懂吗...
  8. C# WinForm窗口最小化到系统托盘
  9. fast rcnn 论文解读(附代码链接)
  10. iOS中如何添加自定义的字体库
  11. python课堂点名_Python制作课堂点名器,原来还能这么玩!
  12. python字典添加元素使用技巧大全_字典里添加元素有哪些方法
  13. springboot 接入京东sdk_【第3期】Springboot:微信公众号分享quot;朋友圈quot;
  14. C-Free 3.5.2 注册码
  15. Labview笔记(十)---文件IO (中)---读写 配置文件,XML文件
  16. 平面三角形外接圆圆心与半径求解算法
  17. win10 联想键盘快捷键关闭_win10系统关闭快捷键的操作方法
  18. 中国各地的特色茶,你知道几个?
  19. 在单面打印机上使用WPS实现手工双面打印
  20. 锂电池参数的一些概念结合一块具体电池参数表的理解

热门文章

  1. laravel5.6 提示The page has expired due to inactivity. Please refresh and try again.的解决方法
  2. [bzoj4816][Sdoi2017]数字表格 (反演+逆元)
  3. 【实验技术笔记】Western Blotting 实验操作要点及数据分析
  4. 哪些能恢复网站服务器的数据的方式呢?
  5. j1900适合装哪版群晖_4000-10000元适合家庭使用的台式电脑选购指南(9月)
  6. android-5.0新功能介绍(Lollipop)
  7. android换肤动画,Android换肤(二) — 插件式换肤
  8. 电商APP首页楼层架构设计详解
  9. secret学习笔记
  10. 异贝,通过移动互联网技术,为中小微实体企业联盟、线上链接、线上线下自定义营销方案推送。案例69