dssactivate - DSS 6 | Data Source Solutions Documentation

Documentation: dssactivate - DSS 6 | Data Source Solutions Documentation

dssactivate

Usage

<b>dssactivate</b> [<b>-R</b><em>url</em>] [<em>-options</em>]... <em>hub</em> <em>chn</em>

Description

Command dssactivate loads a replication channel. It encapsulates all steps required to generate and load the various components needed to enable replication of channel <em>chn</em>. These components include replication jobs and scripts, table enrollment information for log-based capture, etc. For more information about these components, see the concepts page Components for Activating Replication.

Command dssactivate corresponds to the Activate Replication dialog in the User Interface.

Options

This section describes the options available for command dssactivate.

Parameter Description
-b Run in the background, do not wait for the activation to complete.
-d

Deactivate a channel. This drops replication components only. If this option is not supplied, then dssactivate will drop and recreate the components associated with the channel, such as DSS scripts, internal tables, and any transaction files containing data in the replication pipeline. Only few components are preserved such as job groups in the Scheduler repository tables; these can be removed using dssactivate -d.

In the User Interface, this option corresponds to the Deactivate Replication option.
-E

Recreates (replace) enroll file for all tables present in the channel.

Using dssactivate -E is the same as dssactivate -osctprEljf.

In the User Interface Activate Replication dialog, this option corresponds to Replication Components.

-ix


Capture start moment (rewind). Activate channel to start capturing changes from a specific time in the past, rather than only changes made from the moment the dssactivate command is run. Capture rewind is only supported for database log-based capture and for capture from file locations when parameter DeleteAfterCapture is not defined.

