Dear There,
i am creating a shell scripts which mails us in case the production database growth is more than 300mb as we usually face space crunch issue.
our OS is Solaris Sun sparc 10 64bit.
in this scripts there are two variable which will be storing the current date free space and previous date free space in mb.
if the difference of the two is more than 300 mb it should generated an alert through mail.
i am able to store the value of twp scripts but when i try to take the difference of these two variable value i am getting error expr: 0402-050 Syntax error
not able to figure out where the issue is.?
below is the script:
export PATH=/usr/bin:/usr/sbin
if [ -f /usr/bin/less ]; then
export PAGER="/usr/bin/less -ins"
elif [ -f /usr/bin/more ]; then
export PAGER="/usr/bin/more -s"
fi
case ${SHELL} in
*bash)
typeset +x PS1="\u@\h:\w\\$ "
;;
esac
export ORACLE_HOME=/oracle11/home/app/oracle11/product/11.2.0/dbhome_1
export ORACLE_BASE=/oracle11/home/app/oracle11
export TNS_ADMIN=/oracle11/home/app/oracle11/product/11.2.0/dbhome_1/network/admin
PATH=$PATH:$ORACLE_HOME/bin
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/lib
export LD_LIBRARY_PATH
today=`sqlplus -s system/*****@PODBCGI1 <<endl
set pagesize 0 feedback off verify off heading off echo off;
SELECT round(FREE_SPACE) FROM DB_GROWTH WHERE trunc(SYSDATE) = trunc(sysdate);
exit
endl`
yesterday=`sqlplus -s system/*****@PODBCGI1 <<endl
set pagesize 0 feedback off verify off heading off echo off;
SELECT round(FREE_SPACE) FROM DB_GROWTH WHERE trunc(SYSDATE) =trunc(sysdate-1);
exit
endl`
d=`expr $today - $yesterday` ===> its giving error here
echo $d
thanks