使用sqlldr100万条数据加载

1.select a.owner||',"'||a.object_name||'",'||a.object_id||','||to_char(a.created,'yyyy-mm-dd hh24:mi:ss')||','||a.status from dba_objects a,(select rownum rn from dual connect by rownum<=20) b;

getobject.sql

2.set echo off
set term off
set line 1000 pages 0
set feedback off
set heading off
spool D:\\oracle\\product\\10.2.0\\db_1\\script\\ldr_object.csv
@D:\\oracle\\product\\10.2.0\\db_1\\script\\getobject.sql
spool off
set heading on
set feedback on
set term on
set echo on

call.sql

3.@D:\\oracle\\product\\10.2.0\\db_1\\script\\call.sql

4.conn scott/scott
create table objects(
owner varchar2(30),
object_name varchar2(50),
object_id number,
status varchar2(10),
created date);

create index idx_obj_owner_name on objects(owner,object_name);

5.
Load DATA
INFILE ldr_object.csv
TRUNCATE INTO TABLE OBJECTS
FIELDS TERMINATED BY "," OPTIONALLY ENCLOSED BY '"'
(owner,
object_name,
object_id,
created Date 'yyyy-mm-dd hh24:mi:ss',
status)


sqlldr scott/scott control=ldr_object.ctl error=10 rows=5000 bindsize=10485760

sqlldr scott/scott control=ldr_object.ctl direct=true streamsize=10485760 date_cache=5000

}
 

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/22253646/viewspace-667346/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/22253646/viewspace-667346/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值