Marking a table for replication

NoteFor ASE only: Individual tables can not be marked or unmarked when the primary database is configured with sp_reptostandby (which is the default ASE setting for a Mirror Activator environment.

To mark a table for replication use the pdb_setreptable command. It returns replication marking status; marks all user tables or a specified table for replication; and enables replication for all marked tables or a specified table. The following is an example of the pdb_setreptable command that returns replication marking information for all marked tables in the primary database:

pdb_setreptable mark

NoteBy default, Mirror Replication Agent creates a repdef in Replication Server for each table that is explicitly marked for replication. Also, Mirror Replication Agent creates a replication definition for each table created during replication (by reading the DDL command). If this is not the default behavior desired, you can turn off automatic replication definition creation using the pdb_auto_create_repdefs configuration parameter.

Use the following procedure to mark tables for replication with Mirror Replication Agent.

StepsTo mark a table in the primary database for replication

  1. Log in to the Mirror Replication Agent instance with the administrator login.

  2. Use the pdb_setreptable command to determine if the table is already marked:

    pdb_setreptable pdb_table
    

    where pdb_table is the name of the table that you want to mark for replication.

    If the pdb_setreptable command returns information that the specified table is marked for replication, you do not need to continue this procedure.

    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.

    The pdb_setreptable command allows you to mark the primary table to be replicated and specify a different table name to use in the replicate database (as specified in a replication definition).

    If the value of the pdb_dflt_object_repl parameter is true, you can skip step 4 in this procedure.

    If the value of the pdb_dflt_object_repl parameter is false, you must enable replication for the table, as described in step 4.

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

    pdb_setreptable pdb_table, enable
    

    where pdb_table is the name of the marked table.

After replication is enabled for the table, the Mirror Replication Agent can begin replicating transactions that affect data in that table.