sqlldr工具参数:

[oracle@server ~]$ sqlldr 

SQL*Loader: Release 11.2.0.3. - Production on Wed Nov  :: 

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

Usage: SQLLDR keyword=value [,keyword=value,...]

Valid Keywords:

    userid -- ORACLE username/password
control -- control file name
log -- log file name
bad -- bad file name
data -- data file name
discard -- discard file name
discardmax -- number of discards to allow (Default all)
skip -- number of logical records to skip (Default )
load -- number of logical records to load (Default all)
errors -- number of errors to allow (Default )
rows -- number of rows in conventional path bind array or between direct path data saves
(Default: Conventional path , Direct path all)
bindsize -- size of conventional path bind array in bytes (Default )
silent -- suppress messages during run (header,feedback,errors,discards,partitions)
direct -- use direct path (Default FALSE)
parfile -- parameter file: name of file that contains parameter specifications
parallel -- do parallel load (Default FALSE)
file -- file to allocate extents from
skip_unusable_indexes -- disallow/allow unusable indexes or index partitions (Default FALSE)
skip_index_maintenance -- do not maintain indexes, mark affected indexes as unusable (Default FALSE)
commit_discontinued -- commit loaded rows when load is discontinued (Default FALSE)
readsize -- size of read buffer (Default )
external_table -- use external table for load; NOT_USED, GENERATE_ONLY, EXECUTE (Default NOT_USED)
columnarrayrows -- number of rows for direct path column array (Default )
streamsize -- size of direct path stream buffer in bytes (Default )
multithreading -- use multithreading in direct path
resumable -- enable or disable resumable for current session (Default FALSE)
resumable_name -- text string to help identify resumable statement
resumable_timeout -- wait time (in seconds) for RESUMABLE (Default )
date_cache -- size (in entries) of date conversion cache (Default )
no_index_errors -- abort load on any index errors (Default FALSE) PLEASE NOTE: Command-line parameters may be specified either by
position or by keywords. An example of the former case is 'sqlldr
scott/tiger foo'; an example of the latter is 'sqlldr control=foo
userid=scott/tiger'. One may specify parameters by position before
but not after parameters specified by keywords. For example,
'sqlldr scott/tiger control=foo logfile=log' is allowed, but
'sqlldr scott/tiger control=foo log' is not, even though the
position of the parameter 'log' is correct.
[oracle@server ~]$

创建测试表:

