Download IBP Replicator 4.1
Transcript
126 IBP Replicator 4.1 CAVEAT :: These examples are for guidance toward a custom solution to a complex business problem. They are in no way intended to be templates or a recommendation to meddle with the generated System Objects. Use row-level replication conditions to achieve the effects indicated in the examples. Trigger sets created in the source database for London (for each target) would be modified by row-level conditions, to take the localised username into account when determining what to replicate: CREATE TRIGGER REPL$_XYZ FOR ATABLE ACTIVE AFTER INSERT POSITION 32760 AS BEGIN IF (USER<>'REPL') THEN /* row-level condition :USER<>'REPL' */ BEGIN IF (USER<>'REPL_MAN') THEN /* row-level condition :USER<>'REPL_MAN' */ BEGIN INSERT INTO REPL$LOG (....) VALUES(....); END END END This logic can be tabulated as follows: Source Username Target Username Condition Mancheste REPL r London REPL_MAN Birmingha REPL m London REPL_BIR Leeds REPL London REPL_LEE London REPL Manchester REPL USER <> 'REPL_MAN' London REPL Birmingham REPL USER <> 'REPL_BIR' London REPL Leeds REPL USER <> 'LEE' This ensures that data is replicated from one branch into the hub in London. The hub then replicates this data to the other branches, but not back to the originating branch. Replication Schema Definition The defined replication schema for such a scenario would look something like this: Manchester To London Source Database in Manchester - UserName REPL Target Database in London - UserName REPL_MAN Birmingham To London Source Database in Birmingham - UserName REPL Target Database in London - UserName REPL_BIR Leeds To London © 2013 IBPhoenix Editors