Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: How to stop a job automatical

Re: How to stop a job automatical

From: Chuck <chuckh_at_softhome.net>
Date: Tue, 29 Apr 2003 09:27:11 -0400
Message-ID: <f8j1pwnf0u71$.1naar32ku36p.dlg@40tude.net>


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

TimerPid=$!
<do your processing here>
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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US