Delete an existing HADR database resource from the resource model

This procedure is mandatory when dropping an HADR enabled database from the instance. Perform this procedure only after the database is dropped.

About this task

Important: To run the db2cm utility as the root user, ensure the DB2INSTANCE environment variable is set to the instance owner.
The following placeholders are used in the command statements throughout this procedure:
  • <database_name> is the name of the Db2 database on the HADR database resource.
  • <instance_name> is the name of the Db2® instance on the cluster

Procedure

  1. As the root user, delete the database resource from your Db2 instance:
    ./sqllib/bin/db2cm -delete -db <database_name> -instance <instance_name>
  2. As the root user, verify that the resource is removed successfully:
    ./sqllib/bin/db2cm -status

Examples

The following example shows the command syntax and output from removing a database resource from the Db2 instance db2inst1 (see step 1):
[db2inst1@pcmk-test-srv-1 ~]$ db2cm -delete -db GT -instance db2inst1
Database resource 'db2_db2inst1_db2inst1_GT' deleted successfully.
The following example shows the command syntax and output from verifying that the database resource SAMPLE is removed from the cluster domain (see step 2):
[db2inst1@pcmk-test-srv-1 ~]$ db2cm -status
2024-12-06-10.33.10
-------------------
Cluster Summary:
* Stack: corosync (Pacemaker is running)
* Current DC: pcmk-test-srv-2 (version 2.1.9-1.db2pcmk.el9-3479fba) - partition with quorum
* Last updated: Fri Dec 6 10:33:10 2024 on pcmk-test-srv-1
* Last change: Fri Dec 6 10:33:05 2024 by db2inst1 via db2inst1 on pcmk-test-srv-1
* 2 nodes configured
* 4 resource instances configured
Node List:
* Online: [ pcmk-test-srv-1 pcmk-test-srv-2 ]
Full List of Resources:
* db2_ethmonitor_pcmk-test-srv-1_eth1 (ocf:heartbeat:db2ethmon): Started pcmk-test-srv-1
* db2_ethmonitor_pcmk-test-srv-2_eth1 (ocf:heartbeat:db2ethmon): Started pcmk-test-srv-2
* db2_pcmk-test-srv-1_db2inst1_0 (ocf:heartbeat:db2inst): Started pcmk-test-srv-1
* db2_pcmk-test-srv-2_db2inst1_0 (ocf:heartbeat:db2inst): Started pcmk-test-srv-2
QDevice Information:
* The current user does not have root permission to obtain qdevice information