Adding a subscription database (addsubdb) v7

For SMR only: The addsubdb command adds a subscription database definition.

Synopsis

-addsubdb
  -repsvrfile subsvrfile
  -dbtype { oracle | enterprisedb | postgresql | sqlserver }
  -dbhost host
  -dbport port
  -dbuser user
{ -dbpassword encrypted_pwd | -dbpassfile pwdfile }
[ -oraconnectiontype { sid | servicename } ]
  -database dbname
[ -urloptions jdbc_url_parameters ]

The addsubdb command creates a new subscription database definition. The addsubdb command displays a unique subscription database ID that is assigned to the newly created subscription database definition. The subscription database ID is used to identify the subscription database definition on which to operate when running other Replication Server CLI commands.

See Adding a subscription database for details on the database connection information to supply when adding a subscription database definition.

Parameters

subsvrfile

The file containing the subscription server login information.

-dbtype

Specify the values as shown in the table.

ValueDatabase
oracleOracle
enterprisedbEDB Postgres Advanced Server database in Oracle-compatible configuration mode
postgresqlPostgreSQL database or an EDB Postgres Advanced Server database in PostgreSQL-compatible configuration mode
sqlserverMicrosoft SQL Server

host

The IP address of the host where the subscription database server is running.

port

The port number on which the database server is listening for connections.

user

The subscription database user name.

encrypted_pwd

The encrypted password of the subscription 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 subscription database user.

-oraconnectiontype

Specify sid to use the Oracle system ID (SID) to identify the subscription database in the database parameter. Specify servicename to use the Oracle service name to identify the subscription 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 subscription database.

jdbc_url_parameters

Extended usage of JDBC URL parameters such as for support of SSL connectivity. (See Using secure sockets layer (SSL) connections for information on SSL connectivity to the subscription database.)

Examples

This example adds a subscription database definition for an Oracle database. The encrypted password is given on the command line with the dbpassword parameter. A subscription database ID of 1 is assigned to the database by the subscription server.

$ java -jar edb-repcli.jar -addsubdb -repsvrfile ~/subsvrfile.prop \
>   -dbtype oracle -dbhost 192.168.2.6 -dbport 1521 \
>   -dbuser subuser -dbpassword ygJ9AxoJEX854elcVIJPTw== \
>   -oraconnectiontype sid \
>   -database xe
Adding Subscription Database...
Subscription database added successfully. Subscription Database id:1

This example adds a subscription database definition for an EDB Postgres Advanced Server database. The encrypted password is read from a file named pwdfile with the dbpassfile parameter. A subscription database ID of 2 is assigned to the database by the subscription server.

$ java -jar edb-repcli.jar -addsubdb -repsvrfile ~/subsvrfile.prop \
>   -dbtype enterprisedb -dbhost 192.168.2.7 -dbport 5444 \
>   -dbuser subuser -dbpassfile ~/pwdfile \
>   -database subdb
Adding Subscription Database...
Subscription database added successfully. Subscription Database id:2