3. Manage BDomain Metadata of a CDCG Watcher

Make sure that the BDomain and related BDI settings exist:

Make sure that a CDC group and a watcher already exist:

3.1. Add BDomain specific Metadata to a CDC Watcher

To add BDomain specific metadata to a cdc watcher use API_DBIADM.ADD_CDCG_WATCH_BD. Values for the source database and source connection have to be provided only in case a source table was specified for the watcher expression. p_bdate_change_offset … An optional where-clause (‘p_scr_where_clause’) may be introduced in order to filter out rows when detecting a change (used for separation of BDomains within the same table or view). The watcher may be set active or inactive for this very BDomain. This minimal interval (‘p_cdc_min_intv’) is used to prevent triggers from reading from the same table at the same time.

Example

 1EXECUTE SCRIPT API_DBIADM.ADD_CDCG_WATCH_BD(
 2   'tst_cdc_grp'  -- p_cdc_group
 3   ,'TESTING'     -- p_bdomain
 4   ,null          -- p_src_db_name
 5   ,null          -- p_src_connection
 6   ,null          -- p_bdate_change_offset
 7   ,null          -- p_scr_where_clause
 8   ,false         -- p_active
 9   ,null          -- p_cdc_min_intv
10);

This command results in a new entry in the table 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)

3.2. Modify BDomain specific CDC Watcher

Modify the watcher using API_DBIADM.MODIFY_CDCG_WATCH_BD. Providing NULL leaves the parameters as is, while a blank (’ ‘) restores the default value. In the example below, the watcher is set to active, while the rest of the parameters stay the same.

Example

 1EXECUTE SCRIPT API_DBIADM.MODIFY_CDCG_WATCH_BD(
 2   'tst_cdc_-grp'  -- p_cdc_group
 3   ,'TESTING'     -- p_bdomain
 4   ,null          -- p_src_db_name
 5   ,null          -- p_src_connection
 6   ,null          -- p_bdate_change_offset
 7   ,null          -- p_scr_where_clause
 8   ,true          -- p_active
 9   ,null          -- p_cdc_min_intv
10);

The command above will change the entry in the table 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)

3.3. Remove BDomain Specific Metadata from a CDC Watcher

To remove BDomain specific metadata from a CDC watcher use API_DBIADM.REMOVE_CDCG_WATCH_BD.

Example

1EXECUTE SCRIPT API_DBIADM.REMOVE_CDCG_WATCH_BD(
2   'PERS'       -- p_cdc_group
3   ,'TESTING'   -- p_bdomain
4);

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 DBI_CDCG_WATCH_BD.