For ASE: 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
By default, Mirror Replication Agent creates a replication
definition 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 any Mirror Replication Agent.
The ra_init command no longer
causes pdb_auto_create_repdefs settings to
take effect. To create replication definitions after initialization,
execute rs_create_repdef all after ra_init for
all tables currently marked for replication.
Marking a table in the primary database for replication
Log in to the Mirror Replication Agent instance with the administrator login.
Use the pdb_setreptable command to determine if the table is already marked:
pdb_setreptable pdb_table
Here, 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.
If there is no table replication definition, only a database replication definition, and no table replication definition is to be added before replication, do one of the following:
When the table in the standby database has the same name as the table in the primary database, use the following command to mark a table for replication:
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.
When the table in the standby database has a different name from the table in the primary database, use the following command to mark a table for replication:
pdb_setreptable pdb_table, rep_table, mark
Here, pdb_table is the name of the table in the primary database that you want to mark for replication, and rep_table is the name of the table in the standby database.
If there is a table replication definition or one is to be added before replication, do one of the following regardless of whether or not there is also a database replication definition:
When the primary table in the table replication definition has the same name as the table in the primary database, use the following command to mark a table for replication:
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.
If the table in the standby database has the same name
as the primary table in the table replication definition, you can
use the with all tables named clause in the replication
definition in the primary Replication Server. For example,
create replication definition my_table_repdef with primary at data_server.database with all tables named pdb_table ...
If the table in the standby database has a different name from the primary table in the table replication definition, the table replication definition must map to the table in the standby database. For example,
create replication definition my_table_repdef with primary at data_server.database with primary table named pdb_table with replicate table named rep_table ...
When the primary table in the table replication definition has a different name from the table in the primary database, use the following command to mark a table for replication:
pdb_setreptable pdb_table, rdpri_table, mark
Here, pdb_table is the name of the table in the primary database that you want to mark for replication, and rdpri_table is the name of the primary table in the table replication definition. The table replication definition must map to the table in the standby database.
If the table in the standby database has the same name
as the primary table in the table replication definition, you can
use the with all tables named clause in the replication
definition in the primary Replication Server. For example,
create replication definition my_table_repdef with primary at data_server.database with all tables named rdpri_table ...
If the table in the standby database has a different name from the primary table in the table replication definition, the table replication definition must map to the table in the standby database. For example,
create replication definition my_table_repdef with primary at data_server.database with primary table named rdpri_table with replicate table named rep_table ...
When you mark a table for replication, optionally specify that the table owner must be included when matching to an owner-qualified replication definition.
If the owner mode is set, then the owner name is used when matching the replication definition in Mirror Replication Agent.
If the owner mode is not set, then the owner name is not used by Mirror Replication Agent for replication definition name matching.
To specify that the table owner must be included when matching to an owner-qualified replication definition, use the owner keyword after the mark keyword:
pdb_setreptable pdb_table, mark, owner
Here, pdb_table is the name of the table that you want to mark for replication.
The table owner name returned from the primary database
must be the same as the owner name specified in the replication
definition for the table.
Consider the following:
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 the following step for using pdb_setreptable to enable replication for a marked table.
If the value of the pdb_dflt_object_repl parameter is false, you must enable replication for the table, as described in the following step.
Use the pdb_setreptable command to enable replication for a marked table:
pdb_setreptable pdb_table, enable
Here, 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.