Setting up consists of configuring the source, target, and control servers, and setting up NT services on Windows. 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.
Important: The Capture program is bound automatically during execution. Therefore, the following steps for binding the Capture program on Windows and OS/2 are optional. If you want to specify options or check that all bind processes completed successfully, complete the following tasks:
DB2 CONNECT TO database
where database is the source server database.
DB2 UPDATE DATABASE CONFIGURATION FOR database_alias USING LOGRETAIN ON DB2 BACKUP DATABASE database_alias
or:
DB2 UPDATE DATABASE CONFIGURATION FOR database_alias USING USEREXIT ON DB2 BACKUP DATABASE database_alias
You might need to increase DBHEAP, APPLHEAPSZ, PCKCACHESZ, LOCKLIST, and LOGBUFSZ based on your installation requirements.
DB2 BIND @CAPTURE.LST ISOLATION UR BLOCKING ALL
where UR specifies the list in uncommitted read format for greater performance.
These commands create a list of packages, the names of which are in the file CAPTURE.LST.
Important: The Apply package is bound automatically during execution. Therefore, the following steps for binding the Apply package on Windows and OS/2 are optional. If you want to specify options or check that all bind processes completed successfully, complete the following tasks:
DB2 CONNECT TO database
where database is the source server database.
Note: | If the source server database is catalogued as a remote database, you might
need to specify a user ID and password on the DB2 CONNECT TO
command. For example:
DB2 CONNECT TO database USER userid USING password |
DB2 BIND @APPLYCS.LST ISOLATION CS BLOCKING ALL
DB2 BIND @APPLYUR.LST ISOLATION UR BLOCKING ALL
where cs specifies the list in cursor stability format, and ur specifies the list in uncommitted read format.
These commands create a list of packages, the names of which are in the files APPLYCS.LST and APPLYUR.LST.
DB2 CONNECT TO database
where database is the target server database.
DB2 BIND @APPLYCS.LST ISOLATION CS BLOCKING ALL GRANT PUBLIC
DB2 BIND @APPLYUR.LST ISOLATION UR BLOCKING ALL GRANT PUBLIC
Because the Apply program uses static SQL calls for the control tables, the Apply bind process searches for the control tables at each server that the Apply program is bound to, regardless of whether these control tables are used at a server.
For end-user authentication to occur at the source server, you must provide a password file with an AUTH=SERVER scheme. The Apply program uses this file when connecting to the source server. Give read access only to the user ID that will run the Apply program.
Creating a password file:
The password file must meet the following criteria:
applyqual.PWD
Where applyqual is a case-sensitive string that must match the case and value of the Apply qualifier (APPLY_QUAL) in the subscription set table exactly.
For example: DATADIR.PWD
This naming convention is the same as the log file name (.app) and the spill file name (.nnn), but with a file extension of .PWD.
SERVER=server_name USER=userid PWD=passwordWhere:
For more information about authentication and security, refer to the IBM DB2 Universal Database Administration Guide.
You can operate the Capture and Apply programs for Windows 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.
You must install the replication service manually (installation is not automatic). The following steps explain how to install the replication service and set it up as an NT service.
Tip: | In this section, x:\ refers to the drive and directory containing executable programs. These programs are usually located in the \sqllib\bin directory. |
To install replication and set up the NT service:
ASNINST x:\ASNSERV.EXE
ASNPATH=x:\
db_name x:\ASNCCP parameters
db_name x:\ASNAPPLY parameters
where db_name specifies the name of the source database for the Capture program and the name of the control database for the Apply program, x:\ is the location of the programs, and parameters specifies one or more invocation parameters (such as APPLYQUAL).
To use the Capture program and Apply program trace facilities, specify the invocation parameters in the file. For example:
DBNAME1 C:\SQLLIB\BIN\ASNCCP COLD TRACE<CRLF> DBNAME2 C:\SQLLIB\BIN\ASNAPPLY APPLYQUAL DBNAME2 TRCFLOW TRCFILE<CRLF>
The TRCFILE invocation parameter is necessary, in addition to the usual trace invocation parameter (such as TRCFLOW), to generate an Apply program trace.
Do not specify an output file name for traces. These will be written to default locations, with default file names, as follows:
x:\instancenamedbname.trc
x:\APPLYtimestamp.trc
x:\ntserv.asn
The Replication Services program stores all messages in x:\asnserv.log. If you encounter any problems, check this log file for error messages.
To stop the Capture and Apply programs:
Important: After you start the service, the Capture and Apply programs run independently of ASNSERV. Therefore, stopping ASNSERV does not stop the Capture and Apply programs. Use the ASNCMD STOP command in a command window to stop the Capture program. Use the ASNASTOP command in a command window to stop the Apply program.
To remove replication from the NT service:
To remove Replication Services from the NT Control Panel, run the ASNREMV program.