Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: How to stop a job automatical
On 29 Apr 2003 01:05:22 -0700, Sergej Berg wrote:
> Hi!
>
> i have a small question.
> On our database 9i are some jobs running.
> i want to stop a job after 1 hour.
> How can i do that?
>
> Thanks,
>
> Sergej
There are several ways. The easiest is to run the job as a user who has a one hour connect time limit set up in a profile.
Another would be to run the job from unix along with a child the sleeps for one hour. If the child finishes first, kill the parent.
Example:
#!/bin/ksh
set -m # Monitor child processes trap "kill $$" CHLD # Kill parent if child process terminates sleep 3600& # Set timer to one hour
trap - CHLD # Disable further traps kill $TimerPid # Clean up timer
Note that this simple example may not work if other parts of your script also execute child processes. Received on Tue Apr 29 2003 - 08:27:11 CDT
![]() |
![]() |