CCU ETL指令碼列表
CCU執行流程
- 7:30 執行 /opt/yanguang/etl/orads/kpi/kpi_auto_data.sh 需要追加遊戲請修改配置檔案kpi_ccu_site_cd.cfg
- kpi_auto_data.sh產生kpi_imp_data.sh,kpi_imp_data.sh再呼叫kpi_ccu_his.sh
- kpi_ccu_his.sh呼叫儲存KPI.PROC_UPDATE_KPI_RPT_CCU
------------------------------------------------------------------------ /* kpi_auto_data.sh 用於生成各遊戲呼叫ccu處理的指令碼*/ #!/bin/bash #auth: maoyu #date: 20100220 #desc: kpi ccu data import cur_dt=$1 IF [ -z $cur_dt ] THEN cur_dt=`DATE +%Y%m%d` fi cat kpi_ccu_site_cd.cfg |awk '{if(substr($1,1,1)!="#") {print "/bin/bash /opt/yanguang/etl/orads/kpi/kpi_ccu_his.sh ""'$cur_dt'"" "$2"'$cur_dt'""/ "$2"'$cur_dt'""/ orads dstage gamenow "tolower($1)"_ccu_his_""'$cur_dt'"".txt "tolower($1);}}' > /opt/yanguang/etl/orads/kpi/kpi_imp_data.sh # /bin/bash /opt/yanguang/etl/orads/kpi/kpi_imp_data.sh ------------------------------------------------------------------------ /* kpi_imp_data.sh 執行kpi_auto_data.sh產生的結果檔案*/ /bin/bash /opt/yanguang/etl/orads/kpi/kpi_ccu_his.sh 20100222 /opt/pass9kpi/sunkpi/20100222/ /opt/pass9kpi/sunkpi/20100222/ orads dstage gamenow sun_ccu_his_20100222.txt sun /bin/bash /opt/yanguang/etl/orads/kpi/kpi_ccu_his.sh 20100222 /opt/pass9kpi/gekpi/20100222/ /opt/pass9kpi/gekpi/20100222/ orads dstage gamenow ge_ccu_his_20100222.txt ge /bin/bash /opt/yanguang/etl/orads/kpi/kpi_ccu_his.sh 20100222 /opt/pass9kpi/fifakpi/kpi/20100222/ /opt/pass9kpi/fifakpi/kpi/20100222/ orads dstage gamenow fifa_ccu_his_20100222.txt fifa /bin/bash /opt/yanguang/etl/orads/kpi/kpi_ccu_his.sh 20100222 /opt/pass9kpi/wofkpi/kpi/20100222/ /opt/pass9kpi/wofkpi/kpi/20100222/ orads dstage gamenow mjsg_ccu_his_20100222.txt mjsg /bin/bash /opt/yanguang/etl/orads/kpi/kpi_ccu_his.sh 20100222 /opt/pass9kpi/atkpi/20100222/ /opt/pass9kpi/atkpi/20100222/ orads dstage gamenow at_ccu_his_20100222.txt AT /bin/bash /opt/yanguang/etl/orads/kpi/kpi_ccu_his.sh 20100222 /opt/pass9kpi/9zkpi/kpi/20100222/ /opt/pass9kpi/9zkpi/kpi/20100222/ orads dstage gamenow 9war_ccu_his_20100222.txt 9z ------------------------------------------------------------------------ /* kpi_ccu_his.sh 匯入及後續處理指令碼*/ #!/usr/bin/bash #auth: maoyu #date: 20100221 #desc: import ccu_his source /opt/yanguang/common/ora_env_var.sh echo "------------------------------------------" >> /opt/yanguang/etl/orads/kpi/imp.LOG #current DATE cur_dt=$1 IF [ -z $cur_dt ] THEN cur_dt=`DATE +%Y%m%d` fi #dest PATH work_path=$2 dest_path=$3 cd $dest_path #set variable # oracle USER password db_server=$4 # "orads" ora_user=$5 # "kpi" ora_pwd=$6 # "kpigamenow" # file name init_file_name=$7 src_file_name="${init_file_name}" ctl_file_name1="${init_file_name}.ctl" des_file_name1="${init_file_name}" # site_cd site_cd=$8 IF [ -f ${src_file_name} ]; THEN #build sqlldr ctl file echo "load data" > $ctl_file_name1 echo "infile '$des_file_name1'" >> $ctl_file_name1 echo "append" >> $ctl_file_name1 echo "into table temp_kpi_ccu_daily_his" >> $ctl_file_name1 echo "fields terminated by '|' trailing nullcols" >> $ctl_file_name1 echo "(" >> $ctl_file_name1 echo " site_cd, " >> $ctl_file_name1 echo " create_ts, " >> $ctl_file_name1 echo " site_id, " >> $ctl_file_name1 echo " group_id, " >> $ctl_file_name1 echo " accu_val, " >> $ctl_file_name1 echo " pccu_val " >> $ctl_file_name1 echo ")" >> $ctl_file_name1 #load_data TO temporey TABLE sqlldr $ora_user/$ora_pwd@"$db_server" control=$ctl_file_name1 bad=${des_file_name1}.bad LOG=${des_file_name1}.LOG rows=10000 skip=1 #process LOG echo "`date +%Y%m%d%H%M%S`--sqlldr ${dest_path}/${src_file_name} OK!" >> /opt/yanguang/etl/orads/kpi/imp.LOG sqlplus -S $ora_user/$ora_pwd@"$db_server" >> /opt/yanguang/etl/orads/kpi/imp.LOG << EOF SET serveroutput ON; DECLARE vcnt NUMBER(12) := 0; BEGIN SELECT COUNT(*) INTO vcnt FROM temp_kpi_ccu_daily_his WHERE site_cd = '${site_cd}' AND create_ts >= TO_DATE('${cur_dt}', 'yyyymmdd') - 1 AND create_ts < TO_DATE('${cur_dt}', 'yyyymmdd') ; IF vcnt <> 0 THEN kpi.proc_update_kpi_rpt_ccu('${site_cd}', TO_DATE('${cur_dt}', 'yyyymmdd') - 1); DBMS_OUTPUT.put_line(TO_CHAR(SYSDATE, 'yyyymmddhh24miss') || 'data is ok!'); ELSE DBMS_OUTPUT.put_line(TO_CHAR(SYSDATE, 'yyyymmddhh24miss') || 'data load failure!'); END IF; EXCEPTION WHEN OTHERS THEN DBMS_OUTPUT.put_line(TO_CHAR(SYSDATE, 'yyyymmddhh24miss') || ' insert data error!'); END; / EXIT; EOF ELSE echo "`date +%Y%m%d%H%M%S`--${work_path}/${src_file_name} not exists!" >> /opt/yanguang/etl/orads/kpi/imp.LOG fi
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/25618347/viewspace-713877/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- ETL指令碼的實現指令碼
- 用Shell指令碼&sqlloader做ETL指令碼SQL
- RestCloud ETL解決shell指令碼引數化RESTCloud指令碼
- CCU遷移
- Mark Fortner:Java指令碼期望列表Java指令碼
- ETL工具與指令碼實現之間的對比指令碼
- 流行Linux和Windows指令碼語言列表LinuxWindows指令碼
- 國產ETL etl-engine 視覺化 輕量級 跨平臺 支援動態解析GO語言指令碼視覺化Go指令碼
- 利用SSIS進行SharePoint 列表資料的ETL
- v-for 列表渲染指令
- 根據ip列表檢測主機狀態(shell指令碼)指令碼
- 國產ETL工具 etl-engine
- ETL 是什麼 ETL 工具有哪些 ETL 工具對比 engine
- ETL介紹與ETL工具比較
- ETL工具
- 庫物件指令碼抽取指令碼物件指令碼
- 巧用shell指令碼生成快捷指令碼指令碼
- 生成insert指令碼的指令碼指令碼
- ETL簡介
- ETL工具 etl-engine 能嵌入go語言進行開發的ETL產品Go
- 密碼指令碼密碼指令碼
- [指令碼例項]——統計系統資訊指令碼指令碼
- 前端js指令碼與防止js指令碼前端JS指令碼
- 遊戲運營資料解讀:CCU實時線上曲線遊戲
- ETL資料整合平臺,RestCloud視覺化ETLRESTCloud視覺化
- 國產 ETL工具 ETL產品 資料交換系統
- iOS逆向 Shell指令碼+指令碼重簽名iOS指令碼
- 常用指令碼學習手冊——Bat指令碼指令碼BAT
- Shell指令碼匯入外部指令碼內容指令碼
- 指令碼新選擇——用C做指令碼指令碼
- perl指令碼指令碼
- Bash指令碼指令碼
- java 指令碼Java指令碼
- JMeter指令碼JMeter指令碼
- MySQL指令碼MySql指令碼
- 常用指令碼指令碼
- ora 指令碼指令碼
- 指令碼1指令碼