DBReplication - Administrate replication database
For supporting replication clients, the database must enable replication clients. Also the database may be disabled or re-enabled for replication. This can be done by calling DBReplication utility.
The program may be called with a database path or an ini-file. The database must be accessible on the local machine or as file share. In case of encoded databases, the ini-file is required in order to provide the access key defined in the dictionary. The ini-file must contain a [DATABASE] section defining at least database and dictionary path. When using an external key file, the KEY_FILE option is required in addition.
The program allows enabling or disabling the replication mode for the database.After disabling the replication mode, the server will not provide replication services for this database anymore. When re-enabling (i. enable an enabled replication database), the replication version will be increased and transaction number is reset. Re-enabling is required when exceeding the transaction limit.
Usually, the replication database version is increased by 1. When, however, disabling replication before, the version will be reset. In order to define the next or higher version for the database, it may be passed explicitly by the version option.
The utility may be called locally or as client in a client/server application (object or replication server). As client/server application, all clients accessing the database will be terminated (killed) after waiting the defined wait time interval. New clients cannot be started until the utility has terminated.
DBReplication db_or_ini [oper] [-T:ta_limit] [-V:version] [-W:wait] [-q} [-h]
db_or_ini - symbolic name or file path referring to the database or ini-file.
oper - operation: enable - enable RDB mode, disable - disable RDB mode.
ta_limit - maximum number of transactions stored on server
version - new replication version number (default: next version number)
wait - time waiting for terminating clients
Enabling replication database mode will automatically create a backup file (a compressed version of the database) for being downloaded to client applications when starting up (opening the database the first time).
The backup file for download is either stored in the same directory as the database but with extension .ozi or in the directory defined in the BACKUP_FILES option variable (global or main section variable) when being defined.
In order to reset the transaction number and to force clients to load an updated version for the database from the server, one may re-enable (DBReplication enable ...) a replication database. This causes increasing the version number of the replication database. Clients running with an older version of the replication database will automatically reload the database when starting an application. Moreover, the transaction-log is cleared, i.e. the number of update transactions is reset to 0.
Re-enabling the database allows also changing the maximum transaction number for the database.
When the transaction limit is exceeded, further transactions will fail and applications will not work properly. In order to avoid such situations, one may define re-enable options
[RE_ENABLE]
TIME=1:30
LIMIT=10
The time value defines the time for the daily limit check by the server. When less than LIMIT percent of maximum transactions are available, the database will be re-enabled after closing all connections for the database still opened.
Not yet implemented
In some cases, for maintenance reasons the replication master base is used in a local environment. To ensure database consistency, the replication feature for the database is deactivated automatically, when opening the database in Update or Write mode.
When moving the maintained master database back to the server and re-starting the server, the server detects a deactivated version and will implicitly re-enabling the database before starting.
The replication mode is automatically reset, when running a replication database application with local database access. In this case, a confirmation for resetting the replication mode is requested. When not confirming, opening the database fails and the application stops. Otherwise, the replication mode is disabled and must be enabled later, again, in order to use the database in replication mode.
In order to disable replication mode explicitly, DBReplication must be called with operation disable.