By default, Mirror Replication Agent will create a replication
definition in Replication Server for each procedure that is explicitly
marked for replication. If this is not the default behavior desired,
you can turn off automatic replication definition creation using
the pdb_auto_create_repdefs configuration
parameter.
To mark a stored procedure for replication
Log in to the Mirror Replication Agent instance with the administrator login.
Use the pdb_setrepproc command to determine if the stored procedure is already marked in the primary database:
pdb_setrepproc pdb_proc
where pdb_proc is the name of the stored procedure in the primary database that you want to mark for replication.
If the pdb_setrepproc command returns information that the specified stored procedure is marked, you do not need to continue this procedure
If the pdb_setrepproc command returns information that the specified stored procedure is not marked, continue this procedure to mark the stored procedure for replication.
Use the pdb_setrepproc command to mark the stored procedure for replication.
The pdb_setrepproc command allows you to mark the primary stored procedure to be replicated and specify a different stored procedure name to use in the replicate database (as specified in a function replication definition).
Use the following command to mark the stored procedure for replication using a function replication definition with the same stored procedure name:
pdb_setrepproc pdb_proc, mark
where pdb_proc is the name of the stored procedure in the primary database that you want to mark for replication.
Use the following command to mark the stored procedure for replication using a function replication definition with a different stored procedure name:
pdb_setrepproc pdb_proc, rep_proc, mark
where:
pdb_proc is the name of the stored procedure in the primary database that you want to mark for replication.
rep_proc is the name of the stored procedure in the function replication definition for this stored procedure.
Consider the following:
If the value of the pdb_dflt_object_repl parameter is true, the stored procedure marked for replication with the pdb_setrepproc command is ready for replication after you invoke the pdb_setrepproc command successfully.
If the value of the pdb_dflt_object_repl parameter is true (the default value), you can skip step 4 in this procedure
If the value of the pdb_dflt_object_repl parameter is false, you must enable replication for the stored procedure before replication can take place
Use the pdb_setrepproc command to enable replication for the marked stored procedure:
pdb_setrepproc pdb_proc, enable
where pdb_proc is the name of the marked stored procedure for which you want to enable replication.
After replication is enabled for the stored procedure, you can begin replicating invocations of that stored procedure in the primary database.
For Oracle only: If you disabled
DDL replication during stored procedure marking, remember to re-enable
DDL replication. Since marking of a stored procedure modifies that
stored procedure, you must first disable DDL replication to prevent
the marking modifications from replicating to the standby site.
See “Enabling replication for DDL”.