Home / Knowledge base / 7. COMMANDS TO BE USED / 7.2 Remove Repstance Database Objects

7.2 Remove Repstance Database Objects

The “remove” database objects command is used to remove Repstance database replication objects.

The successful result of using this command will be:

  • For the Source and Target Database, it will remove the Repstance Database Objects that were created by the “prepare” command;
  • For MS SQL Server Database configured as a Source, it will also disable CDC on the tables used by Repstance.

After successful completion of the command any remaining running Processes will fail.

7.2.1 Remove Repstance Database Objects in MS SQL Server

Note – In order to use the “remove” database command the database user must have sufficient privileges.

REST API:

  • Endpoint: https://repstance_url/configure/database
  • Method: POST
  • Header:
    • Content-Type: application/json
    • X-Token: token
  • Body:
    {    
      "command":"remove",
      "parameters":[
          ["database","source|target"],
          ["dbtype","mssql"],
          ["server","host_name"],
          ["port","port_number"],
          ["dbname","database_name"],
          ["user","db_user_name"],
          ["password","db_user_password"]
       ]
    }

Server response:

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

CLI Syntax:

repcli remove database=source|target dbtype=mssql \
server=databaseHost port=databasePort \
user=username password=password \
dbname=databaseName

The input parameters are:

  • database – Database role, the possible values are:
  • source – to remove Capture Process Objects and disable CDC
  • target – to remove Apply Process Objects
  • dbtype – Type of RDBMS, the possible value is mssql
  • server – Host name or IP address of the database server
  • port – Database port
  • dbname – Database name
  • user – Database User name
  • password – Database User password

7.2.2 Remove Repstance Database Objects in Oracle

Note – In order to use the “remove” database command the database user must have sufficient privileges.

REST API:

  • Endpoint: https://repstance_url/configure/database
  • Method: POST
  • Header:
    • Content-Type: application/json
    • X-Token: token
  • Body:
    {    
      "command":"remove",
      "parameters":[
         ["database","source|target"],
         ["dbtype","oracle"],
         ["connectiontype","tns|ezconnect"],
         ["tnsname","tns_alias"],
         ["server","host_name"],
         ["port","port_number"],
         ["servicename","service_or_SID"],
         ["dbname","database_name"],
         ["user","db_user_name"],
         ["password","db_user_password"]
      ]
    }

Server response:

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

CLI Syntax:

repcli remove database=source|target dbtype=oracle \
connectiontype=tns|ezconnect tnsname=tns_alias \
server=databaseHost port=databasePort \
servicename=service_or_SID \
user=username password=password \
dbname=databaseName

The input parameters are:

  • database – Database role, the possible values are:
  • source – to remove Capture Process Objects
  • target – to remove Apply Process Objects
  • dbtype – Type of RDBMS, the only possible value is oracle
  • connectiontype – Specifies the method of connection to Oracle, possible values are:
  • tns – Local Naming Method to be used
  • ezconnect – EZCONNECT to be used
  • tnsname – Name of the TNS alias, valid only if connectiontype=tns
  • server – Host name or IP address of the database server, valid only if connectiontype=ezconnect
  • port – Database port number, valid only if connectiontype=ezconnect
  • servicename – Database service name or SID, valid only if connectiontype=ezconnect
  • dbname – Name of either container or pluggable database. Valid only if database=source and for any Oracle versions 12c-19c but excluding RDS instances
  • user – Database User name
  • password – Database User password

7.2.3 Remove Repstance Database Objects in PostgreSQL and Aurora PostgreSQL Databases

Note – In order to use the “remove” database command the database user must have sufficient privileges.

REST API:

  • Endpoint: https://repstance_url/configure/database
  • Method: POST
  • Header:
    • Content-Type: application/json
    • X-Token: token
  • Body:
    {    
      "command":"remove",
      "parameters":[
          ["database","target"],
          ["dbtype","postgresql"],
          ["server","host_name"],
          ["port","port_number"],
          ["dbname","database_name"],
          ["user","db_user_name"],
          ["password","db_user_password"]
       ]
    }

Server response:

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

CLI Syntax:

repcli remove database=target dbtype=postgresql \
server=databaseHost port=databasePort \
user=username password=password \
dbname=databaseName

The input parameters are:

  • database – Database role, the only possible value is target – to remove Apply Process Objects
  • dbtype – Type of RDBMS, the possible value is postgresql
  • server – Host name or IP address of the database server
  • port – Database port
  • dbname – Database name
  • user – Database User name
  • password – Database User password

7.2.4 Remove Repstance Database Objects in MySQL and Aurora MySQL Databases

Note – In order to use the “remove” database command the database user must have sufficient privileges.

REST API:

  • Endpoint: https://repstance_url/configure/database
  • Method: POST
  • Header:
    • Content-Type: application/json
    • X-Token: token
  • Body:
    {    
      "command":"remove",
      "parameters":[
          ["database","target"],
          ["dbtype","mysql"],
          ["server","host_name"],
          ["port","port_number"],
          ["dbname","database_name"],
          ["user","db_user_name"],
          ["password","db_user_password"]
       ]
    }

Server response:

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

CLI Syntax:

repcli remove database=target dbtype=mysql \
server=databaseHost port=databasePort \
user=username password=password \
dbname=databaseName

The input parameters are:

  • database – Database role, the only possible value is target – to remove Apply Process Objects
  • dbtype – Type of RDBMS, the possible value is mysql
  • server – Host name or IP address of the database server
  • port – Database port
  • dbname – Database name
  • user – Database User name
  • password – Database User password

7.2.5 Remove Repstance Database Objects in Snowflake Database

Note – In order to use the “remove” database command the database user must have sufficient privileges.

REST API:

  • Endpoint: https://repstance_url/configure/database
  • Method: POST
  • Header:
    • Content-Type: application/json
    • X-Token: token
  • Body:
    {    
      "command":"remove",
      "parameters":[
         ["database","target"],
         ["dbtype","snowflake"],
         ["account","account"],
         ["region","region"],
         ["warehouse","warehouse"],
         ["user","username"],
         ["password","password"],
         ["dbname","databaseName"]
       ]
    }

Server response:

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

CLI Syntax:

repcli remove database=target dbtype=snowflake \
account=account region=region warehouse=warehouse \
user=username password=password \
dbname=databaseName

The input parameters are:

  • database – Database role, the possible value is target – to remove Apply Process Objects
  • dbtype – Type of RDBMS, the possible value is snowflake
  • account – Snowflake Account name
  • region – Snowflake Region name
  • warehouse – Warehouse name
  • user – Database User name
  • password – Database User password
  • dbname – Database name

How to find “Snowflake Account” and “Snowflake Region” is described in chapter 7.1.7 Prepare Snowflake as Target Database.