Configuring and verifying the primary IBM DB2 Universal Database for replication

Before you install Replication Agent, configure the primary IBM DB2 Universal Database for replication. To do so, you may need to connect to the primary database using the primary database instance owner user.

StepsVerifying the current archive setting of the transaction log

Replication Agent requires that the primary IBM DB2 Universal Database transaction logging be archive logging, not circular logging.

  1. Determine the LOGARCHMETH1 setting.

    1. Connect to the database by entering the following command at the CLP prompt.

      CONNECT TO dbalias USER db2_user USING db2_user_ps
      

      Here, dbalias is the cataloged alias of the primary database, db2_user is the primary database user, and db2_user_ps is the password.

    2. Determine the LOGARCHMETH1 setting:

      GET DB CFG FOR dbalias
      
  2. If the results do not show that LOGARCHMETH1 is set to LOGRETAIN or to the path name of the directory to which logs are archived, set it:

    • To use the default archive location:

      UPDATE DATABASE CONFIGURATION USING logarchmeth1 LOGRETAIN
      
    • To use a specific archive location:

      UPDATE DATABASE CONFIGURATION USING logarchmeth1 DISK:path
      

      Here, path is the full path name of the directory where the archive logs are to be stored.

StepsSetting the IBM DB2 Universal Database connectivity autocommit parameter

Replication Agent requires that the IBM DB2 Universal Database connectivity autocommit parameter be turned on (autocommit=1). The autocommit parameter is specified in the DB2 call-level interface (CLI) configuration file for the primary database. If the autocommit parameter is not turned on, a deadlock problem may occur.

  1. To set the autocommit parameter, edit the db2cli.ini file.

    It is located in <HOME>\sqllib, where <HOME> is the home directory of the IBM DB2 Universal Database instance owner (UNIX or Linux) or the IBM DB2 Universal Database client or server installation directory (Windows).

StepsCreating an IBM DB2 Universal Database user and grant permissions

Replication Agent requires an IBM DB2 Universal Database login that has permission to access data and create new objects in the primary database. The IBM DB2 Universal Database login must have SYSADM or DBADM authority to access the primary database transaction log.

  1. Create a new operating system user named ra_user using commands appropriate for your operating system.

    For example, the following command can be used to create a user named ra_user on the UNIX and Linux operating systems:

    useradd -gusers -Gmgmt -s/bin/shell -ppassword 
    -d/home/ra_user -m ra_user
    

    Here, password is the password corresponding to the ra_user user name.

  2. Select Start | Programs | IBM DB2 | Control Center.

  3. Configure the Control Center administration tool to connect to the primary IBM DB2 Universal Database according to the IBM documentation. Once the Control Center administration tool has been configured, the primary database appears in the All Databases view.

  4. In the Control Center administration tool display window, right-click the primary database name, and select Authorities from the context menu.

  5. In the Database Authorities window, click Add User.

  6. In the Add User window, select ra_user from the list of displayed operating system users, and click OK.

  7. Click Grant All to add necessary authorities to ra_user.

NoteIn a POC environment, the user is created by an IBM DB2 Universal Database system administrator.

StepsAdding a temporary tablespace to the primary database

  1. In the Control Center All Databases view, right-click the Table Spaces folder under your primary database, and select Create from the context menu.

  2. In the Name window, specify a name for the new table space, and select the Let DB2 Manage My Storage radio button. Click Next.

  3. In the Type window, select User Temporary, and click Next.

  4. In the Buffer Pool window, click Create.

  5. In the Create Buffer Pool window, specify a name for the buffer pool, specify at least 8KB as the page size in the drop-down menu, select Create Bufferpool Immediately, and click OK.

  6. Click Finish to create the table space. The new table space appears in the Table Spaces folder.