Requirements for DB2 for Linux, UNIX and Windows

Last updated on Feb 24, 2021

Contents

DB2 for LUW
Capture Hub Integrate

This section describes the requirements, access privileges, and other features of HVR when using DB2 for Linux, UNIX and Windows (LUW) for replication. 

For the Capabilities supported by HVR on DB2 for Linux, UNIX and Windows, see Capabilities for DB2 for Linux, UNIX and Windows.

For information about the supported data types and mapping of data types in source DBMS to the corresponding data types in target DBMS or file format, see Data Type Mapping.

For instructions to quickly setup replication using DB2 for Linux, UNIX and Windows, see Quick Start for HVR - DB2 for LUW.

Supported Editions

HVR supports the following editions of DB2 for Linux, UNIX and Windows:

  • Server Edition
  • Advanced Enterprise Server Edition
  • Express-C Edition

For information about compatibility and supported versions of DB2 for Linux, UNIX and Windows with HVR platforms, see Platform Compatibility Matrix.

Prerequisites

HVR requires DB2 client to be installed on the machine from which HVR connects to DB2. The DB2 client should have an instance to store the data required for the remote connection. For information about the supported DB2 client versions, refer to the HVR release notes (hvr.rel) available in hvr_home directory or the download page.

To setup the DB2 client, use the following commands to catalog the TCP/IP node and the remote database:

db2 catalog tcpip node nodename remote nodename server portnumber

db2 catalog database databasename at node nodename

To test the connection with DB2 server, use the following command:
db2 connect to databasename user username
For more information about configuring DB2 client, refer to IBM Knowledge Center.

Location Connection

This section lists and describes the connection details required for creating DB2 for Linux, UNIX and Windows location in HVR. HVR uses SQL Call Level Interface to connect, read and write data to DB2 for Linux, UNIX and Windows location.


Field

Description

Database Connection

INSTHOME

The directory path of the DB2 installation.
Example: /db2/9.7

DB2INSTANCE

The name of the DB2 instance.
Example: db2instl

Database

The name of the DB2 database.
Example: mytestdb

User

The username to connect HVR to DB2 Database.
Example: hvruser

Password

The password of the User to connect HVR to DB2 Database.

Hub

HVR allows you to create hub database in DB2 for Linux, UNIX and Windows. The hub database is a small database which HVR uses to control its replication activities. This database stores HVR catalog tables that hold all specifications of replication such as the names of the replicated databases, the list of replicated tables, and the replication direction.

Grants for Hub

To capture changes from source database or to integrate changes into target database, the following privileges are required:

  • The User should have permission to create and drop HVR catalog tables.

    grant createtab on database to user hvruser

Capture

HVR supports capturing changes from DB2 for Linux, UNIX and Windows. For the list of supported DB2 for Linux, UNIX and Windows versions, from which HVR can capture changes, see Capture changes from location in Capabilities.

Table Types

HVR supports capture from the following table types in DB2 for Linux, UNIX and Windows:

  • Regular Tables
  • Multidimensional Clustering (MDC) Tables
  • Insert Time Clustering (ITC) Tables
  • Uncompressed Tables
  • Row Compressed Tables (both static and adaptive)
  • Value Compressed Tables (both static and adaptive)

Log-based Capture

HVR uses the db2ReadLog API to read the DB2 transaction logs. For this the database user needs to have authorization SYSADM or DBADM.

Supplemental Logging

HVR supports supplemental logging for log-based capture from DB for Linux, UNIX and Windows.

Supplemental logging can be enabled while executing HVR Initialize by selecting option Supplemental Logging (option -ol).

  • Alternatively, executing the following command on replicated tables has the same effect.

    alter table tablename data capture changes include longvar columns

    To alter a table, the User should have one of the privileges ( alter control or alterin ) or else the User should have SYSADM or DBADM authority.

While executing HVR Initialize, if supplemental logging is enabled, HVR also executes (only if required by DB2 to reorganize the tables for better performance) the following:

reorg table tablename

To enable "archive logging" in db2 , define the database configuration parameters logarchmeth1 and logarchmeth2.

For logarchmeth1, you must set value to either logretain or disk and, for logarchmeth2, set value to either off or disk. For example: 

db2 update db cfg for databasename using logarchmeth1 logretain

db2 update db cfg for databasename using logarchmeth2 off

or 

db2 update db cfg for databasename using logarchmeth1 disk:/u/dbuser/archived_logs

db2 update db cfg for databasename using logarchmeth2 off

The user executing this command should be part of SYSADM , SYSCTRL or SYSMAINT. This does not have to be the HVR database user.

Integrate and Refresh Target

HVR supports integrating changes into DB2 for Linux, UNIX and Windows location. This section describes the configuration requirements for integrating changes (using Integrate) into DB2 for Linux, UNIX and Windows location. For the list of supported DB2 for Linux, UNIX and Windows versions, into which HVR can integrate changes, see Integrate changes into location in Capabilities.

  • The User should have permission to read and change replicated tables.

    grant select on tbl to user hvruser
    grant insert on tbl to user hvruser
    grant update on tbl to user hvruser
    grant delete on tbl to user hvruser

  • The User should have permission to load data.

    grant load on database to user hvruser

  • The User should have permission to create and drop HVR state tables.

    grant createtab on database to user hvruser

Burst Integrate and Bulk Refresh

HVR uses db2Load API for copying data to a target during bulk refresh and loading data into burst tables during Integrate with /Burst.

Compare and Refresh Source

The User should have permission to read replicated tables

grant select on tbl to user hvruser