Execute Load Control
Executing the Load Control means loading the data by following an execution plan. This is done in several steps:
- Create an execution log with a step for each load object part of the execution plan
- Create a list of dependencies between these load objects
- Start one or more execution threads that execute all load objects in the appropriate order
Please find more details about Load Control execution plans here: Plan Load Control.
All the details for each target technology can be found here: Load data with a native load control.
It is possible to execute a load with several threads.
The default execution generated by biGENIUS-X contains a single thread.
Example
For example, in a Microsoft SQL Server Generator with a native Load Control, the executions are stored in the following tables:
- Execution: the execution (load) itself is identified by an ID that will be used in the other tables
- Execution_LoadObject_Dependency: the dependencies between the Load Objects added in the execution plan
- Execution_Step: the steps of the execution according to the execution plan
Execute a load
The execution is done in the LoadControl_Execution_XXXX.sql script (executed by the helper execute.ps1) by the following code:
--The execution plan name must be the same as in the Plan Load Control step
EXEC [LC].[Start_Execution] @ExecutionPlan = N'DEV_XXXX';
Cancel a running execution
An active execution can be canceled by setting the value of the column IsCanceled of the table Execution to 1.
The following procedure does this:
EXEC [LC].[Stop_Execution] @ExecutionPlan = N'DEV_XXXXX';
This procedure can also be used to terminate a broken execution. This will deactivate the active flag so that a new execution can be started.
Why cannot an execution be started
There can only be one active execution for each execution plan.
If another execution is still active, a new execution can not be started.
This can have multiple reasons:
- the other execution is still running: Check the state of the other execution. The process must be terminated before a new execution can be started. The procedure Stop_Execution can cancel the running execution.
- the other execution was not terminated correctly: Examine the execution log (table ExecutionStep). Check for the failures and fix them.
Resume an execution
If an execution step fails, all depending execution steps are disabled.
The execution is continued for the other steps.
The result of the execution is “finished with errors”.
There are execution steps that could not be executed.
The following tasks must be fulfilled before the execution can be resumed:
- Find the reason for the failure and fix it
- Stop the execution if it is still active (with the corresponding procedure).
Then the execution can be resumed. The following procedure does this:
EXEC [LC].[Resume_Execution] @ExecutionPlan = N'DEV_XXXX';
This procedure looks for an execution with steps that were not executed successfully. It creates a new execution log with log steps and dependencies for all steps that were not executed successfully. A new execution thread is started for this execution. It is handled like a “normal” execution. All maintenance and info procedures can be applied.
You can now monitor your Load Control.