Use the following procedure to mark tables for replication with any Sybase Replication Agent (either log-based or trigger-based).
To mark a table in the primary database for replication
Log in to the Replication Agent instance with the administrator login.
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.
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).
Use the following command to mark the table for replication when the replicate table (in the replicate database) has the same table name:
pdb_setreptable pdb_table, mark
where pdb_table is the name of the table that you want to mark for replication.
Use the following command to mark the table for replication when the replicate table (in the replicate database) has a different table name:
pdb_setreptable pdb_table, rep_table, mark
where:
pdb_table is the name of the table that you want to mark for replication.
rep_table is the name of the replicate table in the replicate database.
When the primary table and replicate table have different names,
you must use the with all tables named rep_table clause
when you create the replication definition in the primary Replication
Server.
When marking a table for replication, you have the option to specify that the table owner’s name is sent with the table name in the LTL:
If the owner mode is set, then the owner name is used when matching the repdef in Sybase Replication Agent.
If the owner mode is not set, then the owner name is not used by Sybase Replication Agent for repdef name matching.
To specify that the table owner’s name is sent with the table name in the LTL, use the owner keyword after the mark keyword, as shown:
pdb_setreptable pdb_table, mark, owner
where pdb_table is the name of the table that you want to mark for replication.
The table owner’s name returned from the primary
database must be the same as the owner name specified in the replication definition
for the table.
If the value of the pdb_dflt_object_repl parameter is true, the table you marked for replication is ready for replication immediately after the pdb_setreptable command returns successfully.
The default value of the pdb_dflt_object_repl parameter is true.
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.
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 Replication Agent can begin replicating transactions that affect data in that table.