Table of Contents Previous Next



You can run the xDB Replication Server CLI from any host on which you can run the xDB Replication Console. The xDB Replication Server CLI is run by executing the java runtime program and specifying the following arguments to the java program:
The path to the xDB Replication Server CLI jar file edb-repcli.jar
An xDB Replication Server CLI command
The Java jar file edb-repcli.jar is located in directory XDB_HOME/bin.
Each xDB Replication Server CLI command has the following general syntax:
-command [ { pubname | subname } ...]
[ -parameter [ value ] ...] ...
In the preceding syntax diagram, command is the name of an xDB Replication Server CLI command. The command name must be prefixed by a hyphen character (-). If the command acts on a publication, the name of the publication represented by pubname is specified. If the command acts on a subscription, the subscription name represented by subname is specified. Certain commands may allow the specification of more than one publication name or more than one subscription name.
java -jar XDB_HOME/bin/edb-repcli.jar
-command [ { pubname | subname } ...]
[ -parameter [ value ] ...] ...
Note: You can continue a command onto the next physical line if you enter the operating system’s continuation character (for example, the backslash character (\) in Linux or the caret character (^) in Windows) before pressing the Enter key.
If you execute the xDB Replication Server CLI with the help command, xDB Replication Server CLI will list a syntax summary of all commands.
See Section 8.3.1 for details on the help command.
This section discusses the syntax and usage of an xDB Replication Server CLI parameter, required by many commands, named repsvrfile. Using parameter repsvrfile is the xDB Replication Server CLI equivalent for the process of registering the publication server or the subscription server in the xDB Replication Console.
Section 5.2.1 discusses how the first step in building a replication system is to register the publication server. In the xDB Replication Console, the registered publication server appears as a node in the replication tree. The Publication Server node provides a context to which you can add other logical components of the replication system.
When using the xDB Replication Server CLI, there is no replication tree image available with which to relate the other logical components of the replication system. Instead, whenever you execute an xDB Replication Server CLI command that requires the context of a publication server or subscription server, you must specify the publication server’s login information or the subscription server’s login information by means of the repsvrfile parameter.
The repsvrfile parameter takes as its value, the path to a text file that contains the login information of either the publication server instance or the subscription server instance that you want to use. The general xDB Replication Server CLI command syntax including the repsvrfile parameter is shown in the following diagram:
-command [ { pubname | subname } ...]
[ -parameter [ value ] ...] ...
[ -repsvrfile repsvrfile ]
[ -parameter [ value ] ...] ...
The xDB Replication Server CLI command to be executed is represented by command. If required, publication names represented by pubname or subscription names represented by subname are specified next. The path to the text file containing either the publication server or subscription server login information is represented by repsvrfile. The parameters and their values that are used with command are denoted by parameter and value.
The order on the command line in which -repsvrfile repsvrfile and -parameter and its values are given does not matter. For example, -repsvrfile repsvrfile can be given as the first parameter on the command line, the last parameter on the command line, or somewhere in between other parameters.
The following is an example of repsvrfile for a publication server:
The following is an example of repsvrfile for a subscription server:
This is the same information with which you would need to register the publication server or subscription server if you were using the xDB Replication Console. See Section 5.2.1 for additional information on registering the publication server. See Section 5.3.1 for information on registering the subscription server.
The following example illustrates how the repsvrfile parameter is used along with the printpublist command.
When using the xDB Replication Server CLI, text files are used to store certain information, which may include user names and passwords. An example is the files containing publication server and subscription server login information used with the repsvrfile parameter.
In the file specified with parameter repsvrfile, the password field must be set to a password in encrypted form. Using an encrypted password prevents unauthorized personnel from accessing the publication server or subscription server using the values of user and password if the file was somehow compromised. (The encrypted password cannot be used to access the publication server or subscription server from its dialog box in the xDB Replication Console.)
See Section 8.3.4 for directions on generating an encrypted password using the encrypt command.
The paramfile command allows you to run an xDB Replication Server CLI command and its parameters that have been coded into a text file. This technique is useful if you want to save the command and its parameters for repeated executions.
The syntax for executing paramfile is shown by the following:
java -jar XDB_HOME/bin/edb-repcli.jar
-paramfile cmdparamfile
The syntax of the xDB Replication Server CLI command and its parameters coded into text file cmdparamfile is the same as if given at the command line prompt as shown by the following:
-command [ { pubname | subname } ...]
[ -parameter [ value ] ...] ...
[ -repsvrfile repsvrfile ]
[ -parameter [ value ] ...] ...
Using the paramfile command has the following restrictions:
Only one xDB Replication Server CLI command can be coded into the parameter file cmdparamfile.
The parameters to be used with the xDB Replication Server CLI command must all be included in cmdparamfile. You cannot code some of the parameters into cmdparamfile and give other parameters on the command line.
The following example creates an Advanced Server publication database definition using a parameter file named addpubdb_advsvr.
Note: Unlike entering the xDB Replication Server CLI command and its parameters directly at the command line prompt, when coded into a text file, no continuation characters are needed to continue onto the following lines.
An exit status of 0 indicates successful execution. A non-zero exit status indicates a failure has occurred.
For Linux only: The environment variable, $?, contains the exit status.
The following example shows the 0 exit status upon the successful execution of the addpubdb command contained in the addpubdb_advsvr parameter file described in Section 8.2.5.
For Windows only: The environment variable, %ERRORLEVEL%, contains the exit status.


Table of Contents Previous Next