TV 3.7.0
Before one can add bdomain specific metadata to a CDC watcher, a bdomain has to exist and bdomain settings have to have been added. This can be achieved by following the first chapters of the following HowTo Guides:
Furthermore a CDC group and a CDC watcher have to exist as well, which can be added by following the first chapters of the HowTo Guides below:
To add bdomain specific metadata to a cdc watcher the script API_DBIADM.ADD_CDCG_WATCH_BD is used. One has to provide the name of the cdc group and bdomain that have been created in the steps before. Furthermore, a value for the source database and source connection have to be provided if a schema and table have been provided for creating the watcher, otherwise a null value has to be used. Additionally one has to choose if the watcher should be active or not and if there should be an offset for the bdate change. A source where clause can be used to differentiate between bdomains and the minimal interval between two triggers for the cdc watcher can be set as well if the watcher was configured for triggers. This minimal interval is used to prevent triggers from reading from the same table at the same time.
EXECUTE SCRIPT API_DBIADM.ADD_CDCG_WATCH_BD(
'tst_cdc_grp' -- p_cdc_group
,'TESTING' -- p_bdomain
,null -- p_src_db_name
,null -- p_src_connection
,null -- p_bdate_change_offset
,null -- p_scr_where_clause
,false -- p_active
,null -- p_cdc_min_intv
);
This command results in a new entry in the table DBIADM.DBI_CDCG_WATCH_BD.
cdc_group | bdomain | src_db_name | src_connection | bdate_change_offset | src_where_clause | active | cdc_min_intv |
---|---|---|---|---|---|---|---|
tst_cdc_grp | TESTING | (null) | (null) | (null) | (null) | false | (null) |
If one wants to modify any of the variables of a watcher connected to a bdomain, one has to provide the name of the cdc group the watcher belongs to as well as the name of the bdomain the watcher is connected to, to the script API_DBIADM.MODIFY_CDCG_WATCH_BD. Furthermore, one has to provide the new value for the variable one wants to change and by providing a null value for the rest, the current value will be kept for those variables.
In the example below, the watcher is set to active, while the rest of the variables stay the same.
EXECUTE SCRIPT API_DBIADM.MODIFY_CDCG_WATCH_BD(
'tst_cdc_-grp' -- p_cdc_group
,'TESTING' -- p_bdomain
,null -- p_src_db_name
,null -- p_src_connection
,null -- p_bdate_change_offset
,null -- p_scr_where_clause
,true -- p_active
,null -- p_cdc_min_intv
);
The command above will change the entry in the table DBIADM.DBI_CDCG_WATCH_BD as follows:
cdc_group | bdomain | src_db_name | src_connection | bdate_change_offset | src_where_clause | active | cdc_min_intv |
---|---|---|---|---|---|---|---|
tst_cdc_grp | TESTING | (null) | (null) | (null) | (null) | true | (null) |
To remove bdomain specific metadata from a cdc watcher one only has to provide the name of the cdc group as well as the name of the bdomain to the script API_DBIADM.REMOVE_CDCG_WATCH_BD as can be seen in the example below.
EXECUTE SCRIPT API_DBIADM.REMOVE_CDCG_WATCH_BD(
'PERS' -- p_cdc_group
,'TESTING' -- p_bdomain
);
After having issued the command above, the entry for the cdc group 'tst_cdc_grp' for the bdomain 'TESTING' will have been removed from the table DBIADM.DBI_CDCG_WATCH_BD.