sqlldr相关

--DROP SEQUENCE SEQ_P_ENTERHALLLEADFLOW_CODES;
CREATE  SEQUENCE SEQ_P_ENTERHALLLEADFLOW_CODES START WITH 1 CACHE 100;


CREATE OR REPLACE TRIGGER tri_1 BEFORE INSERT ON P_ENTERHALLLEADFLOW_CODES FOR EACH ROW WHEN(NEW.ID IS NULL)
BEGIN
SELECT SEQ_P_ENTERHALLLEADFLOW_CODES.NEXTVAL INTO :NEW.ID FROM DUAL;
END;
/
sqlldr sh10000_wx/sh10000_wx log=1.log bad=1.bad discard=dis.log control=1.ctl
 
LOAD DATA
INFILE '1.text'
INFILE "2.txt"
APPEND
INTO TABLE P_ENTERHALLLEADFLOW_CODES
Fields terminated    by","
TRAILING NULLCOLS
(
ID "SEQ_P_ENTERHALLLEADFLOW_CODES.NEXTVAL",
LEAD_CODE, 
isvalid FILLER
)
 
CREATE INDEX IDX_lead_code ON P_ENTERHALLLEADFLOW_CODES(lead_code) tablespace TSH10000_WX;

sqlldr tt/tt log=1.log bad=1.bad discard=dis.log control=11.ctl

dos2unix
===========================
# crm start #####################################################################################
#
# interface
rm -f de_bst_interface.txt
cat /oradata2/share_interface/hmbst/in/97SI*.txt >de_bst_interface.txt
mv  /oradata2/share_interface/hmbst/in/97SI*.txt /oradata2/share_interface/hmbst/arch
sqlldr userid=add114/add114 control=de_bst_interface.ctl log=log/de_bst_interface_$TIME.log errors=1000 bad=de_bst_interface_$TIME.bad
#
# details
rm -f de_bst_details.txt
cat /oradata2/share_interface/hmbst/in/97SD*.txt >de_bst_details.txt
mv  /oradata2/share_interface/hmbst/in/97SD*.txt /oradata2/share_interface/hmbst/arch
sqlldr userid=add114/add114 control=de_bst_details.ctl log=log/de_bst_details_$TIME.log errors=1000 bad=de_bst_details_$TIME.bad
#
# bad
cp de_bst_interface*.bad /oradata2/share_interface/hmbst/bad
cp de_bst_interface*.bad /oradata2/share_interface/hmbst/arch
rm -f de_bst_interface*.bad
cp de_bst_details*.bad /oradata2/share_interface/hmbst/bad
cp de_bst_details*.bad /oradata2/share_interface/hmbst/arch
rm -f de_bst_details*.bad
#
# crm end #######################################################################################


来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/30592920/viewspace-2143898/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/30592920/viewspace-2143898/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值