Specifying the replication definition name and table names

A replication definition has a global name space—that is, at every Replication Server with routes from the primary Replication Server, the name refers to the same replication definition.

Replication Server cannot always enforce the unique-name requirement when you enter create replication definition. You must ensure that there is no existing replication definition (table or function) with the same name when you create a new replication definition.

By default, the replication definition name is the name of both the source and destination tables.

In some instances, you may need to use different names for your source and destination tables, or different names for your tables and replication definitions. Include one of the optional clauses with all tables named, with primary table named, or with replicate table named to specify table names where they differ from the replication definition name.


When source and destination tables share the same name

When the source table and all destination tables share the same name but you want to give the replication definition a different name, use with all tables named to specify the table names.

For example, to create a replication definition named publishers_rep for source and destination tables named publishers, enter this command:

create replication definition publishers_rep
with primary at TOKYO_DS.pubs2
with all tables named publishers
...

When source and destination tables have different names

When the source table and any destination tables have different names, use with primary table named to specify the name of the source table, or use with replicate table named to specify the destination table name. You can use one of these clauses or both of them together.

If you don’t specify different table names, the replication definition name is assumed by Replication Server to be the name of both the source and destination tables.

For example, to create a replication definition named publishers_rep for a source table named publishers1 and destination tables named publishers2, enter:

create replication definition publishers_rep
with primary at TOKYO_DS.pubs2
with primary table named publishers1
with replicate table named publishers2
...

For a replication definition and a source table named publishers, and destination tables named publishers2, enter:

create replication definition publishers
with primary at TOKYO_DS.pubs2
with replicate table named publishers2
...

In this example, the publishers replication definition also becomes the source table’s name.


Specifying the name of the source or destination table owner

You can specify the table owner’s name as an optional qualifier along with the name of the source or destination table. Data server operations may fail if the table owner does not correspond to what is specified in the replication definition.

For example, to create a replication definition for the publishers source table and the publishers2 destination table owned by the user “ravi,” enter:

create replication definition publishers
with primary at TOKYO_DS.pubs2
with replicate table named ravi.publishers2
...