sql loader(sqlldr)最基本的使用方法

这里说的是sql*plus界面下的使用,并非TOAD一类工具里的sqlload的使用

使用SQLLDR去导入一段CSV文件里的数据,最关键的是CONTROL File的建立。

以下部分为ctl里的内容:

options (skip=1,rows=128)
LOAD DATA
INFILE "C:/your file name.csv"  --------------你的csv文件的存放路径,尽量简单,容易输入
append
into TABLE MEO_TBL_IEEQP_INFO
FIELDS TERMINATED BY ","
OPTIONALLY ENCLOSED BY '"'
TRAILING NULLCOLS
(                                  ----------------------括号内为你的表里的栏位(column)
SID,
Faa,
Logic_Area,
Category,
Area,
Bay_Location,
PR,
PT_Owner,
EEQ,
EEQ_Owner,
MG,
EQEE_Type,
ID,
Mach_Function,
Vendor,
Agent,
Model,
Phase,
Status,
FdYear,
Actual_Movein_Finish,
Remark,
Actual_Moveout

   )                             ---------------------括号内为你的表里的栏位(column)

 

------------------------------------------------------------------------------------------------------------------------------------------------

下面也贴出一些命令,方便大家查看,也方便自己下次查看:

 

Oracle   SQL   Loader 的详细语法    
SQL*LOADER
ORACLE 的数据加载工具,通常用来将操作系统文件迁移到 ORACLE 数据库中。 SQL*LOADER 是大型数据 仓库选择使用的加载方法,因为它提供了最快速的途径( DIRECT PARALLEL )。现在,我们抛开其理论不谈,用实例来使您快速掌握 SQL*LOADER 的使用方法。   
   
首先,我们认识一下 SQL*LOADER   
   
NT 下, SQL*LOADER 的命令为 SQLLDR ,在 UNIX 下一般为 sqlldr/sqlload   
   
如执行: d:/oracle>sqlldr   
  SQL*Loader:   Release   8.1.6.0.0   -   Production   on  
星期二    1    8   11:06:42   2002  
  (c)   Copyright   1999   Oracle   Corporation.   All   rights   reserved.  
 
用法 :   SQLLOAD   关键字    =      [,keyword=value,...]  
 
有效的关键字 :  
  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   (
全部默认 )  
  skip   --   Number   of   logical   records   to   skip   (
默认 0)  
  load   --   Number   of   logical   records   to   load   (
全部默认 )  
  errors   --   Number   of   errors   to   allow   (
默认 50)  
  rows   --   Number   of   rows   in   conventional   path   bind   array   or   between   direct   path   data   saves  
 
(默认 :   常规路径    64,   所有直接路径)   
  bindsize   --   Size   of   conventional   path   bind   array   in   bytes(
默认 65536)  
  silent   --   Suppress   messages   during   run   (header,feedback,errors,discards,partitions)  
  direct   --   use   direct   path   (
默认 FALSE)  
  parfile   --   parameter   file:   name   of   file   that   contains   parameter   specifications  
  parallel   --   do   parallel   load   (
默认 FALSE)  
  file   --   File   to   allocate   extents   from  
  skip_unusable_indexes   --   disallow/allow   unusable   indexes   or   index   partitions(
默认 FALSE)  
  skip_index_maintenance   --   do   not   maintain   indexes,   mark   affected   indexes   as   unusable(
默认 FALSE)  
  commit_discontinued   --   commit   loaded   rows   when   load   is   discontinued(
默认 FALSE)  
  readsize   --   Size   of   Read   buffer   (
默认 1048576)   
  PLEASE   NOTE:  
命令行参数可以由位置或关键字指定   
 
。前者的例子是    'sqlload  scott/tiger   foo'; 后者的例子是    'sqlload   control=foo userid=scott/tiger'. 位置指定参数的时间必须早于但不可迟于由关键字指定的参数。例如 ,  
  'SQLLOAD   SCott/tiger   control=foo   logfile=log',  
' 不允许                              
sqlload   scott/tiger   control=foo   log', 即使允许  参数    'log'   的位置正确。   
  d:/oracle>
  • 0
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值