Page 1 of 1

updating audit table

Posted: Mon Oct 07, 2013 11:18 am
by DSRajesh
Dear All,

I am running two jobs parallely which will update the audit table which have jobstatus column.

while running a job ,there will be a record created with 'running' status for each job so two records will be created in the audit table.

once the bothe job has completed the run,status shall be updated for both the jobs.

can i some one help me how to build the audit job for this to update the both the records for the audit table.

Re: updating audit table

Posted: Mon Oct 07, 2013 12:57 pm
by abhinavagarwal
Hi

A column or flag or indicator which can find the the exact job-id, can be helpful.
Your audit job should be able to pick the job-id and then should be able to update the corresponding rows in the audit tables.

Cheers.

Posted: Mon Oct 07, 2013 8:14 pm
by DSRajesh
Dear Abhinav

How can i use the flag/indicator to catch up the corresponding job id record value and update the same.

can any one guide me here please.

Posted: Mon Oct 07, 2013 10:02 pm
by abhinavagarwal
Hi

In your audit tables you must have a static table where your all jobs/sequences must have an entry with a unique id. Use that id to pick up the row in the status table.

If you are trying to have every run states then use date and status also in your where clauses in your update query.

If you are really keep to minimize the time of execution of your whole batch then you should try a audit routine rather than audit job.

That will save time and some deadlock issues on the audit tables in case of multiple instances.

Cheers.

Posted: Tue Oct 08, 2013 2:24 am
by priyadarshikunal
And why is it required.

If there is any such dependecy either run it in a sequence and update the records at last. Or may be same script calling both the jobs. I think the best way will be to get them triggered from the same sequence/script.

There are a few other solutions but these are simple and will work.

Posted: Tue Oct 08, 2013 10:43 am
by DSRajesh
Hi abhinav

I have one audit table with the fields jobid, jobname, jobstatus, jobstarttime, jobendtime, createetimestamp, updatetimesramp, createuserid and updateuserid fields .

I need to create audit job which will insert a record in audit table with jobstatus as running.there are two jobs running parallel so that two records cre ated with running status.

Once jobs run completed, actual status will update in place of running status.


These two job s are calling in different sequence.

Regards,
Kumar

Posted: Tue Oct 08, 2013 1:14 pm
by chulett
At this point, I'm a little lost as to what your actual question / issue is. Do you need help creating the first 'audit job' that inserts the record? Or are you looking for help with the second part where the current record is updated? Or do you need help with both?

I'd also be curious what you've tried so far and what issues you've encountered... so far.