pdb_setreptable

Description

Returns replication marking status; unmarks all marked tables or a specified table; enables or disables replication for all marked tables or a specified table; marks a specified table for replication.

Syntax

To return replication marking status:

pdb_setreptable [tablename|mark|unmark|enable|disable]

To unmark, enable or disable all tables:

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

To mark, unmark, enable, or disable a specified table:

pdb_setreptable tablename, {mark[, owner]|
 unmark[, force] |enable|disable}

To mark a specified table for replication with a replicated name:

pdb_setreptable tablename, repname, mark[, owner]

Parameters

tablename

The name of a user table in the primary database.

The tablename parameter can be owner-qualified to include the primary table owner name, with each element separated by a period. For example:

owner.table

NoteIf you want to use owner-qualified table names for either primary tables or replicate tables, you must set the value of the Replication Agent use_rssd parameter to true.

This parameter can be delimited with quote characters to specify the character case.

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

"Owner".table
"Owner"."Table"

Each mixed case element of the tablename parameter must be delimited separately, as illustrated in the previous example.

NoteIf you must use an object name case that does not match the value 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:

"table name"
owner."table name"

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

owner."table.name"
"table.owner"."table.name"
repname

The name of the table specified in the replication definition for a primary table.

NoteThe replicated name (including the owner name) you specify with the pdb_setreptable command must match a table name specified by a with all tables named clause in a replication definition for the primary database connection. The Replication Agent pdb_setreptable command cannot verify the existence of a valid replication definition, but if it does not exist, replication from the primary table will fail.

The repname parameter can be owner-qualified to include the replicate table owner name, with each element separated by a period. For example:

repowner.reptable

NoteIf you want to use an owner-qualified replicate table name with the replicate owner’s name, do not use the owner keyword with the pdb_setreptable command. If you use the owner keyword and specify a replicate table name, the primary table owner name is sent with the replicate table name in the LTL.

This parameter can also be delimited with quote characters to specify the character case. See the previous description of the tablename parameter for specifics.

all

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

mark

A keyword that refers to replication marking.

When the mark keyword is the only option, the pdb_setreptable command returns a list of all marked tables in the primary database. When the mark keyword follows a table name (and optionally a replicated name), the pdb_setreptable command marks the specified table in the primary database.

owner

A keyword that refers to the mark operation.

When the optional owner keyword follows the mark keyword, the pdb_setreptable command marks the specified table in the primary database so that when operations against that table are replicated, the primary table owner name is sent along with the table name in the form owner.tablename when LTL is sent to the primary Replication Server.

NoteIf you want to use owner-qualified table names for either primary tables or replicate tables, you must set the value of the Replication Agent use_rssd parameter to true.

NoteIf you want to use an owner-qualified replicate table name with the replicate owner’s name, do not use the owner keyword with the pdb_setreptable command. If you use the owner keyword and specify a replicate table name, the primary table owner name is sent with the replicate table name in the LTL.

unmark

A keyword that refers to unmarking a marked table.

When the unmark keyword is the only option, the pdb_setreptable command returns a list of all tables in the primary database that are not marked for replication. When the unmark keyword follows a table name, the pdb_setreptable command removes replication marking for the specified table in the primary database. When the unmark keyword follows the all keyword, the pdb_setreptable command removes replication marking for all marked tables in the primary database.

force

A keyword that refers to the unmark operation.

When the force keyword follows the unmark keyword, the pdb_setreptable command immediately removes replication marking for the specified table in the primary database, without first checking the enable status of the table or checking for pending operations in the transaction log. When the force keyword follows the unmark keyword and the all keyword, the pdb_setreptable command immediately removes replication marking from all marked tables in the primary database, regardless of their enable status or any 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. 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_setreptable 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 tables.

When the enable keyword is the only option, the pdb_setreptable command returns a list of all marked tables in the primary database for which replication is enabled. When the enable keyword follows a table name, the pdb_setreptable command enables replication for the specified table in the primary database. When the enable keyword follows the all keyword, the pdb_setreptable command enables replication for all marked tables in the primary database.

disable

A keyword that refers to disabling replication for marked tables.

When the disable keyword is the only option, the pdb_setreptable command returns a list of all marked tables in the primary database for which replication is disabled. When the disable keyword follows a table name, the pdb_setreptable command disables replication for the specified table in the primary database. When the disable keyword follows the all keyword, the pdb_setreptable command disables replication for all marked tables in the primary database.

Examples

Example 1

pdb_setreptable authors

This command returns replication marking information for the table named authors in the primary database.

Example 2

pdb_setreptable mark

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

Example 3

pdb_setreptable disable

This command returns replication marking information for all marked tables for which replication has been disabled in the primary database.

Example 4

pdb_setreptable all, unmark, force

This command forces unmarking for all marked tables in the primary database.

Example 5

pdb_setreptable all, enable

This command enables replication for all marked tables in the primary database.

Example 6

pdb_setreptable authors, mark

This command marks for replication the table named authors in the primary database.

Example 7

pdb_setreptable authors, mark, owner

This command marks for replication the table named authors in the primary database so that the name of the primary table owner will be passed along with the table name in the LTL.

Example 8

pdb_setreptable authors, auth_name, mark

This command marks for replication the table named authors in the primary database with a replicate name auth_name.

Example 9

pdb_setreptable authors, auth_name, mark, owner

This command marks for replication the table named authors in the primary database with a replicate name auth_name so that the name of the primary table owner will be passed along with the replicate name in the LTL.

Example 10

pdb_setreptable authors, bob.auth_name, mark

This command marks for replication the table named authors in the primary database with a replicate name auth_name so that the name of the replicate table owner (bob) will be passed along with the replicate name in the LTL.

Example 11

pdb_setreptable authors, enable

This command enables replication for the marked table authors in the primary database.

Example 12

pdb_setreptable table=mark, enable

This command enables replication for the marked table named mark in the primary database.

Example 13

pdb_setreptable authors, unmark, force

This command forces unmarking for the marked table authors in the primary database.

Usage

See also

pdb_xlog, pdb_setrepcol, pdb_setrepproc, ra_config