pdb_setrepproc

Description

NoteThis command is available only for Oracle and Microsoft SQL Server.

Returns stored procedure replication marking status; marks specified procedures for replication; unmarks all marked procedures or a specified procedure; enables or disables replication for all marked procedures or a specified procedure.

Syntax

To return stored procedure replication marking status:

pdb_setrepproc [procname|mark|unmark|enable|disable]

To unmark, enable, or disable all marked stored procedures:

pdb_setrepproc all, {unmark[, force]|enable|disable}

To mark a specified stored procedure:

pdb_setrepproc procname, [repname,] mark

To unmark, enable, or disable a specified stored procedure:

pdb_setrepproc procname, {unmark[, force]|enable|disable}

NoteFor Microsoft SQL Server, the pdb_dflt_object_repl configuration parameter has no impact on pdb_setrepproc command.

Parameters

procname

The name of a user stored procedure in the primary database.

The procname option can be delimited with quote characters to specify the character case.

If mixed character case (both uppercase and lowercase) is required, the name must be delimited. For example:

"Proc"

NoteIf you must use an object name case that does not match the setting of the ltl_character_case parameter, the object name must be delimited.

If an object name contains any non-alphanumeric characters, such as spaces, periods, and so forth, it must be delimited with quote characters. For example:

"proc name"
"proc.name"

If an object name contains a period, it must be both owner-qualified and delimited with quote characters. For example:

owner."proc.name"
"proc.owner"."proc.name"
repname

The name of the stored procedure specified in a function replication definition for the primary stored procedure.

The repname option can be delimited with quote characters to specify character case. See the previous description of the procname option for details.

By specifying a replicated name, stored procedure invocations can be replicated to a stored procedure invocation in the replicate database that has a different stored procedure name from the primary database.

NoteThe replicated name you specify with the pdb_setrepproc command must match the name specified by a “with primary function named” clause in a Replication Server function replication definition for the primary database connection. The Replication Agent cannot validate the function replication definition, but if it does not exist, function replication from the primary database will fail.

all

A keyword that refers to all user stored procedures in the primary database. By using the all keyword, you can mark all user stored procedures, or apply an unmark, enable, or disable operation to all marked stored procedures.

mark

NoteYou must specify an owner when using the mark keyword.

A keyword that refers to marking user stored procedures for replication.

unmark

A keyword that refers to unmarking marked stored procedures.

force

A keyword that refers to the unmark operation. When the force keyword follows the unmark keyword, the pdb_setrepproc command immediately unmarks the specified stored procedure in the primary database, without first checking the enable status of the stored procedure or checking for pending operations in the transaction log. When the force keyword follows the unmark keyword and the all keyword, the pdb_setrepproc command immediately removes replication marking from all marked stored procedures in the primary database, regardless of their enable status or pending operations in the transaction log.

The force keyword also forces complete execution of the unmarking script, even if errors occur during the unmarking process. Normally, when errors occur during script execution, the script terminates immediately without completing.

Note Sybase recommends that you read the “Usage” section that follows to better understand how scripts are used in Oracle procedure marking and unmarking.

The force keyword can be useful when a previous script execution failed and left the unmarking operation incomplete. When errors occur during a forced script execution, the pdb_setrepproc command returns the following message:

Errors were encountered and ignored during FORCED script execution. See error log for details.
enable

A keyword that refers to enabling replication for marked stored procedures.

disable

A keyword that refers to disabling replication for marked stored procedures.

Examples

Example 1

pdb_setrepproc

This command returns replication marking information for all marked stored procedures in the primary database.

Example 2

pdb_setrepproc authors

This command returns replication marking information for the user stored procedure named “authors” in the primary database.

Example 3

pdb_setrepproc authors, mark

This command marks the user stored procedure named “authors” in the primary database.

Example 4

pdb_setrepproc authors, enable

This command enables replication for the marked stored procedure named “authors” in the primary database.

Example 5

pdb_setrepproc all, unmark

This command unmarks all marked stored procedures in the primary database.

Usage

For Oracle:

To support stored procedure replication in Oracle, a stored procedure that is marked for replication must be modified. The modification is required to record the stored procedures execution in the Oracle transaction log. As a result of the modifications, the following behavior should be considered when marking and unmarking stored procedures in Oracle:

See also

pdb_setrepcol, pdb_setreptable, ra_config