Home / Repstance User Guide / PROCESS CONFIGURATION COMMANDS

PROCESS CONFIGURATION COMMANDS

Repstance replicates data with two kinds of processes. A Capture Process extracts the changes from the Source Database and writes them to trail files on the Repstance server. An Apply Process reads the trail files of a Capture Process and applies the changes to the Target Database; it can also change the data and the data definition when transformation rules are configured. The commands of this section create these processes, show and change their configuration, check them and remove them.

The commands

CommandWhat it doesPage
prepareCreates a Capture Process or an Apply Process.Prepare Capture Process, Prepare Apply Process
showShows the configuration that is stored for a process.Show Process
validateChecks that a process can run: its parameters, the connection and the database objects.Validate Process
alterChanges the parameters of a process, or removes them.Alter Process
removeDeletes a process, its files and the database objects it has created.Remove Process

The commands that run and stop the processes and show what they are doing are in PROCESS CONTROL COMMANDS. The commands that prepare the databases are in DATABASE CONFIGURATION COMMANDS.

Setting up a replication

  1. Prepare the Source Database and the Target Database (see Prepare Source Database and Prepare Target Database).
  2. Create the Capture Process with prepare process=capture (see Prepare Capture Process). It names the Source Database and the tables to replicate.
  3. Create the Apply Process with prepare process=apply (see Prepare Apply Process). It names the Capture Process it reads from and the Target Database.
  4. Check both processes with validate (see Validate Process).
  5. Run the processes (see Run any Capture or Apply Processes).

The Web UI leads through the same steps, see Setup First Replication.

What is configured

Capture ProcessApply Process
The id and the name of the processThe id of the process and the name of the Capture Process that provides the data
The connection to the Source Database and the capturing methodThe connection to the Target Database
The tables to replicate and the kind of replication, DML and DDL (see Capture Objects Specification)How the DDL is processed
The tables to load first (see Initial Load)The filtering rules, if required (see Objects Filtering)
The global transformation rules, if required (see Objects Mapping and Possible Transforms)The local transformation rules, if required (see Objects Mapping and Possible Transforms)
The parameters of the extractionThe parameters that tune the process

Rules of the commands

  • Every command works with one process: process is capture or apply and id is its number, from 1 to 99999. The id is unique among the processes of one kind, a Capture Process and an Apply Process can have the same id.
  • A Capture Process has a name (letters, digits, _ and -). The name is unique, it is the prefix of the trail files of the process and it cannot be changed once it is set. An Apply Process names the Capture Process it reads from with capturename, which cannot be changed once it is set either.
  • prepare needs process, id and dbtype: mssql, oracle, mysql or postgresql for a Capture Process, mssql, oracle, postgresql, mysql, snowflake, redshift or s3 for an Apply Process. The other commands take the database type from the stored process. The name, the capture name and the connection parameters can be added later with alter, but the process cannot run without them.
  • The parameters of a process depend on its kind and its database: SQL Server Capture Parameters, Oracle Capture Parameters, SQL Server Apply Parameters, Oracle Apply Parameters, PostgreSQL Apply Parameters, MySQL Apply Parameters, Snowflake Apply Parameters, Redshift Apply Parameters, AWS S3 Apply Parameters and Kafka Apply Parameters. A parameter that belongs to another database is refused.
  • The names of the parameters and the keyword values are not case sensitive. A parameter can be given once in a command.
  • preview=1 with prepare or alter lists the tables that the settings select and saves nothing (see Alter Process).
  • A configuration is used when the process is run. A change of a running process is used after the process has been stopped and run again (see Stop any Capture or Apply Processes).
  • repcli accepts capture=2 or apply=3 in place of process=capture id=2 or process=apply id=3, for example repcli show capture=2.

Messages

repcli prints the answer of a command as [Completed]: message, [Valid]: message, [Invalid]: message or [Failed]: message. The messages of a command that is refused:

MessageCause
Missed dbtype parameter and Valid values: mssql | oracle | mysql | postgresql | redshift | snowflake | s3 | kafkaprepare without dbtype. A Capture Process takes mssql, oracle, mysql or postgresql.
Process id=2 already existsprepare with the id of another process of the same kind.
[SQLServerCap2] is already user by 2 captureprepare with the name of another Capture Process (the product writes “user”).
Invalid Process ID has been suppliedshow, validate, alter or remove with an id that does not exist.
An invalid value [70000] has been supplied for parameter [port]. and a line that describes the parameterA value that the parameter does not accept.
An invalid parameter [foo] has been supplied. and the list of the valid parameters of this process and databaseA parameter that does not exist.
An invalid parameter [s3.bucketname] has been supplied. It is a parameter of redshift, s3, not of mssql.A parameter of another database.
Parameter [name] has been provided more than 1 timeThe same parameter twice in one command.

REST API

The five commands are POST requests to /configure/process. The body is JSON, the header X-Token carries the token of the Repstance server (see Configure repcli for Remote Access and REST API). The element command is the name of the command and parameters is a list of [name, value] pairs, the same names as in repcli. The answer has the fields Status and Message, and parameters for show or the lists of tables for preview. The bodies and the answers are on the pages of the commands. The HTTP codes:

HTTP codeMeaning
200The request is valid and has been processed. The body has the status Completed and the message; for validate the status is Valid or Invalid.
401The token is invalid.
422The request is invalid or cannot be carried out: the JSON, the command, a parameter or the id of the process is wrong, or the process is running (remove). The body has the status Failed and the message.

Web UI

The processes are created and changed on the dashboard. “Add Capture” and “Add Apply” open the configuration forms (see Setup First Replication), “Edit” opens the form of an existing process, with “Validate”, “Save Process” and “Delete” (see Edit Replication Processes and Remove Replication Configuration), and the tables and the rules are chosen in the Replication Object Wizard.