Chatta subito con l'assistenza
Chat con il supporto

SharePlex 11.4 - Administration Guide

About this Guide Conventions used in this guide Revision History Overview of SharePlex Run SharePlex Run multiple instances of SharePlex Execute commands in sp_ctrl Set SharePlex parameters Configure data replication Configure replication to and from a container database Configure named queues Configure partitioned replication Configure replication to a change history target Configure a replication strategy Configure DDL replication Configure error handling Configure data transformation Configure security features Assign SharePlex users to security groups Start replication on your production systems Monitor SharePlex Prevent and solve replication problems Repair out-of-sync data Tune the Capture process Tune the Post process Recover replication after Oracle failover Make changes to an active replication environment Apply an Oracle application patch or upgrade Back up Oracle data on the source or target Troubleshooting Tips Appendix A: Peer-To-Peer Diagram Appendix B: SharePlex environment variables

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

Method 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

Argument Description
& 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.

  • The sp_cop process is the root process.

  • The following child processes are spawned by sp_cop on a source system:

    • Command and Control process (sp_cnc)
    • Capture (sp_ocap)
    • Read (sp_ordr)
    • Export (sp_xport)
  • The following child processes are spawned by sp_cop on a target system:

    • Command and Control process (sp_cnc)

    • Import (sp_mport)
    • Post (sp_xpst)

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 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:

  • Processes are easily isolated. You do not have to set environment variables to point to the correct port and variable-data directory.
  • You can upgrade or perform other maintenance one product directory at a time, or choose not to perform those tasks.
  • You can run the same or different versions of SharePlex on the same system.

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.

Run multiple instances of SharePlex from one installation

Run Multiple Instances of SharePlex from One Installation

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-many relationship between a set of binaries and two or more variable-data directories. In this configuration, you create multiple variable-data directories and link each one to a unique port number, each running a separate instance of sp_cop.

This method has the following benefits:

  • You install and upgrade only one installation of SharePlex. Maintenance procedures are performed for only one installation.
  • You conserve disk space, because you only store one set of SharePlex binaries and installed files.
  • The customization of the SharePlex monitoring scripts only need to be done once, in one place. For more information, see Run Monitor Scripts on Unix or Linux.
  • Startup and shutdown scripts only need to be created and run for one set of binaries.

The disadvantages are:

  • Processes must be directed to each instance. You must set environment variables for each instance, start sp_cop with the correct identifier for each instance, and set a port connection in sp_ctrl to ensure that commands are directed to the correct instance.
  • Upgrades apply to all instances of SharePlex.
  • All sp_cop instances are the same version of SharePlex.

How to run multiple sp_cop instances on Unix and Linux

To run multiple instances SharePlex on the same Unix or Linux machine, you run multiple instances of the sp_cop program, each running on a different port number. You link each sp_cop to a different variable-data directory. Each variable-data directory is identified by the port number of its sp_cop. Connection information to the source or target datastore is linked to each sp_cop instance.

1. Assign port numbers

Assign each instance of sp_cop a unique port number.

  • For each sp_cop instance, obtain one port number that will be used by that instance for both TCP and UDP communication.
  • For each sp_cop instance, use the same port number for the remote instances of sp_cop that will process the same replication data stream as the instance you are configuring.

The sp_cop process uses the TCP port for communication between two different systems in the network, such as data exchange between the Export and Import processes. If the ports are different, sp_cop on one system cannot connect to the sp_cop on another system to send or receive messages.

2. Create variable-data directories

For each instance of sp_cop, create a variable-data directory, and assign each to one of the port numbers you obtained. The variable-data directory contains the environment that is unique to a SharePlex instance.

  1. Install SharePlex according to the instructions in the SharePlex Installation Guide. At the end of the installation, you should have one product directory, one variable-data directory associated with a port number, and one database account. This is your base instance of SharePlex.
  2. Log in as a root user.
  3. Shut down sp_cop if it is running.
  4. Copy the original variable-data directory (with its sub-directories) to a new variable-data directory for each instance of sp_cop that you want to run. Include the port number in each name, as shown in the following examples.

    cp -p -r /splex/vardir/splex2100 /splex/vardir/splex2101

    cp -p -r /splex/vardir/splex2100 /splex/vardir/splex2102

3. Define the port numbers in the SharePlex environment

For each variable-data directory that you created, perform this procedure to set the port number that you reserved for this instance of SharePlex.

  1. Export the SP_SYS_VARDIR variable to point to one of the new variable-data directories, for example splex2101 in the preceding example.

    ksh shell:

    export SP_SYS_VARDIR=/full_path_of_variable-data_directory

    csh shell:

    setenv SP_SYS_VARDIR=/full_path_of_variable-data_directory

  2. Export the SP_COP_TPORT and SP_COP_UPORT variables to point to the port number of the variable-data directory that you exported.

    ksh shell:

    export SP_COP_TPORT=port

    export SP_COP_UPORT=port

    csh shell:

    setenv SP_COP_TPORT port

    setenv SP_COP_UPORT port

  3. Log in as SharePlex Administrator.
  4. Run the clean_vardir.sh script. The script removes duplicate replication queues and restores each one to a fresh state. See clean_vardir.sh in the SharePlex Reference Guide for more information.
  5. In the rim sub-directory of the exported variable-data directory, delete the shstinfo.ipc and shmaddr.loc files. (These files may not exist if sp_cop has never been started for this variable-data directory.)
  6. Repeat these steps for each additional variable-data directory.

4. Establish connections to the source or target datastore

For each sp_cop instance, establish the connections that SharePlex will use to access the source or target data of this SharePlex instance.

  1. Export the SP_SYS_VARDIR variable to point to one of the new variable-data directories, for example splex2101 in the example.

    ksh shell:

    export SP_SYS_VARDIR=/full_path_of_variable-data_directory

    csh shell:

    setenv SP_SYS_VARDIR=/full_path_of_variable-data_directory

  2. Run the appropriate Database Setup utility for the database. For more information, see Database Setup Utilities in the SharePlex Reference Guide.

  3. Repeat these steps for each additional variable-data directory.

5. Start sp_cop instances

You can now run separate instances of sp_cop and sp_ctrl as needed.

  1. Export the SP_SYS_VARDIR environment variable to point to the variable-data directory of the first sp_cop instance.

    ksh shell:

    export SP_SYS_VARDIR=/full_path_of_variable-data_directory

    csh shell:

    setenv SP_SYS_VARDIR=/full_path_of_variable-data_directory

  2. Start sp_cop with the -u option, where port is the port assigned to the sp_cop instance.

    /splex/proddir/bin/sp_cop -u port &

  3. In sp_ctrl, use the port command to set the session to the port number of the sp_cop instance you want the commands to affect.

    ./sp_ctrl

    port number

  4. Repeat these steps for each instance of sp_cop that you want to run.

Note: If you receive an error message similar to the following, find out if someone else started a session of sp_cop using the same port number and variable-data directory. If permissible, kill the processes associated with that session, then start sp_cop again.

Error cleaning up previous shared memory segment ###.

Cannot delete because there are users attached.

Check if SharePlex processes are running and kill them if necessary.

Related Documents

The document was helpful.

Seleziona valutazione

I easily found the information I needed.

Seleziona valutazione