let lc="$(wc -l <$CRONDIR/maint/alert_log_errors.txt)" if ((lc > 0)); then mailx -s "$ORACLE_SID: Alert Log Errors!!" k@a.com r@a.com < $CRONDIR/maint/alert_log_errors.txt fi
#! /bin/ksh sqlplus -s "/ as sysdba" <>EOF //use less than redirection symbols set pages 0 set feedback off spool /tmp/instance_status.log select status from v\$instance; spool off EOF grep "OPEN" /tmp/instance_status.log if [$? -eq 0]; then echo "Instance is up!" else echo "Instance is Down!" fi
#! /bin/ksh LISTENER_NAME=$1 ps -ef|grep "tnslsnr $LISTENER_NAME"|grep -v grep if[ $? -eq 0 ]; then echo "The listener $LISTENER_NAME is UP" else echo "The listener $LISTENER_NAME is DOWN" fi