Chatta subito con l'assistenza
Chat con il supporto

SharePlex 12.0 - Administration Guide

About this Guide Conventions used in this guide 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 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:

  1. Start the system.
  2. Start the source and target databases.
  3. 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. .
  4. Start the SharePlexport# service.
  5. Start sp_ctrl from the bin sub-directory of the SharePlex product directory.
  6. 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.

  1. 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
  2. View the Windows services to make certain the Cygserver service is running. Start it, if needed.
  3. Run the SpUtils utility from the desktop shortcut or the Programs menu.
  4. Click the SharePlex Services tab of the utility.
  5. Select the port number of the SharePlex instance that you want to control.
  6. 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.

  1. Open the Services console of the Administrative Tools control panel.
  2. Right-click the SharePlex service name, then click Properties.
  3. 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

  1. Run SpUtils.
  2. Select the TaskMgr tab.
  3. Right click the SharePlex instance that you want to prioritize.
  4. 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

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.

How to run multiple sp_cop instances on Windows

To run multiple instances of SharePlex on the same Windows machine, you install and run a SharePlex service for each instance, each with a different port number and variable-data directory.

1. Install the instances

  1. Install SharePlex on the source and target systems according to the directions in the SharePlexInstallation Guide. This creates your initial instance of SharePlex.
  2. Repeat the installation procedure for each SharePlex instance that you want to create, with the following differences:

    • Use the same product directory for each instance.
    • Select or create a different variable-data directory for each instance.
    • Select a different port number for each instance. The installation program locates available ports, which you can override if necessary.
    • When prompted for a license key, use the same license key for all instances. Make certain to select the correct port each time.
    • When you run the Database Setup utility, use the correct port number for the instance, and use a different name for each database account.

2. Start the SharePlex instances

All instances are controlled from the SpUtils utility.

  1. Log onto Windows as a SharePlex Administrator (member of the spadmin group).
  2. Run the SpUtils utility.
  3. Select the SharePlex Services tab.
  4. Select the port number for the instance of SharePlex that you want to start.
  5. Under SharePlex Service Status, click Start. This starts the service for that instance.
  6. When the Current State text box shows that the service has started, you can start another instance of SharePlex.
  7. Run Sp_Ctrl for the instance.
  8. 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

Related Documents

The document was helpful.

Seleziona valutazione

I easily found the information I needed.

Seleziona valutazione