APEX Background Jobs #JoelKallmanDay
Table of contents
- Scheduler / Co-Ordinator Jobs
- Queue Handlers
- Maintenance Jobs
- Monitoring APEX Jobs
- Don't Forget ORDS
I recently watched an excellent presentation by Carsten Czarski from the APEX Development Team on All Things Background. In his presentation, Carsten touched on several DBMS Scheduler jobs which APEX uses to a) Perform Maintenance activities in your APEX environment and b) Launch scheduled processes such as APEX Automations, REST Source Synchronizations, and Page Background Processes.
In this post, I will review these jobs and explain what they do and when they are scheduled to run.
Scheduler / Co-Ordinator Jobs
The most interesting jobs for an APEX developer are what Carsten called Scheduler or Co-Ordinator Jobs. These jobs run on a scheduled basis to check if some of your code needs to be run, such as APEX Automations, REST Data Synchronizations, and Background Page Processes.
This job runs every 10 minutes and checks to see if you have scheduled any REST Source Synchronizations to run at that time (or before). If there are any scheduled REST Source Synchronizations, then it runs them.
This job runs every 2 minutes (at 5 seconds past the minute) and checks to see if you have scheduled any APEX Automations to run at that time (or before). If there are any scheduled APEX Automations, then it runs them.
This job runs every 2 minutes (at 45 seconds past the minute) and checks to see if any Background Page Processes need to be run. If there are any, then it runs them.
Schedule for Co-Ordinator Jobs
The table below shows the precise schedule that the Co-Ordinator jobs run on.
What I call Queue Handler jobs are jobs that manage the various queues within your APEX Environment. These include jobs that send out PWA Push Notifications and Emails sent out using the
This job runs every 2 minutes (at 0 seconds past the minute) and sends out any pending PWA Push Notifications.
This job runs every 5 minutes (at 0 seconds past the minute) and sends out any pending emails.
This job runs on the hour and the half hour and sends out Interactive Report Subscriptions.
This job runs every two minutes and creates requested and approved Workspaces.
This job runs every hour on the hour and sends out emails initiated from APEX Teams Development.
Schedule for Queue Handler Jobs
Maintenance jobs are jobs that perform maintenance activities within your APEX environment.
This job purges expired APEX Sessions and runs every hour, on the hour.
This job performs activities such as Archiving Activity Summary, purging REST Source Cache, purging Stale Page/Region Cache, purging Uploaded Files, etc. It runs every day at 1 a.m. database time (usually UTC).
This job deletes APEX Workflow Approval tasks that have been Canceled, Errored, or Completed that are beyond the retention period. It runs every day at 2 a.m. database time (usually UTC). Read more on Workflow Task Retention and purge rules here.
Similar to the previous job, this job is also related to APEX Workflow Tasks. It handles re-processing expired Workflow tasks. The job runs every hour on the hour.
This job gathers aggregated workspace, schema, and instance-level metrics. It runs every day at 2 a.m. database time (usually UTC).
This job caches database dictionary objects related to APEX Workspaces. It runs every day at 1 a.m. database time (usually UTC).
This job performs backups of your APEX Applications that changed in the previous 24 hours. It runs every day at 2 a.m. database time (usually UTC).
Monitoring APEX Jobs
You can use the following SQL (run as the SYSTEM or SYS user) to get a list of scheduler jobs owned by APEX:
WHERE owner = 'APEX_230100'; -- Change based on your APEX Version.
You can also view APEX Jobs from the INTERNAL / Administration Services Workspace by navigating to Monitor Activity > Jobs.
Clicking on a specific job will show you details about individual executions of the job. This can be helpful when tracking down issues.
In later versions of APEX, you can also find APEX job information under Monitor Activity > Administrator Digest > System Schedule Jobs:
Don't Forget ORDS
Also, don't forget that ORDS has a background job that performs administrative tasks. This job is called
ORDS_HOUSEKEEPING_JOB, and it runs from the
ORDS_METADATA schema. This job runs every hour on the hour.
I believe that it is important for developers to understand what is happening under the APEX hood. I know that I have learned a lot just by writing this blog post.