Removing the replication environment

You can use a built-in script to undo all changes that were made to enable replication.

Before you begin

  • You must run the script as the dsadm user.
  • All replication activities must be stopped before you run the script. You can use the following command:
    /opt/ibm/bludr/scripts/bin/bludr-stop.sh
    You can check to ensure that replication is inactive by running the following command:
    /opt/ibm/bludr/scripts/bin/bludr-status.sh

About this task

You might want to use the script to restore an inconsistent replication environment by removing all replication objects and starting over.

Note: You must run the script on all source and target systems that are part of the replication environment that you want to remove.

Procedure

Use one of the following commands:
Outside the common container
docker exec -u dsadm Db2W_container_name /opt/ibm/bludr/scripts/bin/bludr-remove.sh
Within the common container
/opt/ibm/bludr/scripts/bin/bludr-remove.sh

To also remove external table (ET) files and subdirectories that are used for replication of column-organized tables, run the script with the et argument. For example:

./bludr-remove.sh et

This argument invokes the bludr-etfile-cleanup.sh script. Before you run bludr-etfile-cleanup.sh, you can check which ET files will be removed by using the following search command and SQL query:

db2set | grep DB2_DCC_FILE_PATH

select FILERECV_PATH from QASN.IBMQREP_FILE_RECEIVERS

Db2 writes ET files in the location that is specified by the DB2_DCC_FILE_PATH configuration parameter. The FILERECV_PATH setting for replication specifies the location where the ET files are received at the target.

Note: You can also run the bludr-etfile-cleanup.sh script independently of the bludr-remove.sh script as the dsadm user. If you do so, it is advisable to run the bludr-etfile-cleanup.sh script prior to the bludr-remove.sh script. If you run bludr-remove.sh without the et argument prior to running the bludr-etfile-cleanup.sh script, the location that is defined by FILERECV_PATH in the IBMQREP_FILE_RECEIVERS control table will be unavailable to the et file cleanup script because bludr-remove.sh removes the control tables. As a result, the files and subdirectories at that location are not removed.

Results

The script takes the following actions:

  • Stops and deletes all queue managers
  • If you specify the et argument, deletes ET files and subdirectories from the locations that are specified by the DB2_DCC_FILE_PATH variable and the FILERECV_PATH column in the IBMQREP_FILE_RECEIVERS table.
  • Turns off DATA CAPTURE CHANGES for all tables and schemas where this attribute was enabled
  • Drops all replication control tables
  • Drops all Db2® packages in the QASN and ASN schemas if these schemas exist
  • Removes entries for databases and nodes that were cataloged by replication
  • Deletes the contents of the $BLUDR_SHARED_DIR/logs directory

What to do next

If you want to set up replication again, restart the replication web server by running one of the following commands:
/opt/ibm/bludr/scripts/bin/bludr-start.sh

/opt/ibm/bludr/scripts/bin/bludr-restart-webserver.sh

The script does not remove the replication license.

To begin with a new setup, start by enabling a source database.