Configure Load Control
Applies to
Platform: Microsoft SQL Server · Oracle
Configuring load control registers every loader of your project as a load object with its dependencies, so that execution plans can run them in order. The generated deployment does it for you; use this workflow to check the configuration after a deployment or to run it again after a model change. Afterwards the load configuration of your project lists the load objects of all active model objects.
This workflow applies to the native load control. For the concepts, read Understand Load Control.
Prerequisites
- LoadControl Options contains
Native Load Control, and Configure LoadControl istrue(the default). - Artifacts are generated, the placeholders are replaced, and the load control is deployed, either by this project (Deploy LoadControl
true) or by the project that owns a shared load control.
What the deployment registers
The generated deploy.sql calls LoadControl\configure_loadcontrol.sql after the layers and the load-control deployment. It runs one script per layer, for example LoadControl\L010_Stage_Configuration.sql. Each layer script does three things:
- It calls
Build_LoadConfigwith the project name as load configuration, for exampleDatavault.Mssql. The procedure deactivates the layer's load objects and deletes their dependencies. - It calls
AddOrUpdate_LoadConfig_LoadObjectonce per loader. An existing load object keeps its ID and is activated again. - It calls
AddOrUpdate_LoadConfig_LoadObject_Dependencyonce per dependency.
Deactivated model objects have no load objects. The view LoadConfig_LoadObject_Dependencies lists each load object with the objects it depends on.
Run the configuration again
- Generate the artifacts and replace the placeholders.
- Open a terminal in the folder of the replaced artifacts. The
:rincludes of the scripts are relative to it. - Run
sqlcmd -S <server> -E -i LoadControl\configure_loadcontrol.sql, or deploy the whole project withdeploy.ps1.<server>is your SQL Server instance; the scripts switch to the load-control database of the replacement configuration (loadcontrol#loadcontrol#database_name). The configuration scripts print no result rows; check the result as described below.
You can also create load configurations of your own with AddOrUpdate_LoadConfig, AddOrUpdate_LoadConfig_LoadObject and AddOrUpdate_LoadConfig_LoadObject_Dependency, and execution plans as described in Plan Load Control.
Manually created load configurations and execution plans are deleted when load control is deployed again. Keep their scripts and run them after each deployment with Deploy LoadControl set to true.
Check the result
Count the active load objects per layer:
SELECT [lo].[ModelObjectLayer], COUNT(*) AS [LoadObjects] FROM [LC].[LoadConfig] AS [c] JOIN [LC].[LoadConfig_LoadObject] AS [lo] ON [lo].[FK_LoadConfig_ID] = [c].[ID] WHERE [c].[LoadConfig] = N'Datavault.Mssql' AND [lo].[IsActive] = 1 GROUP BY [lo].[ModelObjectLayer];
The query returns one row per layer with the number of load objects. Replace LC with your load-control schema and Datavault.Mssql with your project name.
Example
The Data Vault Test Project Datavault.Mssql registers 103 load objects in three layers. After a second deployment with Deploy LoadControl false, the table still holds 103 load objects with the same IDs, and an execution plan created before the deployment still runs.
Failure symptoms and recovery
A model object has no load object
Cause: the model object is deactivated, so the generator writes no loader for it.
Fix: activate the model object and generate again. See Troubleshoot generation, deployment and load failures.
On Oracle the configuration fails with ORA-01400
Message: ORA-01400: cannot insert NULL into (...LOADCONFIG_LOADOBJECT."SCHEMA_NAME")
Cause: a schema placeholder of a layer is empty in the replacement configuration (Oracle).
Fix: set all placeholder values, replace the placeholders again and rerun the configuration.
Platform differences
Oracle uses the same steps with these names:
- Procedures
PR_Build_Loadconfig,PR_Add_Or_Update_Loadconfig_Loadobject,PR_ADD_Loadconfig_Loadobject_Dependency. - Tables
Loadconfig,Loadconfig_Loadobject,Loadconfig_Loadobject_Dependency; viewsV_Load_Conf_All,V_Load_Conf_Dependencies. deploy.sqlis a SQL*Plus script;configure_loadcontrol.sqlconnects with the load-control user from the replacement configuration.
Related articles
- Previous: Understand Load Control
- Next: Plan Load Control
- Reference: Configure LoadControl (Project), Deploy LoadControl (Project), LoadControl Options (Project)
- See also:
- Microsoft SQL Server: Load data - Native Load Control
- Oracle: Load data - Native Load Control