• No results found

Marking and Unmarking Tables

Individual tables to be replicated must be marked. You can mark tables explicitly using the

pdb_setreptable command or automatically during ra_admin init processing when the

pdb_automark_tables configuration parameter is set to true.

Note: The pdb_automark_tables configuration parameter is not supported for UDB. To replicate transactions that affect the data in a table in the primary database, that table must be marked for replication, and replication must be enabled for the marked table.

Marking a table can be separate from enabling replication for that table. If the value of the

pdb_dflt_object_repl parameter is true, replication is enabled automatically at the time a table is marked.

See also

Table Marking with Replication Agent for Oracle

When a table is marked for replication with Replication Agent for Oracle, Replication Agent connects to the RASD and records the mark status for the table in the RASD article for that table.

When a table is marked, any subsequent operations that affect the data in that table are replicated.

Table Marking and Unmarking with Replication Agent for Microsoft SQL Server When a table is marked for replication with Replication Agent for Microsoft SQL Server, Replication Agent logs in to the primary database and executes commands to turn on logging of changes in the Microsoft SQL Server transaction log.

When a table marked for replication is unmarked with Replication Agent for Microsoft SQL Server, Replication Agent logs in to the primary database and executes commands to turn off logging of changes in the Microsoft SQL Server transaction log.

Table Marking with Replication Agent for UDB

Replication Agent for UDB performs tasks at the primary database when a table is marked for replication.

Replication Agent:

• Logs in to the primary database and sets the value of the table DATA CAPTURE option to

DATA CAPTURE CHANGES.

• Adds a row to the Replication Agent marked objects table in the primary database. Each row in the marked objects table lists attributes of a table marked for replication in the primary database.

Table Unmarking with Replication Agent for UDB

Replication Agent for UDB performs tasks at the primary database when a table is unmarked. Replication Agent:

• Logs in to the primary database and restores the value of the table DATA CAPTURE option to the value it had before the table was marked.

• Adds a row to the Replication Agent marked objects table in the primary database. Each row in the marked objects table lists attributes of a table unmarked for replication in the primary database.

• Deletes the table row in the Replication Agent marked objects table.

When a table is unmarked, any subsequent operations that affect the data in that table are ignored (not replicated).

Marking a Table in the Primary Database for Replication Mark tables for replication with any Replication Agent instance. Prerequisites

Before you can mark tables for replication, you must create the Replication Agent transaction log objects.

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 for replication, you do not need to continue this procedure.

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

3. If there is no table replication definition, only a database replication definition, and no

table replication definition is to be added before replication, either:

a) When the table in the replicate database has the same name as the table in the primary database, use:

pdb_setreptable pdb_table, mark

b) When the table in the replicate database has a different name from the table in the primary database, use:

pdb_setreptable pdb_table, rep_table, mark

where rep_table is the name of the table in the replicate database.

4. If there is a table replication definition or one is to be added before replication, do one of

this regardless of whether or not there is also a database replication definition: a) When the primary table in the table replication definition has the same name as the

table in the primary database, use:

pdb_setreptable pdb_table, mark

Note: If the table in the replicate 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

If the table in the replicate 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 replicate 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 ...

b) When the primary table in the table replication definition has a different name from the table in the primary database, use:

pdb_setreptable pdb_table, rdpri_table, mark

where 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 replicate database.

Note: If the table in the replicate 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 replicate 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 replicate 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 ...

5. 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 Replication Agent.

• If the owner mode is not set, then the owner name is not used by 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

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

Note: 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.

• true (the default), the table you marked for replication is ready for replication immediately after pdb_setreptable returns successfully. You can skip the next step for using pdb_setreptable to enable replication for a marked table.

• false, you must enable replication for the table, as described in the next step.

7. Enable replication for the table:

pdb_setreptable pdb_table, enable

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

Unmarking a Table in the Primary Database Unmark primary database tables.

Prerequisites

For UDB only, Replication Agent must be in Admin state when unmarking. 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 unmark. If pdb_setreptable returns information that the specified table is marked, continue this procedure to unmark the table.

If pdb_setreptable returns information that the specified table is not marked, you need not continue this procedure.

3. Disable replication for the table:

pdb_setreptable pdb_table, disable

4. Unmark the table:

pdb_setreptable pdb_table, unmark

To force the unmark, use:

pdb_setreptable pdb_table, unmark, force

5. Confirm that the table is no longer marked for replication:

pdb_setreptable pdb_table

Note: You can unmark all marked objects in the primary database by invoking the

Related documents