#!/bin/bash
source /etc/profile
source ~/.bash_profile
DATE_N=`date "+%Y-%m-%d %H:%M:%S"`
out_log="/monitor/scripts/tmp_test.out"
echo "shell start at $DATE_N" >> $out_log
processName="test.sh"
processNum=`ps -aef |grep "${processName}" | grep -v grep | wc -l`
if [ "${processNum}" -gt "2" ]; then
echo "Shell is Already Running ${processNum}" >> $out_log
exit 1
fi
#################################
#sleep 30
#echo "Shell Start Run" >> $out_log
sqlplus -s username/password@ipaddr:1521/orcl >>$out_log <<!
call test();
exit
!
echo "shell complete at `date "+%Y-%m-%d %H:%M:%S"`" >> $out_log
版权声明:本文为博主原创文章,未经博主允许不得转载。
oracle