Reply To: How to create channel, add tables and set PK/Distribution Key for tables from Command Line.

#12549
ggoodrich
Keymaster

Hello Bhavik,

Yes, we can accomplish your needs using a command line utility named hvradapt.

It sounds like you are already familiar with using the Table Explore feature via the HVR Console (GUI) to define which tables are included in the replication channel definition. You are then clicking on the properties to manage the replication or distribution keys. As you noticed, HVR was already setting the PK based on the tables primary key or unique index. If you want a command line equivalent, then hvradapt is the command utility to use.

In short, create an input file that lists all of the tables to include. You probably want to add a “+” to the top line indicating to add tables to channel. When you create the list of table names, add the -K (column list) after the table name to declare which columns to use for the distribution key.

You can find examples of a sample input file and example running the command in the following wiki page: https://www.hvr-software.com/wiki/Hvradapt

Best!

Glenn

© 2020 HVR

Test drive Contact us