---Oracle调试:
set serveroutput on;
sho errors
set autotrace on;
select text from user_source where name='SP_LZW_ZJ201101300004';
---linux通过过程定期取数:
#!/bin/sh
##ZJ201101300004_fee.sh
##每月定期扣费数据
## 0 7 6 * * /gmcc_data/zj/zjlzw/wg/shell/ZJ201101300004_fee.sh >> /gmcc_data/zj/zjlzw/wg/shell/ZJ201101300004_fee.log &
export ORACLE_BASE=/oracle
export ORACLE_HOME=/oracle/products/10.2/db
export PATH=$ORACLE_HOME/bin:$ORACLE_HOME/Apache/Apache/bin:$PATH
export ORACLE_TERM=xterm
export LD_LIBRARY_PATH=/oracle/products/10.2/db/lib:$LD_LIBRARY_PATH
export PATH=/oracle/products/10.2/db/bin:$PATH
export ORA_NLS33=$ORACLE_HOME/ocommon/nls/admin/data
export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK
. /etc/profile
date
datepath="/gmcc_data/zj/zjlzw"
logininfo=`cat /gmcc_data/zj/zjlzw/login.sh | grep sqlplus`
datetmp2=`date +%d`
$logininfo 0 ) then
execute immediate 'drop table tmp_lzw_ZJ201101300004_'||vv_date_pre||' purge';
end if;
---手机报扣费
execute immediate '
create table tmp_lzw_ZJ201101300004_'||vv_date_pre||' nologging as
select /*+ parallel(a,16) */
subno
,out_route
,in_route
,CALL_Date
,CALL_time
,case when ROLLBACK_FLAG = ''0'' then AFTER_MOB_FEE else 0-AFTER_MOB_FEE end AFTER_MOB_FEE_0
,case when ROLLBACK_FLAG = ''0'' then AFTER_TOLL_FEE else 0-AFTER_TOLL_FEE end AFTER_TOLL_FEE_0
,case when ROLLBACK_FLAG = ''0'' then AFTER_INF_FEE else 0-AFTER_INF_FEE end AFTER_INF_FEE_0,
msrn
from DGDM_DW.TB_DW_LS_CDR_data_day a
where a.CALL_Date >= '''||vv_date_pre4||'01''
and a.CALL_Date = to_date('''||vv_date_pre||'01'',''yyyymmdd'')
and deal_date