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

Home -> Community -> Usenet -> c.d.o.misc -> Re: status_table

Re: status_table

From: Ed Prochak <edprochak_at_gmail.com>
Date: 1 Jun 2006 08:15:58 -0700
Message-ID: <1149174957.962292.170720@f6g2000cwb.googlegroups.com>

swapna.marri_at_gmail.com wrote:
> Hi All,
>
> I have a Job_status_table which will keep track of the status of the
> cron jobs.I built one procedure where in, it logs on the start-time,
> end_time, job_name,status_flag of all the cron jobs when executing.When
> the script(job) fails, it will not put the end_time and marks the
> status_flag as 'N'.
>
> Now I would like to create a procedure that checks our job_status table
> to look for any abended or hung jobs ( we'll need to make sure to
> make allowances for active jobs so probably just look for records with
> an hour or so ago start time/date but no end time/date). Once we have
> a procedure like this we can call we can schedule it in cron to run
> every 5 minutes or so.
>
> Help is appreciated,
> Thanks,
> Choti

these are cron jobs as in UNIX/Linux? or are these database jobs? Checking wherther a process is "hung" versus performing a long calculation is impossible in the general case. A typical solution is including somekind of "heartbeat" from the application such as writing a message to a log file/table/console device at certain checkpoints in the application (especially within loops).

If you KNOW that none of your applications ever runs longer than 30minutes, then stopping applications that have been running over an hour only gives you a factor of 2 safety margin. It's still no quarantee that you are not stopping a process just before it gets to it's final COMMIT before ending.

If completion of the applications is critical, then I would suggest your status program merely reports what's happening so a human can act on it. The report might show:
application A started, but never finished. It is no longer running. application B started, but never finished. It is still running.

The response for app A might be to update the status table because it finished but failed on the update to the status table. The response for app B might be to check certain logs and either kill the process or fix what is stopping it so it completes successfully.

HTH,
  ed Received on Thu Jun 01 2006 - 10:15:58 CDT

Original text of this message

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