Starting a user-initiated failover on a Mutual Failover Db2 instance

You can initiate a failover and move a mutual failover partition from one host to the other.

Before you begin

You must run the db2cm command from the install path as the root user.

Procedure

  1. As root, find the location of the partition that you want to move.
    $ ./db2cm -list
  2. As root, from the install path run db2cm -move to move your partition:
    $ /opt/ibm/db2/V11.5/bin/db2cm -move -instance <instance_name> -partition <partition number> -host <target_host_for_your_partition> 
    Partition resource db2_<instance_name>_<partition_number> moved to <target_host_for_your_partition> successfully. 
    
  3. Repeat step 1 to check the status of your partition move operation.

Example

The following example shows the command syntax and result for checking the location of a partition on the Db2 cluster. See step 1:
$ ./db2cm -list
Cluster Status 

Domain information: 
Domain name               = db2ha 
Pacemaker version         = 2.1.2-4.db2pcmk.el8 
Corosync version          = 3.1.6 
Current domain leader     = haap2 
Number of nodes           = 2 
Number of resources       = 4 

Node information: 
Name                State 
----------------    -------- 
haap2              Online 
haap1              Online 

Resource Information: 
Resource Name             = db2_haap1_eth0 
State                       = Online 
Managed                     = true 
Resource Type               = Network Interface 
Node                        = haap1 
Interface Name              = eth0 

Resource Name             = db2_haap2_eth0 
State                       = Online 
Managed                     = true 
Resource Type               = Network Interface 
Node                        = haap2 
Interface Name              = eth0 

Resource Name             = db2_db2inst1_0 
State                         = Online 
Managed                       = true 
Resource Type                 = Partition 
Instance                      = db2inst1 
Partition                     = 0 
Current Host                  = haap2 

Resource Name             = db2_db2inst1_0-mnt_db2hamf 
State                         = Online 
Managed                       = true 
Resource Type                 = File System 
Device                        = "/dev/sdb" 
Mount Point                   = "/db2hamf" 
File System Type              = ext3 
Current Host                  = haap2


The partition resides on the host haap2:

Resource Name             = db2_db2inst1_0 
State                         = Online 
Managed                       = true 
Resource Type                 = Partition 
Instance                      = db2inst1 
Partition                     = 0 
Current Host                  = haap2 
The result shows that the partition resides on host haap2

The following example shows the command syntax for moving the partition db2_db2inst1_0 to the host haap1. See step 2 :

$ /opt/ibm/db2/V11.5/bin/db2cm -move -instance db2inst1 -partition 0 -host haap1 
Partition resource db2_db2inst1_0 moved to haap1 successfully.