#!/bin/bash
# Check database space
#############################################################
MAIL_HOME=/home/oradba/bin/javaMail
# Check database space
#############################################################
SQLPATH=/home/oradba/chk
CHKFILE=$SQLPATH/log/spaceUsage.txt
TMPFILE=$SQLPATH/log/chk_db.tmp
# Oracle Enviroment
ORACLE_HOME=/opt/oracle/product/9.2.0;export ORACLE_HOME
ORACLE_SID=sselido;export ORACLE_SID
ORACLE_OWNER=oradba
NLS_LANG=american_america.ZHS16GBK;export NLS_LANG
ORA_NLS33=$ORACLE_HOME/ocommon/nls/admin/data;export ORA_NLS33
NLS_DATE_FORMAT='YYYY-MM-DD HH24:MI:SS'
# /data1
JOB_ON=`ps -efw | grep chk_free | grep -v grep | wc -l`
JOB_IS_ON=`expr $JOB_ON`
echo "Running Count:" $JOB_IS_ON
if [ $JOB_IS_ON -lt 3 ]
then
FREE=`df -m | grep 135629 | awk '{print $3}'`
FREE_SIZE=`expr $FREE`
echo $FREE_SIZE
if [ $FREE_SIZE -lt 256 ]
then
date +'%Y-%m-%d %T' >$CHKFILE
echo 'Check System Free Space : /data1 < 256M:' >>$CHKFILE
df -h >>$CHKFILE
$MAIL_HOME/jmail a "sse.Disk.Will.Full !!!" $CHKFILE
fi
fi
阅读(505) | 评论(0) | 转发(0) |