3. Manage Appplication Components¶
Make sure that you have already created an application:
3.1. Add Database Objects to the Application¶
Using the script API_REDADM.ADD_APP_DISCOVER_RULE adds database objects based on search rules.
These search rules can be defined using regular expressions without ‘^’ and ‘$’ which are implicitly added.
The search rules can be defined to include and exclude patterns from schemas and tables.
While the inclusion patterns are mandatory, the exclusion patterns are optional.
The definition of an application name and the name of the BDomain are mandatory as well while a comment for a rule is optional.
The example below adds objects with the exact name ‘TEST_TAB’ from schemas which have ‘TEST’ in their name excluding schemas which end with ‘_RAW’. For all objects only the BDomain ‘TEST’ should be taken into account.
Example
1EXECUTE SCRIPT API_REDADM.ADD_APP_DISCOVER_RULE(
2 'test_app' -- p_app_name
3 ,'.*_TEST_.*' -- p_schema_incl_pattern
4 ,'.*_RAW' -- p_schema_excl_pattern
5 ,'TEST_TAB' -- p_table_incl_pattern
6 ,NULL -- p_table_excl_pattern
7 ,'TEST' -- p_bdomain
8 ,'Adding objects to the Test-Application' -- p_rule_comment
9);
After the discover rule has been added, it can be found in RED_APP_DISCOVER_RULES.
RULE_ID |
APP_NAME |
SCHEMA_INCL_PATTERN |
SCHEMA_EXCL_PATTERN |
TABLE_INCL_PATTERN |
TABLE_EXCL_PATTERN |
BDOMAIN |
RULE_COMMENT |
---|---|---|---|---|---|---|---|
3 |
test_app |
.TEST. |
.*_RAW |
TEST_TAB |
(null) |
TEST |
Adding objects to the Test-Application |
Modify the discover rule
To modify the discover rule use API_REDADM.MODIFY_APP_DISCOVER_RULE. Fetch the ID of the rule first from the table RED_APP_DISCOVER_RULES. Providing NULL leaves the parameters as is, while a blank (’ ‘) restores the default value.
In the example below only the schema exclusion pattern and the rule comment are being changed.
Example
1EXECUTE SCRIPT API_REDADM.MODIFY_APP_DISCOVER_RULE(
2 3 -- p_rule_id
3 ,'test_app' -- p_app_name
4 ,null -- p_schema_incl_pattern
5 ,'.*_(RAW|BA)' -- p_schema_excl_pattern
6 ,null -- p_table_incl_pattern
7 ,null -- p_table_excl_pattern
8 ,'modifying discover rule' -- p_rule_comment
9);
After issuing the command above the rule entry in table RED_APP_DISCOVER_RULES will have changed and look as follows:
RULE_ID |
APP_NAME |
SCHEMA_INCL_PATTERN |
SCHEMA_EXCL_PATTERN |
TABLE_INCL_PATTERN |
TABLE_EXCL_PATTERN |
BDOMAIN |
RULE_COMMENT |
---|---|---|---|---|---|---|---|
3 |
test_app |
.TEST. |
.*_(RAW|BA) |
TEST_TAB |
(null) |
TEST |
modifying discover rule |
3.2. Remove a Discover Rule from an Application¶
By removing a discover rule using API_REDADM.REMOVE_APP_DISCOVER_RULE all related object are no longer part of the application. The rule id can be found in the table RED_APP_DISCOVER_RULES.
Example
1EXECUTE SCRIPT API_REDADM.REMOVE_APP_DISCOVER_RULE(
2 3 -- p_rule_id
3);
The entry in the table RED_APP_DISCOVER_RULES for the ‘test_app’ rule will be removed, after the script above is being issued.