[data unload]
print "
set long 99999999
set feedback off
set pagesize 0
set linesize 2000
set tab off
set define off
alter session set nls_date_format = 'yyyymmdd';
SELECT A, B, C_clob, D
FROM {Schema}.{table}
WHERE A BETWEEN '20130901' AND '20130931';" | sqlplus -s {id}/{pw} > {data_file}.dat
[ctl File]
LOAD DATA
INFILE *
APPEND
INTO TABLE {schema}.{table_name}
FIELDS TERMINATED BY '^|'
TRAILING NULLCOLS
(A DECIMAL_EXTERNAL
,B char(20)
,C_clob LOBFILE(clob_filename) TERMINATED BY EOF
,D char(2000) "REPLACE(:ATMC_SMS_SND_CTNT,CHR(1),CHR(10))"
)
[data load]
sqlldr {id}/{pw} control={control_file}.ctl errors=10000 data={data_file}.dat log=sqlldr_`date +%Y%m%d%H%M`.log
'RDBMS > Oracle' 카테고리의 다른 글
Oracle DBA SQL (0) | 2021.01.28 |
---|---|
아카이브 로그(Archive log) 관련 SQL (0) | 2021.01.14 |
문자셋(character set) 확인 (0) | 2020.12.18 |
Gather statistics about objects(통계정보 생성) (0) | 2020.12.18 |
OBJECT 조회 (0) | 2020.12.17 |