I'm an Oracle DBA and need suggestions to understand a weird situation that came up today.
One of our DBA job failing with saying 'Already its running'
from Tivoli scheduler. However that is not the case. Running once but not sure why the UNIX creating 2 processes simultaneously and caused the job failure.
My analysis:
Ran the job as below from my UNIX id and it does create 2 processes. Not sure why its creating ( OS -AIX 6.1).
$sudo su - oracle -c /tmp/dba_audit_cleanup.sh
1) pandas5 20578520 9109824 0 12:08:03 pts/4 0:00 sudo su - oracle -c /tmp/dba_audit_cleanup.sh
2) oracle 36241502 20578520 0 12:08:03 pts/4 0:00 /bin/ksh /tmp/dba_audit_cleanup.sh
3) oracle 28180512 36241502 0 12:08:12 pts/4 0:00 grep dba_audit_cleanup.sh
CODE:
IsJobRunning()
{
if [[ $DEBUG -ne 0 ]]
then
set -x
fi
if [ `ps -ef | grep $PROGNAME | grep -v grep | wc -l` -ne 1 ]
then
return 1
else
return 0
fi
}
# MAIN
################################################################################
if IsJobRunning
then
continue
else
print " $PROGNAME is already running on this node "
exit 0