During the execution of a loader set, the target tables will be populated by inserting the extracted rows into each table. These rows will form a referentially correct and complete (as specified by the extraction rules) collection of subset data. However, the Set Loader application cannot guarantee while the load operation is in progress that the rows will be continuously referentially correct. It would be practically impossible to ensure this. In effect, this means that the foreign keys must be disabled in the target schema for the duration of the load and re-enabled upon completion. If the foreign keys are disabled they will not generate errors and reject rows which temporarily have invalid referential relationships.
A Foreign Key Manager rule is a container which manages the execution of a number of subsidiary actions which perform the foreign key disable or enable. Foreign Key Manager rules can be defined in a loader set to automate the enable/disable process and are usually automatically generated when a loader set is created by the New Loader Set Wizard.
The implementation of the foreign key enable/disable operations as a manager rule was done to make the process simple and intuitive. An Oracle schema can have many foreign keys and each disable/enable action requires the execution of a distinct SQL statement. Each operation must be recorded in the log and any errors must be detected and reported. If such actions were configured as individual rules in the loader set, then the large quantity of such rules could visually overwhelm the loader set - leaving it hard to maintain the other load rules. It is much more efficient to collect all of the actions together under one rule which acts as a manager. The Foreign Key Manager Rule form provides the ability to view, configure and manage the foreign key disable/enable actions and the Foreign Key Manager rule itself controls the execution of the configured disable/enable foreign key operations. Errors and statistics are handled by the Foreign Key Enable/Disable rule and presented in a manageable summary form.
It is possible to configure the Foreign Key Manager to ignore a certain number (or all) of the errors received while processing the foreign key operations. This enables the Foreign Key Manager to continue operating even if errors occur. Be aware that ignoring the errors in the Foreign Key Manager just permits the Foreign Key Manager to complete as many operations as possible before returning an error and stopping the execution of the loader set. In other words, even if errors are ignored, any errors which occur during the foreign key disable/enable operations will mark the Foreign Key Manager rule as having failed and the error state will be reported to the DataBee software for handling once the actions have completed.
Important Note: The Foreign Key Manager rule is only aware of the foreign keys given to it by the Rule Controller. To refresh the list of foreign keys known to the Foreign Key Manager rule, first refresh the foreign keys in the Rule Controller using the Refresh Foreign Keys button on Options tab of the edit Rule Controller form. This retrieves an up-to-date list from the target schema. Once the Rule Controller has been updated, use the Refresh Foreign Key List button on the Foreign Key Manager Rule form to refresh the list inside the Foreign Key Manager rule.
Once the Foreign Key Manager rule has begun to execute, the foreign key disable/enable operations will proceed in parallel using the full number of threads specified on the Set Loader Run Statistics tab until all specified foreign keys have been operated on.
Foreign Key Manager rules are usually configured using Rule Blocks to run in disable mode as the very first rule in the loader set. A second Foreign Key Manager rule is configured to run in enable mode as the very last rule in the loader set. This ensures the foreign keys are disabled during the load operations and, hence, will not generate errors which would terminate the load process.
Foreign Key Manager rules are created by launching the New Foreign Key Manager rule form using the New Loader Rule button located on the bottom right of the main Set Designer form.
How to Create a New Foreign Key Manager rule