$ mkdir xtern
$ mkdir xtern/mySID
$ mkdir xtern/mySID/data
$ ls -l /oracle/feeds/xtern/mySID
SQL> connect sys as sysdba
Enter password:
Connected.
SQL> create or replace directory xtern_data_dir
2 as '/oracle/feeds/xtern/mySID/data';
Directory created.
SQL> grant read,write on directory xtern_data_dir to bulk_load;
Grant succeeded.
create table xtern_f_su_santral( butce_g varchar2(100),
butce_m varchar2(50),
id_no varchar2(25),
bina varchar2(5),
oda_no varchar2(3),
dahili varchar2(10),
isim varchar2(25),
tarih_saat date,
aranan_no varchar2(15),
sure varchar2(10),
kontor number(2),
ucret number(10,3)
)
organization external
( default directory xtern_data_dir
access parameters
( records delimited by newline
badfile xtern_log_dir:'xtern_f_su_santral.bad'
logfile xtern_log_dir:'xtern_f_su_santral.log'
discardfile xtern_log_dir:'xtern_f_su_santral.dsc'
fields terminated by ','
( BUTCE_G,
BUTCE_M,
ID,
BINA,
ODA_NO,
DAHILI,
ISIM,
tarih_saat DATE "MM/DD/YY HH:MI:SS AM",
ARANAN_NO,
SURE,
KONTOR,
UCRET NUMBER(15,3)
)
)
location ('f_su_santral.csv')
);
Hiç yorum yok:
Yorum Gönder