Marking stored procedures in the primary database

To replicate invocations of a stored procedure in the primary database, the stored procedure must be marked for replication, and replication must be enabled for that stored procedure.

For Oracle, DDL replication must be disabled before marking (or unmarking) a stored procedure.

NoteProcedure replication is not available for UDB.

StepsMarking a stored procedure in the primary database

  1. Log in to the Replication Agent administration port.

  2. Use the pdb_setrepproc command to determine if the stored procedure you want to mark is already marked in the primary database:

    pdb_setrepproc pdb_proc
    

    Here, 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 and replication is enabled, you need not continue this procedure.

    • If the pdb_setrepproc command returns information that the specified stored procedure is marked but replication is disabled, skip step 3 and continue this procedure from step 4 to enable replication for the stored 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.

  3. Use the pdb_setrepproc command to mark the stored procedure for replication and specify the name to use for replication:

    • Use the following command to mark the stored procedure for replication using a function replication definition with the same procedure name:

      pdb_setrepproc pdb_proc, mark
      

      Here, 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 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 with all procedures named rep_proc clause in the function replication definition for this stored procedure.

    If the pdb_dflt_object_repl parameter is set to true (the default), the stored procedure marked for replication with the pdb_setrepproc command is ready for replication after you invoke the pdb_setrepproc command successfully, and you can skip step 4 in this procedure.

    If the pdb_dflt_object_repl parameter is set to false, you must enable replication for the stored procedure so replication can take place.

  4. Use the pdb_setrepproc command to enable replication for the marked stored procedure:

    pdb_setrepproc pdb_proc, enable
    

    Here, pdb_proc is the name of the marked stored procedure in the primary database for which you want to enable replication.

After the stored procedure is marked and replication is enabled for the stored procedure, you can begin replicating invocations of that stored procedure.