此脚本为生产服务器脚本 实时运行情况良好,可根据实际情况来修改
无事拿来分享
#!/bin/bash
cd /export/home/oracle/
source ./.profile
#TODAY=`date +%Y%m%d`
#TZ=CST+16
#export TZ
#YESTERDAY=`date +%Y%m%d`
sqlplus mps/smartpaymps <set echo off;
set feedback off;
set heading off;
set pagesize 0;
set linesize 10000;
set numwidth 12;
set termout off;
set trimout on;
set trimspool on;
set space 0;
SPOOL /export/home/oracle/tmp.txt
insert into MPS.SVA_BALANCE_SETTLEMENT (SVA_TX_DATE,SVA_TYPE,SVA_STATE,SVA_BALANCE,SVA_NUM)
select to_char(sysdate, 'yyyyMMdd') SVA_TX_DATE,
type SVA_TYPE,
state SVA_STATE,sum(balance) SVA_BALANCE,
count(*) SVA_NUM
from mps.sva_account
group by type, state;
commit;
SPOOL OFF
quit
EOF
exit
阅读(1376) | 评论(0) | 转发(0) |