Requirements for DB2 for Linux, UNIX and Windows

From HVR
Jump to: navigation, search

This section describes the requirements, access privileges, and other features of HVR when using DB2 for Linux, UNIX and Windows (LUW) for replication. For information about the capabilities supported by HVR on DB2 for Linux, UNIX and Windows, see Capabilities for DB2 for Linux, UNIX and Windows.

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

DB2 for LUW
Capture Hub Integrate
Icon-Yes.png Icon-Yes.png Icon-Yes.png

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.

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 i location in HVR.

SC-Hvr-Location Db2.png
Field Description
Database Connection
INSTHOME The 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.

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

Supplemental logging can be enabled by defining action HVR Initialize /Supplemental Logging or by using the command hvrinit -ol.

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

alter table table name 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 performing HVR Initialize, if the supplemental logging is enabled, HVR also executes (only if required by DB2 to reorganize the tables for better performance) the following:

reorg table table name

To enable "archive logging" in db2 you should execute command

db2 update db cfg for databasename using logretain on

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

Table Types

HVR supports 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)

Grants for Compare and Refresh Source

  • The User should have permission to read replicated tables
grant select on tbl to user hvruser

Grants for Integrate and Refresh Target

  • 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