Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: DBMS_SCHEDULER external jobs failing but status of SUCCEEDED?!?!
> Interesting, with the exit "$?" additonal_info has -
> STANDARD_ERROR="#!/bin/ksh -xv
>
> cd /home/hubbatch/era/staging
> + cd /home/hubbatch/era/staging
>
> ls ${1}*
> + ls XYZ*
> XYZ* not found
> exit "$?"
> + exit 0"
>
> So it would seem the shell is returning an exit code of 0 (meaning the
> scheduler thinks it succeeded) yet the ls failed!!
[...]
What is the output from trap -p ?
> I have added to the shell -
> if [ `ls -l ${FILEPREFIX}* 2>/dev/null | wc -l` = 0 ]
> then
> echo "Cannot read ${FILEPREFIX}* - Exiting"
> exit 1
> fi
The code is wrong.
You could write it like this:
set -- "${FILEPREFIX}"*
[ -e "$1" ] 2>&- || echo "Cannot read ${FILEPREFIX}* - Exiting"
Will NOT work, because the exit status is 0 for success (the echo command
succeeds).
In your case you can use:
set -- "${FILEPREFIX}"*
[ -e "$1" ]
So:
$ ls XYZ*
XYZ XYZpippo
$ set -- "${FILEPREFIX}"* $ [ -e "$1" ] $ echo $?
> Ok so now the fun begins, the job FAILED (woohoo) in addtional_info -
> ORA-27369: job of type EXECUTABLE failed with exit code: Not owner
[...]
Check MetaLink for "Not owner".
> Nearly there I can see the light!
Regards
Dimitre
Received on Wed Nov 01 2006 - 06:25:50 CST