Marking and unmarking stored procedures

Replication Agent supports Replication Server function replication by replicating the invocation of stored procedures in the primary database.

NoteIn this document, the terms function and stored procedure are synonyms.

Replication Agent can replicate both applied functions and request functions:

NoteStored procedure replication is not supported for IBM DB2 Universal Database.

Replication Agent does not distinguish between these two function types, except to supply a specific user and password for use with request functions. If you are using request functions, the configuration parameters function_username and function_password must be supplied.

For more information about applied and request functions, see the Managing Replicated Functions chapter of the Replication Server Administration Guide.

For more information about the function_username and function_password configuration parameters, see the Replication Agent Reference Manual.

In order to replicate a stored procedure invoked in a primary database, the stored procedure must be marked for replication, and replication must be enabled for that stored procedure. (This is analogous to marking and enabling replication for tables.)

NoteMarking a stored procedure for replication is separate from enabling replication for the stored procedure. If the value of the pdb_dflt_object_repl parameter is true, replication is enabled automatically at the time a stored procedure is marked. See “Enabling and disabling replication for stored procedures”.

If a marked stored procedure performs operations that affect a marked table, the operations that affect the marked table are not captured for replication; only the invocation of the marked stored procedure is replicated.

When you mark a stored procedure for replication, Replication Agent creates a shadow-row procedure for that stored procedure. Replication Agent for Oracle and Replication Agent for UDB also modify the marked stored procedure as follows:

To temporarily suspend replication of a marked stored procedure (for example, when database maintenance operations are performed in the primary database), you can disable replication for the stored procedure.

When you unmark an object that has been marked for replication, the transaction log objects that were created to facilitate the replication for that object are removed from the primary database.

For more information on the Replication Server function replication feature, see the Replication Server Administration Guide.