Scenarios for marking tables for replication in Oracle, IBM DB2 UDB,
or Microsoft SQL Server.
- Scenario 1: If the owner and table names are the same at the primary and replicate
database, mark the table in the primary database using
pdb_setreptable with the owner mode set to
on. You can use rs_create_repdef to create the replication
definition.
For
example:
pdb_setreptable T1, mark, owner
go
rs_create_repdef T1
go
- Scenario 2: If the primary and replicate tables have the same name but different
owners, mark the table in the primary database using
pdb_setreptable with the owner mode set to
off. Create a replication definition using rs_create_repdef and
then alter the replication definition to point to the replicate
table.
For
example:
pdb_setreptable T1, mark
go
rs_create_repdef T1
go
In
the Replication Server
run:
isql -Usa -Psa_pass -SSAMPLE_RS
alter replication definition <repdefname>
with replicate table named <replicate tableowner>.<replicate tablename>
go
- Scenario 3: If you are replicating a primary table to a table of the same name, and
the owner of the replicate table is the same as the maintenance user of the
replicate connection, mark the table in the primary database using
pdb_setreptable with the owner mode set to
off. You can use rs_create_repdef to create the replication
definition.
For
example:
pdb_setreptable T1, mark
go
rs_create_repdef T1
go
- Scenario 4: If there are two primary tables with the same schema, each with its own
owner and if you are replicating them to the same replicated table of the same table
name, mark the table in the primary database using
pdb_setreptable with the owner mode set to
off. You can use rs_create_repdef to create the replication
definition.
For
example:
pdb_setreptable T1, mark
go
rs_create_repdef T1
go
For more information about marking tables for replication with Replication Agent for
Oracle, IBM DB2 UDB, or Microsoft SQL Server, see Replication Agent Administration
Guide > Setup and Configuration > Primary Database Object Marking. For
information about creating replication definitions, see Replication Server
Reference Manual.