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

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/crm status

Examples

The following example shows the command syntax and output from removing a database resource from the Db2 instance db2inst1 (see step 1):
[root@ignited1 ~]# sqllib/bin/db2cm -delete -db SAMPLE -instance db2inst1
Deleted resource for HADRDB on db2inst1 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):
[root@ignited1 ~]# crm status
Stack: corosync
Current DC: ignited1 (version 2.0.2-1.el8-744a30d655) - partition with quorum
Last updated: Tue Mar 10 14:10:23 2020
Last change: Tue Mar 10 14:10:23 2020 by db2inst2 via cibadmin on cuisses1
     
2 nodes configured
4 resources configured
     
Online: [ cuisses1 ignited1 ]

Full list of resources:
 
db2_cuisses1_eth0      (ocf::heartbeat:db2ethmon):     Started cuisses1
db2_ignited1_eth0      (ocf::heartbeat:db2ethmon):     Started ignited1
db2_cuisses1_db2inst1_0        (ocf::heartbeat:db2inst):       Started cuisses1
db2_ignited1_db2inst2_0        (ocf::heartbeat:db2inst):       Started ignited1