IBM Books

Replication Guide and Reference


Operating Apply for UNIX platforms

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 UNIX platforms

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

To start the Apply program on UNIX:

  1. Log on with the IBM Replication user ID.

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

  3. Set the LIBPATH environment variable or edit the .profile file in the same environment in which the Apply program starts.

    AIX example:

    export LIBPATH=db2instance_home_directory/sqllib/lib:/usr/lib:/lib
    

    HP-UX example:

    export SHLIB_PATH=db2instance_home_directory/sqllib/lib:/usr/lib:/lib
    

    Solaris and UnixWare 7 example:

    export LD_LIBRARY_PATH=db2instance_home_directory/sqllib/lib:/usr/lib:/lib
    export NLS_PATH=/usr/lib/locale/%L/%N:/usr/lib/locale/prime/%N
    

    where db2instance_home_directory is the name of the DB2 instance's home directory.

  4. Enter the asnapply command and options:
>>-asnapply--apl_qual----+-----------+---+-----------+---------->
                         '-ctrl_serv-'   +-loadxit---+
                                         '-noloadxit-'
 
>-----+----------+---+---------+---+---------+---+----------+--->
      +-inamsg---+   +-notrc---+   '-trcfile-'   +-notify---+
      '-noinamsg-'   +-trcerr--+                 '-nonotify-'
                     '-trcflow-'
 
>-----+---------+---+----------+---+----------+---+----------+-->
      +-sleep---+   '-delay(n)-'   '-copyonce-'   '-logreuse-'
      '-nosleep-'
 
>-----+-----------+---+----------+-----------------------------><
      '-logstdout-'   '-trlreuse-'
 

Table 28 defines the invocation parameters.

Table 28. ASNAPPLY Invocation Parameter Definitions for UNIX Platforms
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 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 UNIX platforms

Use the at command to start the Apply program at a specific time. For example, the following command starts the Apply program at 3:00 p.m. on Friday:

at 3pm Friday asnapply myqual

Stopping Apply for UNIX platforms

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 ]