OCM_Session4_3_Oracle_Loader External Tables

本文档介绍了如何使用Oracle.Loader创建名为PROD_MASTER的外部表。首先,检查prod_master.dat和prod_master.ctl文件的内容,然后利用sqlldr工具生成创建外部表的SQL语句。接着,需在SH schema的PROD数据库中创建sh.exm1表以避免错误,最后在SH用户下创建目录并完成外部表的创建。
摘要由CSDN通过智能技术生成

 

  • 3. Oracle_Loader External Tables
  •  3.1 In the scripts directory, you will find prod_master.dat and prod_master.ctl. Using the information found in these files, create an external table names PROD_MASTER in the SH schema of the PROD database.
在脚本目录里,你会找到 prod_master.dat脚本和 prod_master.ctl脚本,使用在这些文件里找到的信息,创建一个外部表,名字叫 PROD_MASTER,在PROD数据库的SH方案里

  • 1.首先找到这两个脚本,查看一下内容;

[oracle@ocm1 ~]$ cd /home/oracle/script/
[oracle@ocm1 script]$ ll
total 12
-rw-r--r-- 1 oracle oinstall  64 Mar 19 14:22 create_bishhr.sql
-rw-r--r-- 1 root   root     154 Mar 27 11:01 prod_master.ctl
-rw-r--r-- 1 root   root      56 Mar 27 11:01 prod_master.dat
[oracle@ocm1 script]$   cat prod_master.ctl 
load data
infile '/home/oracle/script/prod_master.dat'
into table   sh.exm1  fields terminated by whitespace  --插入表 sh.exm1, 以空白符为间隔
TRAILING NULLCOLS
(emp_no,dept_no,name,num)

[oracle@ocm1 script]$   cat prod_master.dat 
1 1 tom 1
2 2 rose 2
3 1 jone 2
4 3 jack 3
5 2 jacky 4

[oracle@ocm1 script]$ 

参考联机文档:
Utilities ==> 13 The ORACLE_LOADER Access Driver


  • 2.使用sqlldr工具生成创建外部表的语句。

[oracle@ocm1 script]$  sqlldr

SQL*Loader: Release 10.2.0.1.0 - Production on Thu Mar 27 11:23:24 2014

Copyright (c) 1982, 2005, Oracle.  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 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)
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值