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
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.
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
Or...
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 or Sp_capture (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
- Press Control | Alt | Delete.
- Select Start Task Manager or Task Manager, depending on your Windows version.
- Select the Processes tab.
- (Optional) Sort the processes by name.
- Select the process that you want to kill.
- 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.
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. For more information, see Monitor events with sp_eventmon.
Note: To control the number of out-of-sync messages that Post logs when a target table is very out-of-sync, use the SP_OPO_SYNC_LOG_FREQUENCY parameter. For more information, see the SharePlex Reference Guide.
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.
The information commands in sp_ctrl help you monitor different aspects of replication. Issue them frequently to:
- Monitor for out-of-sync tables.
- Verify that replication processes are running.
- View the number of replicated messages in the queues.
- View the Event Log to view warnings, errors and other notifications.
- View process statistics that are helpful for tuning and problem solving.
- Detect tables or operations that are slowing down the replication process.
List of information commands
append status |
3 |
Displays status and results of the append using and append commands. |
copy status |
3 |
Displays status and results of the copy using and copy commands. |
compare status |
3 |
Displays the status and results of the compare using and compare commands. |
lstatus |
3 |
Displays detailed information about the state of SharePlex replication. |
job status |
3 |
Displays current status and history for append, compare, copy and repair commands. |
orainfo |
3 |
Displays the Oracle database information. |
qstatus |
3 |
Displays the state of the capture, export and post queues. |
repair status |
2 |
Disaplys the status and results of the repair and repair using commands. |
report |
3 |
Displays append, compare, copy and/or repair history for a table. |
show |
3 |
Displays the source and destination of the data being processed by each replication process on a system, and displays the status of each process. |
show capture |
3 |
Displays brief or detailed statistics for the Capture process for use in tuning and problem solving. |
show config |
3 |
Displays properties of the active configuration. |
show export |
3 |
Displays the number of messages sent to the target system(s). |
show import |
3 |
Displays the number of messages received from the source system(s). |
show log |
3 |
Displays the Even Log, Command Log, Verify Log, Trace Log, or a process log. |
show post |
3 |
Displays brief or detailed statistics for the Post process for use in tuning and problem solving. |
show read |
3 |
Displays brief or detailed statistics for the Read process for use in tuning and problem solving. |
show sql |
3 |
Displays the current or last SQL statement processed by the Post process. |
show statusdb |
3 |
Displays the Status Database, which contains records of important replication events. |
show sync |
3 |
Displays information about out-of-sync conditions. |
status |
3 |
Displays an overview of the state of SharePlex replication. |
See the SharePlex Reference Guide for details about these commads.