返回顶部
首页 > 资讯 > 数据库 >Oracle Sqlldr optionally enclosed by
  • 665
分享到

Oracle Sqlldr optionally enclosed by

2024-04-02 19:04:59 665人浏览 薄情痞子
摘要

Oracle Sqlldr optionally enclosed by(GCH)In all, when you edit the control file,you would rather add th

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


您可能感兴趣的文档:

--结束END--

本文标题: Oracle Sqlldr optionally enclosed by

本文链接: https://lsjlt.com/news/36664.html(转载时请注明来源链接)

有问题或投稿请发送至: 邮箱/279061341@qq.com    QQ/279061341

猜你喜欢
  • Oracle Sqlldr optionally enclosed by
    Oracle Sqlldr optionally enclosed by(GCH)In all, when you edit the control file,you would rather add th...
    99+
    2024-04-02
  • 利用sqlldr迁移数据- KDB到Oracle
    ./ kdb_to_oracle.sh user_name user_password eg: ./get_ddl.sh nda_202 N...
    99+
    2024-04-02
  • oracle中如何使用sqlldr导入数据
    小编给大家分享一下oracle中如何使用sqlldr导入数据,相信大部分人都还不怎么了解,因此分享这篇文章给大家参考一下,希望大家阅读完这篇文章后大有收获,下面让我们一起去了解一下吧!背景900W数据的TX...
    99+
    2024-04-02
  • oracle中sqlldr的使用方法是什么
    SQLLoader是Oracle数据库中的一个用来批量加载数据到数据库表中的实用程序。以下是SQLLoader的使用方法: 编写...
    99+
    2024-05-11
    oracle
  • oracle中sqlldr使用要注意哪些事项
    在使用sqlldr之前,需要确保已安装Oracle客户端,并且设置了正确的环境变量(如ORACLE_HOME和PATH)。 ...
    99+
    2024-05-21
    oracle
  • Oracle sqlldr导入一个日期列实例详解
    Oracle sqlldr导入一个日期列实例详解 1. LOAD DATA INFILE * INTO TABLE test FIELDS TERMINATED BY X'9' TRAILING NUL...
    99+
    2024-04-02
  • 批量数据文件用sqlldr导数据到oracle中
        使用sqlload导文本数据到oracle中想必很多人多使用过,但是倘若有几百或者几千个数据文本,或者实时有文本数据产生。这种场景如何批量导入oracle呢,下面就来讲解下我处理...
    99+
    2024-04-02
  • oracle中connect by怎么用
    这篇文章主要介绍了oracle中connect by怎么用,具有一定借鉴价值,感兴趣的朋友可以参考下,希望大家阅读完这篇文章之后大有收获,下面让小编带着大家一起了解一下。1、基本语法select&...
    99+
    2024-04-02
  • oracle中group by的用法
    oracle 中的 group by 语句用于根据指定列分组数据并聚合汇总值,语法为:select 聚合函数(列名), 分组列 from 表名 group by 分组列。功能包...
    99+
    2024-04-30
    oracle 聚合函数
  • oracle中connect by的用法
    connect by 在 oracle 中用于执行层级查询,它通过指定层次结构来遍历数据,具体步骤包括:创建层次结构,指定连接的列以定义层次结构;设定连接条件,使用 prior 和 cu...
    99+
    2024-04-30
    oracle
  • ORA-09330: Session terminated internally by Oracle or by an Oracle DBA ORACLE 报错 故障修复 远程处理
    文档解释 ORA-09330: Session terminated internally by Oracle or by an Oracle DBA Cause: Oracle to terminate that session afte...
    99+
    2023-11-05
    报错 故障 Session
  • Oracle系列:(7)order by子句
    查询员工信息(编号,姓名,月薪,年薪),按月薪升序排序,默认升序,如果月薪相同,按oracle内置的校验规则排序select empno,ename,sal,sal*12  f...
    99+
    2024-04-02
  • Oracle Linux 教程 by 冰琉璃
    Linux入门第一课:为什么学习Linux?这是我接触Linux问的第一个问题。        当时我得到的答案是Linux比...
    99+
    2024-04-02
  • Oracle高级查询之OVER (PARTITION BY ..)
    为了方便大家学习和测试,所有的例子都是在Oracle自带用户Scott下建立的。注:标题中的红色order by是说明在使用该方法的时候必须要带上order by。一、rank()/de...
    99+
    2024-04-02
  • Oracle递归查询connect by用法
    目录一、概述1、层级查询的基本语法:二、使用1、基本用法2、SYS_CONNECT_BY_PATH() 函数3、CONNECT_BY_ISLEAF 伪列4、CONNECT_BY_RO...
    99+
    2024-04-02
  • Oracle 中关于 group by 的那些坑
    分组聚合Group by  在mysql中,对group by 的使用限制是比较宽松,还是比较灵活的, 表数据之间的调取是完全没问题的; 而在Oracle中,对group by 就有一定限制,两句相同的SQL语句,可能在mys...
    99+
    2021-03-16
    Oracle 中关于 group by 的那些坑
  • Oracle order by子句对NULL的排序
    我们都知道在Oracle SQL语句中order by 是用来排序查询出来的结果集的,而在Oracle中NULL值是一个很特殊的值,如果order by指定的列有NULL值,那排序结果又是怎样的呢。下面做一...
    99+
    2024-04-02
  • oracle中connect by/level/start with怎么用
    这篇文章主要介绍了oracle中connect by/level/start with怎么用,具有一定借鉴价值,感兴趣的朋友可以参考下,希望大家阅读完这篇文章之后大有收获,下面让小编带着大家一起了解一下。l...
    99+
    2024-04-02
  • Oracle中如何优化connect by语句
    Oracle中如何优化connect by语句,针对这个问题,这篇文章详细介绍了相对应的分析和解答,希望可以帮助更多想解决这个问题的小伙伴找到更简单易行的方法。执行SQL:SELECT A...
    99+
    2024-04-02
  • oracle中group by的作用是什么
    在Oracle数据库中,GROUP BY子句用于将查询结果按照指定的列进行分组,然后对每个分组应用聚合函数,如SUM、AVG、COU...
    99+
    2024-03-13
    oracle
软考高级职称资格查询
编程网,编程工程师的家园,是目前国内优秀的开源技术社区之一,形成了由开源软件库、代码分享、资讯、协作翻译、讨论区和博客等几大频道内容,为IT开发者提供了一个发现、使用、并交流开源技术的平台。
  • 官方手机版

  • 微信公众号

  • 商务合作