IBM DB2

Before configuring disaster recovery (DR) services, check the database environments of the production end and the DR end where DB2 databases reside, and the storage end environment. If the database environments do not meet requirements, modify database configurations.

Production End and DR End

Check the database environments of the production end and the DR end where DB2 databases reside.

When the DB2 RHCS is used at the production end and the logical volume is managed in CLVM, a single machine is used at the DR end is not supported.

  1. When a database environment is configured at the production end where hosts running Linux, AIX or HP-UX are deployed, the mount points of the file system used by the database cannot be nested. For example, mount points /testdb/ and /testdb/database1/ are nested.
  2. Before configuring a DB2 database, you must obtain the instance name, user name, and password of the DB2 database. The instance name is the DB2 database instance name. The user name is that of the system user of the DB2 database instance. Usually, the user name is the same as the instance name. The password is that of the system user. The DB2 database password do not support special characters !;"'(),·=\', otherwise, database authentication will fail when creating a protected group.
  3. For the DB2 PowerHA cluster, you need to ensure that the host names of the hosts where the production and DR end DB2 database resides must be same as the specified node name in PowerHA cluster. Otherwise, protected groups will fail to be created.
  4. In AIX, the logical volumes used by the file systems of DB2 databases and those used by raw devices of tablespace cannot belong to one volume group.
  5. Check and configure environment variables.

    eReplication Agent starts to protect data consistency between DB2 databases only after you have configured environment variables for DB2 databases at the production end respectively. You are advised to configure environment variables before installing the eReplication Agent. If you have installed the eReplication Agent, restart it after configuring environment variables.

    Before configuring environment variables, check the default shell type of user rdadmin on eReplication Agent.

    • In AIX, if the shell type is bash, modify the .profile file under the rdadmin home directory. If the shell type is csh, modify the .cshrc file under the rdadmin home directory.
    • In Linux, if the shell type is bash, modify the .bashrc file under the rdadmin home directory. If the shell type is csh, modify the .cshrc file under the rdadmin home directory.
    • In HP-UX, if the shell type is bash, modify the .profile file under the rdadmin home directory. If the shell type is csh, modify the .cshrc file under the rdadmin home directory.

    This document uses shell type bash in AIX to modify the .profile file as an example.

    1. Use PuTTY to log in as root to the application server where the eReplication Agent is installed.
    2. Run the TMOUT=0 command to prevent PuTTY from exiting due to session timeout.

      After you run this command, the system continues to run when no operation is performed, resulting a risk. For security purposes, you are advised to run exit to exit the system after completing your operations.

    3. Run the su - rdadmin command to switch to user rdadmin.
    4. Run the vi ~/.profile command to open the .profile file in the rdadmin home directory.
    5. Press i to go to the edit mode and edit the .profile file.
    6. Add the following variables to the .profile file. Table 1 describes related environment variables.
      DB2_HOME=/home/db2inst1/sqllib 
      PATH=$PATH:$DB2_HOME/bin:/usr/sbin:/sbin 
      DB2INSTANCE=db2inst1 
      INSTHOME=/home/db2inst1 
      export DB2_HOME PATH DB2INSTANCE INSTHOME     

      In Linux, you need to add VCS script path in PATH variable, for example PATH=$PATH:$DB2_HOME/bin:/usr/sbin:/opt/VRTS/bin:/sbin.

      Table 1 System Variables

      Variable

      Value

      Example

      DB2_HOME

      Installation directory of a DB2 instance

      DB2_HOME=/home/db2inst1/sqllib

      PATH

      Indicates the bin folder under the home directory of a DB2 instance user

      PATH=$PATH:$DB2_HOME/bin:/usr/sbin:/sbin

      DB2INSTANCE

      Name of a DB2 instance

      DB2INSTANCE= db2inst1

      INSTHOME

      Home directory of a DB2 instance user

      INSTHOME=/home/db2inst1

    7. After you have successfully modified the .profile file, press Esc and enter :wq! to save the changes and close the file.

Production End

  1. Check the database configuration at the production end.

    eReplication of the current version supports DR for DB2 databases on AIX, Linux and HP-UX. To enable eReplication to perform DR for DB2 databases, the DB2 databases must meet the following requirements:

    • Installation directories of DB2 instances must reside on local disks or independent storage devices and cannot reside on the same devices as databases for which DR is intended.
    • Data and log files in the DB2 databases for which DR and protection are intended must be stored on LUNs provided by Huawei storage devices.

DR End

  1. Check the database environment at the DR end.

    If the database environments at the DR end and production end are not the same, the user should deal with it to make sure that the DR end and production end have the same database environments.

    Table 2 describes the lists configuration requirements.

    Table 2 Configuration Requirement of the Database on the DR End

    Check Item

    Configuration Requirement

    Installation

    The operating system and its edition run by DB2 databases are the same as that at production end.

    The versions of DB2 databases are the same as that at the production end.

    Configuration

    The cluster where the DB2 databases reside at the DR end has the same configuration as that at the production end. The two clusters must have the same resource configuration and dependency among resources.

    The environment variable configurations are the same as that at the production end.

    Instance

    The instance names, user names, and passwords of databases are the same as that at the production end.

    The user groups to which users of DB2 database instances belong are the same as that at the production end.

    The installation directories of DB2 instances at the DR end reside on local disks or independent storage devices.

    The DB2 databases to be recovered are created under DB2 instances at the DR end and ensure that the created databases meet the following requirements:

    • Names of databases are the same at the DR and production ends.
    • Storage paths (file systems) used by databases or names of devices (raw devices) are the same at the DR and production ends.
    • Names of logical volumes used by databases and volume groups to which logical volumes belong are the same at the DR and production ends.
    • Tablespaces used by databases, log names, and storage configurations are the same at the DR and production ends. For example, tablespace tp1 in production database DB1 uses /db2data/db1 (specified when the database is created) and tablespace tp2 uses /dev/rtdd1, the same tablespaces tp1 and tp2 must be created under /db2data/db1 and /dev/rtdd1 in the DR database DB1 respectively.

  2. Close databases on the DR end.

    After checking the database environments, close databases on the DR end before creating a recovery plan.

    • For a single DB2 device, close the database directly.
    • For a DB2 cluster, take the cluster resources or resource groups of the database offline.

Storage End

Check the storage environments of the production end.
  • Map the initiator of the physical DR host to the logical host of the DR storage. In a cluster, add the logical host to the host group.
  • If the storage is T series V2R2 or later or 18000 series, the storage support automatically add host and storage mapping function. If the connection between the storage device and the host initiator is normal, the hosts, host groups, LUN mappings, and mapping view will be created in the storage device automatically.
  • If the storage array is T series V200R001C00, deselect Enable Inband Command to change the mapping view attribute after the mapping view is created.
  • If the storage array is FusionStorage V100R006C30SPC100, mount a linked clone volume of a Huawei Distributed Block Storage snapshot to another Huawei Distributed Block Storage storage device. The two storage devices must use the same block storage client.

Copyright © Huawei Technologies Co., Ltd.