IBM DB2

Before configuring DR services, check the database environments at the production and DR ends where DB2 databases reside, and the storage environment. If any environment does not meet requirements, modify its configurations.

Public Check Items

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, the DR end does not support the standalone deployment mode.

  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, 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 does 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 DB2 databases reside must be same as the specified node names 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.

    The 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. For detailed operations, see System Maintenance > System Maintenance Commands > Starting the eReplication Agent in the OceanStor BCManager 8.2.0 eReplication User Guide.

    Before configuring environment variables, check the default shell type of user rdadmin on the 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 in 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 ~/. xxx_profile command to open the .profile file in the home directory of user rdadmin.For example, run the vi ~/.bash_profile command in the Red Hat operating system.

      Set xxx based on the site requirements.

    5. Press i to go to the editing 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 the VCS script path in the 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

      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 run :wq! to save the changes and close the file.

Check Items at the Production End

Check the database configuration at the production end.

eReplication of the current version supports DR for DB2 databases on AIX, Linux, and HP-UX. DB2 databases that can be protected by eReplication must meet the following requirements:

Check Items at the 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 DR database

    Check Item

    Configuration Requirement

    Installation

    The operating system type and version run by DB2 databases are the same as those at production end.

    The DB2 database version is the same as that at the production end.

    Configuration

    The cluster where the DB2 databases reside at the DR end has the same configurations (including resources and dependencies among resources) as that at the production end.

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

    Instance

    The names, user names, and passwords of database instances are the same as those at the production end.

    The user groups to which users of DB2 database instances belong are the same as those 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 at the DR end.

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

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

Check Items at the Storage End

  1. A consistency replication relationship and a HyperMetro relationship have been created for the storage array used by the database.

    • A HyperMetro relationship has been established between the LUNs used by the production database and remote replication relationship has been established between the LUNs used by the database at the remote DR end. The HyperMetro pair status and remote replication status are normal.
    • If multiple LUNs are used at the production end, related remote replication pairs have been added to one remote replication consistency group. If only one LUN is used at the production end, the replication pair where the storage resides does not need to be added to a consistency group.

  2. Perform the checks on storage at the production end.

    If remote replication is performed on data of the Oracle database at the production end, multiple LUNs used by one database at the production end must be in the same consistency group. If the database uses only one LUN, the LUN does not need to be added to a consistency group.

  3. Perform the checks on storage at the DR end.

    1. After setting up the application environment for the DR end, remove host mappings of the LUNs or volumes that store data files, control files, and log files of the applications.
    2. Ensure all file systems used by the Oracle databases that you want to recover on the DR hosts are unmounted.
    3. On the Huawei storage management software, ensure that the secondary LUN of the remote replication used by the DR database is not mapped to any host, host group, or mapping view.
    4. If the DR hosts run AIX, check the following:
      • Check whether information about the volume group hosting the logic volume of the to-be-recovered database is deleted from the DR host.
      • Check whether information about the physical volume used by the database and the corresponding device (hdiskx) is deleted from the DR host.


Copyright © Huawei Technologies Co., Ltd.