Marking a Table in the Primary Database

For transactions against a table to be replicated, the primary table in the primary database must be marked for replication, and replication must be enabled for that table.

Prerequisites
Task
  1. Log in to the Replication Agent instance with the administrator login.
  2. Determine if the table is marked in the primary database:
    pdb_setreptable pdb_table
    where pdb_table is the name of the primary database table that you want to mark for replication.
    • If pdb_setreptable returns information that the specified table is marked and replication is enabled, you need not continue this procedure.

    • If pdb_setreptable returns information that the specified table is marked but replication is disabled, skip step 3 and go to step 4 to enable replication for the table.

    • If pdb_setreptable returns information that the specified table is not marked, continue this procedure to mark the table for replication.

  3. Mark the table for replication and specify the name to use for replication:
    • To mark the table for replication using a replication definition with the same table name, use:
      pdb_setreptable pdb_table, mark
    • To mark the table for replication using a replication definition with a different table name, use:
      pdb_setreptable pdb_table, rep_table, mark
      where:
      • pdb_table is the name of the table in the primary database that you want to mark for replication.

      • rep_table is the name of the table in the with primary table named rep_table clause in the replication definition for this table.

    • When you mark a table for replication, if the Replication Server replication definition for the table is to be owner qualified, you must specify that the log transfer language (LTL) sent by Replication Agent should also be owner qualified to match the replication definition. To do this, use the owner keyword after the mark keyword:
      pdb_setreptable pdb_table, mark, owner
      where pdb_table is the name of the table in the primary database that you want to mark for replication.

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

    If pdb_dflt_object_repl is false, you must enable replication for the table before replication can take place.

  4. Enable replication for the table:
    pdb_setreptable pdb_table, enable
    To mark or enable all user tables at once, use:
    pdb_setreptable all, {mark|enable}

    where mark or enable are the keywords identifying the action to take against all user tables in the database.

After the table is marked and replication is enabled for the table, you can begin replicating transactions that affect data in that table.