From HVR
Jump to: navigation, search
Previous: hvrgui
Next: hvrlivewallet
Command Reference


hvrinit – Load a replication channel.


hvrinit [–options] hubdb chn


SC-Hvr-Initialize demo01 sqlserver Advanced StateTabs TxFiles.png

hvrinit encapsulates all steps required to generate and load the various objects needed to enable replication of channel chn. These objects include replication jobs and scripts as well as database triggers/rules for trigger–based capture and table enrollment information for log–based capture.

The first argument hubdb specifies the connection to the hub database. This can be an Oracle, Ingres, SQL Server, DB2, DB2 for i, PosgreSQL, or Teradata database depending on its form. See further section Calling HVR on the Command Line.


Parameter Description
–d Drop objects only. If this option is not supplied, then hvrinit will drop and recreate the objects associated with the channel such as HVR scripts, internal tables and any transaction files containing data in the replication pipeline. Only a few objects are preserved such as job groups in the scheduler catalogs; these can be removed using hvrinit –d.
–E   Since    v5.3.1/1   Recreates enroll file. Using hvrinit –E is same as hvrinit –osctprEljf (in HVRGUI it is same as selecting all options under Object Types).
–hclass Specify hub database. Valid values are oracle, ingres, sqlserver, db2, db2i,postgresql, or teradata. For more information, see section Calling HVR on the Command Line.
–ix Capture rewind. Initialize channel to start capturing changes from a specific time in the past, rather than only changes made from the moment the hvrinit command is run. Capture rewind is only supported for database log–based capture (not for trigger–based capture i.e. /TriggerBased parameter) and for capture from file locations when parameter /DeleteAfterCapture is not defined.
time Valid formats 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).

"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.
–Ix Defines start emitting time.
time Emit changes from the specified moment of time. The 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 from prefix 0x or contains hexadecimal digits A,B,C,D,E or F then it is treated as hexadecimal.
scn=number Emit changes from a specified SCN. For Oracle, this is equivalent to Emit from HVR transaction sequence number where hvr_tx_seq=scn*65536. The number can be in a decimal or a hexadecimal form.
–lx Only affect objects for locations specified by x. Values of x may be one of the following:
loc Only affect location loc.
l1l2 Affects all locations that fall alphabetically between l1 and l2 inclusive.
!loc Affect all locations except loc.
!l1l2 Affects all locations except for those that fall alphabetically between l1 and l2 inclusive.

Several –lx instructions can be supplied together to hvrinit.

–oS Operations limited to objects indicated by S.

Values of S may be one of the following:

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

Several –oS instructions can be supplied together (e.g. –octp) which causes hvrinit to effect all object types indicated. Not specifying a –o option implies all objects are affected (equivalent to –osctpreljf).

–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. This option cannot be used with option –S.
–S Write SQL to stdout instead of applying it to database locations. This can either be used for debugging or as a way of generating a first version of an SQL include file (see action DbObjectGeneration /IncludeSqlFile), which can later be customized. This option is often used with options –lloc –otp.
–ty Only affect objects referring to tables specified by y. Values of y may be one of the following:
tbl Only affects table tbl.
t1t2 Affects all tables that fall alphabetically between t1 and t2 inclusive.
!tbl Affects all tables except tbl.
!t1t2 Affects all tables except for those that fall alphabetically between t1 and t2 inclusive.

Several –ty instructions can be supplied together to hvrinit.

–uuser [/pwd] Connect to hub database using DBMS account user. For some databases (e.g. SQL Server) a password must also be supplied.


Folder-icon.png HVR_HOME
└─ Folder-icon.png bin
└─ hvrinit
Folder-icon.png HVR_CONFIG
├─ Folder-icon.png files
└─ *.logrelease Which log–based capture journals or archive files have been released by the capture job.
├─ Folder-icon.png jnl
└─ Folder-icon.png hub
└─ Folder-icon.png chn
└─ Folder-icon.png YYYYMMDD Journal files created by action Integrate /JournalRouterFiles.
├─ Folder-icon.png job Directory containing generated job scripts. Some jobs use static scripts instead.
├─ Folder-icon.png router Directory containing replication state.
└─ Folder-icon.png sqlgen Directory containing temporary files used during generation of SQL.

See Also

Commands hvrproxy, hvrrouterview and hvrscheduler.