Mimer SQL Documentation TOC PREV NEXT INDEX

Mimer SQL Developer Site

MIMSYNC - Synchronizing Tables

A third component in the replication service is the MIMSYNC program. It is typically run in batch and operates on pairs of tables, where one table resides in the source database and the other resides in the target database. Data manipulation operations are performed to ensure that the two tables contain the same rows. The table in the source database is considered to be the master, which means that MIMSYNC will only modify (delete/insert/update) the table in the target database.

Synchronization can in some cases be used instead of replication. If the replication updates only need to be performed, say, every 24 hours, this could be done by a batch job running MIMSYNC each night.

The MIMSYNC program supports synchronization between tables in the source and target database. The program operates on pairs of tables, and compares the contents of the two tables in a pair and makes both contain the same records. The table in the source database is considered to be the master, which means that it is the table in the target database that will be updated. The SQL statements needed to modify the target table are constructed and grouped into reasonably large transactions (1 000 rows).


 usage: mimsync -s [options] [subs-options]  [source_database] [subscription]
        mimsync -t [options] [table-options] [source_database]
     -s    Synchronizes all tables in a subscription
     -t    Synchronizes a pair of tables
     -l logfile, --logfile=logfile    Logfile name, if omitted standard output
     -?          --help               Display this help and exit
                 --noexecute          Do not update target, verify only
                 --version            Output version information and exit
     --spassword=password    REP_SOURCE_USER source password
     --tpassword=password    REP_TARGET_USER target password
     --stable=table          Source table
     --ttable=table          Target table
     --susername=user        Source user
     --spassword=password    Source password
     --sprogram=program      Source program
     --susing=password       Source program password
     --tdatabase=database    Target database
     --tusername=user        Target user
     --tpassword=password    Target password
     --tprogram=program      Target program
     --tusing=password       Target program password

If the database, user and/or password switches are not given the program will prompt for database, user and/or password. The other switches are optional.

 $ mimsync -s --logfile=synclog --spassword=secret --tpassword=secret
sourcedb subs1 $ mimsync -t --suuser=SrcUsr --spassword=scrt
--tdatabase=TrgDb --tuser=TrgUsr --tpassword=scrt
table1 table2 SrcDb


When synchronizing a subscription MIMSYNC is run as REP_SOURCE_USER and REP_TARGET_USER.

When synchronizing a pair of tables MIMSYNC can be run as any user (having SELECT and INSERT rights).


Note: MIMSYNC may fail to synchronize a table that has a foreign key reference to itself. Also circular foreign keys may cause problems.


When executing MIMSYNC, it will write execution information to its log file. (If no log file is specified, standard output will be used.)

Example log file:
 2016-11-29 09:33:41.62   <Information>
 Starting Mimer SQL Synchronization
 2016-11-29 09:33:42.74   <Information>
 Mimer SQL 10.1.0A
 Mimer SQL Synchronization
 for subscription S on database SOURCEDB STARTED
 Synchronizing table SYSADM.T1...
 Synchronization of table SYSADM.T1 complete
 Synchronizing table SYSADM.T3...
 Synchronization of table SYSADM.T3 complete
 2016-11-29 09:33:42.98   <Information>
 Mimer SQL Synchronization for subscription S STOPPED

Mimer Information Technology AB
Phone: +46 18 780 92 00
Mimer SQL Documentation TOC PREV NEXT INDEX