Re: Help getting an EXECUTABLE to run under DBMS_SCHEDULER
- From: Andy Hassall <andy@xxxxxxxxxxx>
- Date: Wed, 21 Dec 2005 17:00:52 +0000
On 21 Dec 2005 06:18:08 -0800, "GeoPappas" <PappasG@xxxxxxxxx> wrote:
>The following command (which just executes the date command) says that
>it completes successfully:
>
>BEGIN
>DBMS_SCHEDULER.CREATE_JOB(
> job_name => 'test',
> job_type => 'EXECUTABLE',
> job_action => '/usr/bin/date',
> enabled => TRUE
>);
>END;
>/
>
>But the following command (which appends the output of the date command
>to a file in the tmp directory) fails:
>
>BEGIN
>DBMS_SCHEDULER.CREATE_JOB(
> job_name => 'test',
> job_type => 'EXECUTABLE',
> job_action => '/usr/bin/date>>/tmp/date.log',
> enabled => TRUE
>);
>END;
>/
>
>The error that is thrown is "ORA-27369: job of type EXECUTABLE failed
>with exit code: No such file or directory".
>
>I have tried this without the existence of a date.log file and with the
>existence of a date.log file in the /tmp directory. Both commands fail
>with the same error (above).
Probably because Oracle is (quite rightly) taking the job_action column
literally, and looking for a file named '/usr/bin/date>>/tmp/date.log' to run -
which doesn't exist.
>> as append to file is a shell construct, whereas this is just running an
executable direct.
Consider the following which does work (had to adjust paths for my system as
date is in /bin on mine, not /usr/bin) - this runs it through a shell and adds
the rest as arguments:
BEGIN
DBMS_SCHEDULER.CREATE_JOB(
job_name => 'test',
job_type => 'EXECUTABLE',
job_action => '/bin/sh',
number_of_arguments => 2
);
DBMS_SCHEDULER.SET_JOB_ARGUMENT_VALUE (
job_name => 'test',
argument_position => 1,
argument_value => '-c'
);
DBMS_SCHEDULER.SET_JOB_ARGUMENT_VALUE (
job_name => 'test',
argument_position => 2,
argument_value => '/bin/date>>/tmp/date.log'
);
DBMS_SCHEDULER.ENABLE('test');
END;
/
--
Andy Hassall :: andy@xxxxxxxxxxx :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool
.
- Follow-Ups:
- Re: Help getting an EXECUTABLE to run under DBMS_SCHEDULER
- From: GeoPappas
- Re: Help getting an EXECUTABLE to run under DBMS_SCHEDULER
- References:
- Help getting an EXECUTABLE to run under DBMS_SCHEDULER
- From: GeoPappas
- Help getting an EXECUTABLE to run under DBMS_SCHEDULER
- Prev by Date: Re: Help getting an EXECUTABLE to run under DBMS_SCHEDULER
- Next by Date: Re: Changing datafile size.
- Previous by thread: Re: Help getting an EXECUTABLE to run under DBMS_SCHEDULER
- Next by thread: Re: Help getting an EXECUTABLE to run under DBMS_SCHEDULER
- Index(es):
Relevant Pages
|