[oracle@oralin5 ~]$ cat .profile
export EDITOR=vi
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=/u01/app/oracle/product/10.2.0/db_1
export ORACLE_SID=tdb
export ORACLE_TERM=xterm
export NLS_DATE_FORMAT='YYYY-MM-DD HH24:MI:SS'
export TNS_ADMIN=/u01/app/oracle/product/10.2.0/db_1/network/admin
export ORA_NLS33=/u01/app/oracle/product/10.2.0/db_1/ocommon/nls/admin/data
export LD_LIBRARY_PATH=/u01/app/oracle/product/10.2.0/db_1/lib:/u01/app/oracle/product/10.2.0/db_1/network/lib:/lib:/usr/lib:/usr/local/lib
export LIBPATH=/u01/app/oracle/product/10.2.0/db_1/lib:/u01/app/oracle/product/10.2.0/db_1/network/lib:/lib:/usr/lib:/usr/local/lib
export PATH=/u01/app/oracle/product/10.2.0/db_1/bin:/u01/app/oracle/product/10.2.0/db_1/lib:./root/bin:/usr/lib/qt-3.3/bin:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin:/sbin:/usr/lbin:/usr/sbin:/bin
export TMPDIR=/tmp
export DBALIST="testmail@163.com,abc@def.com.cn"
umask 022
[oracle@oralin5 ~]$
[oracle@oralin5 ~]$ cat mi.sh
#!/bin/ksh
source /home/oracle/.profile
#for SID in `cat $ORACLE_HOME/sidlist`
for SID in 'tdb'
do
cd /u01/app/oracle/admin/tdb/bdump
if [ -f alert_${SID}.log ]
then
mv alert_${SID}.log alert_work.log
touch alert_${SID}.log
cat alert_work.log >> alert_${SID}.hist
grep ORA- alert_work.log > alert.err
fi
if [ `cat alert.err|wc -l` -gt 0 ]
then
mailx -s "testdb ORA- mail ${SID} ORACLE ALERT ERRORS" $DBALIST < alert.err
fi
done
[oracle@oralin5 ~]$
done
[oracle@oralin5 ~]$ crontab -l
* * * * * sleep 5; /home/oracle/mi.sh
[oracle@oralin5 ~]$
[oracle@oralin5 ~]$ cat /etc/hosts
127.0.0.1 localhost
220.181.12.14 smtp.163.com
123.125.50.29 pop3.163.com
192.168.8.132 oralin5
[oracle@oralin5 ~]$
[oracle@oralin5 ~]$ cat /etc/resolv.conf
#search localdomain
nameserver 8.8.8.8
[oracle@oralin5 ~]$