Adding a publication database (addpubdb) v7
The addpubdb
command adds a publication database definition.
Synopsis
The addpubdb
command creates a new publication database definition. The addpubdb
command displays a unique publication database ID that is assigned to the newly created publication database definition. The publication database ID is used to identify the publication database definition on which to operate when running other Replication Server CLI commands.
See Adding a publication database for details on the database connection information you must supply when adding a publication database definition for a single-master replication system. See Adding the primary definition node and Creating more primary nodes for a multi-master replication system.
Parameters
pubsvrfile
The file containing the publication server login information.
-dbtype
Specify the values as shown in the table.
Value | Database |
---|---|
oracle | Oracle |
enterprisedb | EDB Postgres Advanced Server database in Oracle-compatible configuration mode |
postgresql | PostgreSQL database or an EDB Postgres Advanced Server database in PostgreSQL-compatible configuration mode |
sqlserver | Microsoft SQL Server |
host
The IP address of the host where the publication database server is running.
port
The port number on which the database server is listening for connections.
user
The publication database user name.
encrypted_pwd
The encrypted password of the publication database user. See Encrypting passwords to learn how to use the encrypt
command to generate an encrypted password.
pwdfile
The file containing the encrypted password of the publication database user.
-oraconnectiontype
Specify sid
to use the Oracle system ID (SID) to identify the publication database in the database parameter. Specify servicename
to use the Oracle service name to identify the publication database in the database parameter.
Note
For Oracle 12c, use the service name.
dbname
The Postgres or SQL Server database name, the Oracle SID, or the Oracle service name of the publication database.
jdbc_url_parameters
Extended usage of JDBC URL parameters such as for support of SSL connectivity. See Preparing using secure sockets layer (SSL) connections for information on SSL connectivity to the publication database.
filterid_n
For MMR only: Applies to non-MDN nodes. Comma-separated list of filter IDs identifying the filter rules from the set of available table filters to enable on the corresponding tables in the new primary node. Use the printpubfilterslist
command to get the filter IDs for the available filter rules in the publication (see Printing a list of filters in a publication). Do not use any white space between the comma and filter IDs.
-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. The default is s
.
-replicatepubschema
For MMR only: Applies to non-MDN nodes. Set this option to true
if you want the publication table definitions replicated from the primary definition node when creating a new primary node. Set this option to false
if you already created the table definitions in the new primary node. The default is true
. Don't specify this parameter when creating the primary definition node.
Unless you intend to use the offline snapshot technique (see Loading tables from an external data source (offline snapshot), we suggest that you specify this option. You must perform an initial snapshot replication from the primary definition node to every other primary node before performing synchronization replications on demand (see Performing a synchronization) or by a schedule (see Configuring a multi-master schedule). If a newly added primary node didn't undergo an initial snapshot, any later synchronization replication might not apply the transactions to that primary node. You can also take the initial snapshot by performing an on-demand snapshot (see Take a multi-master snapshot).
-initialsnapshot
For MMR only: Applies to non-MDN nodes. Specify this option if you want an initial snapshot replication performed when creating the primary node. Omit this option if you don't want an initial snapshot replication performed when creating the primary node.
Note
Unless you intend to use the offline snapshot technique (see Loading tables from an external data source (offline snapshot)), we suggest that you specify this option. You must perform an initial snapshot replication from the primary definition node to every other primary node before performing synchronization replications on demand (see Performing a synchronization) or by a schedule (see Configuring a multi-master schedule). If a newly added primary node didn't undergo an initial snapshot, any later synchronization replication might not apply the transactions to that primary node. You can also take the initial snapshot by performing an on-demand snapshot (see Take a multi-master snapshot) or by a schedule (see Configuring a multi-master schedule).
-verboseSnapshotOutput
Set this option to true
if you want to display the output from the snapshot. Set this option to false
if you don't want to display the snapshot output. The default is true
.
Use this option after the -initialsnapshot
option.
priority_level
For MMR only: Integer value from 1 through 10 assigning the priority level to a primary node. 1 has the highest priority and 10 has the lowest priority.
-changesetlogmode
Specify T
to use the trigger-based method of synchronization replication for this publication database. Specify W
to use the log-based (WAL) method of synchronization replication for this publication database. The default is T
.
Examples
This example adds a publication database definition for an Oracle database. The encrypted password is given on the command line with the dbpassword
parameter. A publication database ID of 1 is assigned to the database by the publication service.
This example adds a publication database definition for an EDB Postgres Advanced Server database. The encrypted password is read from a file named pwdfile
with the dbpassfile
parameter. A publication database ID of 2 is assigned to the database by the publication service.
This example adds a publication database definition for a primary definition node in a multi-master replication system.
This example adds a publication database definition for a primary node (other than the primary definition node) in a multi-master replication system. An initial snapshot isn't invoked (the initialsnapshot
parameter is omitted). Filter rules with filter IDs 8 and 16 are applied to this primary node. A node priority level of 3 is assigned to the primary node.
Note
A publication must be created in the primary definition node before creating additional primary nodes. See Creating a Publication for the command to create a publication.
- On this page
- Synopsis
- Parameters
- Examples