Creating a Publication (createpub) v6.2
The createpub
command creates a new publication.
Synopsis
The createpub
command adds a new publication subordinate to the publication database definition with the publication database ID given by parameter pubdbid
. If the publication is designated as snapshot-only by setting parameter reptype
to s
, then any views listed after the views parameter are ignored.
See Adding a Publication for additional information on creating a publication for a single-master replication system. See Adding a Publication for a multi-master replication system.
Note
The schema names, table names, and view names that you supply as values for the tables and views parameters are case-sensitive. Unless quoted identifiers were used to build the database objects, Oracle names must be entered using uppercase letters (for example, EDB.DEPT
), and Advanced Server names must be entered in lowercase letters (for example edb.dept
). See Quoted Identifiers and Default Case Translation for additional information on quoted identifiers and case translation.
Parameters
pubname
The publication name to be given to the new publication.
pubsvrfile
The file containing the publication server login information.
dbid
The publication database ID of the publication database definition subordinate to which the new publication is to be added.
-reptype
Specify s if the publication is to be a snapshot-only publication. Specify
t
if the publication is to allow synchronization replications.
schema_tn
The name of the schema containing the nth table of the tables parameter list. This value is case-sensitive.
table_n
The table name of the nth table in the tables parameter list. This value is case-sensitive.
schema_vn
For SMR only: The name of the schema containing the nth view of the views parameter list. This value is case-sensitive.
view_n
For SMR only: View name of the nth view in the views parameter list. This value is case-sensitive.
ordinal_tn
The ordinal number (that is, the position in the list counting from left to right starting with 1) of a table in the tables parameter list to which an attribute is to be applied.
filtername_tn
The filter name to be assigned to the filter rule on the table.
filterclause_tn
The filter clause to be applied to the table in the tables parameter list at the position indicated by ordinal_tn.
ordinal_vn
For SMR only: The ordinal number (that is, the position in the list counting from left to right starting with 1) of a view in the views parameter list to which an attribute is to be applied.
filtername_vn
The filter name to be assigned to the filter rule on the view.
filterclause_vn
For SMR only: The filter clause to be applied to the view in the views parameter list at the position indicated by ordinal_vn.
-conflictresolution
For MMR only: For the conflict resolution option, specify E for earliest timestamp conflict resolution, L for latest timestamp conflict resolution, N for node priority conflict resolution, M for manual conflict resolution, or C for custom conflict handling. The specified conflict resolution applies to the table in the position given by ordinal_tn counting from left to right in the tables parameter list. If omitted the default is E.
-standbyconflictresolution
For MMR only: For the standby conflict resolution option, specify E for earliest timestamp conflict resolution, L for latest timestamp conflict resolution, N for node priority conflict resolution, M for manual conflict resolution, or C for custom conflict handling. The specified conflict resolution applies to the table in the position given by ordinal_tn counting from left to right in the tables parameter list. If omitted the default is M.
customhandler_tn
For MMR only: For the conflict resolution option or the standby conflict resolution option, specify customhandler_tn as the function name with an optional schema prefix (that is, formatted as schema.function_name) as given in the CREATE FUNCTION command for the custom conflict handling function created for the table in the tables parameter list at the position indicated by ordinal_tn. The custom conflict handling function must be added to the primary definition node. See Adding a Custom Conflict Handling Function for an example of adding the custom conflict handling function using PSQL. The custom handler name option must be specified if and only if the conflict resolution option or the standby conflict resolution option is set for custom conflict handling with the C value.
-repgrouptype
Specify s if this command applies to a single-master replication system. Specify m if this command applies to a multi-master replication system. If omitted, the default is s.
Examples
In the following example, a publication named dept_emp is created that contains the EDB.DEPT and EDB.EMP tables of an Oracle database. The replication method is synchronization.
In the following example, a publication named salesemp is created that contains the EDB.SALESEMP view of an Oracle database. The replication method is snapshot-only.
In the following example, a publication named analysts_managers is created that contains the edb.dept
table and employees from the edb.emp
table who are analysts or managers. The tables are in an Advanced Server database. The replication method is snapshot-only.
The following example creates a publication for a multi-master replication system. One table filter is defined on table edb.dept
and three table filters are defined on table edb.emp
. Table edb.dept
is assigned node priority conflict resolution and latest timestamp as the standby conflict resolution strategy. Table edb.emp
is assigned earliest timestamp conflict resolution and manual resolution (the default) as its standby strategy.