Deleting replication targets from a Q Replication configuration
You can remove target systems from your Db2 on Red Hat replication configuration. This action also deletes any replication sets that are associated with the targets.
Before you begin
- The basic authorization token of the source on the cluster host.1
- The host names of both the replication source and replication target databases.
- The external port numbers of both the replication source and replication target databases.2
1 You need to create a basic authorization token to run a cURL
request. To create your token, run this
command:
echo <source_db_username>:<source_db_password> | base64
where source refers to either the source or destination database.2 You can retrieve the external port numbers for both the replication
source database and replication target database by running the following
command:
oc get svc | grep <db2_instance_id> | grep db2u-engn-svc | grep 50001 | sed 's/.*50001://' | sed 's/\/TCP.*//')About this task
Deleting a target system from your Q Replication configuration produces the following results:
- All replication sets for the target are removed.
- The capture queue manager on the source is configured to remove communication to the target system.
- All apply metadata tables are removed on the target database.
- The queue manager and apply processes are stopped.
- The apply message queue manager is removed on the target system.
Procedure
Results
executionState=COMPLETED and overallJobResult=PASS is returned.
Until these values are returned, examine the error code, message, and resolution in the response.
The following table lists the possible HTTP status codes and response messages for the
replication target deletion API call. It also includes sample code to show the response
syntax.
| HTTP Status Code | Reason | Response Model |
|---|---|---|
| 202 | Target deletion queued | The user request returns a job (id) and URL as the API call
starts (sample value): |
| 200 | Status check of API is successful | Look for executionState=COMPLETED and
overallJobResult=PASS in the response. |
| 4xx | Client request error | The user request was not fulfilled due to malformed request syntax or other client
issues: |
| 5xx | Server error | The user request appeared valid, but was not fulfilled due to an issue with the
server: |
Example
curl --insecure -X DELETE --header 'Content-Type: application/json' --header 'Accept: application/json' --header 'Authorization: Basic ZHNhZG06MDNRVWlMczFhcmoxb3ky' -d '{ "dbUsername": "myuser1", "dbPassword": "mypass1" }' 'https://dr.source1.ibm.com:dr.source1.ibm.com/dr/v2/target/dr.target2.ibm.com/32621/BLUDB'
Use the returned job number to check for the delete target progress. See step 2:
curl --insecure -X GET --header 'Accept: application/json' --header 'Authorization: Basic ZHNhZG06aFRjT3dTTjR1RFo0N1Ew' 'https://api.dr-source1.ibm.com:30674/dr/v1/target/progress/11'