Sybase Replication Agent supports Replication Server function replication by replicating the invocation of stored procedures in the primary database.
In this document, the terms function and stored
procedure are synonyms.
Sybase Replication Agent can replicate both applied functions and request functions:
Applied functions are stored procedures that are executed in the primary database and generate transactions that affect data in the primary database.
Request functions are stored procedures that are invoked in one database (for example, a replicate database), then executed in another database (for example, a primary 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 Sybase 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.)
Marking 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. For more information,
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 also modifies the marked stored procedure as follows:
Inserts a new first step to execute the associated shadow-row procedure
Inserts a new last step to again execute the shadow-row procedure with different parameters.
If you need 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. For more information, see “Enabling and disabling replication for stored procedures”.
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.
Procedure replication is not supported for DB2 UDB.
For more information on the Replication Server function replication feature, see the Replication Server Administration Guide.