SoftTree Technologies SoftTree Technologies
Technical Support Forums
RegisterSearchFAQMemberlistUsergroupsLog in
Job Logging

 
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite View previous topic
View next topic
Job Logging
Author Message
Jeff



Joined: 29 Apr 2002
Posts: 37

Post Job Logging Reply with quote

I currently have about 8 jobs that run each night one after another. I call them all from a single "Master Job" using Jobrun statements. I would like to save some statistics from these jobs to a relational database table. Much of the information is already saved in the log file such as job_id, job_name, start_time, end_time, exit_code. However I may want some additional data in the table as well. Can you recommend the best way to do handle this in 24x7? Thanks, Jeff

Tue May 17, 2005 12:04 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7975

Post Re: Job Logging Reply with quote

I think the best way is to develop a user-defined JAL statement using the script library feature (Tools/Script Library menu)
Then in the "Master Job" after each JobRun call you can add "Job Logging" call where Job Logging would be replaced with your statement name following all relevant parameters that you want to pass to your code.

Your statement can then connect to the database, make an insert and disconnect, here is an example

Dim rows, number
Dim my_sql, string
DatabaseConnect "profile name here"
//... build SQL INSERT statement here
ConcatEx "INSERT INTO my_table VALUES (', param1, "', '", param2, "', '", param3, "')", my_sql
DatabaseExecute my_sql, rows
DatabaseDisconnect

: I currently have about 8 jobs that run each night one after another. I call
: them all from a single "Master Job" using Jobrun statements. I
: would like to save some statistics from these jobs to a relational
: database table. Much of the information is already saved in the log file
: such as job_id, job_name, start_time, end_time, exit_code. However I may
: want some additional data in the table as well. Can you recommend the best
: way to do handle this in 24x7? Thanks, Jeff

Tue May 17, 2005 12:26 pm View user's profile Send private message
Jeff



Joined: 29 Apr 2002
Posts: 37

Post Re: Job Logging Reply with quote

Thanks for the tips, I think it has me headed in the right direction. I am also trying to write a unique key to each record in the table. I thought I would pull this from an oracle sequence I created using the databaseretrieve function. How do I then get the value into a variable which I can put in my Insert statement? Thanks.

Tue May 17, 2005 4:35 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7975

Post Re: Job Logging Reply with quote

Unless you want to know the sequence value within the master job script you don't need to fetch it first, then assign it, then copy, etc... This all can be done directly in the INSERT. Here is an example demonstrating what I mean

INSERT INTO my_table (pkcol, col1, col2) SELECT myseq.nextval, 'param1', 'param2' FROM dual.

In case if you prefer doing it in multiple steps then use the following method
DatabaseRetrieve "SELECT myseq.nextval FROM dual", rows
DatabaseGet 1, 1, myseq_value
ConcatEx ... full INSERT here ... see my previous post. for details

: Thanks for the tips, I think it has me headed in the right direction. I am
: also trying to write a unique key to each record in the table. I thought I
: would pull this from an oracle sequence I created using the
: databaseretrieve function. How do I then get the value into a variable
: which I can put in my Insert statement? Thanks.

Tue May 17, 2005 4:47 pm View user's profile Send private message
Display posts from previous:    
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite All times are GMT - 4 Hours
Page 1 of 1

 
Jump to: 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


 

 

Powered by phpBB © 2001, 2005 phpBB Group
Design by Freestyle XL / Flowers Online.