pdb_setreptable

Description

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

Syntax

To return replication marking status:

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

To mark all user tables (available only for Oracle and Microsoft SQL Server):

pdb_setreptable all, mark

To unmark, enable, or disable all marked tables:

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

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

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

NoteMarking or unmarking all tables at once in the primary database using pdb_setreptable all, mark or pdb_setreptable all, unmark is not supported in Replication Agent for UDB. You must mark or unmark each table individually.

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

pdb_setreptable tablename, repname, mark[, owner][, force]

To mark a specified table for replication immediately for any occurrence, that may or may not be marked:

pdb_setreptable tablename, mark[, immediate]

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

This parameter 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:

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

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

If an object name contains any non-alphanumeric characters, such as spaces or periods, 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 you specify with the pdb_setreptable command must match a table name specified by a with primary table named clause in a Replication Server replication definition for the primary database connection. The Replication Agent cannot validate the replication definition, but if it does not exist, or if the with primary table named clause does not match the replicated name specified with pdb_setreptable, replication from the primary table will fail.

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

repowner.reptable

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

NoteIf the replicate table name contains a period (for example, table.name), without owner qualification, you must set the value of the Replication Agent use_rssd parameter to true.

all

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

mark

A keyword that refers to marking a table.

owner

A keyword that refers to the mark operation.

The owner keyword turns on the SEND OWNER mode. When you specify the owner of a table in a replication definition, you must always use the owner keyword if you want to enable the SEND OWNER mode.

owner mode sets a flag in the LTL telling Replication Server that any table level Replication definition must be owner qualified to match this table.If the owner mode is set, the replication definition must be owner qualified. If the owner mode is not set, the replication definition must not be owner qualified.

unmark

A keyword that refers to unmarking a marked table.

force

A keyword that refers to the unmark operation or mark (For Oracle) operation:

NoteThe combination of mark and force keywords with the pdb_setreptable command is only valid for Oracle.

  • 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, pdb_setreptable 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 (Microsoft SQL Server only). 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.
    
  • For Oracle:

    When the force keyword follows the mark keyword, the pdb_setreptable command allows a table that contains one or more columns with unsupported datatypes to be marked for replication. No data for the unsupported columns is sent to Replication Server. As a result, any replicate table must have a suitable default value defined for the unsupported columns, since no data is received by the replicate database to be inserted into the unsupported columns.

    The force keyword can not be used in combination with the all keyword. Tables with unsupported datatypes must be individually marked using the pdb_setreptable command and the force keyword (they will never be automatically marked, or marked by default if they have columns with unsupported datatypes). In addition, tables with unsupported datatypes are not automatically marked when configuration parameter pdb_automark_tables is true. Tables with unsupported datatypes must be individually marked using the pdb_setreptable command and the mark and force keywords.

    NoteIf a replication definition is created using the command rs_create_repdef, for a table that was marked using the force keyword, only columns with supported datatypes are listed in the replication definition. Any column with an unsupported datatype is excluded from the replication definition.

enable

A keyword that refers to enabling replication for marked tables.

disable

A keyword that refers to disabling replication for marked tables.

immediate

A keyword that allows a table to be immediately marked for any occurrence.

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. The primary table name in the replication definition must be authors.

Example 7

pdb_setreptable authors, mark, owner

This command marks for replication the table named “authors” in the primary database so that the OWNER_MODE is enabled in the LTL. Therefore, any table replication definition created for this table must also be owner qualified.

Example 8

pdb_setreptable ptable, rtable, mark, owner

The primary table name in the replication definition must be:

powner.rtable

Example 9

pdb_setreptable ptable, rowner.rtable, mark,owner

The primary table name in the replication definition must be:

rowner.rtable

Example 10

pdb_setreptable ptable, rowner.rtable, mark,owner

The primary table name in the replication definition must be:

rowner.rtable

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.

Example 14

(Oracle only)

pdb_setreptable authors, mark, force

This command forces table “authors” to be marked, even if it contains columns with unsupported datatypes. The columns with unsupported datatypes will not be replicated.

Usage

See also

pdb_setrepcol, pdb_setrepproc, ra_config