How to run sp_ctrl
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.
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:
sp_ctrl>command [on host]
- 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
On Windows systems, you can run sp_ctrl from the Sp_Ctrl desktop shortcut or Windows Programs menu.
The sp_ctrl command line allows a total of 256 characters, including spaces.
The sp_ctrl prompt appears in one of two ways, depending on whether or not you set a default host and port number.
||Basic sp_ctrl prompt|
||Prompt when a default system and port are set by issuing the host and port commands|
To exit the sp_ctrl command-line interface, issue the exit or quit command.
On Windows systems, you can simply close the sp_ctrl command prompt window.
The exit or quit command only closes the sp_ctrl session. It does not stop the SharePlex replication processes.
Define a default port for sp_ctrl
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 SharePlexReference Guide.
Define a default host for sp_ctrl
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.
Set a default editor for sp_ctrl
You can set the default editor that sp_ctrl runs when you issue a command that requires input to an ASCII text file, such as a configuration file. By default, sp_ctrl runs vi on Unix and Linux and WordPad on Windows.
The default text editors are tested and proven to work with SharePlex. If you change the default editor, the new editor must be a native ASCII text editor. Do not use a word processing program or other non-ASCII program, even if you can save a file to ASCII from that program.
Change the editor on Unix or Linux
Set the EDITOR variable in either of these ways:
- Before you start sp_ctrl. This sets the editor only for that session of sp_ctrl.
- In the shell startup script on the local machine. This sets the editor permanently, until changed in the startup script. You can override this setting on a per-session basis.
Syntax - ksh shell
Syntax - csh shell
setenv EDITOR name_of_editor
Change the editor on Windows
To change the text editor for sp_ctrl on a Windows system, you must add the EDITOR variable in the Windows Registry.
Important! Incorrect Registry settings can adversely affect the operation of SharePlex. Consult a System Administrator if you need help with this procedure.
- Shut down the SharePlex service.
- Open the Run dialog. The location varies with the Windows version.
- In the Run dialog, type regedit to run the Registry Editor.
- Expand the SharePlex node:
- Right click the port number of the SharePlex instance to which you want to add a variable, then select New, then String Value.
- Under the Name column, right click the new variable, then select Rename.
- Type the correct name.
- Double click the new variable.
- Under Value Data, enter the string for the new variable and then click OK.
- Exit the Registry.