Replication-only triggers
AssigneeInternational Business Machines Corporation
InventorClarence Madison Pruet, III
Life of this patent
Estimating the term…
Abstract
A method provides a replication-only trigger in a database management system. The database management system has a source server and a target server. At least one replication-only trigger which is associated with a replication operation is registered. The replication-only trigger is associated with a stored procedure. The stored procedure is invoked in response to an occurrence of the replication operation in replicating data from the source server to the target server.
Claims28
A method of managing replicated data at a target database, comprising:
- registering a replication-only trigger specifying a replication condition and a stored procedure, the replication-only trigger configured to invoke the stored procedure only upon detecting a replication event at the target database that satisfies the replication condition, wherein the replication-only trigger comprises one of:
- (i) a pre-commit trigger, and (ii) a post-commit trigger, wherein the pre-commit trigger executes within a transaction that applies the replication event to data in the target database, wherein the post-commit trigger creates an indication specifying whether the replication event is successfully applied to the data in the target database, wherein the replication-only trigger comprises a replication trigger header associated with a replication trigger column;
- monitoring, at the target database, replication events received from a source database to detect when the replication condition is satisfied;
- responsive to detecting a first replication event that satisfies the replication condition specified in the replication-only trigger, invoking the stored procedure specified by the replication-only trigger at the target database;
- and
- updating a progress table that indicates a commit point of a transaction which was last processed, wherein invoking the specified stored procedure is based on the commit point of the progress table.
A computer program product for managing replicated data at a target database, comprising:
- a non-transitory computer-readable storage medium having computer readable program code embodied therewith, the computer readable program code executable to perform an operation comprising:
- registering a replication-only trigger specifying a replication condition and a stored procedure, the replication-only trigger configured to invoke the stored procedure only upon detecting a replication event at the target database that satisfies the replication condition, wherein the replication-only trigger comprises one of:
- (i) a pre-commit trigger, and (ii) a post-commit trigger, wherein the pre-commit trigger executes within a transaction that applies the replication event to data in the target database, wherein the post-commit trigger creates an indication specifying whether the replication event is successfully applied to the data in the target database wherein the stored procedure specified in the replication-only trigger is configured to be invoked only once, wherein registering the replication-only trigger comprises specifying a set of attributes of the replication-only trigger, wherein the set of attributes comprise:
- (i) a name of a server hosting the target database, (ii) a replicate name, (iii) a name of the stored procedure, (iv) a type of the replication-only trigger, and (v) a set of database columns passed to the stored procedure;
- monitoring, at the target database, replication events received from a source database to detect when the replication condition is satisfied;
- and
- responsive to detecting a first replication event that satisfies the replication condition specified in the replication-only trigger, invoking the stored procedure specified by the replication-only trigger at the target database.
A system, comprising:
- a processor;
- and
- a memory containing a program that, when executed by the processor, performs an operation for managing replicated data at a target database, the operation comprising:
- registering a replication-only trigger specifying a replication condition and a stored procedure, the replication-only trigger configured to invoke the stored procedure only upon detecting a replication event at the target database that satisfies the replication condition, wherein the replication-only trigger comprises one of:
- (i) a pre-commit trigger, and (ii) a post-commit trigger, wherein the pre-commit trigger executes within a transaction that applies the replication event to data in the target database, wherein the post-commit trigger creates an indication specifying whether the replication event is successfully applied to the data in the target database wherein the stored procedure specified in the replication-only trigger is configured to be invoked only once, wherein registering the replication-only trigger comprises specifying a set of attributes of the replication-only trigger, wherein the set of attributes comprise:
- (i) a name of a server hosting the target database, (ii) a replicate name, (iii) a name of the stored procedure, (iv) a type of the replication-only trigger, and (v) a set of database columns passed to the stored procedure;
- monitoring, at the target database, replication events received from a source database to detect when the condition replication is satisfied;
- and
- responsive to detecting a first replication event that satisfies the replication condition specified in the replication-only trigger, invoking the stored procedure specified by the replication-only trigger at the target database.
Dependencies are inferred from the claim text.