Home / Repstance User Guide / PROCESS CONTROL COMMANDS / Run any Capture or Apply Processes

Run any Capture or Apply Processes

This command is used to “Run” either a single Capture or Apply Process or a group of either Capture, or Apply Processes or all configured Processes. The default is to run all Processes that are available to be run, if no additional “Parameters” are specified.

As part of the “run” command, Repstance carries out background checks to ensure that Source and/or Target Databases are properly configured with the necessary functionality to enable the Capture and/or Apply Processes to run. In the event that either of the Databases are not properly configured, it will display an error message listing the inconsistencies.

At the “first time” run of the Capture Process for MS SQL database it creates CDC tables needed for the replication and start extracting the changes from the first available LSN generated in the CDC tables.

For the Oracle database at the “first time” run the “current database SCN” is used as the start point of the replication.

Note – If there are any active transactions were running at the “current database SCN”, and these transactions are committed after this SCN, the ALL changes generated by these transactions are included into the replication, so the tables will be in consistent state and no data is missed.

If the previously defined Objects (see chapter Capture Objects Specification) are changed or the Transformation Rules (see chapter Objects Mapping and Possible Transformations) are altered, at this point all the DDL and DML changes will be re-implemented using the new criteria.

If any Objects are no longer configured for Capture Process the “run” command will “Turn Off” CDC on these Objects and they will no longer be written to the Trail Files – the reverse is true i.e. if new Objects are specified then the “run” command will enable CDC for them and they will now be written to the Trial Files.

If this is the “First time” an Apply Process has been run, it is only at this point that data from the specified Capture Process will be written to the Target Database using the first available LSN in the Trail File generated by this Capture Process.

The Apply Process can be configured to use a specific LSN from a Capture Process as a start point, i.e it can be configured to use any available LSN from a Trail File, but this is done by using the “reset” command (see chapter Reset Apply Process).

If the specified Capture Process either is not configured or has never been run, the Apply Process will fail.

CLI Syntax:

repcli run process=apply|capture id=processID

The input parameters are:

  • process – Constant value apply for Apply Processes or constant value capture for Capture Processes
  • id – Identifier of the Process

The output parameters are:

  • Status – Status of the command, possible values are:
    • Error – the command has failed to run
    • Completed – the command has completed successfully
  • Message – Details of command execution

REST API:

  • Endpoint: https://repstance_url/control/process
  • Method: POST
  • Header:
    • Content-Type: application/json
    • X-Token: token
  • Body:
    {
      "command": "run",
      "parameters": [
        ["process","apply|capture"],
        ["id","processID"]
      ]
    }

Server response:

  • HTTP Status – Status of the command, possible codes are:
    • 200 – if no error occurs
    • 422 – if error occurs
  • Body:
    {
      "Status":"{Completed|Error}",
      "Message":"The command execution details"
    }