IBM Books

Replication Guide and Reference


Operating Apply for Windows and OS/2

An administrator can use the commands in the following sections to perform the following Apply program tasks:

Before you start the Apply program

Before you start the Apply program, ensure that:

Starting Apply for Windows and OS/2

After you start the Apply program, it runs continuously until:

To start the Apply program using the NT services:

  1. Select Replication from the NT Services window.

  2. Click the Start push button. The Apply program starts according to the ASCII file information you provided.

You can also start the replication service by typing STRTSERV on the Windows NT command line.

To start the Apply program using the DB2 command window:

Perform the following steps from a Windows or OS/2 window:

  1. Log on with the IBM Replication user ID.

  2. Ensure that you set the DB2 instance as shown:
    SET DB2INSTANCE=db2_instance_name
    

  3. Enter the ASNAPPLY command from the Windows or OS/2 window where you issued the SET command:
>>-ASNAPPLY--Apl_qual----+-----------+---+-----------+---------->
                         '-Ctrl_serv-'   +-LOADXit---+
                                         '-NOLOADXit-'
 
>-----+----------+---+---------+---+---------+---+----------+--->
      +-INAMsg---+   +-NOTRC---+   '-TRCFILE-'   +-NOTIFY---+
      '-NOINAMsg-'   +-TRCERR--+                 '-NONOTIFY-'
                     '-TRCFLOW-'
 
>-----+---------+---+----------+---+----------+---+----------+-->
      +-SLEEP---+   '-DELAY(n)-'   '-COPYONCE-'   '-LOGREUSE-'
      '-NOSLEEP-'
 
>-----+-----------+---+----------+-----------------------------><
      '-LOGSTDOUT-'   '-TRLREUSE-'
 

Table 30 defines the invocation parameters.

Table 30. ASNAPPLY Invocation Parameter Definitions on Windows and OS/2
Parameter Definition
Apl_qual Specifies the Apply qualifier that the Apply program instance uses to identify the subscriptions to be served. The Apply qualifier is case sensitive and must match the value of the APPLY_QUAL in the subscription set table. This must be the first parameter.
Ctrl_serv Specifies the name of the server where the replication control tables will reside. If you do not specify this parameter, the default is the default database or the value of DB2DBDFT.
LOADXit Specifies that the Apply program is to invoke ASNLOAD, an IBM-supplied exit routine that uses the export and load utilities to refresh target tables.
NOLOADXit  (default)  Specifies that the Apply program will not invoke ASNLOAD.
INAMsg  (default)  Specifies that the Apply program is to issue a message when the Apply program is inactive.
NOINAMsg Specifies that the Apply program will not issue this message.
NOTRC  (default)  Specifies that the Apply program does not generate a trace.
TRCERR Specifies that the Apply program generates a trace that contains only error information.
TRCFLOW Specifies that the Apply program generates a trace that contains both error and execution flow information.
TRCFILE If both trcfile and trace are specified, the Apply program writes trace output to the trace file (*.trc). If you do not specify this option, the Apply program sends trace output to the standard output, stdout.
NOTIFY Specifies that the Apply program is to invoke ASNDONE, an exit routine that returns control to the user when the Apply program processing ends.
NONOTIFY  (default)  Specifies that the Apply program will not invoke ASNDONE.
SLEEP  (default)  Specifies that the Apply program is to go to sleep if no new subscriptions are eligible for processing.
NOSLEEP Specifies that the Apply program is to stop if no new subscriptions are eligible for processing.
DELAY(n) Where n=0, 1, 2, 3, 4, 5, or 6. Specifies the delay time (in seconds) at the end of each Apply program cycle when continuous replication is used. The default delay time is 6 seconds.
COPYONCE The Apply program executes one copy cycle for each eligible subscription set and then terminates. An eligible subscription set is such that:

  • ACTIVATE > 0

  • REFRESH_TIMING = R or B or REFRESH_TIMING = E and the specified event has occurred.
MAX_SYNCH_MINUTES and END_OF_PERIOD are honored if specified.
LOGREUSE The Apply program reuses the log file (*.app) by first deleting it and then re-creating it when the Apply program is restarted. If you do not specify this option, the Apply program appends messages to the log file, even after the Apply program is restarted.
LOGSTDOUT The Apply program sends all messages to both the standard output (stdout) and the log file.
TRLREUSE The Apply program empties the Apply trail table when the Apply program is started.

Scheduling Apply for Windows and OS/2

For Windows: Use the Windows AT command to start the Apply program at a specific time. For example, the following command string starts the Apply program for Windows at 15:00.

c:\>AT 15:00 /interactive "c:\SQLLIB\BIN\db2cmd.exe
    c:\SQLLIB\BIN\asnapply.exe qualid1 cntldb"

Before you enter the AT command, the Windows Schedule Service should already be started.

For OS/2: Use the Alarms program in the OS/2 Productivity set to start the Apply program at a specific time.

Stopping Apply for Windows and OS/2

Use the ASNASTOP command or a key combination to stop the Apply program in an orderly way.

>>-ASNASTOP--Apply_qualifier-----------------------------------><
 

To use the command, do the following from a window where the Apply program is not running:

  1. Set environment variable DB2INSTANCE to the value set when the Apply program was started.

  2. Set environment variable DB2DBDFT to the source server specified when the Apply program was started (or the DB2DBDFT value used when the Apply program was started).

  3. Enter the command.


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

[ DB2 List of Books | Search the DB2 Books ]