This chapter describes how to replicate the execution of a stored procedure from the source database to the destination database using replicated functions.
When you use function replication, Replication Server replicates the execution of a stored procedure to the destination database. That is, when a stored procedure is executed at the source database, the replication server invokes the execution of another stored procedure at the destination database. The two stored procedures need not have the same name nor perform the same tasks.
Refer to the Replication Server Design Guide for information about replication system design issues that concern replicated stored procedures.
This chapter covers the distribution of stored procedures via function replication definitions. The distribution of stored procedures associated with table replication definitions is described in Appendix A, “Asynchronous Procedures,” in the Replication Server Administration Guide Volume 2. The request function distribution with versions earlier than 15.1 without subscription is described in Appendix C, “Pre-15.1 Request Function Replication,” in the Replication Server Administration Guide Volume 2.
You identify the stored procedure at the source and the information that is to be passed to the destination by creating a function replication definition, which specifies:
The names of the stored procedures at the source and destination databases (if they are different)
The datatypes and parameters that are to be passed to the destination stored procedure
To satisfy the requirements of distributed applications, Replication Server provides two ways to implement replicate functions. Use:
An applied function to deliver a transaction to a replicate database by the maintenance user. See “Applied functions” for more information.
A request function to deliver a transaction to a replicate database by the same user who invokes the stored procedure at the primary database. See “Request functions” for more information.
The maint_user runs the transaction at the replicate database if the function is replicated through applied function replication definition. The origin_user runs the transaction if the function is replicated through request function replication definition at the replicate database.