Chat now with support
Chat with Support

SharePlex 8.6.6 - 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 SharePlex parameters Prepare an Oracle environment for replication Create a configuration file Configure replication to Open Target targets Configure a replication strategy Configure partitioned replication Configure named queues Configure SharePlex to maintain a change history target Replicate Oracle DDL Set up error handling Transform data Configure SharePlex security features Activate replication in your production environment Monitor SharePlex Prevent and solve replication problems Repair out-of-sync Data Procedures to maintain Oracle high availability Make changes to an active replication environment Apply an Oracle application patch or upgrade Back up Oracle data on the source or target Tune the Capture process Tune the Post process Appendix A: Peer-To-Peer Diagram Appendix B: SharePlex environment variables

Activate replication from Oracle to Open Target

Activate replication in your production environment > Activate replication from Oracle to Open Target

Use this procedure to synchronize an Oracle source database with an Open Target database. You will need to use a copy utility that can copy from Oracle to the type of target that you are using. SharePlex replicates the Oracle data changes and maintains them in the Post queue until the target is established with the copy. When the target is ready, you run the SharePlex reconcile feature, which ensures that Post only applies the operations that occurred after the copy and discards operations that were committed to the source before the copy.

To avoid added overhead on the production source database, you can copy the data from a mirrored secondary Oracle instance. In this case, you can use your Oracle RMAN backup system to recover the secondary instance to the point where the copy will start, or you can perform a manual backup to a secondary instance. The instructions include this option.

Important! Even if you use a secondary instance as the source of the data copy, the SharePlex configuration file should replicate directly from the production Oracle instance to the Open Target target. There is no replication to the secondary Oracle instance.

Preliminary considerations

Read these points before you proceed.

Supported databases

Oracle source and any supported target

If using a secondary Oracle instance as the source of the copy, that instance must be a mirror of the production source instance.

Supported replication strategies

All except cascading.

Requirements

  • This document does not provide instructions for how to perform the chosen copy method. Someone with expertise in database copy methods should perform this procedure. Use a copy method that supports the target database and can copy data from an Oracle database.

  • (Linux/Unix) If you plan to use a secondary Oracle instance as the source of the copy, verify that the ORACLE_SID and ORACLE_HOME in the oratab file are correct for the instance you will be establishing with a backup. The SID must be the SID used in the routing map in the configuration file that you will be activating.
  • Read the requirements for activating a configuration file. Requirements for activating a configuration.
  • Make certain SharePlex database accounts exist in the source and target databases. This account usually is created during installation. See the SharePlex Installation Guide for more information.
  • Before you start, review this procedure and see the SharePlex Reference Guide for more information about the commands that are used.

Naming conventions used

In this procedure, the "source" is one of the following:

  • The source database or system of a single-direction replication configuration.
  • All source databases or systems of a consolidated (many-to-one) replication configuration.

In this procedure, the "target" system is the Open Target database or the target system.

In this procedure, the SharePlex commands in the procedure apply to all sp_cop instances in the replication configuration, including all sp_cop processes on a target in consolidated replication.

