sqloader more file

15 Jul

sqloader more file
sqloader untuk mengeksekusi lebih dari 1 file data dapat dilakukan dengan sederhana yaitu dengan menuliskan pada control file nama – nama yang akan di-sqlloader-kan

1. periksa struktur tabel
SQL> desc scott_xxx;
Name                                      Null?    Type
—————————————– ——– —————————-
MODELID                                   NOT NULL CHAR(10)
PRODUCTID                                 NOT NULL CHAR(4)
TGL                                       NOT NULL DATE

2. siapkan terlebih dulu control filenya
[oracle@xxx ~]$ cat scott_xxx.ctl
load data
 INFILE  scott_xxx.dat
    INFILE  scott_yyy.dat
    INFILE  scott_zzz.dat
APPEND
into table scott_xxx
fields terminated by “,” OPTIONALLY ENCLOSED BY ‘”‘
(MODELID,
PRODUCTID,
TGL DATE “yyyy-mm-dd hh24:mi:ss” )

3. eksekusi
[oracle@xxx ~]$ sqlldr userid=scott/***** control=scott_xxx.ctl log=scott_xxx.log

4. lihat lognya
[oracle@xxx ~]$ cat ARSTBHN_XXX.log | more
SQL*Loader: Release 11.1.0.6.0 – Production on Fri Jul 15 03:00:01 2011
Copyright (c) 1982, 2007, Oracle.  All rights reserved.
Control File:   scott_xxx.ctl

There are 3 data files:
Data File:      scott_xxx.dat
Bad File:     scott_xxx.bad
Discard File:  none specified

(Allow all discards)
Data File:      scott_yyy.dat
Bad File:     scott_yyy.bad
Discard File:  none specified

(Allow all discards)
Data File:      scott_zzz.dat
Bad File:     scott_zzz.bad
Discard File:  none specified

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: