Chinaunix首页 | 论坛 | 博客
  • 博客访问: 189808
  • 博文数量: 57
  • 博客积分: 1625
  • 博客等级: 上尉
  • 技术积分: 715
  • 用 户 组: 普通用户
  • 注册时间: 2007-07-15 10:55
文章分类
文章存档

2012年(2)

2011年(12)

2010年(15)

2009年(19)

2008年(9)

我的朋友

分类: WINDOWS

2011-09-23 09:06:54

sendmail.bat
cd c:\blat
SQLPLUS.EXE username/passwd@connstr @C:\blat\check.sql 

blat body.txt -to address@domain.com -cc address1@domain.com -cc address@domain.com  -subject "check log %DATE%" -f address@domain.com -server mail_server_ip -charset gb2312 -debug

check.sql
set heading       on;
set verify        off;
set wrap          on;
set trimspool     on;
set serveroutput  on;
set escape        on;
spool body.txt
COLUMN tdate NEW_VALUE _date NOPRINT
SELECT TO_CHAR(SYSDATE,'MM/DD/YYYY') tdate FROM dual;
COLUMN date_time NEW_VALUE _date_time NOPRINT
SELECT TO_CHAR(SYSDATE,'MM/DD/YYYY HH24:MI:SS') date_time FROM dual;
prompt check time:&_date_time

prompt ;
prompt check server_212 job: select job,failures from user_jobs where job in (43,61,63,141,201,261,262)
select job,failures from user_jobs where job in (43,61,63,141,201,261,262);

prompt ;
prompt ;
prompt check server_123 job: select job,failures from user_jobs@tsps where job in (4,5,61,101)
select job,failures from user_jobs@tsps where job in (4,5,61,101);

prompt ;
prompt ;
prompt check sql1 :select count(1) from tb_tsps_mailplane_receipt t where t.d_date= trunc(sysdate-1);
select count(1) from tb_tsps_mailplane_receipt t where t.d_date= trunc(sysdate-1);

prompt ;
prompt ;
prompt check sql2 :select count(1) from  tb_tsps_mailplane_receipt t where t.n_status<>1;
select count(1) from  tb_tsps_mailplane_receipt t where t.n_status<>1;

prompt ;
prompt ;
prompt check sql3 :select count(1) from tb_sec_mail_summary xt where xt.d_plane_date= trunc(sysdate-1);
select count(1) from tb_sec_mail_summary xt where xt.d_plane_date= trunc(sysdate-1);
spool off
quit

阅读(3272) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~