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/