[oracle@server ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.3. Production on Wed Nov  :: 

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

Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3. - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options SQL> create table test(name varchar2(), id varchar2()); Table created. SQL> exit

准备要导入数据data.txt:

[oracle@server ~]$ vi data.txt
jack,
jimmy,
sara,

编写导入控制文件input.ctl:

[oracle@server ~]$ vi input.ctl
LOAD DATA
INFILE 'data.txt'
INTO TABLE test
APPEND
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
(name, id)

执行导入:

[oracle@server ~]$ sqlldr userid=\'/ as sysdba\' control=input.ctl

SQL*Loader: Release 11.2.0.3. - Production on Wed Nov  :: 

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

Commit point reached - logical record count 

可以看出影响记录为3行,说明导入成功。

另外,导入过程的详细信息可以在默认日志文件input.log中查看,如:

[oracle@server ~]$ more input.log 

SQL*Loader: Release 11.2.0.3. - Production on Wed Nov  :: 

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

Control File:   input.ctl
Data File: data.txt
Bad File: data.bad
Discard File: none specified (Allow all discards) Number to load: ALL
Number to skip:
Errors allowed:
Bind array: rows, maximum of bytes
Continuation: none specified
Path used: Conventional Table TEST, loaded from every logical record.
Insert option in effect for this table: APPEND Column Name Position Len Term Encl Datatype
------------------------------ ---------- ----- ---- ---- ---------------------
NAME FIRST * , O(") CHARACTER
ID NEXT * , O(") CHARACTER Table TEST:
Rows successfully loaded.
Rows not loaded due to data errors.
Rows not loaded because all WHEN clauses were failed.
Rows not loaded because all fields were null. Space allocated for bind array: bytes( rows)
Read buffer bytes: Total logical records skipped:
Total logical records read:
Total logical records rejected:
Total logical records discarded: Run began on Wed Nov ::
Run ended on Wed Nov :: Elapsed time was: ::00.30
CPU time was: ::00.02

oracle批量数据导入工具 sqlldr的更多相关文章

  1. ImportTsv-HBase数据导入工具

    一.概述 HBase官方提供了基于Mapreduce的批量数据导入工具:Bulk load和ImportTsv.关于Bulk load大家可以看下我另一篇博文. 通常HBase用户会使用HBase A ...

  2. 关于 Oracle 的数据导入导出及 Sql Loader (sqlldr) 的用法

    在 Oracle 数据库中,我们通常在不同数据库的表间记录进行复制或迁移时会用以下几种方法: 1. A 表的记录导出为一条条分号隔开的 insert 语句,然后执行插入到 B 表中2. 建立数据库间的 ...

  3. Redis数据导入工具优化过程总结

    Redis数据导入工具优化过程总结 背景 使用C++开发了一个Redis数据导入工具 从oracle中将所有表数据导入到redis中: 不是单纯的数据导入,每条oracle中的原有记录,需要经过业务逻 ...

  4. ABAP-1-会计凭证批量数据导入本地ACCESS

    公司会计凭证导入ACCESS数据库,需要发送给审计,原先的方案是采用DEPHI开发的功能(调用函数获取会计凭证信息,然后INSERT到ACCESS数据表),运行速度非常慢,业务方要求对该功能进行优化, ...

  5. oracle数据库数据导入导出步骤(入门)

    oracle数据库数据导入导出步骤(入门) 说明: 1.数据库数据导入导出方法有多种,可以通过exp/imp命令导入导出,也可以用第三方工具导出,如:PLSQL 2.如果熟悉命令,建议用exp/imp ...

  6. ABAP-2-会计凭证批量数据导入本地ACCESS

    ABAP-1-会计凭证批量数据导入本地ACCESS 上一版本出现问题: A.若TXT数据条目超过800万(大概1.3G),则将TXT导入ACCESS过程不成功,ACCESS数据表为空.(Access单 ...

  7. CYS-Sqlite数据导入工具

    界面: 曹永思 下载地址:asp.net 2.0版 Sqlite数据导入工具.zip 欢迎转载,转载请注明出处,希望帮到更多人.

  8. 记一次oracle 11g数据导入

    1.ORACLE数据库数据导入到测试库环境 172.15.1.51 root  kic@test 172.15.1.52 root 一般先将数据导入52的环境(配置比较低),再将数据导入51的环境(本 ...

  9. graphql 数据导入工具

    graphql 是比 比较方便的工具,但是数据导入也是一个比较重要的工具类似prisma 包含一个seed 的功能,类似docker我们使用mysql 数据库的initdb.d,但是那个基本上就 是添 ...

随机推荐

  1. elasticsearch系列(四)部署

    本文采用tar包的方式部署es 准备jdk8的环境 5.4.0的es依赖jdk8及以上版本 下载linux版的jdk jdk-8u121-linux-x64.tar.gz tar -zvxf jdk- ...

  2. 开涛spring3(12.2) - 零配置 之 12.2 注解实现Bean依赖注入

    12.2  注解实现Bean依赖注入 12.2.1  概述 注解实现Bean配置主要用来进行如依赖注入.生命周期回调方法定义等,不能消除XML文件中的Bean元数据定义,且基于XML配置中的依赖注入的 ...

  3. 开涛spring3(9.2) - Spring的事务 之 9.2 数据库事务概述

    9.2.1  概述 Spring框架支持事务管理的核心是事务管理器抽象,对于不同的数据访问框架(如Hibernate)通过实现策略接口 PlatformTransactionManager,从而能支持 ...

  4. css样式自动换行/强制换行

    写样式时遇到的英文字符超出容器问题,度娘后了解下列知识,与大家分享,同时以便自己日后回顾. 一.自动换行问题 正常字符的换行是比较合理的,而连续的数字和英文字符常常将容器撑大. 下面介绍的是CSS如何 ...

  5. css实现梯形(各种形状)的网页布局——transform的妙用

    在各式各样的网页中,经常会看到形状特别的布局,比如说下面的这种排版方式: 这种视觉上的效果,体验十分好.那么他是如何来实现的呢,博主在这里整理了如下2种实现的方式. 1.通过给 div 加border ...

  6. ZooKeeper分布式锁浅谈(一)

    一.概述 清明节的时候写了一篇分布式锁概述,里面介绍了分布式锁实现的几种方式,其实那时候我一直沉迷于使用redis的悲观锁和乐观锁来实现分布式锁,直到一个血案的引发才让我重新认识了redis分布式锁的 ...

  7. JavaSE教程-03Java中分支语句与四种进制转换

    一.分支语句 计算机源于生活,程序模拟现实生活,从而服务生活 行为模式 1,起床,刷牙,洗脸,吃早餐,上课,回家,睡觉(顺序性) 2,如果时间不太够,打个滴滴快车,如果时间够,坐个地铁(选择性) 3, ...

  8. centos 下 安装mysql

    今天在centos上安装了一下 mysql 出现了一点问题 记录一下解决方案: 1:解决yum install mysql-server没有可用包的问题 sudo yum install mysql- ...

  9. div,css命名规范!

    命名规则说明: 1).所有的命名最好都小写 2).属性的值一定要用双引号("")括起来,且一定要有值如class="pcss5",id="pcss5& ...

  10. [Leetcode] Binary search--275 H-Index

    Follow up for H-Index: What if the citations array is sorted in ascending order? Could you optimize ...