0003. [sh ] shell 에서 sqlldr 사용하기
shell 에서 sqlldr 사용하기
export ctlfile=hist_${JOB_DATE}.ctl
echo "load data" > $ctlfile
echo "infile $file" >> $ctlfile
echo "badfile ${file}.bad" >> $ctlfile
echo "append" >> $ctlfile
echo "into table hist_tmp" >> $ctlfile
echo "( actv_date position(34:47) date \"yyyymmddhh24miss\"," >> $ctlfile
echo " ent_seq_no sequence(${seq_no},1)," >> $ctlfile
echo " ban position(25:33) integer external," >> $ctlfile
echo " oper_id position(01:07) integer external," >> $ctlfile
echo " imq_mac_addr position(08:24) char nullif imq_mac_addr = '@@ '," >> $ctlfile
echo " org_id position(48:54) integer external," >> $ctlfile
echo " window_name position(55:114) char," >> $ctlfile
echo " ctn position(115:125) char," >> $ctlfile
echo " model_id position(126:129) integer external," >> $ctlfile
echo " msn position(130:149) char," >> $ctlfile
echo " log_ind position(150:150) char," >> $ctlfile
echo " dealer_code position(151:157) char)" >> $ctlfile
sqlldr control=$ctlfile userid=$ORA_USER/$ORA_PASS@$ORA_INST
'IT' 카테고리의 다른 글
0005. shell 도중 FTP 사용하기 (0) | 2015.06.29 |
---|---|
0004. [sh ] 쉘 처음시작시 사용유저검색하기 (0) | 2015.06.29 |
0002. [sqlplus ] 쉘에서 sqlplus 로 delete drop create insert 구문 사용하기 (0) | 2015.06.29 |
0001. [Solaris] (install) <환경설정> 솔라리스8 설치 후 환경 설정정리 (0) | 2015.06.29 |
0638. [Shell] (case) <here문서> httpd WAS 재기동 script (0) | 2015.05.12 |