Procedure

  1. On the source and target systems, start sp_cop and sp_ctrl from the bin sub-directory of the SharePlex product directory.
  2. On source and target systems, verify that the SharePlex processes are running.

    sp_ctrl> status

  3. On the target system, stop the Post process. This allows replicated data to accumulate in the post queue until the target database is instantiated and reconciled.

    sp_ctrl> stop post

  4. If you will be making the copy from a secondary instance, start the backup to establish that instance. Wait until the backup is finished before proceding to the next step.
  5. Activate the configuration on the source system.

    sp_ctrl> activate config filename

  6. On the source system, monitor activation status.

    sp_ctrl> show activate

    Note: The command retains control of sp_ctrl until activation is finished.

  7. When activation is complete, switch log files on the source system.

    svrmgr1> alter system switch logfile;

  8. Do one of the following:

    • To reconcile to a sequence number on the target, make a note of the log sequence number of the new log file.

    • To reconcile to a Oracle System Change Number (SCN) on the target, make a note of an SCN in the new log file.
  9. If you will be making the copy from the secondary instance, do the following:

    1. Recover that database to the point where Oracle fully applied the log for which you recorded the sequence number or SCN.
    2. Open the database with the RESETLOGS option.

      Note: The next steps apply the replicated changes that occurred after the backup point.

  10. Using the copy utility, make a copy of the Oracle data (from the secondary instance, if applicable, or directly from the production source) to the Open Target database. Wait until the copy is finished before proceeding to the next step.
  11. [Optional] If you are using named post queues and are unsure of the queue names, issue the qstatus command and make a note of them.

    sp_ctrl> qstatus

  12. On the target system, disable triggers on the target tables.
  13. On the target system, disable check constraints and scheduled jobs that perform DML.
  14. On the target system, run sp_ctrl, then issue one of the following reconcile commands. If you are using named post queues, issue the command for each one.

    • To recover to a log sequence number, substitute the sequence number of the log that you noted previously.

      sp_ctrl> reconcile queue queuename for datasource-datadest seq sequence_number

      Example: reconcile queue SysA for o.prod1-r.rep1 seq 1234

    • To recover to an SCN, substitute the SCN that you noted previously.

      sp_ctrl> reconcile queue queuename for datasource-datadest scn scn_number

      Example: reconcile queue SysA for o.prod1-r.rep1 scn 0123456789

      Note: The command retains control of sp_ctrl until the reconcile process is finished.

  15. [Partitioned replication only] If you are using vertically partitioned or horizontally partitioned replication for any tables, delete the unneeded columns or rows from those tables.
  16. On the target system, start the Post process. The two instances are now in synchronization, and SharePlex will continue replicating to maintain synchronization.

    sp_ctrl> start post

Monitor SharePlex

Monitor SharePlex

This chapter contains an overview of the tools that SharePlex provides to detect errors and monitor the replication processes. Like any mission-critical software, SharePlex should be monitored regularly for situations or events that could interfere with processing, especially those that could result in loss of data synchronization.

Contents

View and kill SharePlex processes

Monitor SharePlex > View and kill SharePlex processes

These instructions show you how to forcefully terminate SharePlex processes in cases where replication must be shut down immediately. In normal circumstances, follow the shutdown instructions in the following topics:

Run SharePlex on Unix and Linux

Run SharePlex on Windows

View and terminate processes on Unix and Linux

On Unix and 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:

    1. Command and Control process (sp_cnc)

    2. Import (sp_mport)
    3. Post (sp_opst_mt if the database is Oracle or sp_xpst if the database is Open Target)

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.

To terminate a SharePlex process on Unix and Linux

$ killPID

Or...

$ kill -9PID

View and terminate SharePlex processes on Windows

On Windows systems, SharePlex is managed by the NuTCRACKER operating environment, rather than the Windows operating system. However, you can view and terminate SharePlex processes in the normal manner, as you would other Windows programs.

View SharePlex processes on Windows

You can view the SharePlex processes on Windows systems in the following ways:

  • From the Command Prompt console using the tlist program provided with the SharePlex software.
  • From the Windows Task Manager.

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. The parent Sp_Copsrv.exe process spawns child Sp_Copsrv.exe processes — one for each replication process (Capture, Read, Export, Import, Post, sp_ctrl, and so forth.).

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 (Capture) process plus one child Sp_Copsrv.exe process.
  • One Sp_Ordr (Read) process plus one child Sp_Copsrv.exe process.
  • One Sp_Xport (Export) process plus one child Sp_Copsrv.exe process.
  • If there are any additional SharePlex processes running, such as sp_ctrl, there is an additional Sp_Copsrv.exe process for each one.

On the target system:

  • One parent Sp_Copsrv.exe process.
  • One Sp_Mport (Import) process plus one child Sp_Copsrv.exe process.
  • One Sp_Opst_Mt (Oracle Post) or Sp_Xpst (Open Target Post) process plus one child Sp_Copsrv.exe process.
  • If there are any additional SharePlex processes running, such as sp_ctrl, there is an additional Sp_Copsrv.exe process for each one.

If there are no active replication configurations, the SharePlex processes do not start when you start the service, and just the parent Sp_Copsrv.exe will be running.

To identify the parent Sp_Copsrv.exe process in the Windows Task Manager, look for the one that is using the largest amount of memory. The child Sp_Copsrv.exe processes consume less memory than the parent process.

