Run SharePlex on Linux for PostgreSQL
On Linux systems, start SharePlex by running the sp_cop program. After you activate a configuration, sp_cop spawns the necessary child replication processes on the same system. Each instance of sp_cop that you start is a parent to its own set of child replication processes. The sp_cop process must be started on each system that is part of the replication configuration.
You can start sp_cop in one of two ways:
- From the operating system command line.
- At system startup as part of the startup file.
IMPORTANT: Run SharePlex from either the korn (ksh) or C shell (csh) shell.
Warning! Do not use the Bourne shell (sh), because the way it handles background processes is not compatible with SharePlex. If you must use the Bourne shell, switch shells to ksh or csh to run SharePlex, then exit the shell and return to the Bourne shell.
Start SharePlex on Linux
To start SharePlex, you must log onto the system as a SharePlex Administrator. Your user name must be assigned to the SharePlex admin group in the /etc/group file. For more information, see Assign SharePlex users to security groups in the SharePlex Administrator's guide.
Table 3: SharePlex startup syntax
From root, with full path |
$ /productdir/bin/sp_cop [-uidentifier] & |
CD to the product directory |
$cd /productdir/bin
$./sp_cop [-uidentifier] & |
From a startup script |
#!/bin/ksh
cd productdir\bin
nohup sp_cop [-uidentifier] & |
Table 4: Description of SharePlex startup syntax
& |
Causes SharePlex to run in the background. |
nohup |
Directs the startup of SharePlex to continue in the background after the current user logs out. |
-uidentifier |
Starts sp_cop with a unique identifier. Use this option when there are multiple instances of sp_cop running on a system, which is required for some SharePlex configurations. For more information, see Run multiple instances of SharePlex in the SharePlex Administrator Guide.
Some suggestions for identifier are:
- the SharePlex port number (such as -u2100)
- the identifier of the database for which replication is running (such as -pg13c)
- any descriptive identifier (such as -utest)
|
Identify SharePlex processes on Linux
Every session of sp_cop has a process ID number. The ID is returned after startup and then the command prompt reappears. If a configuration was activated during a former session of sp_cop, replication begins immediately. Without an active configuration, sp_cop runs passively in the background.
On Linux systems, you can use the ps -ef | grep sp_ command to view the SharePlex processes that are running.
Each child process has the same -uidentifier as its parent sp_cop process. This makes it easier to identify related processes when multiple session of sp_cop are running.
Stop SharePlex on Linux
Before shutting down the SharePlex process user should deactivate the active configuration and check the following processes:
- Capture/read/export on source
- Import/post on target are not running
For more information on this, see the Deactivate Config in the SharePlex Reference Guide.
To stop SharePlex, issue the shutdown command in sp_ctrl. This is a graceful shutdown that saves the state of each process, performs a checkpoint to disk, read/releases buffered data, and removes child processes. Data in the queues remains safely in place, ready for processing when sp_cop starts again. The shutdown process can take some time if SharePlex is processing large operations.
You can use the force option with the shutdown command to forcefully shut down replication if necessary. It terminates sp_cop immediately, bypassing normal shutdown procedures. See the SharePlex Reference Guide for more information about this command.
Shutdown considerations on Linux
You can safely shut down SharePlex for a short time while there is still transactional activity. The next time you start SharePlex, replication resumes at the correct place in the WAL files, if needed. However, the best practice is to leave SharePlex running while there is transactional activity. Otherwise, SharePlex may need to process a large volume of WAL files backlog when you start it again, and there will be latency between the source and target data.
Note: If you want to shut down both SharePlex and the database, shut down SharePlex first. Otherwise, SharePlex will interpret that the database is failing and generate a warning message.
As an alternative to stopping SharePlex, you can use the stop command in sp_ctrl to stop individual SharePlex replication processes as needed. See the SharePlex Reference Guide for more information about this command.
Run SharePlex on Windows
On Windows, SharePlex runs as a service named SharePlexport#, where port# is the port number that is used by a particular instance of SharePlex. The service can be installed during the installation of SharePlex or at a later time by running the SharePlexSpUtils progam. See the SharePlex Reference Guide for more information about SpUtils.
Note: When directed in the documentation or other instructions to start or stop sp_cop on the Windows platform, it means to start or stop the SharePlex service.
Startup Sequence on Windows
When you start systems that are involved in replication, start the components in this order:
- Start the system.
- Start the source and target databases.
- Start the Cygwin cygserver service in the Windows Administrative Tools > Services control panel. This starts the Cygwin operating environment, which must be running in order to run SharePlex. .
- Start the SharePlexport# service.
- Start sp_ctrl from the bin sub-directory of the SharePlex product directory.
-
Verify that the SharePlex processes are started by issuing the lstatus command in sp_ctrl.
sp_ctrl> lstatus
Start and stop SharePlex on Windows
On Windows, the only way to start or stop SharePlex is by starting or stopping the SharePlex service. To control the service, you can use the SpUtils utility or the Windows Administrative Tools control panel.
Note: Starting the SharePlex service automatically starts the SharePlex replication processes (Capture, Read, Export, Import and Post). If you do not want those processes to start when the service starts, they must be stopped with the stop command in sp_ctrl before you shut down the SharePlex service. They will remain stopped until you issue the start command for each process that you want to start.
To control the SharePlex service with SpUtils
You can use SpUtils to install, start, stop, and check the status of the SharePlex service.
- Log onto Windows as a SharePlex Administrator. Your user name must be assigned to the SharePlex admin group. For more information, see Assign SharePlex Users to Security Groups
- View the Windows services to make certain the Cygserver service is running. Start it, if needed.
- Run the SpUtils utility from the desktop shortcut or the Programs menu.
- Click the SharePlex Services tab of the utility.
- Select the port number of the SharePlex instance that you want to control.
-
Do one of the following:
- Click Install to install the service. If Install is not shown, the service exists.
- Click Start to start the service. When Current State shows that the service is running, you can close the utility. If Start is not shown, the service is either running already or not installed.
- Click Stop to stop the service. If Stop is not shown, the service is either stopped already or not installed.
Note: You can also use the shutdown command in sp_ctrl to stop the SharePlex service.
To control the SharePlex service from Windows
The SharePlex service appears as an entry named SharePlexport# in the Services console of the Administrative Tools control panel. Right-click the service name to start or stop the service.
Set SharePlex startup status on Windows
You can change the timing of SharePlex startup. By default, it is Automatic, meaning the service starts when the system starts. You may need to contact a System Administrator to perform this task.
- Open the Services console of the Administrative Tools control panel.
- Right-click the SharePlex service name, then click Properties.
- From the Startup type list, select the desired startup option. For assistance, click the Help link in the dialog.
Set SharePlex process priority on Windows
Important! Do not use the standard Windows Task Manager to set process priority for SharePlex.
On Windows systems, the CYGWIN operating environment controls the SharePlex processes. The SpUtils utility has an option that enables you to run the Windows Task Manager with the required elevated privileges to set the process priority. This procedure must be performed by a SharePlex Administrator. Consult with the System Administrator to select an appropriate value based on the requirements of all software running on the system.
To set SharePlex priority
- Run SpUtils.
- Select the TaskMgr tab.
- Right click the SharePlex instance that you want to prioritize.
- Select Set Priority, then select the desired priority level.
Identify SharePlex processes on Windows
In the Windows Task Manager, SharePlex appears as Sp_Copsrv.exe, representing the SharePlex sp_cop process. The operating system controls the parent Sp_Copsrv.exe service.
For a standard uni-directional configuration replicating through default queues to one target system, there are following processes on a Windows system:
On the source system:
- One parent Sp_Copsrv.exe process.
- One Sp_Ocap or Sp_capture (Capture) process.
- One Sp_Ordr (Read) process.
- One Sp_Xport (Export) process.
On the target system:
- One parent Sp_Copsrv.exe process.
- One Sp_Mport (Import) process.
- One Sp_Opst_Mt (Oracle Post) or Sp_Xpst (Open Target Post) process.
Shutdown Considerations on Windows
You can safely shut down SharePlex for a short time while there is still transactional activity. The next time you start SharePlex, replication resumes at the correct place in the redo logs or the archive logs, if needed. However, the best practice is to leave SharePlex running while there is transactional activity. Otherwise, SharePlex may need to process a large volume of redo backlog when you start it again, and there will be latency between the source and target data.
If the redo logs wrap and the archive logs cannot be accessed, resynchronization of the source and target data may be the only option. Take this possibility into account whenever you stop SharePlex while redo is still being generated.
Note: If you want to shut down both SharePlex and the database, shut down SharePlex first. Otherwise, SharePlex will interpret that the database is failing and generate a warning message.
As an alternative to stopping SharePlex, you can use the stop command in sp_ctrl to stop individual SharePlex replication processes as needed. See the SharePlex Reference Guide for more information about this command.
Run multiple instances of SharePlex
Run Multiple Instances of SharePlex
This chapter shows you how to configure and run multiple instances of SharePlex on one machine. For example, when replication is configured from multiple source systems to a central target system, you can run multiple instances of sp_cop to isolate the replication streams.
Contents
Run multiple instances of SharePlex from separate installations
Run Multiple Instances of SharePlex from Separate Installations
Important! This topic assumes that there is no active configuration. It assumes you are configuring multiple instances of sp_cop as part of an initial setup of the replication environment.
This method provides a one-to-one relationship between the binaries and the variable-data directory. This procedure creates autonomous SharePlex instances, with nothing in common between them. You start, control and maintain each SharePlex instance separately, and there are no special setup requirements.
This method has the following benefits:
The disadvantages are:
- You must install and upgrade each installation separately.
- More disk space is required to store the product files.
- In startup and shutdown scripts, and other places where you must map environment variables to SharePlex components, you must map them for each installation.
To set up multiple instances of SharePlex in this configuration:
- Install each one separately. There should be one product directory and one variable-data directory per installation.
- Install each one on a different TCP/IP port number.
Important! Make certain to create a different database account for each installation.
To install SharePlex, see the SharePlex Installation Guide.