The avg_run_time attribute for AutoSys jobs is a crucial metric for performance analysis, forecasting, and scheduling. Users may observe that this value is either not populated initially or does not update as expected. This document clarifies the specific conditions and methods by which the avg_run_time attribute is populated and maintained in AutoSys.
AutoSys Workload Automation
Component: Job Definitions, Scheduler
Database: Underlying database hosting the AutoSys schema (Oracle)
The avg_run_time for an AutoSys job is populated and updated through specific mechanisms:
1. Job Initial Insertion: *
When a job is initially inserted into AutoSys, its avg_run_time attribute is established.
However, it will typically be 0 or NULL until actual run data is available.
Or unless a user specifies a value during the insertion.
2. dbstatistics Utility Execution:
The avg_run_time is updated when the dbstatistics utility is executed, provided that the job has historical run data recorded in the ujo_job_runs table.
The dbstatistics utility processes historical data to calculate and update various job statistics, including average run times.
3. Manual Execution of ujo_calculate_avg_jobruns Function:
The function responsible for calculating average run times is ujo_calculate_avg_jobruns. This is the same function that dbstatistics invokes.
You can explicitly execute this function to update average run times, either manually from the database or by defining an AutoSys job to run it.
Example AutoSys Job Definition:
insert_job: sql_job3 job_type: SQL machine: localhost owner: aedbadmin@<hostname>.<example>.<com> sql_command: "DECLARE v_Return NUMBER; BEGIN v_Return := ujo_calculate_avg_jobruns; END;"
* In the example above, aedbadmin@<hostname>.<example>.<com> is an example of a database user configured in autosys_secure with the necessary credentials.
* Required Database Permissions: By default, execute permission is granted for this function via the following SQL command: grant execute on ujo_calculate_avg_jobruns to ujoadmin
* Therefore, any database user ID that has been granted ujoadmin permissions will be able to execute the ujo_calculate_avg_jobruns function.