IBM Books

Replication Guide and Reference


Setting Up the Capture and Apply Programs

Setting up consists of configuring the source, target, and control servers, and setting up NT services. The following sections provide instructions for configuring each server, providing end-user authentication at the source server, and setting up the NT Service Control Manager.

Configuring the Capture Program for Windows NT and Windows 95

  1. Ensure that the user ID under which the Capture program is running has the required privileges:

  2. Log on with the user ID from the source server system.

  3. Connect to the source server database by entering:
    DB2 CONNECT TO database
    

    where database is the source server database.

  4. Prepare the source server database (source database) for roll-forward recovery by issuing the update database configuration command and the backup database command. For example:
    DB2 UPDATE DATABASE CONFIGURATION FOR database_alias USING LOGRETAIN ON
    DB2 BACKUP DATABASE database_alias
    

  5. Change to the directory where the Capture program bind files are located, which is usually drive:\SQLLIB\BND.

  6. Create and bind the Capture program package to the source server database by entering the following command:
    DB2 BIND @CAPTURE.LST ISOLATION UR BLOCKING ALL
    

    where UR specifies the list in uncommitted read format for greater performance.

    If your system does not support UR, substitute CS (cursor stability format) instead.

    These commands create a list of packages, the names of which can be found in the CAPTURE.LST file.

Configuring the Apply Program for Windows NT and Windows 95

  1. Ensure that the user ID under which the Apply program is running has the required privileges:

  2. Log on with the user ID from the target server system.

  3. Change to the directory where the Apply program bind files are located, which is usually in drive:\SQLLIB\BND.

  4. Connect to the source server database by entering:
    DB2 CONNECT TO database
    
    where database is the source server database.

  5. Create and bind the Apply package to the source server database by entering both of the following commands:
    DB2 BIND @APPLYCS.LST ISOLATION CS BLOCKING ALL
    
    DB2 BIND @APPLYUR.LST ISOLATION UR BLOCKING ALL 
    

    Where:

    CS

    The list in cursor stability format.

    UR

    The list in uncommitted read format.

    These commands create a list of packages, the names of which can be found in the APPLYCS.LST and APPLYUR.LST files.

  6. Connect to the target server database by entering:
    DB2 CONNECT TO database
    
    where database is the target server database.

  7. Create and bind the Apply package to the target server database by entering both of the following commands:
    DB2 BIND @APPLYCS.LST ISOLATION CS BLOCKING ALL GRANT PUBLIC
    
    DB2 BIND @APPLYUR.LST ISOLATION UR BLOCKING ALL GRANT PUBLIC
    
    Note:Because the Apply program control tables use static SQL calls, the Apply bind process searches for nearly all of the control tables at each server that it is bound to, regardless of whether these control tables have any use or meaning at each server.

  8. Repeat the connect and bind steps for each server that the Apply program connects to. You must bind the Apply program to the source, target and control servers.

Providing End-User Authentication at the Source Server

For end-user authentication to occur at the source server, you must provide a password file with the AUTH=SERVER scheme for the Apply program to use when connecting to the source server. It is advisable to limit read access of this file to the user ID that will run the Apply program.

Creating a password file:

The password file must meet the following criteria:

For more information about authentication and security, refer to the IBM DB2 Universal Database Administration Guide.

Setting Up the NT Service Control Manager

You can operate the Capture and Apply programs for Windows NT and Windows 95 by using the DB2 command processor, or by using the NT Service Control Manager (SCM). The SCM enables you to automatically start the Capture and Apply programs as services from the NT Control Panel.

To set up NT services:

  1. Install the replication service by entering the fully-qualified path name of the ASNSERV executable as shown in the following example:
    ASNINST D:\DIRECTORY\ASNSERV.EXE
    

  2. Set up the service from the NT Control Panel.

    1. Click on the Services icon. The Services window appears.

    2. Select Replication and click on the STARTUP push button.

    3. Ensure that the startup type radio button indicates automatic.

    4. Specify the local user ID and password, then click on OK. The user ID must be the one that runs the Capture and Apply programs with the appropriate DB2 privileges.

  3. Add the environment variable ASNPATH to specify the location of the Capture and Apply files.

    1. Select System from the NT Control Panel. The System Properties window appears.

    2. Click on the Environment tab.

    3. Type the ASNPATH string in the System Variable field as shown in the following example:
      ASNPATH=D:
      

    4. Click on OK.

  4. Create an ASCII file to execute the Capture and Apply programs.

    1. Enter the following records in the file:
      db_name x:\\ASNCCP parameters
      
      db_name x:\\ASNAPPLY parameters
      

      where db_name is the name of your source database for the Capture program and control database for the Apply program, x is the drive, and parameters is one or more parameters as in the following example:

      DBNAME1 C:\CAPTURE\ASNCCP COLD TRACE
      DBNAME2 C:\APPLY\ASNAPPLY X 2
      

    2. Save the file to the following name:
      D:\NTSERV.ASN
      

After starting the service, the Capture and Apply programs run independently of ASNSERV. Consequently, stopping ASNSERV does not stop the Capture and Apply programs.

To remove ASNSERV from the NT Control Panel, use the ASNREMV program. After removing ASNSERV, Replication no longer appears on the Services window.


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]

[ DB2 List of Books | Search the DB2 Books ]