In earlier APEX projects i have used DBMS_SCHEDULER to manage scheduled jobs. APEX Automation was introduced in version 20.2. Until recently, I have not tested this. I have used what I always use for regular repeating jobs, good old DBMS_SCHEDULER.
APEX Automation is built on top of DBMS_SCHEDULER and both solve the job I need them to do. In my integration apps, I often use DBMS_SCHEDULER to fetch data. For example getting new segment values and open and closed periods from ERP. Now it was time to try APEX Automation for similar tasks.
Yes, APEX Automation was easy to set up. It does the same job my DBMS_SCHEDULER jobs does. Albeit it has some limitation that made me a little disappointed. I expected Automation to bring something more.
What’s Missing: Potential Improvements for APEX Automation
No runtime rescheduling by end users.
At the moment, only developers can schedule or modify an Automation. They can do this within APEX Builder or through custom PL/SQL code. Developers can potentially create a custom interface for end users to reschedule jobs. However, APEX Automation does not offer this functionality out of the box. Neither do DBMS_SCHEDULER, but it’s easier to query the jobs from scheduler than from APEX Automation.

Code for changing the schedule using DBMS_SCHEDULER:
BEGIN
DBMS_SCHEDULER.SET_ATTRIBUTE(
name => :P4_JOB_NAME,
attribute => 'REPEAT_INTERVAL',
value => :P4_INTERVAL);
END;
APEX Automation also have procedure to change the next running time, but not the schedule itself. If called with only the static id the job will run at once.
APEX_AUTOMATION.RESCHEDULE (
p_application_id IN NUMBER DEFAULT {current application id},
p_static_id IN VARCHAR2,
p_next_run_at IN timestamp with time zone DEFAULT systimestamp )
It’s possible to find the SCHEDULER_JOB_NAME. See code below. I have not tested if it’s possible to change the schedule using DBMS_SCHEDULER.SET_ATTRIBUTE, and then this would be reflected into the Automation. Probably not. The point of building something above DBMS_SCHEDULER should be to avoid call this package directly.
APEX_AUTOMATION.GET_SCHEDULER_JOB_NAME (
p_application_id IN NUMBER DEFAULT {current application id},
p_static_id IN VARCHAR2 )
RETURN VARCHAR2;
-- ==> APEX$AUTOMATION_2167837869128719
No built-in job status dashboard for end users.
APEX Automation does not have an interface for end users to view the status of jobs. Developers can track job statuses via the logs in APEX Builder. They can also query the log tables. However, there’s no built-in dashboard for end users to see the status of running jobs. They cannot check whether the jobs have succeeded or failed. A developer can of course build an overview using the functions for getting “Is Running” and “Last Run”. This would have do be “hard coded” per job static id.
End users can not start or stop jobs by default.
APEX Automation don’t provide built-in controls for end users to start or stop jobs. Developers can build custom functionality to allow users to trigger an automation using procedures like Execute, Enable and Disable. This is more cumbersome than querying the DBMS_SCHEDULER for jobs following a naming convention.
Automation can not run every minute.
APEX Automation rely on a master job that runs every two minutes. This means that even though DBMS_SCHEDULER supports minute-level or lower scheduling, APEX Automation won’t run at minute-level granularity. Every two minutes an automation that are due will be started.
There’s already a great model for how APEX Automation could evolve—APEX Workflow. Workflow has a runtime dashboard, allowing users to track processes, view statuses, and make changes on the fly. If APEX Automations had similar capabilities, it would drastically enhance its usefulness for both developers and end users.
Imagine if users could:
- See a list of all running jobs along with their statuses
- Start or stop jobs when needed
- Reschedule jobs dynamically to suit their needs
- Run jobs at more frequent intervals, such as every minute
These are the kinds of features that would transform APEX Automation into a truly robust job management tool. Currently, it provides a developer-friendly interface for basic scheduling needs. However, it lacks the flexibility that power users require.
I think that Apex Automation should have been rewritten to register it’s jobs directly with DBMS_SCHEDULER. That would give the full flexibility of this tool. Built inn dashboard pages would also be welcome changes.
For now I will use DBMS_SCHEDULER. It’s not that hard to register a job there:
BEGIN
DBMS_SCHEDULER.create_job(
job_name => 'EBSAS_LOAD_SEGMENT_VALUES',
job_type => 'PLSQL_BLOCK',
job_action => 'DECLARE
l_loglevel NUMBER;
BEGIN
SELECT NVL(loglevel, 0) INTO l_loglevel FROM xxebs_glj_loglevel;
xxebs_glj_setup_pkg.LoadFFV_Segments_Proc(l_loglevel);
END;',
start_date => SYSTIMESTAMP,
repeat_interval => 'FREQ=DAILY; BYHOUR=0; BYMINUTE=0; BYSECOND=0',
enabled => FALSE
);
END;

Leave a Reply