updating audit table

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

Post Reply
DSRajesh
Premium Member
Premium Member
Posts: 297
Joined: Mon Feb 05, 2007 10:37 pm

updating audit table

Post 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.
RD
abhinavagarwal
Participant
Posts: 26
Joined: Thu Jun 19, 2008 12:39 am
Location: Atlanta

Re: updating audit table

Post 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.
- Thanks and Regards,
Abhinav Agarwal
DSRajesh
Premium Member
Premium Member
Posts: 297
Joined: Mon Feb 05, 2007 10:37 pm

Post 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.
RD
abhinavagarwal
Participant
Posts: 26
Joined: Thu Jun 19, 2008 12:39 am
Location: Atlanta

Post 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.
- Thanks and Regards,
Abhinav Agarwal
priyadarshikunal
Premium Member
Premium Member
Posts: 1735
Joined: Thu Mar 01, 2007 5:44 am
Location: Troy, MI

Post 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.
Priyadarshi Kunal

Genius may have its limitations, but stupidity is not thus handicapped. :wink:
DSRajesh
Premium Member
Premium Member
Posts: 297
Joined: Mon Feb 05, 2007 10:37 pm

Post 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
RD
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post 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.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply