[Oracle] SQL*Loader 详细使用教程


输入sqlldr,后面不接任何参数,将显示所有的命令行参数的简单描述及其默认值(当你忘记某些参数时,也可以通过这个方式快速查询):

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 0)
      load -- number of logical records to load    (Default all)
    errors -- number of errors to allow            (Default 50)
      rows -- number of rows in conventional path bind array or between direct path data saves
              (Default: Conventional path 64, Direct path all)
  bindsize -- size of conventional path bind array in bytes  (Default 256000)
    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 1048576)
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 5000)
streamsize -- size of direct path stream buffer in bytes  (Default 256000)
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 7200)
date_cache -- size (in entries) of date conversion cache  (Default 1000)
no_index_errors -- abort load on any index errors  (Default FALSE)

为了不用每次都在命令行中输入同样的参数,你也可以使用参数文件或把参数写在控制文件的OPTIONS字句里,当然命令行参数的优先级最高,可以覆盖参数文件和控制文件里的参数配置。

SQL*Loader默认是导入到本地数据库,但也支持导入到远程数据库,只要在username后面加上“@远程数据库连接字符串”即可,如下所示:


> sqlldr CONTROL=ulcase1.ctl
Username: scott@inst1
Password: password下面是命令行参数的具体解释:

BAD - 坏文件名 (.bad)

CONTROL - 控制文件名 (.ctl)

DATA - 数据文件名(.dat),等同于控制文件里的INFILE,可以指定多个数据文件

DIRECT - true表示使用直接路径加载,false表示使用传统路径加载

DISCARD - 丢失文件名(.dsc)

DISCARDMAC - 最多允许多少条记录可以被丢失,如果超过该数字,将停止加载

ERRORS - 最多预习多少条记录insert失败,如果超过该数字,将停止加载

EXTERNAL_TABLE - 是否使用外部表加载方式

FILE - 该参数只在直接路径并行加载时有用

LOAD - 最多允许多少条记录可以被加载

LOG - 日志文件名(.log)

PARALLEL - true or false,直接路径加载是否使用并行模式

PARFILE - 参数文件名(.par)

ROWS - 指定达到多少条记录时提交

SKIP - 指定忽略最开始的多少条记录

SKIP_INDEX_MAINTENANCE - true表示在直接路径加载过程中不维护索引,导致索引状态变为unusable

接下来请看第2页精彩内容

  • 1
  • 2
  • 下一页
【内容导航】
第1页:命令行参数 第2页:控制文件

相关内容

    暂无相关文章