Marking tables 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.

NoteThe setting of the pdb_convert_datetime parameter affects the format of date values sent to Replication Server. The pdb_convert_datetime parameter should be set appropriately before any tables are marked for replication. For a detailed description of the pdb_convert_datetime configuration parameter, see Chapter 2, “Configuration Parameters,” in the Replication Agent Reference Manual.

StepsMarking a table in the primary database

  1. Log in to the Replication Agent administration port.

  2. Use the pdb_setreptable command to determine if the table you want to mark is already marked in the primary database:

    pdb_setreptable pdb_table
    

    Here, pdb_table is the name of the table in the primary database that you want to mark for replication.

    • If the pdb_setreptable command returns information that the specified table is marked and replication is enabled, you need not continue this procedure.

    • If the pdb_setreptable command 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 the pdb_setreptable command returns information that the specified table is not marked, continue this procedure to mark the table for replication.

  3. Use the pdb_setreptable command to mark the table for replication and specify the name to use for replication:

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

      pdb_setreptable pdb_table, mark
      

      Here, pdb_table is the name of the table in the primary database that you want to mark for replication.

    • Use the following command to mark the table for replication using a replication definition with a different table name:

      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
      

      Here, pdb_table is the name of the table in the primary database that you want to mark for replication.

    If the pdb_dflt_object_repl parameter is set to true (the default), the table marked for replication with the pdb_setreptable command is ready for replication after you invoke the pdb_setreptable 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 table before replication can take place.

  4. Use the pdb_setreptable command to enable replication for the marked table:

    pdb_setreptable pdb_table, enable
    

    Here, pdb_table is the name of the marked table in the primary database for which you want to enable replication.

  5. Use the pdb_setreptable command with the all keyword to mark or enable all user tables at once:

    pdb_setreptable all, {mark|enable}
    

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

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

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