The remove command removes the objects that prepare has created in a Source Database or in a Target Database. The tables that are replicated are not touched. A process that uses the database fails afterwards, so stop it first (see Stop any Capture or Apply Processes). The rules that all the database commands share and the messages are on DATABASE CONFIGURATION COMMANDS.
generatesql=1 does not stop the command: it removes the objects whatever its value.
| Database | What remove does |
|---|---|
| SQL Server Source | It drops the database trigger, the SQL Server Agent jobs, the procedures, the functions, the tables and the schema repi, and it disables CDC for the whole database: CDC is switched off for all the tables of the database, also for the tables that other applications read with CDC. The tables hb_stat and ValidateTables stay while repi.apply_ckpt exists. |
| Oracle Source | It drops the tables, the sequence, the functions, the packages and the types of the user REPI, and the user itself when it owns no other object. The supplemental logging, the Oracle directories and the grants stay. |
| MySQL Source | It drops the tables repi.ld_capture and repi.ValidateTables, and the database repi when nothing else is in it. |
| PostgreSQL Source | It drops the two event triggers, the three functions and the tables of the schema repi, and the schema when nothing else is in it. The slots and the publications of the Capture Processes stay until the Capture Process is removed (see Remove Process). |
| SQL Server Target | It drops the checkpoint tables, the procedures and the schema repi. The tables hb_stat and ValidateTables stay while repi.dml_capture exists. |
| Oracle Target | It drops the tables, the sequences and the procedures of the user REPI, and the user itself when it owns no other object. |
| PostgreSQL Target | It drops the four tables and the four functions, and the schema repi when nothing is left in it. |
| MySQL Target | It drops the four tables and the four procedures, and the database repi when no table is left. |
| Redshift and Snowflake Target | It drops the schema repi with everything that is in it. |
| AWS S3 Target | Nothing: there are no objects. |
| Apache Kafka Target | Nothing: there are no objects. |
The steps, and the privileges they need, are in Database Privileges. Removing an Apply Process deletes only its own rows in the checkpoint tables (see Remove Process).
repcli remove database={source|target} dbtype={oracle|mssql|postgresql|mysql|snowflake|redshift|s3} \
[connection parameters of the database] \
[other parameters of the database]| Parameter | Description |
|---|---|
| database | The role of the database: source or target. Required. |
| dbtype | The type of the database: mssql, oracle, mysql or postgresql for a Source Database, oracle, mssql, postgresql, mysql, snowflake, redshift or s3 for a Target Database. Required. |
| server, port, user, password, dbname and the other connection parameters | How to reach the database. They depend on the database: SQL Server as Source, Oracle as Source, MySQL as Source, PostgreSQL as Source, Oracle as Target, SQL Server as Target, PostgreSQL as Target, MySQL as Target, Snowflake as Target, Redshift as Target, AWS S3 as Target and Kafka as Target. |
Remove the objects from a SQL Server Source Database. The database is not prepared afterwards:
repcli remove database=source dbtype=mssql server=db-src.example.com port=1433 dbname=testDB user=repuser password=Passw0rd123
[Completed]: Capture objects have been removed [db-src.example.com:1433,testDB]repcli validate database=source dbtype=mssql server=db-src.example.com port=1433 dbname=testDB user=repuser password=Passw0rd123
[Invalid]: Database is not prepared for capture: [CDC is not enabled: 1]Remove the objects from a SQL Server Target Database:
repcli remove database=target dbtype=mssql server=db-tgt.example.com port=1433 dbname=testDB user=repuser password=Passw0rd123
[Completed]: Apply objects have been removed [db-tgt.example.com:1433,testDB]repcli validate database=target dbtype=mssql server=db-tgt.example.com port=1433 dbname=testDB user=repuser password=Passw0rd123
[Invalid]: Database is not prepared for apply: [repi schema does not exist: 1]For AWS S3 and Apache Kafka the command does nothing:
repcli remove database=target dbtype=s3 s3.region=eu-west-1
[In Process]: Command [REMOVE] has been sent. Use [validate] command to validate the staterepcli remove database=target dbtype=kafka server=kafka1.example.com:9092
[In Process]: Command [REMOVE] has been sent. Use [validate] command to validate the stateThe body of the request:
{
"command": "remove",
"parameters": [
["database", "source"],
["dbtype", "mssql"],
["server", "db-src.example.com"],
["port", "1433"],
["user", "repuser"],
["password", "Passw0rd123"],
["dbname", "testDB"]
]
}The body of the answer:
{
"Status": "Completed",
"Message": "Capture objects have been removed [db-src.example.com:1433,testDB]"
}| HTTP code | Meaning |
|---|---|
| 200 | The request is valid and the command has been carried out. The body has the status Completed or Failed (prepare and remove) or Valid or Invalid (validate), and the message. A command that cannot do its work, for example because the database cannot be reached, is also answered with 200 and the status Failed or Invalid: always read the status. |
| 401 | The token is invalid. |
| 422 | The request cannot be carried out: the JSON, the command or a parameter is wrong. The body has the status Failed and the message, for example Missed port parameter. |
Click “Cleanup Repstance Objects” in the dialog “Database Settings” of a Capture Process or an Apply Process. The button works on the database that is entered in the dialog and acts at once: there is no confirmation. Use it only for a database that no process needs. The result is shown under the buttons:
The Web UI can clean up only the database that is entered in the dialog. The removal of a replication configuration is described in Remove Replication Configuration.
Prev page:
Validate DatabaseNext page:
PROCESS CONFIGURATION COMMANDS