Elevate Software

Login Login


Home  Elevate Software Blog  Mirroring DBISAM Database Server Code

Icon Mirroring DBISAM Database Server Code

Posted by Tim Young on Wed, Jul 29 2015
You can (finally) download the promised mirroring server for DBISAM 4.35 and higher here:

Mirroring DBISAM Database Server Code

It will mirror one (and only one) database to another local or remote database, and works safely with transactions. The mirroring functionality will automatically try to open, and create if necessary, two tables in the source database:


MirrorData Table

The MirrorData table holds any data that is pending for mirroring. The ActionType field in the MirrorData indicates the type of operation:


The TableName field indicates the table on which the operation occurred (if applicable). The OldValues and NewValues fields contain the record data for record operations, and the Tables field contains the list of affected tables for transaction operations.

MirrorLog Table

The MirrorLog table contains all mirroring error messages, and the date/time when they occurred.

Mirroring Parameters

The mirroring parameters are controlled via a special section in the dbsrvr.ini file. Paste the following section into your dbsrvr.ini and modify as necessary in order to properly set up and enabled the mirroring server.

[Mirror Parameters]
; Mirror update interval (default is 1000 milliseconds)
Mirror Update Interval=1000
; Max mirror failure retries (default is 4)
Mirror Max Fail Retries=4
; Mirror session type (0=Local 1=Remote)
Mirror Session Type=0
; Mirror remote session host name
Mirror Remote Host=
; Mirror remote session address
Mirror Remote Address=
; Mirror remote session port
Mirror Remote Port=12005
; Mirror remote session service name
Mirror Remote Service=
; Mirror remote session user name
Mirror Remote User=Admin
; Mirror remote session password
Mirror Remote Password=DBAdmin
; Mirror ping interval (default is 30 seconds)
Mirror Remote Ping Interval=30
; Mirror database (directory if session is local, database name if session is remote)
Mirror Database=c:\mirrortarget
; Name of database to mirror
Mirrored Database=Source
; Tables to mirror, comma-separated, or single asterisk (*) for all tables (default)
Mirrored Tables=*

The Mirror Max Fail Retries determines how many times the DBISAM Database Server will attempt to retry a mirroring operation before it suspends mirroring. If mirroring is suspended, then stopping/starting the DBISAM Database Server will allow the mirroring to resume. However, if the error being experienced is fatal, such as a key violation, you will need to manually edit the MirrorData table and edit/remove the offending mirroring operations in order to allow the mirroring to successfully resume.

If you have any questions or problems, just let me know. If everyone likes this, I can see about making it a more permanent part of DBISAM so that it shows up in the Server Administration Utility, etc.

Tags: DBISAM, Mirroring, ReplicationPermanent Link

Comments Comments (2) You must be logged in to comment

Comment Mirco Malagoli said... Reply
Good news but what is the logic of operation?
Which servers types are to be installed and where?
Does the mirror server also work as normal server?
Many tanks!

Comment Tim Young [Elevate Software] said... Reply
I'm not sure what you're asking regarding the "logic of operation".

You need at least one DBISAM Database Server to perform the mirroring, and this mirroring server can replicate the data to another local database or another database residing on another DBISAM Database Server.  That's what the Mirror Session Type setting specifies.

And yes, the mirroring server also works as a regular server.