Execute Commands in sp_ctrl
This chapter contains instructions for using the sp_ctrl command interface to execute commands that configure, control, and monitor SharePlex. The sp_ctrl program resides in the bin sub-directory of the SharePlex product directory.
Note: See the SharePlex Reference Guide for more information about the commands shown in this topic.
Contents
You can run sp_ctrl on any machine where SharePlex is installed. The sp_cop program must be running in order to run sp_ctrl; otherwise it displays an error message similar to this:
Your tcp port is not set properly or “sp_cop” is not running.
Start sp_ctrl
There are two ways to run sp_ctrl:
-
from the command shell of the operating system to issue one command, for example:
$ /productdir/bin/sp_ctrl command [on host]
-
by running the sp_ctrl command interface to issue one or more commands, for example:
$ /productdir/bin/sp_ctrl
sp_ctrl>command [on host]
where:
- productdir is the SharePlex product (installation) directory.
- command is the SharePlex command.
- on host represents one of the command options that allow you to issue a command on the local machine to control SharePlex on a remote machine (if supported by the command), as shown in the following example.
$ /productdir/bin/sp_ctrlstatus on host:port
sp_ctrl prompt
The sp_ctrl prompt appears in one of two ways, depending on whether or not you set a default host and port number.
sp_ctrl> |
Basic sp_ctrl prompt |
sp_ctrl(this_host:3304) > |
Prompt when a default system and port are set by issuing the host and port commands |
Exit sp_ctrl
To exit the sp_ctrl command-line interface, issue the exit or quit command.
The exit or quit command only closes the sp_ctrl session. It does not stop the SharePlex replication processes.
If there is only one instance of SharePlex on a system, sp_ctrl detects the port number. However, if you configured more than one SharePlex instance on a system (where each one runs on a different port number) you must use the port command to set the session of sp_ctrl to the instance for which you want to issue commands.
sp_ctrl > port number
For more information, see Run Multiple Instances of SharePlex.
For more information about the port command, see the SharePlex Reference Guide.
To define a default machine for all interactive sp_ctrl sessions, use the host command. This command enables you to enter a series of commands without using the onhost option for each one.
sp_ctr >host hostname
The command changes the sp_ctrl prompt to include the host name:
sp_ctrl (sysA) >
The host setting applies only to the sp_ctrl session in which it is set.