IBM Support

Technology preview of managing backup operations by using the Db2uBackup resource

News


Abstract

The Db2uBackup resource allows you to initiate a Db2-native database backup through the deployment of a custom resource (CR) in the same namespace as your Db2 or Db2 Warehouse deployment on the Red Hat OpenShift platform.

Content

Highlights

Creating the resource begins the Db2 backup operation. Our db2u-day2 operator manages the lifecycle of this resource. It also reports the completion status of the resource and contains helpful logs about the status of the Backup.

This technical preview is not yet fully supported. It is intended for nonproduction deployments of Db2 and Db2 Warehouse on the Red Hat OpenShift platform that are running the Db2uCluster custom resource on 11.5.8.0-cn1.

Three types of database backup operations are currently supported:

  • Full offline backup.
  • Full online backup.
  • Incremental online backup.

Online backups require that the TRACKMOD configuration parameter to be set to Yes. For more information on backup types, see Backing up and restoring a database, schema, or table.

NOTE: Schema level backups are not yet supported.

Prerequisites
A working Db2uCluster custom resource deployment.

Before running the Db2uBackup resource

This backup feature is not supported for the Db2uInstance CR, only for the Db2uCluster CR.

Creating a Db2uBackup resource for database backups

You create a Db2uBackup custom resource through a YAML script. You can do this in several ways:

  • Through the Red Hat® OpenShift® console.
  • Through the Red Hat OpenShift command-line tool.
  • Through the command-line tool of a Kubernetes cluster.

To use the Red Hat OpenShift console, go to Installed Operators > IBM Db2 and click the Db2uBackup tab. Through this tab page you create your Db2uBackup resource, either by following the on-screen instructions of the form view, or by entering and running the YAML script.
Your YAML script contains the following API call:

apiVersion: db2ubnr.databases.ibm.com/v1alpha1
kind: Db2uBackup
metadata:
  name: <name of your db2ubackup>
spec:
  db2uCluster: <name of your existing db2ucluster>
  databaseBackup:
    dbName: <the database to back up>
    type: <offline | online | incremental>
    backupTarget:
      vendor: disk

where

  • metadata.name is a valid Kubernetes resource name.
    NOTE: A backup name cannot be reused, even if the Db2uBackup resource is deleted.
  • spec.db2uCluster is an active db2uCluster in the same namespace as the Db2uBackup.
  • spec.databaseBackup.dbName is the name of your database.
  • spec.databaseBackup.type is one of the supported types.

The following example shows the command syntax for running the Db2uBackup utility to back up the database BLUDB that resides in the db2uCluster mycluster:

apiVersion: db2ubnr.databases.ibm.com/v1alpha1
kind: Db2uBackup
metadata:
  name: mybackup
spec:
  db2uCluster: mycluster
  databaseBackup:
    dbName: BLUDB
    type: offline
    backupTarget:
      vendor: disk

You can check the status of the backup operation by running the following command:

oc get db2ubackup <mybackup>

The Db2uBackup status indicates the state of the backup operation:

  • InProgress - The backup is ongoing.
  • Complete - The backup was successful.
  • InvalidSpec -There is something wrong with the fields of the Db2uBackup CR.
  • Error - The backup failed.
  • Expired -The backup is no longer available.

Deleting a Db2uBackup resource

Before you attempt to delete a Db2uBackup resource, consider the following information:

  • Deleting a Db2uBackup resource is not recommended unless the backup status is InvalidSpec, Error or Expired.
  • Do not attempt to delete database-level backups manually.
  • If a completed Db2uBackup resource is deleted, the underlying backup image on disk is not deleted.
  • A Db2uBackup that is deleted cannot be restored.

[{"Type":"MASTER","Line of Business":{"code":"LOB10","label":"Data and AI"},"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SSEPGG","label":"Db2 for Linux, UNIX and Windows"},"ARM Category":[{"code":"a8m3p0000006wjpAAA","label":"Backup"}],"Platform":[{"code":"PF016","label":"Linux"}],"Version":"11.5.8;and future releases"}]

Document Information

Modified date:
17 March 2023

UID

ibm16962831