#!/bin/sh
datadir=/home/huawei/data
ctldir=/home/huawei/shell_script
logfile=/home/huawei/once_log.getdata
source /etc/profile
cd $datadir
#ungzip the compiled file
gzip -d *$1*.gz
echo CONVERT THE CHARACTOR SET FROM GBK32 TO UTF8 >> $logfile
#convert the charactor set from GBK32 to UTF8
iconv -f GBK -t UTF8 intf_$1_ods_o_c_group_m.txt -o intf_ods_o_c_group_m.txt
iconv -f GBK -t UTF8 intf_$1_ods_o_u_grp_cust_mbr_rel.txt -o intf_ods_o_u_grp_cust_mbr_rel.txt
iconv -f GBK -t UTF8 intf_$1_ods_owe_fee_user_m.txt -o intf_ods_owe_fee_user_m.txt
iconv -f GBK -t UTF8 intf_$1_ods_p_b_yw_balance_m.txt -o intf_ods_p_b_yw_balance_m.txt
iconv -f GBK -t UTF8 intf_$1_dim_sp_code.txt -o intf_dim_sp_code.txt
iconv -f GBK -t UTF8 intf_$1_dim_user_dinner_free_volume.txt -o intf_dim_user_dinner_free_volume.txt
iconv -f GBK -t UTF8 intf_$1_dim_user_dinner.txt -o intf_dim_user_dinner.txt
iconv -f GBK -t UTF8 intf_$1_ods_o_a_account_d.txt -o intf_ods_o_a_account_d.txt
iconv -f GBK -t UTF8 intf_$1_ods_o_c_customer_d.txt -o intf_ods_o_c_customer_d.txt
iconv -f GBK -t UTF8 intf_$1_su_gprs_sms.txt -o intf_su_gprs_sms.txt
iconv -f GBK -t UTF8 intf_$1_ods_o_u_user_d.txt -o intf_ods_o_u_user_d.txt
iconv -f GBK -t UTF8 intf_$1_ods_o_u_product_d.txt -o intf_ods_o_u_product_d.txt
# get into the control forder
cd $ctldir
echo RUN THE SQLLOADER >> $logfile
#load the data file into the database
sqlldr userid=M2M/M2M@M2M control=dim_sp_code.ctl log=dim_sp_code.log bad=dim_sp_code.bad direct=true rows=100000 errors=9999999
sqlldr userid=M2M/M2M@M2M control=dim_user_dinner.ctl log=dim_user_dinner.log bad=dim_user_dinner.bad direct=true rows=100000 errors=9999999
sqlldr userid=M2M/M2M@M2M control=dim_user_dinner_free_volume.ctl log=dim_user_dinner_free_volume.log bad=dim_user_dinner_free_volume.bad direct=true row s=100000 errors=9999999
sqlldr userid=M2M/M2M@M2M control=ods_a_o_user_m.ctl log=ods_a_o_user_m.log bad=ods_a_o_user_m.bad direct=true rows=100000 errors=9999999
sqlldr userid=M2M/M2M@M2M control=ods_o_c_cust.ctl log=ods_o_c_cust.log bad=ods_o_c_cust.bad direct=true rows=100000 errors=9999999
sqlldr userid=M2M/M2M@M2M control=ods_o_c_group_m.ctl log=ods_o_c_group_m.log bad=ods_o_c_group_m.bad direct=true rows=100000 errors=9999999
sqlldr userid=M2M/M2M@M2M control=ods_o_u_grp_cust_mbr_rel.ctl log=ods_o_u_grp_cust_mbr_rel.log bad=ods_o_u_grp_cust_mbr_rel.bad direct=true rows=100000 errors=9999999
sqlldr userid=M2M/M2M@M2M control=ods_o_u_product_d.ctl log=ods_o_u_product_d.log bad=ods_o_u_product_d.bad direct=true rows=100000 errors=9999999
sqlldr userid=M2M/M2M@M2M control=ods_o_u_user_d.ctl log=ods_o_u_user_d.log bad=ods_o_u_user_d.bad direct=true rows=100000 errors=9999999
Shell 编程
最新推荐文章于 2025-03-11 11:28:52 发布