To identify which replication process is associated with a child Sp_Copsrv.exe process, look in the SharePlex Event Log for the message stating when the replication process started. This entry provides the PID for that process and the PID of the associated Sp_copsvr.exe process.

Terminate SharePlex processes on Windows

You can terminate SharePlex processes on Windows systems as follows:

  • Windows Task Manager: Terminate one SharePlex process at a time
  • KillSharePlex.bat: Terminate all SharePlex processes at once with a batch file.

To terminate a process with Task Manager

  1. Press Control | AltDelete.
  2. Select Start Task Manager or Task Manager, depending on your Windows version.
  3. Select the Processes tab.
  4. (Optional) Sort the processes by name.
  5. Select the process that you want to kill.
  6. Click End Process.

To terminate all processes with KillSharePlex.bat

Run KillSharePlex.bat from the bin sub-directory of the SharePlex product directory.

Note: This tool terminates all SharePlex processes without displaying them. There are no user prompts or confirmation messages.

View events and errors

Monitor SharePlex > View events and errors

SharePlex reports errors and other abnormal conditions in the following ways.

Event Log

SharePlex reports operational errors, notices and warning conditions to the Event Log. This log provides a perpetual step-by-step record of replication activities, errors, and events. The Event Log can help you replay the sequence of events that led up to a problem.

Examples of replication events include:

  • Start or stop of sp_cop or a replication process
  • Execution of a command in sp_ctrl. User-issued commands are recorded for every SharePlex command that is issued.

    Note: A user-issued command appears in the Event Log as a notice, as in the following example:

    Notice 08-07-02 16:13:24.641582 23696 1 User command: rjones activate config 1route (from mycomp14)

  • Database errors
  • Failure of a network connection or SharePlex process
  • Start or stop of a utility or script
  • Login or logout of a user

Each entry in the Event Log includes:

  • The date and time of the event.
  • A description of the event and any related messages (error or non-error).
  • The event’s process ID number, if it is associated with a SharePlex process.

To view the Event Log

Use the show log command in sp_ctrl or open the file named event_log in the log sub-directory of the SharePlex variable-data directory.

SharePlex provides a script for unattended monitoring of this log. See Monitor events with sp_eventmon.

Status Database

The Status Database contains a summary of the conditions reported in the Event Log, including events that did not generate an error message or warning at the sp_ctrl user interface. This information alerts you to potential problems and helps you resolve existing ones. The Status Database may refer you to the Event Log for a more detailed explanation of a warning, notice or event.

To view the Status Database

Use the show statusdb command in sp_ctrl or open the file in the data sub-directory of the SharePlex variable-data directory.

Error Log

When the Post process detects that source and target tables are out of synchronization, it logs the first 100 SQL statements and data for the out-of-sync transactions to an error file on the target system. You can use this log to determine the extent of the out-of-sync condition, and you can use the SQL statements to repair target tables if the condition is not too severe, after first correcting the cause of the problem.

To view the Error Log

Open the ID_errlog.sql file in the log sub-directory of the SharePlex variable-data directory (where ID is the identifier of the SharePlex target, for example a target database).

Process logs

When a SharePlex process cannot process a record, the process not only logs the record to the Event Log, but also to its process log file. The process logs are primarily for use in debugging.

The name of a process log consists of the datasource identifier (such as the ORACLE_SID), the short name of the process (such as ocap, ord, opo, rcl), the file number, and the file extension (.log).

Examples:

Capture: ora10_ocap02.log

Read: ora10_ord01.log

Post: ora10_opo03.log

Reconcile: ora10_rcl01.log

The aging of old log files is performed in a circular pattern. The numbering begins with 01 and ends with 03. Up to three logs can exist at any time, including the current one. When all three logs are full (50 MB), the process starts overwriting them, beginning with the oldest one.

To view a process log

Open the file in the log sub-directory of the SharePlex variable-data directory.

Activation log

When you activate a configuration, it generates a log.

To view the activation log

Open the file named SID_oconf##.log in the log sub-directory of the SharePlex variable data directory.

Compare/repair log

The compare and repair commands log errors, messages and warnings to a log. For more information about these logs, see the compare commands in the SharePlex Reference Guide.

Related Documents