Values of x may be one of the following:

  • oldest_tx: Capture changes from the beginning of the oldest current (not closed) transaction (transactions that do not affect channel's tables will not be considered) and emit from now.
  • time: Start capturing changes from a specific time in the past. Valid formats for time are YYYY-MM-DD [HH:MM:SS] (in local time) or YYYY-MM-DDTHH:MM:SS+TZD or YYYY-MM-DDTHH:MM:SSZ or today or now[±SECS] or an integer (seconds since 1970-01-01 00:00:00 UTC). For example, -i "2017-11-01 12:52:46" or -i 2017-11-01T12:52:46-06:30 or -i 2017-11-01T12:52:46Z or -i now-3600 (for one hour ago).
    This option can be used with option -I to define emit start time. If emit time (option -I) is not specified, then emit time will be same as capture time.
  • min: Capture all available changes in a file location.
  • integ_recov_all: Use existing integrate state tables to decide the rewind and emit start time for capture. This option is meant to be used in a hub failover scenario. The channel definition before and after the failure should be identical (action definition and tables) for this option to work successfully. This option uses data from integrate state table filled by the last integrate job.
    Note that activating target location(s) with option state tables will destroy the state in the state tables. For this reason you must activate the capture time separately without the state tables. Upon such failover it is recommended to not re-activate with option state tables. This option is available only in CLI.
  • integ_recov=integloc[:oldchn-cap-oldcaploc][:oldchn-integ-oldtgtloc]... : This option is similar to integ_recov_all. However, it has more advanced customization options to select a specific target location(s). Also, with this option, rewind is possible in case the name of the channel or source or target location(s) have been changed in the new setup. This option is available only in CLI. Following are a few examples/scenarios for using this option:
    Let us assume, before recovery, the name of the channel was channel1, source location was src1, and target location was tgt1.
    • If there are multiple target locations, you can also supply more than one -i integ_recov with dssactivate command. For example, if there are three target locations - tgt1, tgt2, and tgt3, then you can use dssactivate -i integ_recov=tgt1 -i integ_recov=tgt2 -i integ_recov=tgt3
    • integ_recov=tgt1 – pick rewind and emit time of capture and integrate to a specific (tgt1) only. This format can be used when there are multiple target locations and you want to recover the time of a particular target location.
    • integ_recov=tgt1:channel1-cap-src1 – when either channel or source location name has changed in the new setup. This (channel1-cap-src1) also indicates the name of the old capture job (before recovery).
    • integ_recov=tgt1:channel1-integ-tgt1 – when either channel or target location name has changed in the new setup. This (channel1-integ-tgt1) also indicates the name of the old integrate job (before recovery).
    • integ_recov=tgt1:channel1-cap-src1:channel1-integ-tgt1 – when either channel or source or target location name have changed in the new setup.

The following should be taken into consideration when executing Integrate after running dssactivate with option <b>-i</b>:

  • When Burst Integrate is executed, define the Integrate action with the Resilient parameter to avoid errors caused by rows that are already available (processed by a previous integrate cycle) in the target location.

  • When Continuous Integrate is executed, DSS automatically skips rows that have already been processed by a previous integrate cycle (the transaction sequence number for these rows is already available in the state tables). To forcefully Integrate these rows, the state tables should be cleared by executing dssactivate with the option <b>-os</b>. If Continuous Integrate is executed after clearing the state tables, define the Integrate action with the Resilient parameter to avoid errors caused by rows that are already available (processed by a previous integrate cycle) in the target location.

In the User Interface Activate Replication dialog, use the Capture Start Moment option to start capturing changes from a specific time in the past.

-Ix

Defines start emitting time. This option requires -i.

Values of x may be one of the following:

  • time: Emit changes from the specified moment of time. The time formats are the same as for -i option.
  • dss_tx_seq=number: Emit from a specific DSS transaction sequence number. The number can be given in a decimal or a hexadecimal form. If number contains decimal digits, only then it is decimal. Otherwise, if it starts with prefix 0x or contains hexadecimal digits A, B, C, D, E or F, then it is treated as hexadecimal.

    Since 6.1.5/5, this value is not supported for Db2 for Linux, Unix, and Windows configured with Database Partitioning Feature (DPF).

  • scn=number: Emit changes from a specified SCN. The number can be in a decimal or a hexadecimal form.
    For Oracle, this is equivalent to emit from DSS transaction sequence number where dss_tx_seq=scn*65536. In the User Interface Activate Replication dialog, this option corresponds to Delay Emission Until Oracle SCN.
In the User Interface Activate Replication dialog, use the Custom Rewind Time section of the Capture Start Moment option to define the time for emitting transactions.

-Jx

Job chaining. After replication activation, automatically start capture, integrate, and/or refresh jobs.

Values of x may be one of the following:

  • cap: Start capture job
  • integ: Start integrate job
  • refr: Start refresh job
  • refr_evid: Start refresh job with event ID refr_evid.
In the User Interface Activate Replication dialog, use the Force Start Replication Jobs option to start capture and integrate jobs after the replication activation.

-lx

Only activate replication for locations specified by x.

Values of x may be one of the following:

  • loc: Only location loc.
  • l1-l2: All locations that fall alphabetically between l1 and l2 inclusive.
  • !loc: All locations except loc.
  • !l1-l2: All locations except for those that fall alphabetically between l1 and l2 inclusive.

    The character '!' can be treated as a special (reserved) character in certain shells. In such cases, use single quotes (' ') or a back slash (\) when specifying the location(s) to be excluded. For example, dssactivate -l '!myloc' myhub mychn or dssactivate -l \!myloc myhub mychn

  • pattern: All locations matching the specified pattern. Pattern matching can be done using the special symbols *, ? or [characters], where '*' is any sequence of characters, '?' matches any character (exactly one), and '[]' matches a selection of characters. For example:

    • 'loc*' matches location names starting with 'loc'.
    • '*loc' matches location names ending with 'loc'.
    • 'loc?' matches location names 'loc1', 'loc2', 'loc3', but not 'loc12'.
    • 'a[c0-9]' matches location names with first letter 'a' and second letter 'c' or a digit.
    • 'a*|b*' Multiple patterns may be specified. In this case, the pattern matches location names starting with 'a' and 'b'.
  • @filename: All locations listed in filename (a .txt file containing location names, one per line).

Several -lx instructions can be supplied together to dssactivate.

In the User Interface Activate Replication dialog, use the Locations option to select specific locations.
-oS

Replication components S to generate for a channel.

Values of S may be one of the following:

  • c: Tables containing changes, e.g. burst, history and fail tables.
  • e: Extend enroll information for tables with log-based capture.
  • E: Recreate (replace) enroll file for all tables present in the channel.
  • f: Files inside file location's state directory.
  • j: Job scripts and scheduler jobs and job groups.
  • l: Supplemental logging for log-based capture tables.
  • p: Database procedures in database locations.
  • r: Router directory's transaction files. Also capture start time for log-based capture and file copy channels.
  • s: State tables in database locations, e.g. the toggle table.
  • t: Database triggers/rules for tables with trigger-based capture.

    The trigger-based capture method (Capture_Method=DB_TRIGGER) has been deprecated since 6.2.0/0.

  • u: Creates a new publication (CREATE PUBLICATION) in the source PostgreSQL database (since 6.2.5/0). For more information, see Generic PostgreSQL Configuration section in PostgreSQL Requirements.

Several -oS instructions can be supplied together (e.g. -octp) which causes dssactivate to effect all components indicated. Not specifying the -o option implies all components are affected (equivalent to -osctpreljfu).

In the User Interface Activate Replication dialog, use the Replication Components option to choose the types of objects affected during capture and integration.
-pN Indicates that SQL for database locations should be performed using N sub-processes running in parallel. Output lines from each subprocess are preceded by a symbol indicating the corresponding location.

-Rurl

Remote hub server. Access the hub server running on a remote machine, via the REST interface.

This option is required for remote CLI access. When using this option, command dsslogin should be run first, for authentication.
-ty

Only activate replication for tables specified by y.

Values of y may be one of the following:

  • tbl: Activate only table tbl.
  • t1-t2: Activate all tables that fall alphabetically between t1 and t2 inclusive.
  • !tbl: Activate all tables except tbl.
  • !t1-t2: Activate all tables except for those that fall alphabetically between t1 and t2 inclusive.

    The character '!' can be treated as a special (reserved) character in certain shells. In such cases, use single quotes (' ') or a back slash (\) when specifying the location(s) to be excluded. For example, dssactivate -l '!tbl' myhub mychn or dssactivate -l \!tbl myhub mychn

  • pattern: Activate all tables matching the specified pattern. Pattern matching can be done using the special symbols *, ? or [characters], where '*' is any sequence of characters, '?' matches any character (exactly one), and '[]' matches a selection of characters. For example:

    • 'tbl*' matches table names starting with 'tbl'.
    • '*tbl' matches table names ending with 'tbl'.
    • 'tbl?' matches table names 'tbl1', 'tbl2', 'tbl3', but not 'tbl12'.
    • 'a[c0-9]' matches table names with first letter 'a' and second letter 'c' or a digit.
    • 'a*|b*' Multiple patterns may be specified. In this case, the pattern matches table names starting with 'a' and 'b'.
  • @filename: Activate all tables listed in filename (a .txt file containing location names, one per line).

Several -ty instructions can be supplied together to dssactivate.

In the User Interface Activate Replication dialog, use the Tables option to select specific actions.

Examples

This section provides examples of using the dssactivate command.

Example 1. Activate channel with capture rewind

The following command activates channel mychannel, starts capture job at a specific time (2021-08-20T15:03:04+02:00), and emits changes starting from Oracle SCN (1286643358).

dssactivate -i 2021-08-20T15:03:04+02:00 -I scn=1286643358 -Jcap -Jinteg myhub mychannel
Example 2. Activate channel after definition change

The following command activates channel mychannel, recreates jobs, recreates (replaces) the enroll file for all tables present in the channel, then starts capture and integrate jobs.

dssactivate -J cap -J integ -i oldest_tx -oje myhub mychannel