Preparing to back up or restore Db2

Before you can run the db2 backup or db2 restore commands, you need to identify the node where the Db2® database service is deployed.

Procedure

  1. To identify the Db2 container, run the following command on any node in your cluster:
    kubectl get pods -n namespace | grep db2u

    Replace namespace with the cluster namespace where the database was deployed.

    This command returns a list of one or more nodes for the Db2 database configuration. For a single-node configuration, the catalog node is always the same as physical node.

    A sample SMP configuration:
    db2oltp-1556786589-db2u-0                            1/1     Running     0          3h54m
  2. Exit that bash shell and open a new shell to the single node that hosts your Db2 database service.
    kubectl exec -it -n namespace db2oltp-node -- bash

    Replace db2oltp-node with the name of the node that you found in the previous step.

What to do next

After you open a bash shell, you can proceed with Backing up a Db2 database offline or Restoring Db2 by using commands.