Table replication definition file
ObjectServer gateways can replicate the data in any table between ObjectServers. Details of the tables to be replicated are stored in the table replication definition file. The table replication definition file defines the tables in the source ObjectServer that the ObjectServer Gateway replicates in the target ObjectServer. The gateway reads this table only at startup. If you edit this table while the gateway is running, restart the gateway so that the changes take effect.
For unidirectional gateways, the Gate.Reader.TblReplicateDefFile property specifies the location of the table replication definition file.
For bidirectional gateways, the Gate.ObjectServerA.TblReplicateDefFile property and the Gate.ObjectServerB.TblReplicateDefFile property specify the locations of the files.
Syntax
The syntax of the table replication definition file is as follows:REPLICATE {ALL | INSERTS, UPDATES, DELETES, FT_INSERTS, FT_UPDATES, FT_DELETES}FROM TABLE sourcetable
USING MAP mapname
[FILTER WITH filter_clause] [INTO destinationtable ] [ ORDER BY order_string] [ASC | DESC] [WITH NORESYNC]
[RESYNC DELETES FILTER condition]
[SET UPDTOINS CHECK TO {ENABLED|DISABLED|FORCED}]
[AFTER IDUC DO command]
[CACHE FILTER condition]
The following table describes the variable in the syntax.
Variable | Description |
---|---|
sourcetable | The table to be replicated in the target ObjectServer. |
mapname | The map definition that the defines the table. |
filter_clause | The filter the that gateway uses to select rows for replicating.
By default, filtering is inclusive, which means that the filter sends
only those events that match the filter definition. To send events
that do not match the filter definition, precede the equals sign (=)
with an exclamation mark (!). For example, the following filter clause
sends all events whose severity is not set to 5: |
destinationtable | The table to receive the replicated table. If this clause is omitted, the name of the destination table is the same as the value of sourcetable. |
order_string | A comma-separated list of column names. Each column name can be followed by ASC or DESC, to indicate whether the values in the column are to be in ascending or descending order. |
condition | The SQL condition that the gateway adds to the SELECT statement when limiting the cache entries that the gateway retrieves during a cache refresh. |
propertyname | The property that the gateway uses to filter the table data. Only rows that satisfy the filter are replicated. |
propertyvalue | The argument to be used in the filter. |
targettable | The name of the table in which to replicate the data. |
delete_filter_clause | The resynchronization delete filter that the gateway issues to the target ObjectServer. |
The following table describes the options for the REPLICATE command.
Option | Description |
---|---|
ALL | The equivalent of INSERTS, UPDATES, DELETES. |
WITH NORESYNC | Optional: Specifies the tables that you do not want to be resynchronized. |
ORDER BY | Optional: Specifies the order in which the rows are returned
to the gateway from the ObjectServer. For each column, you can specify how the rows are sorted.
To define multiple columns for sorting, specify a comma-separated list; for example:
|
RESYNC DELETE FILTER | Optional: Defines a resynchronization deletion filter that specifies which rows to remove before insertion into the target table. This filter is used when the rows in the target and source tables are not an exact match. |
SET UPDTOINS CHECK TO | Optional: allows you to configure the update-to-insert functionality.
|
AFTER IDUC DO | Optional: Specifies a column and associated value that the gateway applies to all rows that are inserted, updated, or deleted. |
CACHE FILTER | Optional: Reduces the amount of data that the gateway retrieves
during a unidirectional gateway cache refresh. The condition is added
to the end of the select statement that it uses to retrieve cache
entries. If you want to use the CACHE FILTER option, it must be the last entry in the table replication definition. |