|
|
REPSERVER - Replicating the Data
The actual replication is performed by running the REPSERVER program. This program will handle the replication for one subscription. This program connects to source database as REP_SOURCE_USER and to the target database as REP_TARGET_USER.
MIMSYNC is typically used before replication is first set-up, or has been halted for some reason, to make sure that source and target tables have the same contents. After the synchronization, the replication functionality ensures that the tables remain identical.
Syntax
usage: repserver [options (except -t)] [source_database] [subscription] repserver -t [--spassword=password] [source_database] [subscription] options: -l logfile, --logfile=logfile Logfile, if omitted standard output -e, --exit Exit option -t, --stop Terminate replication server --spassword=password REP_SOURCE_USER source password --tpassword=password REP_TARGET_USER target passwordIf any required parameter is omitted, the program will prompt for these values.
The REPSERVER program will read the log tables for all tables in the subscription and perform the same operations on the target database. After each commit on the target database the data in the log tables will be deleted. Once all operations have been done the program will sleep for the rest of the interval specified for the subscription. If the interval for the subscription is set to 0 the program will poll the log tables for any data continuously.
Start the Replication
To start the replication for a subscription the REPSERVER program can be started with following command line arguments:
repserver [--spassword=password] [--tpassword=password] [--logfile=logfile]
[--exit] database [subscription-name]Note: The REPSERVER program should normally be run as a detached process on VMS, or as a background process on Unix.
Stop the Replication
To stop the replication the REPSERVER program should be run with the following options
REPSERVER -t [--spassword=password] database subscription-nameThis will set the stopping flag in the replication dictionary to 'YES' for the specified subscription. The REPSERVER program will periodically look at this flag, when not active. This means that it can take some time before the replication is stopped.
Error handling
Most Mimer SQL errors are considered fatal for REPSERVER, with the exception of the following three:
- Error -10101, INSERT operation invalid because the resulting table will contain a primary key duplicate
- Error -10110, unique constraint violation
- Error 100, record for update or delete not found
These errors will only result in a warning. This is to make replication possible even if the target table is not identical to the source table.
If REPSERVER gets a transaction conflict, it will try to execute the transaction once more. If the second attempt fails REPSERVER considers this a fatal error.
|
Mimer Information Technology AB Voice: +46 18 780 92 00 Fax: +46 18 780 92 40 info@mimer.se |
|
|