Command hvractivate loads a replication channel. It encapsulates all steps required to generate and load the various components needed to enable replication of channel chn. 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.
This section describes the options available for command hvractivate.
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 hvractivate will drop and recreate the components associated with the channel, such as HVR 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 hvractivate -d.
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 hvractivate 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 -iinteg_recov with hvractivate command. For example, if there are three target locations - tgt1, tgt2, and tgt3, then you can use hvractivate -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 hvractivate with option -i:
When BurstIntegrate is executed then define action Integrate with parameterResilient to avoid the error triggered due to the rows that are already available (processed by a previous integrate cycle) in the target location.
When ContinuousIntegrate is executed then HVR automatically skips the rows that are already 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 hvractivate with option -os. If ContinuousIntegrate is to be executed after clearing the state tables then define action Integrate with parameterResilient to avoid the error triggered due to the rows that are already available (processed by a previous integrate cycle) in the target location.
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.
hvr_tx_seq=number: Emit from a specific HVR 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 HVR transaction sequence number where hvr_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.
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.
Character '!' can be treated as a special (reserved) character in certain shells. Therefore, use single quotes (' ') or a back slash (\) when specifying the location(s) to be excluded. For example:
hvractivate -l '!myloc' myhub mychn
hvractivate -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 hvractivate.
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.
Several -oS instructions can be supplied together (e.g. -octp) which causes hvractivate to effect all components indicated. Not specifying the -o option implies all components are affected (equivalent to -osctpreljf).
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 hvrlogin 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.
Character '!' can be treated as a special (reserved) character in certain shells. Therefore, use single quotes (' ') or a back slash (\) when specifying the table(s) to be excluded. For example:
hvractivate -t '!tbl' myhub mychn
hvractivate -t \!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 hvractivate.
This section provides examples of using the hvractivate 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).
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.
hvractivate -J cap -J integ -i oldest_tx -oje myhub mychannel