Batch Best Practices
Batch Best Practices
DISCLAIMER
This document in any form, software or printed matter, contains proprietary information that is the exclusive property of
Oracle. Your access to and use of this confidential material is subject to the terms and conditions of your Oracle software
license and service agreement, which has been executed and with which you agree to comply. This document and
information contained herein may not be disclosed, copied, reproduced or distributed to anyone outside Oracle without
prior written consent of Oracle. This document is not part of your license agreement nor can it be incorporated into any
contractual agreement with Oracle or its subsidiaries or affiliates.
This document is for informational purposes only and is intended solely to assist you in planning for the implementation
and upgrade of the product features described. It is not a commitment to deliver any material, code, or functionality, and
should not be relied upon in making purchasing decisions. The development, release, and timing of any features or
functionality described in this document remains at the sole discretion of Oracle.
Due to the nature of the product architecture, it may not be possible to safely include all features described in this document
without risking significant destabilization of the code.
Batch Architecture 13
Batch Technology 13
Batch Initiation 14
Batch Interface 14
Batch Objects 16
Batch Execution 16
Plug In Batch 42
Generic Templates 43
F1-PDBEX - Plug In Driven Extract Template 43
F1-PDBG - Plug In Driven Generic Template 44
F1-PDUPL - Plug In Driven File Upload Template 45
Using Templates 46
BATCH CONCEPTS
The following section outlines some basic concepts when configuring and executing the batch component of the Oracle
Utilities Application Framework.
Batch Program
The main component of the background process is the batch program. This program contains the logic to select the batch
of records that the process will perform actions upon. The batch of records is progressively passed to the relevant objects to
complete processing. The program acts as a driver to push individual records to the relevant objects. Objects in the product
are shared across all modes of access to maximize reuse.
Apart from the logic to decide the subset of records, the batch program contains the following additional information:
The batch program contains the code necessary to interface to the framework to automatically manage its
individual execution and restart (if necessary).
Some of the batch programs contain the code necessary to multi-thread the processing. The program determines
which slice or subset of the overall data it needs to process. Not all programs support multi-threading (most do,
except the extract to file type processes).
The product ships with a preset number of batch programs associated with background processes that may be used and
configured to perform the necessary business functions for your site. These background processes can be extended (just
like the rest of the product functionality) and custom batch programs can be added.
Batch Controls
A batch program and its parameters must be defined in metadata prior to initial execution. This data is stored in a Batch
Control object within the meta-data component of the framework.
The Batch Control contains the definition of the batch program and the following additional information:
Identifier. A Batch Code used as an identifier. This is used by the framework to identify the process internally and
used to denote output.
Technology. The technology used to build the batch program is configured so that the Oracle Utilities Application
Framework understands which technology to use to initiate and track the process.
Security. In Oracle Utilities Application Framework V4.3.0.0.0 and above, each batch control can be controlled via
an Application Service to provide additional levels of security.
Execution Metrics. Basic execution statistics for the last execution, including level of service (if configured), last
execution date and time and the latest run number which is primarily used for extract processing.
Fixed Parameters. Each Batch Control has several fixed parameters that control tracing, thread counts, commit
interval and other aspects of behavior.
Thread Metrics. Each thread contains metrics for individual start and end times as well as additional information
such as records processed and in error.
Exceptions. If there are any exceptions, they are listed in the tree. If they are linked to transactions, they may be
hyperlinked to the record causing the error (process dependent).
Note: Some processes create To Do records to highlight errors within the process or within a companion process. Refer
to the product documentation for clarification.
It is also possible using the Batch Run Tree to force a complete restart. By default, the Oracle Utilities Application Framework
will restart a process/thread in error at the last checkpoint (As indicated by Restart Data). To override this behavior and force
the checkpoint to be ignored then set Do Not Attempt Restart on the Run Control Tab. For example:
Note: This functionality only applies to executions in an Error state not completed processes. Setting this value does not
guarantee the process will process the same set of records as originally as the individual process may ignore already processed
records
Batch Parameters
Controlling the behavior of the execution of the batch program are several parameters that are specified in the Batch
Control and on configuration files (depending on the method of execution). These parameters are technical, and business
related and can be explicit or implied. Setting these parameters can change the run-time and processing behavior of the
execution:
Batch Control Explicit Technical/Business This is the identifier of the batch process in the
product. This identifier is used to initiate the
execution and used by some of the submission
methods for logging.
Batch Control Type Explicit Technical This is the type of batch execution used by the
Oracle Utilities Application Framework. This
supports Timed and Non-Timed process. This is
recommended to be set and not changed.
Batch Category Explicit Business This is used for reporting purposes on portals and
zones and categorizes the batch control into its
relevant business area
Accumulate All Instances Explicit Technical Refer to the online help for an explanation of this
setting.
Thread Count Explicit Technical This is the number of threads to execute for a multi-
threaded process. The minimum is 1 and the
maximum is the number of threads supported
concurrently on the architecture. Refer to Multi-
Threaded processes for more information.
Thread Number Explicit Technical This is the individual thread number to submit. This
is used at submission time to submit individual
threads for micromanagement and the value must
be less or equal to the Thread Count. Omitting this
value or setting it to 0 will spawn the number of
threads up to the thread count. Refer to Multi-
Threaded processes for more information.
Override Number of Records Explicit Technical The number of objects to process before a commit
to Commit performed for checkpointing purposes. If no value is
supplied, it is defaulted within the batch process
itself.
Override Maximum Timeout Explicit Technical This is the number of minutes the set of records is
in Minutes processed before a commit is performed. This
prevents sets of data becoming stale within the
database. This parameter works in conjunction with
the Override Number of Records to Commit to
control checkpoints.
Trace Program Start Explicit Technical This setting enables or disables debug messages to
be added to batch logs to record program start. This
is used by developers to debug their code.
Trace Program Exit Explicit Technical This setting enables or disables debug messages to
be added to batch logs to record program ending.
This is used by developers to debug their code.
Trace SQL Explicit Technical This setting enables or disables debug messages to
be added to batch logs to record execution of any
SQL statements in the program. This is used by
developers to debug their code.
Trace Output Explicit Technical This setting enables or disables debug messages to
be added to batch logs to record outcomes of calls
to other objects in the program. This is used by
developers to debug their code.
Batch Rerun Number Explicit Technical/Business This setting is used at submission time to rerun
specific extracts. In normal operation this number is
not provided. Refer to Extract processes for a
discussion of this parameter.
Batch Business Date Explicit Technical/Business This is an important submission parameter that
specifies the date (in ISO format YYYY-MM-DD) that
tells the batch program which records are to be
considered for processing. If not provided, the
current system date is used. It is recommended that
a relevant common date be supplied for each
execution to ensure consistency in set of records
processed.
Batch User Explicit Technical/Business This parameter is required at submission for use in
the batch execution in following ways:
Security. The user supplied is checked within the
security system for appropriate access for the objects
used in the batch program including the Batch Control
itself.
Ownership. All records created or modified in the batch
process will be marked with this user in the appropriate
objects. For example, if To Do records are created then
the To Do creator will be this user.
MAX-ERRORS Implied Business This is a hidden parameter which when used can set
the error tolerance for the process. This sets the
number of errors tolerated before the process is
considered a failure. When this tolerance is reached,
the process is stopped with an error status. By
default, it is omitted which disables the capability.
Refer to Setting the Error Tolerance for more
information.
Multi-Threaded Processes
One of the major features of the batch framework is the ability to support multi-threading. The multi-threading support
allows a site to increase throughput on an individual batch process by splitting the total workload across multiple individual
threads. This means each thread has fine level control over a segment of the total data volume at any time.
The idea behind the threading is based upon the notion that many hands make light work. Each thread takes a segment of
data in parallel and operates on that smaller set. The object identifier allocation algorithm built into the product randomly
assigns keys to help ensure an even distribution of the numbers of records across the threads and to minimize resource and
lock contention.
In Oracle Utilities Application Framework 4.3.0.4.0 and above, it is possible to separate the logic for threading using the
Process SQL algorithm in Plug In Batch and within the Oracle Utilities SDK built batch processes.
The capability can be described as follows:
Thread Limit is Set. A maximum number of Threads is set at execution time to break a large processing task into
smaller parallel tasks. The thread limits need to be set appropriately for the process as well the architecture. The
number of threads specified should not exceed the total number of threads in all threadpool instances allocated to
the batch process. At the execution time this limit and the name of the threadpool are specified, if the thread limit
exceeds the total number of threads available across all instances of the targeted threadpool then the excess
threads will wait till a thread being available. This will delay the total elapsed time of the process.
Partitioning Data Sets. Each Thread is allocated a slice or partition of data to process as dictated by the process.
By default, the Process SQL/selection component of the process will allocate roughly the same number of objects
to process. For example, if the thread limit is set to six (6) then each thread will get approximately 1/6 of the records
to process. The best way to visualize the concept of threading is to use a pie analogy. Imagine the total work set for
a batch process is a pie. If you split that pie into equal sized segments, each segment would represent an individual
thread. For example:
Note: The allocation of records in a thread does not guarantee that the threads will finish at the same time. If there
are some workload skew, some threads will finish later than others.
Each thread will execute independently. Each thread will work through the individual sets of records allocated to
each thread and finish updating the Batch Run Tree appropriately. When the last thread of the process is complete
then the process is complete.
The concept of threading has advantages and disadvantages:
Smaller elapsed run-times. Processes that are multi-threaded finish earlier than processes that are single
threaded. With smaller amounts of work to do, processes with threading will finish earlier.
Note: The elapsed runtime of the threads is rarely proportional to the number of threads executed. Even though
contention is minimized, some contention does exist for resources which can adversely affect run-time.
Threads can be managed individually. Each thread can be started individually and can also be restarted
individually in case of failure. If you need to rerun thread X then that is the only thread that needs to be
resubmitted.
Threading can be somewhat dynamic. The number of threads that are run on any instance can be varied as the
thread number and thread limit are parameters passed to the process at run-time. They can also be configured
using the configuration files outlined in the product documentation.
Note: Threading is not dynamic after the process has been submitted.
Failure due to data issues with threading has reduced impact. As mentioned earlier individual threads can be
restarted in case of failure. This limits the risk to the total process if there is a data issue with an individual thread or
a group of threads.
Number of threads is not infinite. As with any resource there is a theoretical limit. While the thread limit can be up
to 1000's of threads, the number of threads you can physically execute will be limited by the CPU and IO resources
available to the process at execution time.
Theoretically with the objects identifiers evenly spread across the threads the elapsed run-time for the threads should all be
the same. In other words, when executing in multiple threads theoretically all the threads should finish at the same time.
Whilst this is possible, it is also possible that individual threads may take longer than other threads for the following reasons:
Workloads within the threads are not always the same. Whilst each thread is operating on the roughly the same
amounts of objects, the amount of processing for each object is not always the same. For example, an account may
have a more complex rate which requires more processing, or a meter has a complex amount of configuration to
process. If a thread has a higher proportion of objects with complex processing it will take longer than a thread with
simple processing. The amount of processing is dependent on the configuration of the individual data for the
process.
Data may be skewed. Even though the object identifier generation algorithm attempts to spread the object
identifiers across threads there are some processes that use additional factors to select records for processing. If
any of those factors exhibit any data skew, then certain threads may finish later. For example, if more accounts are
allocated to a part of a schedule then threads in that schedule may finish later than other threads executed.
Note: When using the Configuration Migration Assistant to migrate Batch Controls across environments, by default the current
run number in the target environment is retained and not overridden by the value from the source.
BATCH ARCHITECTURE
The Batch architecture provided with the Oracle Utilities Application Framework is a flexible and powerful way of defining
and executing batch programs. The architecture has several layers:
Batch Technology. This layer comprises the technology used to initiate the batch process and/or manage its
relationship with other batch processes. This can range from technology provided with the Oracle Utilities
Application Framework or the provision of third-party technology (in an enterprise solution). An implementation
will use one of the methods supported as their mechanism for managing and executing batch processes.
Batch Initiation. This layer describes the different methods of initiating batch processes including monitoring and
managing their progress or restart.
Batch Interface. This layer is the dedicated interfaces provided to manage and execute batch processes. This
includes providing information to and back to the initiating technology.
Batch Objects. These are a set of internal objects and functions within the Oracle Utilities Application Framework
to record and manage batch processes.
Batch Execution. This layer is responsible for executing the batch process as instructed and providing a
mechanism for feedback to the initiating technology as necessary.
The figure below summarizes the above layers as well their components which will be discussed in the subsequent sections:
Batch Technology
In implementing batch architectures, you need technology to initiate and manage individual batch process or sets of related
batch processes (such as in a schedule). In most cases, this is one of the following technologies:
Batch Initiation
To initiate the execution of batch processes there are three interfaces:
Command Line Utilities. There are several scripts to submit and management processes including submission of
processes, establishment of a runtime environment for execution and a set of related configuration files that define
the behavior of the batch process and architecture.
Oracle Scheduler. A set of API's based upon Oracle's DBMS_SCHEDULER capability. This capability is ideal for most
implementations as it is included as part of the base license for all editions of the Oracle Database, so it tends not to
have a license impact. The solution can be implemented locally or remotely (for an enterprise implementation).
Note: If the DBMS_SCHEDULER objects are placed in a remote database for an enterprise implementation, ensure that
database is licensed appropriately.
Online Submission. This is reserved for use for developers and testers on non-production environments and is
available via the online of the product.
Batch Interface
Note: For details of all the scripts and API's shown in this section refer to the Server Administration Guide.
The product provides several flexible interfaces to allow technologies to initiate, manage and monitor batch processes at the
batch control level or the individual thread level.
Command Line Interface. The Oracle Utilities Application Framework includes a series of scripts that can be run by
an authorized user to configure, manage and execute batch processes. The following is a summary of the
commands available:
Command Line Utilities
UTILITY COMMENTS
bedit.sh This is a utility to create and maintain configuration files relating to the batch
execution architecture. The utility is designed with a wizard like interface to simplify
the building the architecture and reduce common configuration issues.
jmxbatchclient.sh It is possible to monitor and manage executing batch processes (and threads) using a
JMX interface. This utility provides an interface into the JMX capability to allow
management of executing processes.
starttpw.sh This is a utility to start a group of threadpools from the command line for schedulers.
submitjob.sh This is the main utility to start or restart execution of a batch process (or individual
thread) and wait for the process (or thread). This interface is used by third party
schedulers to execute individual batch processes.
threadpoolworker.sh This utility can work alone or in tandem with starttpw.sh to start threadpools
individually. This interface is used by third party schedulers to start or stop individual
threadpools.
Note: Refer to the Server Administration Guide for details of the command line options and the execution of these commands.
Note: As with all commands in the Oracle Utilities Application Framework the splenviron.sh command MUST be executed
prior to any command to set the appropriate environment variables.
Oracle Scheduler Interface. The OUAF_BATCH package interface is provided so that Oracle DBMS_SCHEDULER can be
used to schedule batch processes.
Note: Refer to the Batch Scheduler Integration for Oracle Utilities Application Framework (Doc Id: 2196486.1) and
Server Administration Guide for more information about each API.
OUAF_BATCH Procedures
UTILITY COMMENTS
Submit_process Submits a batch process (or thread) from the scheduler and waits for the process to
complete. This is the main procedure in the API to execute processes.
Restart_Thread Manually restarts threads for restart. This is used manually rather than from the
scheduler.
Cancel_process Cancels an executing process. This will cancel on the next checkpoint or poll interval,
whichever comes first. This is used by manually to cancel processes.
Set_Option Sets GLOBAL or batch control specific options for the scheduler. This sets interface
specific options and some key parameters.
Unset_Option Unsets GLOBAL or batch control specific options for the scheduler that have been set
by the Set_Option interface.
Raise_Thread_Error This is an internal option which allows for specific thread error processing. It can be
used by the scheduler to force error conditions for testing purposes if necessary.
Online Submission. The online submission screen is available for use for testing purposes. This allows a user to
queue an execution of a batch process. Refer to the online documentation for details of the operation of this
screen. An example of the submission is shown below:
Batch Objects
To support the interfaces a set of objects are provided by the Oracle Utilities Application Framework to record and manage
batch processes. The table below lists the objects used provided for use by the interface and runtime:
Batch Objects
Batch Control CI_BATCH_CTRL Batch Controls that define the batch process to the Oracle Utilities Application
Framework
Batch Job CI_BATCH_JOB Submission initiation object used by Online Submission and Oracle Scheduler
Interface. This is not used by the command line interface.
Batch Run CI_BATCH_RUN This is the working object used for initiation, execution and monitoring by the
Oracle Utilities Application Framework batch architecture. It is used by the
execution capability as well as the basis for information in the Batch Run Tree.
An object per execution is persisted in this object along with related
information in child objects.
These objects are manipulated by the execution engine as well as the submission methods shown above. These objects are
not to be manipulated manually under any circumstances.
Batch Execution
The key component of the batch architecture is the execution architecture to execute multiple threads of multiple batch
processes effectively. The architecture is based upon the following principles:
Coherence Based. The architecture is based upon clustering batch resources using the Named Cache capability
within the Oracle Coherence product. Oracle Coherence provides the ability to cluster resources across machines
and effectively scale vertically as well as horizontally needed for performing batch effectively and efficiently.
Flexibility in architecture. The architecture supports simple and complex architectures across single or multiple
machines using a variety of networking methods.
Robust. The architecture detects issues in execution and keeps the Oracle Utilities Application Framework
appropriately informed in real time and as the process completes to ensure consistency.
In built batch daemon. For the online submission and Batch Scheduler integration a daemon is available in the
architecture to detect the initiation of activities. This daemon detects pending requests and submits them to the
architecture.
The batch architecture is based upon the following concepts:
Threadpools. Long running Java Virtual Machines (JVM's) are waiting for threads to process. These are known as
threadpools. These are the JVM's that perform the work.
− Clustered Threadpools. Each threadpool is named (for individual or groups of JVMs). This allows clusters
of similar named threadpools to form a larger virtual threadpool to allow for greater numbers of
concurrent threads.
− Thread Limits on Threadpools. Each threadpool has and have individual thread limits to avoid JVM
overload. The thread limits on similarly named threadpools accumulate to support greater numbers of
concurrent threads.
Configurable Threadpool Behavior. The configuration of threadpools allows for JVM behavior, caching and node
management within a cluster to be configured.
Submitters. When a Batch Interface requests to execute a batch process or thread a submitter is created within the
cluster to act as the client to the cluster. The submitter tells the cluster what to run and where and then waits
around for the threads to finish.
Batch Daemon. A running batch daemon that looks for pending work to submit to the cluster. This is used
exclusively with the Batch Scheduler Integration and Online Submission methods.
These execution concepts are shown below:
bedit.sh <filename> Edit the configuration file name directly. This Refer to each section on the file names
file must be generated by bedit.sh to be edited that are generated by bedit.sh.
by that utility.
Note: Use the bedit.sh -h command for a full list of options available
Note: Refer to the Server Administration Guide shipped with your product for details of the bedit.sh utility and how to use its
facilities.
Note: If the online includes the daemon or batch server, then changes to this file will need to be included in the build of the
online deployment files and a redeployment is required to update the deployment files.
Note: If you are using the bedit.sh functionality, do not manually edit the generated configuration files as this may cause the
utility to overwrite manual changes.
Single Server (ss) The cluster is restricted to the This is useful for non-production environments with
current host. the simplest networking using Single Host Protocol
Uni-cast (wka) The cluster uses unicast protocol This is recommended for sites wanting to lock down a
with the hosts explicitly named cluster to specific hosts and does not want to use
within the cluster that are part of the multi-cast protocols. Administrators will have to name
cluster. the list of hosts, known as Well Known Addresses, that
are part of the cluster as part of this configuration
Multi-cast (mc) The cluster uses the multi-cast This is recommended for sites who want a dynamic
protocol with a valid multi-cast IP configuration where threadpools and submitters are
address and port. accepted on demand. This is the lowest amount of
configuration for product clusters as the threadpools
can join a cluster from any server with the right
configuration dynamically. It is not recommended for
sites that do not use the multi-cast protocol.
Use the same port per machine in WKA. The uni-cast configuration uses host names and port number
combinations to define the cluster. Avoid different port numbers on individual machines to reduce maintenance
complexity.
Avoid using prod mode in non-Production. The cluster may be configured to operate in either dev (development)
or prod (production mode). These modes do not limit access to features, but instead alter some default
configuration settings. For instance, development mode allows for faster cluster startup to ease the development
process. It is recommended to use the development mode for all pre-production activities, such as development
and testing. This is an important safety feature, because the cluster configuration automatically prevents these
nodes from joining a production cluster. The production mode must be explicitly specified when using the cluster in
a production environment.
Note: Oracle Utilities Application Framework has additional built-in membership validation to prevent unintentional
non-production nodes joining production, regardless of the mode setting.
The figure below summarizes the type of information to configure for each template:
The cluster is created, operationally, when the first threadpool is started. Conversely a cluster is closed when the no
threadpools are executing for that cluster. No additional operations are needed explicitly to start or stop a cluster.
THREADPOOL COMMENTS
POOL1 This represents the simplest scenario (A) with a single threadpool instance on a single host. The
number of threads is limited by the limit on the individual instance.
POOL2 This represents a scenario (B) where multiple instances of the same named threadpool exist on a single
machine. The number of threads available in that named pool is the sum of the instances.
POOL3 This represents a scenario (C) where multiple instances across machines. This is like the scenario with
POOL2 in that the number of threads available in that named pool is the sum of the instances but
illustrates that the pool is not constrained within machines.
Note: The scenarios shown above are not exhaustive as variations within each of the scenarios having the ability to be
combined to enable support for complex scenarios. For example, the scenarios of POOL2 and POOL3 (B and C) can be combined
if necessary.
Other Settings. There are several settings in threadpools that should be considered when configuring the
threadpools:
Thread Settings
Threadpool Collection. Create a collection of threadpools to suit your needs. For each threadpool specify a
threadpool name and thread limit per instance of that threadpool. Refer to Designing Your Threadpool Architecture
for detailed design advice.
Note: Remember to save any changes at the end of the session to create the configuration files.
Note: At present, there is no product supplied utility to automatically generate the parameter files from the Batch Control.
The final step in the batch architecture is to build and maintain a configuration file (if required) for individual batch controls
which are used by the submitjob.sh utility.
To setup submitters use one of the following commands:
$ bedit.sh -s
$ bedit.sh -b <batch_control>
There are two commands to create submitter definitions:
Default option (-s). This sets up a default configuration file used for any batch control where no specific batch
properties file exists. This creates a submitbatch.properties file located in the
$SPLEBASE/splapp/standalone/config subdirectory.
Batch Control Specific configuration (-b). This will create a batch control specific configuration file named
job.<batchcontrol>.properties where <batchcontrol> is the Batch Control identifier. This file is in the
$SPLEBASE/splapp/standalone/config/cm subdirectory. In this option, the soft parameters on the batch control
can be configured as well.
Note: The Batch control identifier used in the -b option should be in the same case as the Batch Control record in the
Oracle Utilities Application Framework.
SETTING COMMENTS
poolname This is the default threadpool used for the batch execution if none is specified on the command line or in
a process specific configuration. This should be set to an appropriate threadpool.
threads This is the number of concurrent threads that are executed when no thread limit is specified on the
command line or in a process specific configuration. It is recommended to set this to 1 to prevent
unnecessary overloading of threadpools.
commit This is the default commit interval (in object counts) if no commit interval is specified on the command
line or in a process specific configuration.
maxtimeout This is the timeout limit (in minutes) for holding the set of records processed. This is a legacy setting for
older versions of the Oracle Utilities Application Framework that supported COBOL extensions to prevent
stale record sets.
user This is the default application user used for security purposes if no user is specified on the command line
or in a process specific configuration.
Note: The default SYSUSER account should NOT be used for this setting. The AUSER setting suggested in
the template, needs to be changed to an appropriate value. It is intentionally invalid to force a change in
the configuration.
lang This the default language code used for messages used in this execution if no language is specified on
the command line or in a process specific configuration.
storage This is the default for configuration storage within the cluster. This setting should be set to false unless
otherwise instructed in the product documentation.
role This is a tag used for monitoring purposes. By default, the batch code used at runtime is used to set this
value.
Setup soft parameters in process specific configurations. For batch controls that have parameters, these need
to be set in the configuration file or as overrides on the command line. To minimize maintenance costs and avoid
potential command line issues, it is recommended to set the values in a process specific configuration file, using
the add soft command in bedit.sh with the following recommendations:
− The parameter name in the parm setting must match the name and case of the Parameter Name on the
Batch Control.
− The value set in the value setting must be the same or valid for the Parameter Value on the Batch Control.
− Optional parameters do not not need to be specified unless used.
Note: Do not add a parameter for the DIST-THD-POOL soft parameter as that is configured via the poolname parameter.
Thread Limits per Instance. Each threadpool instances supports a certain number of long running threads threads
set up to the limit.
The table below outlines common threadpool architecture patterns:
Single Named Create a single threadpool name (such as This is the simplest architecture and tends
Threadpool DEFAULT) and then use that to run ALL processes to be used for non-Production
within the architecture using instances of that environments where you start with a single
threadpool . The number of instances of this threadpool instance either standalone or
threadpool will dictate the number of concurrent within the online JVM (the latter scenario is
threads supported. used for demonstrations and training).
Dual Threadpools Create two threadpools (one with L2 caching on and This is a variation on the Single Name
one with L2 caching off). There are internal Threadpool with an additional named
processes, such as Configuration Migration threadpool for L2 Caching on for the small
Assistant and LDAP Synchronization, that benefit number of processes that require it. Most
from the Level 2 cache being turned off. Treat the sites restrict themselves to a single L2
L2 Cache On threadpool the same way you would Cache Off instance per cluster with enough
treat Single Named Threadpool capacity to cater for the small number of
processes that require it.
Targetted This is a wide set of variations where you set up This is varied with the following
Threadpools several named threadpools with specific global considerations:
settings optimized for use with specific processes
Keep Default Configuration. Setup a generic
and some for generic processes.
default pool for non-specific processes. For
example, small processes or single threaded
processes can be targetted to this default
setup.
Specific Java Configuration. For processes
that require special java setups that are not
covered by the default, consider setting up
specific threadpools which are configured for
processing.
Consider Segregating Critical Processes.
While sharing threadpools across processes is
efficient, some sites have considered setting
up a specialist set of critical threadpools to
isolate and optimize those processes
accordingly. For example, it is easier to scale
those specialist threadpools in isolation to
other processes. This is more
micromanagement but allows
implementations to manage and target their
resources appropriately for their business
needs.
The concept is implemented using the local-storage option in Oracle Coherence. The threadpools are configured so that
the local-storage is disabled and, on the cache threadpool it is enabled. This tells Oracle Coherence to distribute the state
of any process to the cache threadpool to save networking. If the cache threadpool is active the cluster will use that
threadpool to centralize communications.
Note: When committing to use cache threadpools you MUST configure the threadpools that use the cache to storage set to
false.
Current Settings
poolname (cache)
minheap (768m)
maxheap (768m)
distthds (4)
invocthds (4)
role (OUAF_Cache_TPW)
jmxstartport (7540)
>
Edit the settings to suit your needs.
By default, every active threadpool instance provides a JMX interface for monitoring purposes using different port numbers
for interaction. If you want to monitor the cluster in real time using JMX directly or via the Application Management Pack for
Oracle Utilities, then you need a fixed port and address to connect to the cluster each time. In these situations, it is
recommended, in complex production environment, to setup a dedicated Administration threadpool. An Administration
threadpool is similar in nature to a cache threadpool in that it does not run batch threads and is only available to act as a
conduit into the cluster for the JMX interface.
Note: To use the Administration threadpool ensure it is the first threadpool to start to reserve the JMX port number
appropriately.
Note: There is no Administration threadpool template shipped with the product. Use the default template to create the
administration threadpool.
Current Settings
minheap (768m)
maxheap (768m)
daemon (false)
rmiport (7540)
dkidisabled (false)
storage (true)
distthds (4)
invocthds (4)
role (OUAF_Admin_TPW)
jmxstartport (7540)
l2 (OFF)
devmode (false)
ollogdir (/u02/sploutput/demo)
ollogretain ()
thdlogretain ()
timed_thdlog_dis (false)
pool.1
poolname (ADMIN)
threads (1)
>
Note: The above settings are suggestions for the threadpool using the appropriate set command within bedit.sh.
Administrating Threadpools
Now that the threadpools are created the next step is to start and stop them using the threadpoolworker.sh command on
the hosts you want to run the threadpools:
$ threadpoolworker.sh -l <template> [-p <threadpool>]
Where:
<template> Configuration file to use threadpoolworker.<template>.properties
<threadpool> Threadpool within template to start. Omitting this will start an instance of all
threadpools in the file.
Note: Use the UNIX kill command or use the jmxbatchclient.sh interface to stop the instances. Refer to the Server
Administration Guide for more details.
Determining Threads
One of the most important decisions to make on a day to day basis is to determine the number of threads to run for an
individual process. Before discussing the threading recommendations a few concepts need to be reinforced:
Thread Limit is Set At Submission Time. When you execute any process, using any submission method, one of
the parameters is the thread limit. This is the fixed limit set at submission time and cannot be altered, even for a
restart, after the process has started.
Individual Threads can be submitted. Even though most submissions will submit all the threads, it is also possible
to submit individual threads using the various submission methods. This allows sites to micromanage threads from
schedulers or support advanced threading models (for example, submitted different threads to different
threadpools).
Thread numbers are cumulative across named instances. When you submit a process, using any submission
method, the threadpool name is also a parameter. This is the set of threadpool instances that will execute the
threads of the batch process. The number of threads available for the process is the total cumulative number of
threads of active instances of that named threadpool. For example, if you have one instance and it was 5 threads
then the total is 5, if you have two instances of 5 threads the total is now 10 etc. For instance:
Respect Availability Of Threads. When a batch process is submitted to a threadpool, the total number of threads
in all running instances should be the same or more than the thread limit for all processes submitted at that time to
that threadpool. If there are not enough available threads across the instances some threads will wait and be
delayed from execution. This will delay the overall execution of the process. In the example below, the first
execution is within the thread limit ( 4 < 5 ), the second execution is not within the limit ( 6 > 5 ) and therefore a
threads waits for any other thread to complete before starting. The last example, shows that with two running
instances of the threadpool that there is enough capacity ( 6 < 10 ):
Shared Threadpools Need Careful Planning. If more than one process is executing at the same time in the same
named threadpool, then there needs to enough capacity across all executions at any time. For example, if two
processes are executing at the same time and both have 3 threads each and the threadpool has a capacity of 5 then
a thread will wait ( 6 > 5 ):
Consider Metrics. The number of objects processed per minute/second and the elapsed time are key metrics to
use for planning purposes. The number of objects processed per minute/second are determined by calculating the
total minutes or seconds in the elapsed time per thread and dividing the number of records processed to determine
the rate of processing. For error prone processes, also consider the number of errors as well.
Now these concepts are understood let us discuss the determination of threads:
Extracts and Imports are Single Threaded. Before you consider any threading, any exports and imports are only
single threads, so the thread limit should always be set to 1. This helps ensure the correct processing of the import
and export files involved in these processes.
Note: No attempt should be made to run single threaded processes in a multi-threaded mode as this may make the process
fail or cause inconsistencies. Refer to the product documentation for guidelines on individual processes (or review the
description on the batch control).
Some Processes are Single Threaded. Review the product documentation for thread guidelines for each product
process.
Do Not Overload Your Threadpools. It is tempting to flood the threadpools with large number of threads, but it is
recommended not to overload the threadpools with large number of threads. Increasing number of threads can
resolve data skew and reduce elapsed time but can introduce inefficiencies due to contention. The rule of thumb is
to increase the number of threads, monitoring the number of objects processed per second/minute till this value
decreases. That would be the natural limit of your configuration to the threading.
Only Increase Threading When Needed. It is tempting to change the thread limits on the processes on a regular
basis but stick to a limit and only change it when the number of objects processed per second/minute or level of
service is not reached.
Threadpool Limits are Configurable. The default in the configuration is 5 batch threads per instance of a
threadpool. This number was chosen to represent the heaviest processes in the product. It can be increased for
lighter processes.
Start Simple and Adapt. In your testing, determine a good starting point for the number of threads to submit for
any multi-threaded process. Monitoring the elapsed and number of objects processed per minute/second should
determine if you need to increase or decrease that number.
Consider Special Cases. In most implementations the data processed each execution of a process might yield the
same elapsed time overall but if the business has a special event that changes the amount to process then the
amount of threads for the duration of that event may need to increase or decrease. For example, if you are
expecting double the volume then you might need to increase the number of threads accordingly.
For the online submission and Oracle Scheduler Integration at least one threadpool must have the daemon running. This
daemon looks for pending work that has been submitted by these methods and submits it to the cluster on behalf of the
user. To use the daemon there are two places to set the value:
Daemon Settings By Submission Method
Online Submission (non- The following setting should be set to true using the configureEnv.sh -a command:
Production use only)
CONFIGUREENV SETTING ENVIRON.INI SETTING VALUE COMMENT
Online JVM Batch Server BATCHENABLED true Only set this value if you want the
Enabled online JVM to include the
threadpool. This is recommended
for demonstration environments.
Batch Scheduler Integration In the default threadpool template, using the bedit.sh -w command, ensure that the
daemon setting is set to true. For example:
...
daemon (true)
...
The daemon should exist in at least one threadpool in the architecture and once active will actively look for jobs that are in
pending status (with other appropriate attributes) and submits them to the architecture. Once the job has completed the
daemon will communicate the state back to the product. The future below summarizes this processing:
Note: This feature only applies to selected product supplied processes only. Batch Processes must be configured or written to
use this technique.
One of the features of the Oracle Utilities Application Framework is the ability to create timed batch processes. Typically,
most batch processes are executed as a single execution on a regular time period such as once a day, once an hour etc. In
some implementation scenarios, it is required to run a batch process continuously (such as a daemon) to process data as it
is found. The Oracle Utilities Application Framework introduced a feature to allow implementations to create processes that
are run continuously. The figure below illustrates the difference in the processing styles:
Use the bedit.sh -l l2cache command which will create a new template for use in the settings.
Set the following settings (settings not mentioned should remain as defaulted):
Level 2 Cache Settings
daemon false
l2 OFF
Create a threadpool named appropriately, for example L2OFF, with a minimum number of threads to process the
utilities. Remove all other pool settings. Save the settings.
When needed start the threadpool using the threadpoolworker.sh -l l2cache command.
Ensure the processes have the above threadpool as the recommended one to execute in.
BNR Batch Run Number This is the system generated run number
STARTTIME Start Date and Time This is the date and time of the start of the processing in the
format of the session
BATCH_THREAD_NBR Thread Number for execution This is the thread number. The BATCH, BNR, SCHID and
BATCH_THREAD_NBR are used as the key for the query.
ENDTIME End Date and Time This is the date and time of the end of the processing in the
format of the session
STATUS Status of process Status of the process. Either Completed (successful) or Error
(unsuccessful)
BATCH_BUS_DT Business Date The Business Date used to process these records. This can be
used to group executions across processes if necessary
BATCH_RERUN_NBR Batch Rerun Number If the process was a restart of an extract, then this will be
populated with the rerun number. A value of zero (0) is used to
denote processes that do not use this capability, or this is not a
rerun.
TIMESEC Seconds difference between This is the difference between STARTTIME and ENDTIME in
start and end date times seconds. Useful for calculations.
REC_ERR_CNT Error Record Count The number of records that errored in the thread.
To check this the following calculation must be performed on the above query:
Thread End Tolerance (TET) = Max(ENDTIME) - Min(ENDTIME) for a Batch Number (or SchId) for a Batch Control.
If this tolerance is within an acceptable limit, then there are no threads that are taking a much longer time to finish. If the
tolerance is above an acceptable limit, then there are outliers to examine. This may be caused by data skew.
To check this the following calculation must be performed on the above query:
Thread Start Tolerance (TST) = Max(STARTTIME) - Min(STARTTIME) for a Batch Number (or SchId) for a Batch
Control.
If this tolerance is within an acceptable limit, then there are no threads that are starting too late. If the tolerance is above an
acceptable limit, then there are outliers to examine. This may be caused by capacity or scheduler issues. These threads need
to be examined alongside what was happening at the same time.
Submission Record
The lower levels can override the higher levels when configured to do or at the appropriate time based upon submission
method.
Note: The MAX-ERRORS parameter is applicable to business errors only. System errors (SEVERE errors) will terminate the process
immediately.
There are two parameters that can be altered to control the amount of resources a background process uses when it
executes. While most implementations reuse the default values supplied with the product, it is possible to alter the values to
tune the performance of background processes and allow background processes to be executed during peak application
usage periods.
The Commit Interval parameter controls the Unit of work on the background process. It controls after how many primary
objects are processed before a commit point is taken, also known as commit frequency. It controls the amount of work the
database must do and when a checkpoint is taken for restart purposes. At the commit point in a background process, all the
HIGH VALUE FOR COMMIT INTERVAL LOW VALUE FOR COMMIT INTERVAL
Can increase throughput on lightly loaded system Can allow background to work harmoniously with online
Less Commits in process (Less checkpoints) More Commits in process (More frequent checkpoints)
Lower Concurrency (higher impact on other users) Higher Concurrency (lower impact on other users)
The second parameter Timeout (in minutes) controls how long a solution set is held by the process. When Oracle database
processes a set of records it typically holds a snap shot of these records to save processing time. If the set is held too long,
the records may not reflect the state of the database, so it is a good idea for the Oracle database to maintain the currency of
this data regularly. Within the background process this is controlled by setting this value to prevent the snapshot being
discarded by Oracle database and causing an abort. If the records are held too long an ORA-1555 Snaphot too old error is
generated and the process aborts.
The Timeout and Commit Interval parameters are tunable parameters to affect the impact of the background processes on
the other processes running and prevent internal database errors. It is also important to understand their impact to ascertain
whether any change is required. The following rules of thumb apply to setting the values:
It is recommended that the Commit Interval should not be set to one (1), unless otherwise instructed, as this value
may causes excessive database I/O and therefore performance degradation.
For light jobs (short duration, single threaded, small numbers of records etc), the default value for Commit Interval
may satisfy your site performance requirements.
For heavy jobs (long duration, multi-threaded, large number of records etc), then a value for Commit Interval of
between 5 (five) to 200 (two hundred) is recommended.
The value of the Commit Interval directly affects the size of the redo logs allocated to the database. The higher the
commit interval the larger the redo logs need to be to hold the in-process objects. Work with your sites DBA groups
to come up with a compromise between redo logs and Commit Interval.
During processing of any background process, a main object is used to drive the process. For example, in BILLING the main
object is Account. The BILLING process loops through the accounts objects as it processes. For other processes it is other
objects that are considered the main object. This main object type is used to determine when a transaction is complete.
For both Timeout and Commit Interval this is important as:
At any time in a process a commit for objects processed may be caused by the reaching the Commit Interval or the
time limit set on Timeout, whichever comes first.
The setting of Commit Interval and Timeout has impact on the amount of memory the JVM memory space
allocated to the individual threads. Higher values of both require more memory to hold the data.
One of the new features of the Oracle Utilities Application Framework is the ability to define the processing necessary for a
batch process without the need for creating a java-based extension in the Oracle Utilities SDK. This is known as Plug In Batch
and is designed to allow implementations to quickly build batch processes without the need for complex coding.
The idea behind Plug In Batch is that you can develop in a series of algorithms in Java, Scripting or Groovy (the latter two are
supported for Cloud implementations) to break a batch process into its constituent parts for processing. The Oracle Utilities
Application Framework will take care of any data access, restarting, checkpointing, multi-threading etc.
The following algorithms are available:
Plug In Batch Algorithms
Select Records This algorithm typically contains an SQL statement to filter the records to process
including threading
File Upload This algorithm is used for processing XML, Fixed or CSV formatted files
Process Record This algorithm takes the information from either Select Records or File Upload
algorithm to process the records appropriately. For file extracts, this algorithm
contains the logic to format the output
Post Processing This algorithm provides the ability to provide extra logic if the Process Record
processing is successful for the record set.
Error Post Processing This algorithm provides the ability to provide extra logic if the Process Record
processing is not successful for the record set.
The first algorithms (Select Records and File Upload) determine the set of records to process for the batch process. Each
record is passed to a Process Record algorithm to process the object (for file extracts that means formatting and writing
records). Optionally, if required, if the process is successful then extra logic can be executed in the Post Processing
algorithm. Conversely, if required, if the process is not successful then extra logic can be executed in the Error Post
Processing algorithm. The figure below illustrates this processing:
Generic Templates
The Oracle Utilities Application Framework provides a set of template batch controls, based upon base classes, that can be
cloned and used as a basis for custom plug in batch processes. This section will outline the features of the templates and
how they can be used to satisfy requirements.
A summary of the processing as well as generic example algorithms available with the product, is shown in the flow below:
Note: Additional examples are supplied with products under the Batch Control – Select Records Algorithm Entity.
Select Records Algorithm. This is the algorithm that contains the SELECT SQL statement to filter the records to be
processed.
Process Record Algorithm. This the algorithm that takes each record passed from the Select Records algorithm
and performs the process as required on that record. This algorithm can also contain additional filtering that is
programmatic in nature that cannot be expressed in the SQL statement.
A summary of the processing as well as generic example algorithms available with the product, is shown in the flow below:
File Adapter Support. The template can use the File Adapter capability to parameterize storage locations for reuse
across environments as an input File Path. Non-SaaS implementations this File Path can be located within local
storage and SaaS implementations can utilize Object Storage.
Multiple Formats. As with the export plug in batch template, the upload process supports delimited files, fixed files
and XML based files. Unlike the export process, the format chosen is explicit within the Process Record algorithm.
File Pattern Support. The specification of the filename can use wildcards to implement file patterns. In this case
the process the File Path location looking for files that match the pattern configured. The file pattern should use
glob syntax.
Configurable Character Encoding. As with the export capability, the import can support a configurable java
character sets that represents the encoding used on the files to be imported. By default, this is set to UTF-8.
Configurable Processed File Extension. Once a file is successfully processed it is renamed to include an extension
so that it is ignored for further processing. By default, this extension is PROCESSED.
Files Not Found Conditions. If no files are found with the file pattern or file name configured, you can configure
the process to ignore the fact that no files were found or return an error condition. The default is to return an error
if no files are found.
Header and Footer Support. As with the export capability, the Process Records algorithm has capabilities to detect
when the record is the first (header) or last (footer) for specialist processing, if required.
Decompression Support. In Oracle Utilities Application Framework 4.4.0.2.2 and above, it is possible to have the
import file automatically decompressed using the zip or gzip format using the appropriate file suffix on the file
name.
To help with the use of the template, several sample plug in scripts are available to process different formats:
SCRIPT USAGE
A summary of the processing as well as generic example algorithms available with the product, is shown in the flow below:
Using Templates
Note: Whilst the templates are fully featured, examine algorithms shipped with similar batch controls for additional examples.
The provision of template is designed to streamline the development process for plug in batch. To use the templates,
perform the following:
Copy the template batch control to a custom batch control.
Configure the appropriate algorithms for the use cases for the batch process. These are configured on the batch
control. In the past sections, several samples can be copied, and those copies modified to suit your needs. Remove
any capabilities in those algorithms not necessary.
Configure the parameters for the custom batch control as you require.
Note: For additional advice for Batch Level of Service refer to the Calling Batch Level of Service, Configuring Batch Level Of
Service, Building a custom Batch Level Of Service Algorithm and New Batch Level Of Service Algorithms articles.
Note: This capability is available on Oracle Utilities SaaS Cloud Services and on-premise implementations (including PaaS and
IaaS implementations). There are exclusive capabilities for Oracle Utilities SaaS implementations which will be indicated
appropriately.
In the Oracle Utilities products there is an inbuilt batch service level monitoring capability called Batch Level Of Service. This
capability, using configuration, assesses level of service using various metrics and batch instance run-time information to
produce the level of service and a message describing the service level. Once configured this capability can be used to
assess the service level associated with batch at any time using various avenues within the cloud service.
The Batch Level Of Service features the following capabilities:
Ability to define pre-built metrics to assess level of service. The product provides a library of metrics that can be
used to define how to assess the level of service.
Ability to define both warning and error target values. The Batch Level Of Service allows for a configuration of a
warning target to provide proactive detection of potential issues as well as an error target to detect unacceptable
performance.
Support for Individual batch jobs or job streams. The Batch Level Of Service can be configured to apply to
individual batch controls and/or job streams. Job Stream support is only available on the Oracle Utilities SaaS Cloud
if the inbuilt provided scheduler is used.
Support for multiple metrics and targets. The Batch Level Of Service supports multiple metrics and targets
allocated to individual batch controls and/or job streams. If multiple batch level of service configurations is
allocated, then the capability will assess each configuration and return the worst case of all assessments as the
overall assessment.
Flexibility on what run-time statistics are used. The library of pre-built metrics can assess the targets against
currently running executions, latest completed execution or both. The latter allows for flexibility to assess metrics
against running execution during the execution and then use completed execution for completed jobs or streams
(Oracle Utilities SaaS Cloud Services only). This means level of service can be assessed at any time for flexible
monitoring.
Multiple assessment interfaces. The invocation of the assessment is available automatically via the Health Check
portal, Health Check REST API and Batch Control maintenance functions. It can be also programmatically invoked
at any time using a provided business service.
Transparent to Execution. The Batch Level Of Service does not impact the execution of the batch processes that
they track as they read batch run statistics from batch instance tables maintained by the Oracle Utilities Application
Framework. The assessment is only performed when requested via the relevant API's or interfaces provided.
SCRIPT USAGE
K1-HCBJSLOS Batch Level Of Service for Batch Job Stream. This should only be configured if you are using the inbuilt
batch scheduling capability provided with the cloud service, directly or indirectly (via an external
scheduler). Customers using external schedulers to micromanage individual jobs cannot not use this
algorithm as the internal scheduler would not expose those metrics to the capability. For those
customers, it is recommended to use the SLA functionality provided by the external scheduler, if
available.
Note: This capability is exclusive to the Oracle Utilities SaaS Cloud Services and only if the inbuilt
scheduler is used on that cloud service.
Concepts
The Batch Level Of Service is an algorithm based assessment process which takes run metrics from batch instance tables to
assess performance against defined targets to produce a state and a message describing the level of service assessment.
This algorithm can be used with individual batch controls and/or Job Streams.
The concepts related to the Batch Level Of Service are as follows:
Batch Controls and Job Streams. The assessment of level of service is targeted at Batch Controls and Job
Streams. Job Streams are only supported if the inbuilt scheduling capability of the service is used for scheduling
jobs. Customers using external schedulers to schedule jobs cannot use this capability for external job streams. Job
Stream support is only available on the Oracle Utilities SaaS Cloud if the inbuilt provided scheduler is used.
Metrics are used to assess level of service. The capability includes a library of metrics, delivered as pre-
configured Algorithm Types, that are used to assess level of service. The metrics can be extended using
ConfigTools to add custom metrics as necessary.
Batch Instance Statistics are used to assess level of service using Status Applicability. The Batch Level of
Service can use statistics from executing processes or the statistics from the latest completed process to allow level
of service to be assessed at any phase of execution. Additionally, the provided level of service assessment process
can use both executing or completed for maximum flexibility in assessments.
Multiple Tolerances are supported. Whilst the service can be assessed for unacceptable behavior, the base Batch
Level Of Service capability supports a warning level as well. This promotes proactive monitoring.
Batch Instance Records are Used for Assessment. The batch architectures create batch instance records no
matter how a batch job is submitted collecting information on submission, execution and completion.
Returned Level Of Service And Message. Using the calculation of statistics batch instance records and the
tolerances, the Batch Level Of service returns the level of service and a message describing the level of service.
Time Between Compare Error Count and Time F1-BAT-LVSVC Batch Control
Executions Since Completion
Elapsed Time Compare Total Batch Run Time to F1-BAT-RTLOS Batch Control
Threshold Threshold
Not Started On Time Batch Job Not Started in X Minutes K1BATJNSXM Batch Control
Job Ran Too Long Batch Job Ran Longer Than Average K1BATLOSRTL Batch Control
(Relative)
Throughput Too Low Batch Job Throughput Lower Than K1BATLOSTTL Batch Control
(Relative) Average
Batch Job Stream Not Compare Batch Job Stream run date K1BJSDJNSXM Batch Job Stream
Started in X Minutes plus threshold to current time
Job Stream Ran Too Batch Job Stream Ran Longer Than K1BJSDJRTL Batch Job Stream
Long (Relative Run) Average
Batch Job Stream Has Batch Job Stream Has Failed K1-BJSD-LVSV Batch Job Stream
Failed
Status Applicability
Note: These settings are applicable to the base provided algorithm types. They may not apply to custom algorithm types.
The base level of service algorithm type support configuring the latest batch instance records to be used as part of the
assessment. These can be configured on the individual Algorithms configured to be used on Batch Controls or Job Streams.
The Status Applicability settings are as follows:
Status Applicability
In Progress Assess against the current batch runs that I This is recommended only to be used when
are in progress. If this value is set and there you have monitor jobs that are run
is no batch run currently in progress, the continuously or in timed mode.
Complete Assess against the most recent completed C This is recommended to be used for jobs that
batch run. are not actively monitored during execution.
This is used when after the fact monitoring is
exclusively performed.
Both Assess against current executing batch run if B This is recommended for most assessments to
the process is executing. If there is no cover both executing and completed processes
running process, then the most recent effectively. This allows you to assess in context
complete batch run for assessment. to when the assessment is requested.
Setting Thresholds
The last piece of the algorithm configuration is to set two thresholds to be used in assessment.
Thresholds
THRESHOLD COMMENTS
Warning This tolerance is used to proactively detect the threshold is close to the error level but sufficiently below
that it should be addressed before it exceeds the error threshold. This should be set to a value that is
enough to generate a warning appropriately but not so close to the error threshold that it does not give
you enough time to address the situation appropriately.
Error This tolerance is used to detect potentially unacceptable behavior in relation to the level of service.
Note: The base algorithm types supplied are provided with source code that can be copied and used as a basis for your own
algorithms.
Create an algorithm. Use Add (or copy) to create a new algorithm with the following details:
− Choose the appropriate Algorithm Type. From the library of available algorithm types select the
algorithm type that will use the appropriate metric to use in the calculation.
− Choose the appropriate Status Applicability. If using the provided algorithm types, decide whether you
want to use In Progress, Completed or both statistics in your calculation.
− Set your Warning and Error Threshold. Set the warning and error tolerances to appropriate values.
− Name the Algorithm appropriately. To ensure you find the algorithm easily to attach to the batch
controls and/or batch streams (Oracle Utilities SaaS Cloud only), name it appropriately.
For example:
Save the Changes. Save the changes to reflect the algorithm onto the Batch Control.
Confirmation. You can confirm the change by looking at the Level Of Service assessment on the Main tab of the
Batch Control maintenance.
For example:
For example:
Note: The Health Check is also available as a REST API for external monitoring tool use. Refer to the documentation for
additional information about the API.
Figure 34. Example Batch Level Of Service within Batch Control Maintenance
This is useful for verifying after making algorithm changes and saving those changes.
Note: The schema above is the schema at the time of publication and may differ from the schema delivered.
To use this service, you need to populate the batchControlId input parameter when calling the service for the service to
return the message and levelOfService.
This business service can be invoked from an extension in the following ways:
Service Script. Include the F1-BatchLevelOfService service as a Data Area attached to the script and use
invokeBS to call the business service. For example:
One of the common use cases is being able to poll the Health Check on a regular basis within a script executed from an on-
premise (or another cloud) to pull the information into another system (such as a management console) or trigger
notifications via a company notification system. The focus is to call the curl command shown in the previous section,
interpret the results (either the overall status or individual status values) and take the appropriate action using an
appropriate channel.
To do this the curl command is incorporated into an appropriate scripting language to form the basis of processing.
Refer to Oracle Utilities System Health Check Probe (Doc Id: 2711546.1) available from My Oracle Support for a sample script
that illustrates a common processing structure for formatting the call via curl (to avoid hardcoding), interpreting the results
and then taking a configured action.
Concepts
Before outlining the techniques and processes for optimizing there are several concepts that must be understood:
Schedulers are responsible for calendaring. The scheduler is responsible for running the jobs and their
dependencies where and when it is necessary. This is associated with a calendar which governs applicable times
and dates for execution.
Schedulers interface to resource management capabilities. One of the other important characteristics of a
scheduler is the ability to take capacity into account when scheduling processes. This helps the execution adhere to
any physical or implied resource constraints.
Jobs are grouped into Job Streams. Regardless of the scheduler and its individual terminology, jobs (instances of
a batch control to be executed) are grouped in logical streams (a.k.a. job streams) with the expression of
dependencies and a calendar. Terminology for these concepts may vary but for the purposes of this document the
terms job and job streams will be used.
Serial and parallel processing is supported. When using a scheduler, job streams are not restricted to a serial
sequence of individual jobs as this is not efficient unless dependencies restrict the stream to be serial. In any
collection of dependencies, the concept of parallel jobs running is typically recommended within resource
constraints.
Critical Jobs need to be run as early as practical. In any depiction of a job stream, based upon execution times
and business direction, there will be a subset of the stream that are considered critical jobs. These are business
important jobs or jobs that can influence the overall elapsed time of a job stream. The goal of any optimized
schedule is to try and schedule these types of processes as early as practical and with efficient access to resources
to maximize throughput.
These concepts will be used across each of the schedule optimization techniques.
Identify business critical processes. In every schedule there are a handful of jobs that are considered business
critical. These are the main processing that must be performed during the schedule. They will become the focus of
optimization as their efficient execution will help ensure success, therefore quickly identifying them is important.
Adjust dependencies for critical processes. The goal of scheduling is not only to run each job but run them
efficiently. The key to success is therefore to ensure that the critical jobs are run with enough resources and as early
as possible to improve overall efficiency. This means adjust less critical jobs to be "out of the way" of the critical
jobs, either after the critical jobs or in parallel to other less critical jobs to help get them complete before the critical
job. Dependencies that are necessary still need to be respected. For example, dedicated To Do batch processes in
an overnight process are typically scheduled alongside jobs that pertain to. Whilst, this seems logical, as To Do
processes are manually processed by humans during business hours, so therefor may be shifted to later in a
schedule safely whilst freeing up time for more critical processes.
Examine each dependency using several dimensions. Examine each individual dependency to ascertain whether
the relationship is necessary for data, status or resource purposes. Unnecessary dependencies may artificially
lengthen the overall duration of a schedule. If the dependency is not needed, then adjust the dependencies
accordingly including running the jobs in parallel or in a different location in the schedule.
Use Parallel Processing effectively. In adjusting dependencies one of the techniques is to consider running more
jobs in parallel. Whilst, this is valid, running too much at the same time can be inefficient from a resource
perspective. Balance running jobs in parallel with the resource usage for each job to ensure the jobs run within your
resource constraints. Remember at any point in time, the cumulative number of active threads needs to be
considered against the thread limits to avoid delayed threads (this may be detected where individual thread start
times vary across a range). For example:
Note: This technique is best used with schedules are run multiple times or in an interval to skip individual executions.
A scenario that arises from time to time is to prevent an execution of a stream due to a condition or the stream will only
proceed if a condition is met. The conditions for this can vary from simply detecting another stream is executing to complex
To implement this logic in your schedule the following process should be undertaken:
Create a Service Script with the Logic. Create a service script containing the logic you want to implement passing
in any parameters in the Batch Control configuration, to avoid hardcoding. For example, to check other streams are
active in the inbuilt scheduler implementation for SaaS customers, use the F1-DBMSGetJobDetails business
service to check the execution status of another flow with the name element containing the name of the Job
Stream and the isInProgress boolean being used to ascertain the running state of the job and the appropriate
termination statement (optionally with message code). If your script requires custom messages, ensure the
messages used are configured prior to implementing the script.
Note: For customers on Oracle Utilities SaaS Cloud implementations, the Cloud Service Foundation includes several
sample scripts such as K1InvokePAS provide ways to process parameters using advanced techniques.
Create a Batch Control. Create a Batch Control to house the logic for the job. For Oracle Utilities SaaS Cloud
customers clone the provided Batch Control K1-IPAIS (Post Activation Installation Scripts). This batch control has
several parameters including a script name and parameter, with up to five (5) scripts supported. The parameter can
be used to pass in a value to each script to compare against.
Configure the Batch Control to use the script. Configure the batch control with the script configured and any
parameter on the job you want to pass in.
Alter the Job Stream. All the new job to the job stream in the appropriate place. Alter the dependencies according
to the logic. To bypass the stream, the end event should make this new job a prerequisite with the appropriate
conditions.
Anytime the stream is now executed, the new job will determine the conditions and depending on the result take the
appropriate action.
This technique can be used for a variety of use cases including cross stream checks.
Copyright © 2020, Oracle and/or its affiliates. All rights reserved. This document is provided for information purposes only, and the contents hereof are subject to change without
notice. This document is not warranted to be error-free, nor subject to any other warranties or conditions, whether expressed orally or implied in law, including implied warranties
and conditions of merchantability or fitness for a particular purpose. We specifically disclaim any liability with respect to this document, and no contractual obligations are formed
either directly or indirectly by this document. This document may not be reproduced or transmitted in any form or by any means, electronic or mechanical, for any purpose, without
our prior written permission.
Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners.
Intel and Intel Xeon are trademarks or registered trademarks of Intel Corporation. All SPARC trademarks are used under license and are trademarks or registered trademarks of
SPARC International, Inc. AMD, Opteron, the AMD logo, and the AMD Opteron logo are trademarks or registered trademarks of Advanced Micro Devices. UNIX is a registered
trademark of The Open Group. 0120