Shareplex 8 6 5 Administrator Guide en
Shareplex 8 6 5 Administrator Guide en
Shareplex 8 6 5 Administrator Guide en
5)
Administrator Guide
Revision 1
Copyright 2016 Dell Inc. All rights reserved.
This guide contains proprietary information protected by copyright. The software described in this guide is furnished under a
software license or nondisclosure agreement. This software may be used or copied only in accordance with the terms of the
applicable agreement. No part of this guide may be reproduced or transmitted in any form or by any means, electronic or
mechanical, including photocopying and recording for any purpose other than the purchasers personal use without the
written permission of Dell Software Inc.
The information in this document is provided in connection with Dell Software products. No license, express or implied, by
estoppel or otherwise, to any intellectual property right is granted by this document or in connection with the sale of Dell
Software products. EXCEPT AS SET FORTH IN DELL SOFTWARES TERMS AND CONDITIONS AS SPECIFIED IN THE LICENSE
AGREEMENT FOR THIS PRODUCT, DELL SOFTWARE ASSUMES NO LIABILITY WHATSOEVER AND DISCLAIMS ANY EXPRESS, IMPLIED
OR STATUTORY WARRANTY RELATING TO ITS PRODUCTS INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTY OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. IN NO EVENT SHALL DELL BE LIABLE FOR
ANY DIRECT, INDIRECT, CONSEQUENTIAL, PUNITIVE, SPECIAL OR INCIDENTAL DAMAGES (INCLUDING, WITHOUT LIMITATION,
DAMAGES FOR LOSS OF PROFITS, BUSINESS INTERRUPTION OR LOSS OF INFORMATION) ARISING OUT OF THE USE OR INABILITY
TO USE THIS DOCUMENT, EVEN IF DELL SOFTWARE HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. Dell Software
makes no representations or warranties with respect to the accuracy or completeness of the contents of this document and
reserves the right to make changes to specifications and product descriptions at any time without notice. Dell Software does
not make any commitment to update the information contained in this document.
If you have any questions regarding your potential use of this material, contact:
Dell Software Inc.
Attn: LEGAL Dept
5 Polaris Way
Aliso Viejo, CA 92656
Refer to our web site (www.software.dell.com) for regional and international office information.
Overview of SharePlex 21
About source and target data 21
About sp_cop 22
About sp_ctrl 22
About the SharePlex architecture 22
SharePlex Directories 23
SharePlex Tables 24
SharePlex queues 25
SharePlex processes 26
How SharePlex replicates data 27
Understand the concept of synchronization 28
Characteristics of synchronized tables 28
Hidden out-of-sync conditions 29
Strategies for information availability 30
Reporting instances 30
Broadcast and cascade 30
Data warehousing 30
High availability and disaster recovery 30
Test before you deploy 31
Run SharePlex 33
Run SharePlex on Unix and Linux 33
Startup sequence on Unix and Linux 34
Start SharePlex on Unix and Linux 34
Identify SharePlex processes on Unix and Linux 35
Stop SharePlex on Unix and Linux 35
Shutdown Considerations on Unix and Linux 36
Run SharePlex on Windows 36
Startup Sequence on Windows 36
l Operating SharePlex
l Planning your replication strategy
l Preparing the environment for replication
l Configuring replication
l Starting replication
l Monitoring, tuning, and troubleshooting replication
l Failover/failback in a high-availability environment
l Performing administrative operations on replication systems
l See the SharePlex Reference Guide for reference information that you will need from time to time. It
includes detailed information about:
l sp_ctrl commands that administer, monitor and control replication
l SharePlex tuning parameters
l SharePlex utilities
l SharePlex error messages
l See the SharePlex Preinstallation Checklist for tasks that must be finished before installing or
running SharePlex.
l See the SharePlex Installation Guide for instructions for installing SharePlex and performing
initial setup.
l See the SharePlex Upgrade Guide for instructions for upgrading a current installation of SharePlex to
this version.
l See the SharePlex Release Notes for information about new features, enhancements, bug fixes and
known issues in this release.
l Bold represents required components of a command or option that must be typed as shown.
l Italics represent variables defined, named or entered by the user.
l Bold Italics represents required user defined variables in example command strings.
l {Braces} enclose available required arguments.
l [Brackets] represent optional command components and may also be used in example command strings
to emphasize required user defined variables in long strings.
Example:
reconcile queue {queuename} for {datasource-datadest} [onhost]
l A vertical bar, or pipe character ( | ) within brackets or braces indicates that you can use only one of
the enclosed components.
Example:
abort service {service | all}
Names of commands, programs, directories and files are expressed in Arial Bold;
other names are expressed in capital letters using the default font.
Examples:
The sp_ctrl program is located in the bin directory.
Open the oramsglst file.
Find the value for ORACLE_HOME.
Click Apply.
System displays, such as prompts and command output, are expressed in Courier New.
Examples:
sp_ctrl(sysA)>
User is a viewer (level=3)
Windows menu items, dialog boxes, and options within dialog boxes are expressed in Arial Bold.
Example:
From the File menu, select Print.
System names are expressed generically or fictitiously. When necessary, the source system
(or primary system) is referred to as SysA. Target systems (or secondary systems)
are referred to as SysB, SysC, SysD, and so forth.
Dell listens to customers and delivers worldwide innovative technology, business solutions and services they
trust and value. For more information, visit www.software.dell.com.
SharePlex provides high-speed, log-based replication that supports a variety of topology configurations in
heterogeneous database environments. This chapter provides an overview of how SharePlex replication works.
It explains concepts surrounding SharePlex replication and provides an overview of SharePlex capabilities.
For more information about the platforms and databases that SharePlex supports, see the SharePlex
Release Notes.
Contents
About source and target data
About sp_cop
About sp_ctrl
About the SharePlex architecture
SharePlex Directories
SharePlex Tables
SharePlex queues
SharePlex processes
How SharePlex replicates data
Understand the concept of synchronization
Characteristics of synchronized tables
Hidden out-of-sync conditions
Strategies for information availability
Test before you deploy
l The source data is the primary data that is to be replicated. This data resides on the source system.
l The target data is a full or subset copy of the primary data.This data resides on the target system. The
object of replication is to keep the source and target data synchronized, or in-sync. This means that the
state of the source data is reflected accurately by the target data, adjusting for any transformation that
is performed and for any time lag in the replication stream.
About sp_cop
The sp_cop program coordinates the SharePlex replication processes: (Capture, Read, Export, Import, Post)
and the SharePlex queues, and it initiates all of the other background processes that perform specific tasks. It
also maintains communication with other systems in the replication network. In general, most SharePlex users
have little interaction with sp_cop other than to start and stop it. Once started, sp_cop runs in the
background.
l Only a SharePlex Administrator (member of the SharePlex admin group) can start or stop sp_cop.
l sp_cop must be started on all source and target systems involved in replication.
l Start sp_cop as soon as (or before) users access the data on the source system, so that all SharePlex
processes are ready to start processing transactions. That way, Capture can keep pace with the changes
that are made to the source data.
l If Capture loses pace with the rate at which source transactions are generated, the redo logs could
wrap before Capture is finished reading them. Log wrap is when the online Oracle redo logs reach their
maximum size and number and Oracle starts writing new logs over the existing ones. If SharePlex has
not captured all of the changes before the logs wrap, it reads the archive logs, but by then there could
be unacceptable latency between source and target data. In that case, it might be more practical to
resynchronize the data.
For more information about the replication processes, see About the SharePlex architecture.
About sp_ctrl
Use sp_ctrl to issue the commands that start, stop, configure, direct and monitor SharePlex activities. The sp_
ctrl program interacts internally with the sp_cnc (command and control) process, which is the child process of
sp_cop that executes the commands. Users do not interact with sp_cnc itself.
Sub- Contents
directory
Sub- Contents
directory
SharePlex Tables
Much of the replication process is controlled and tracked through a series of internal tables that are installed
into the source or target database during the installation of SharePlex. They are essential for SharePlex to
operate, so do not alter them in any way.
Table* Description
SHAREPLEX_JOBS Used by the sp_cnc process and the compare, repair, and copy commands to store
information about a job.
SHAREPLEX_JOB_ Used by the sp_cnc process and the compare, repair, and copy commands to store
STATS information about a job.
SHAREPLEX_JOBS_ Used by the disable jobs and enable jobs commands.
CONFIG
SHAREPLEX_LOB_ Used by the Capture process when processing VARRAYs stored as LOB.
CACHE
SHAREPLEX_LOBMAP Used by the Capture process to map LOBIDs and rows when a table with LOB columns
does not have PK/UK logging enabled.
SHAREPLEX_LOGLIST Used by the Capture process to track inactive RAC instances.
SHAREPLEX_MARKER Used by the Read process when PK/UK logging is not enabled.
SHAREPLEX_OBJMAP Used by the activation and Capture processes to define the objects in replication.
SHAREPLEX_ Used by users to define horizontal partitioning for a table in the replication
PARTITION configuration.
SHAREPLEX_ Used by the Capture process to map Oracle partition IDs to tables in replication.
PARTITION_CACHE
SHAREPLEX_ROUTES Used by the activation and Read processes to provide the target table name and
routing for every table in replication.
SHAREPLEX_SYNC_ Used by the copy command and the Read and Post processes to sync their operations.
MARKER
SHAREPLEX_TRANS Used by the Post process to store checkpoints and to mark transactions that were
applied in a master-to-master configuration.
SHAREPLEX_ Used by the activation and Capture processes to provide wildcard specifications by
WILDCARD which Capture determines whether a newly created table should be replicated.
* Additionally, SharePlex creates the SHAREPLEX_JOBID sequence for use by the sp_cnc process and the
compare, repair, and copy commands to provide a unique job ID.
SharePlex queues
Queues store the replicated data as it is transported from the source system to the target system. Queues are
part of a checkpoint recovery system that facilitates safe, asynchronous transport of data. Data travels through
the queues in the sequence in which it was generated.
Data is not read-released (deleted) from one queue until it is written to the next one. Data accumulates in the
queues on the source and target systems if the network, system, or database slows down or fails, or when a
replication process stops. When the problem or outage is resolved, SharePlex resumes processing from the
point where it stopped.
SharePlex replication uses the following queues:
l Capture Queue: The capture queue resides on the source system and stores captured data for further
processing by SharePlex. There is one capture queue for each data source that is being replicated. A
NOTE: All SharePlex queue files are created and maintained in the rim sub-directory of the SharePlex
variable-data directory.
SharePlex processes
SharePlex replicates data through a series of replication processes that are started by the main SharePlex
process, sp_cop.
l The Capture process: The Capture process reads the transaction logs or archive logs on the source
system for changes to objects that are configured for replication by SharePlex. The Capture process
writes the data to the capture queue, where it accumulates until the Read process is ready for it.
There is a separate Capture process for each datasource being replicated, each functioning
concurrently and independently. The Capture process is named sp_ocap (Oracle Capture).
l The Read process: The Read process operates on the source system to read data from the capture
queue and add routing information to the data. After processing the data, the Read process sends it to
the Export queue. The Read process is named sp_ordr (Oracle Reader).
l The Export process: The Export process operates on the source system to read data from the export
queue and send it across the network to the target system. By default, a source system has one Export
process for each of its target systems. For example, if there are two target systems, there are two
Export processes. Each Export process controls transmission of all data that is being replicated from a
source system to a target system. The Export process is the first part of the Export/Import transport
pair, which moves data between systems over a TCP/IP network. The Export process is named sp_xport.
l The Import process: The Import process is the second half of the Export/Import transport pair. It
operates on the target system to receive data and build a post queue. There is one Import process for
each Export process. For example, if there are two source systems (each with an Export process)
replicating data to a target system, there are two Import processes on the target. The Import process is
named sp_mport.
NOTE: It is possible to replicate data between Oracle instances on the same system. In this case
the Export and Import processes are not created. The Read process places data directly into a
post queue on that system.
l The Post process: The Post process operates on the target system to read the post queue and apply
the replicated operations to the target. There is a Post process for each post queue on a target system.
Multiple Post processes can operate simultaneously on a system. The Post process is sp_opst_mt when
configured to post to an Oracle database and sp_xpst when configured to post to an Open Target target.
l If the change is an INSERT, SharePlex uses all of the columns in the row to build an INSERT statement.
l If the change is a DELETE, SharePlex uses only the key to build a WHERE clause to locate the correct
row. If a table lacks a key, SharePlex simulates one by using the values of all of the columns, except
LONG and LOB columns. You can specify columns to use as a key when you create the configuration file.
l If the change is an UPDATE, SharePlex uses the key plus the values of the changed columns to build a
WHERE clause to locate the correct row. Before applying changes to the database, the Post process
compares a pre-image of the values of the source columns to the existing values of the target columns.
The pre-image (also known as the before image) is the value of each changed column before the
UPDATE. If the pre-image and the existing target values match, confirming a synchronized state, Post
applies the changes. If not, then Post logs the operation to an error file and SharePlex returns an out-
of-sync error.
l If the change is an UPDATE or DELETE statement that affects multiple rows on the source machine,
SharePlex issues multiple statements on the target to complete the task. For example, an UPDATE
tableA set name = Lisa where rownum < 101 statement actually sends 100 UPDATE statements to
the target, even though only one statement was issued on the source.
Ensuring data integrity is the responsibility of the Post process. Post applies a WHERE clause to compare the key
values and the before values of the SQL operations that it processes. Post uses the following logic to validate
synchronization between source and target tables:
l Post applies a replicated INSERT but a row with the same key already exists in the target. Post applies
the following logic:
o If all of the current values in the target row are the same as the INSERT values, Post considers
the rows to be in-sync and discards the operation.
l Prevent write access to the target tables, so that DML and DDL cannot be applied to them.
Reporting instances
Targets maintained by SharePlex are ideal for offloading report and query processing because they are
accessible while being kept up-to-date, and they can be optimized with keys and indexes designed for optimal
query performance. You can run reports all day long, without complaints about performance from your OLTP
users. Even during busy reporting times such as the end of the month or quarter, application response time will
be unaffected by heavy reporting. And, your organizations decision-makers will appreciate the accuracy of the
data reflected in the reports.
Data warehousing
SharePlex can replicate from numerous source systems to one target system. It is ideal for consolidating data in
a data warehouse or a data mart so that information is available enterprise-wide for queries and reports. A high
degree of granularity in the data that you replicate and the option to transform replicated data to conform to a
different target structure are unique SharePlex features that enable you to populate your data warehouse
with the specific, timely information that users need to make good decisions.
The SharePlex Professional Services team can help you prepare for, install, and deploy SharePlex in your
environment.
This chapter contains instructions for running SharePlex on UNIX, Linux, and Windows
Contents
Run SharePlex on Unix and Linux
Startup sequence on Unix and Linux
Start SharePlex on Unix and Linux
Identify SharePlex processes on Unix and Linux
Stop SharePlex on Unix and Linux
Shutdown Considerations on Unix and Linux
Run SharePlex on Windows
Startup Sequence on Windows
Start and stop SharePlex on Windows
Set SharePlex startup status on Windows
Set SharePlex process priority on Windows
Identify SharePlex processes on Windows
Shutdown Considerations on Windows
IMPORTANT: Run SharePlex from either the korn (ksh) or C shell (csh) shell.
l 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.
Argument Description
Processes cannot be started individually after starting sp_cop with -s. Use the
stop command if you must stop individual processes. See the SharePlex
Reference Guide for more information about these commands.
-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. See Run multiple instances of SharePlex.
Some suggestions for identifier are:
Each child process has the same -u identifier as its parent sp_cop process. This makes it easier to identify
related processes when multiple session of sp_cop are running.
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 NuTCRACKERservice 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:
l Click Install to install the service. If Install is not shown, the service exists.
l 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.
l 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.
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.
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 one installation
l Processes are easily isolated. You do not have to set environment variables to point to the correct port
and variable-data directory.
l You can upgrade or perform other maintenance one product directory at a time, or choose not to
perform those tasks.
l You can run the same or different versions of SharePlex on the same system.
l Install each one separately. There should be one product directory and one variable-data directory per
installation.
l You install and upgrade only one installation of SharePlex. Maintenance procedures are performed for
only one installation.
l You conserve disk space, because you only store one set of SharePlex binaries and installed files.
l The customization of the SharePlex monitoring scripts (see Run monitor scripts on Unix) only need to be
done once, in one place.
l Startup and shutdown scripts only need to be created and run for one set of binaries.
l 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.
l Upgrades apply to all instances of SharePlex.
l All sp_cop instances are the same version of SharePlex.
l For each sp_cop instance, obtain one port number that will be used by that instance for both TCP and
UDP communication.
l 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 listens on each system on TCP and UDP ports for communications from SharePlex processes
on other systems in the network, such as a command or exchange between the Export and Import processes. If
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
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. Start sp_cop with the -u option, where port is the port number assigned to the exported variable-data
directory. (Leave no spaces between -u and the port number.)
$ /productdir/bin/sp_cop -uport&
4. Issue the following command to set the port number for the exported variable-data directory.
set param SP_COP_TPORT port
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. See the Utilities section of the SharePlex
Reference Guide for more information.
3. Repeat these steps for each variable-data directory.
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.
This chapter contains instructions for using the sp_ctrl command interface to execute commands that
configure, control, and monitor SharePlex. The sp_ctrl program resides in the bin sub-directory of the
SharePlex product directory.
NOTE: See the SharePlexReference Guide for more information about the commands shown in this topic.
Contents
How to run sp_ctrl
Define a default port for sp_ctrl
Define a default host for sp_ctrl
Set a default editor for sp_ctrl
Start sp_ctrl
There are two ways to run sp_ctrl:
l from the command shell of the operating system to issue one command, for example:
$ /productdir/bin/sp_ctrl command [on host]
l by running the sp_ctrl command interface to issue one or more commands, for example:
$ /productdir/bin/sp_ctrl
sp_ctrl>command [on host]
where:
Exit sp_ctrl
To exit the sp_ctrl command-line interface, issue the exit or quit command.
On Windows systems, you can simply close the sp_ctrl command prompt window.
The exit or quit command only closes the sp_ctrl session. It does not stop the SharePlex replication processes.
The host setting applies only to the sp_ctrl session in which it is set.
l Before you start sp_ctrl. This sets the editor only for that session of sp_ctrl.
l In the shell startup script on the local machine. This sets the editor permanently, until changed in the
startup script. You can override this setting on a per-session basis.
5. Right click the port number of the SharePlex instance to which you want to add a variable, then select
New, then String Value.
6. Under the Name column, right click the new variable, then select Rename.
7. Type the correct name.
8. Double click the new variable.
9. Under Value Data, enter the string for the new variable and then click OK.
10. Exit the Registry.
This chapter contains instructions for preparing an Oracle source or target database environment for
replication. The tasks outlined in this chapter must be performed before you perform initial synchronization to
start replication in your environment. Perform all tasks that apply to your data and to your replication
objectives.
Contents
Set up Oracle redo logging to support SharePlex
Set up Oracle database objects for replication
Set up an Oracle database to support SharePlex
Set up SharePlex to support Oracle data
Set up TDE Support
If a table being replicated by SharePlex does not have a primary key, but does have multiple unique keys, it is
possible that the key columns that Oracle logs are not those that SharePlex requires.
See Set up Oracle database objects for replication for more information about defining key values.
1. Determine the log that SharePlex is processing by querying the SHAREPLEX_ACTID table.
SQL> select seqno from splex.shareplex_actid
2. Determine the log that Oracle is writing to by querying Oracle's V$LOG table.
SQL> select sequence# from v$log where status='CURRENT'
3. Subtract the seqno value from the sequence# value. This reveals how many logs Capture lags
behind Oracle.
4. Subtract the number of online redo logs from that value. If the number is negative, SharePlex is
processing archive logs. For example, if you have 10 redo logs and SharePlex is 11 logs behind, it is
processing archive logs. You can then use this result to adjust the online logging configuration.
If there is a long delay between when Capture stops and then starts again, Capture can lose pace with Oracle
activity and there will be latency between the source and target data. Capture usually needs to read the
archives in this case because the required log is no longer online. To avoid Capture issues, configure archive
logging to support faster and uninterrupted replication as follows:
Enable Archive logging must be enabled on the source system. Otherwise, if the online logs wrap
archive before Capture is finished processing them, a resynchronization of the source and target data
logging on will be necessary.
the source
system
Time Do not compress the archive logs until SharePlex is finished processing them. Otherwise,
compression SharePlex returns a "log wrap detected" message and will stop because it cannot process the
properly data. To determine the current log for SharePlex, issue the show capture command with the
detail option in sp_ctrl on the source system. You can compress any logs that were
generated before the current one.
Specify a If you are storing the archive logs in a location other than the Oracle default, set the SP_OCT_
non-default ARCH_LOC parameter to the full path name of the directory where the archive logs are
archive located. If the redo logs wrap, SharePlex searches for the archive logs in Oracles archive log
location list. If SharePlex does not find the archive log there, it searches the directory or directories
specified by the SP_OCT_ARCH_LOC parameter. To have Capture go directly to the SP_OCT_
ARCH_LOC location and skip the read of the Oracle log list, set the SP_OCT_CK_LOC_FIRST to
1.
Configure If using SP_OCT_ARCH_LOC and you are using an automated method to move the logs to that
Capture to location, you can configure Capture to wait a certain amount of time for the move to be
wait for log- completed. This prevents Capture from stopping because a log it needs is not yet available.
management Capture waits, checks for the logs, stops if they are not yet available, and continues checking
processes and stopping until the logs are available. To configure Capture to wait, set the SP_OCT_
LOGWRAP_RESTART parameter to the number of seconds that you want Capture to wait.
Monitor these processes regularly to prevent replication latency.
Disable You can disable archive logging on the target systems to eliminate unnecessary Oracle
archive activity on that system, except for high availability or peer-to-peer strategies.
logging on
the target
Do not place If the database uses ASM, the Oracle redo logs (online and archive) cannot be located under
logs at the the ASM root directory. SharePlex will not be able to read them at that location.
root ASM
location
Read from Normally, SharePlex provides the least latency when reading from the online redo logs. On
the archive Exadata, however, SharePlex can process higher volumes of data when reading from a
logs on multiplexed archive location outside of the Exadata ASM file system. For more information,
Exadata
see Tune Capture on Exadata.
IMPORTANT: If Capture falls behind the pace at which Oracle generates redo volume, the following may apply:
l It might be more practical to resynchronize the data instead of waiting for SharePlex to restore parity
by capturing from the archive logs.
l It is possible to run out of disk space on the source system while Capture processes and queues the
operations that it missed.
l There is the potential for SharePlex to lose information needed for Post to construct SQL statements,
especially if the needed archive logs no longer are available. Always monitor disk space and latency
while SharePlex is running.
l Primary key
l Unique key with the fewest columns, where at least one of the columns is NOT NULL
l Unique key with the fewest columns.
For best performance, it is recommended that you enable primary and unique key supplemental logging.
If a table does not have a primary or unique key, or if Oracle logs the wrong unique key for SharePlex, you can
specify columns for SharePlex to use as a key when you create the configuration file. This is known as a key
definition and is specified in the configuration file. For more information, see Define a unique key
An alternative to a key definition is to create or use a unique index based on one or more columns that
establish uniqueness.
10 20 100
10 20 200
10 20 300
The new values become the following, and they are replicated to the target system:
Key_Col
2
5
6
8
SharePlex performs the update in the order that the operations enter the redo log:
update x set a=2 where a=1; (Succeeds)
update x set a=5 where a=4; (Fails because a value of 5 already exists.)
update x set a=6 where a=5; (Succeeds)
update x set a=8 where a=7; (Succeeds)
The pre-image value that Post uses for the target sequence is the same as the increased value replicated from
the source. Oracle rejects the operation as a unique constraint violation. Another example would be a
transaction that updates A to B and then updates B to C.
Indexes
The correct use of indexes is important in a replication environment. An index maintains the integrity of the
target data.
l When replicating a source table that has a unique index, the target table also should have a
unique index.
l All large tables should have a unique index on the target system. If there is no unique index, Oracle
scans the entire table in order to locate the rows to be changed by Post.
l Some applications do not use primary key constraints, and therefore a unique index is not created by
default. Often, however, there will be an index that was created, but not named, as a unique index
(not using CREATE UNIQUE INDEX command), although it was created on one or more columns populated
with unique values, such as a persons name and employee identification number. If no unique index
exists for a table, it is recommended that you create one or specify a user-defined key when you create
the configuration file. See Define a unique key.
l Once you have identified or created a unique index, you can ensure that Oracle uses it by employing
the hints feature of SharePlex. See Use Oracle INDEX hints.
l If tables have foreign keys, make sure the appropriate columns are indexed so that modifications to the
foreign keys do not cause full table scans.
l Keep your indexes up-to-date, or it can slow the Post process. Rebuild the ones that are fragmented.
If there are too many indexes on a target table, Oracle must update them all as rows are added and deleted.
This slows the entire system, including replication. Consider limiting the number of indexes to the ones that
have the most utility.
For applications that perform mostly one type of DML, consider the following:
If you run large batch jobs that do millions of SQL operations, remove unnecessary indexes before the batch
job, then rebuild them at the end. This makes SharePlex run faster, and you will have more organized
indexes afterward.
Bitmap indexes
For performance purposes, avoid the use of bitmap indexes while the Post process is applying the data. These
indexes can adversely affect the performance of the Post process.
If you must use bitmap indexes on target tables, weigh their benefit for queries against the their impact on the
transactions applied by Post:
l When Oracle adds, updates or deletes a bitmap entry, it effectively locks all the rows associated with
the bitmap segment.
NOTE: Replicating bitmap indexes is not recommended. Every time you change a table with a bitmap
index, the index is rebuilt. This associated cost (Oracle time and resources) to rebuild is added to your
SQL UPDATE statement.
High availability 1. Enable triggers for users other than SharePlex, either
in preparation for failover or because transactions are
and
performed on multiple source systems.
Peer-to-peer
2. Disable triggers for the SharePlex user by running the
sp_add_trigger.sql script. This script puts a WHEN
clause into each triggers procedural statement that
tells it to ignore operations posted by the SharePlex
user.
Reporting, data sharing, other basic one- Either disable triggers entirely on the target system or run the
way replication sp_add_trigger.sql script to ignore operations posted by the
SharePlex user.
For important information about how to use the trigger scripts, see the SharePlex Reference Guide.
ONDELETECASCADE constraints
SharePlex allows ONDELETECASCADE constraints to remain enabled on the target tables, but this feature must
be enabled. Post detects the ONDELETECASCADEdependencies and suppresses the posting of any replicated
cascaded deletes to the child tables.
If you do not enable this support through SharePlex you must disable these constraints manually on the target.
Otherwise SharePlex replicates both the primary delete and the cascaded deletes, which results in conflicts
and errors when the deletes cascade on the target.
Check constraints
Disable check constraints on the target system. They add unnecessary overhead. These checks are
redundant in a well maintained, synchronized replication environment because they are satisfied on the
source system. For high-availability purposes, you can build a script that re-enables the constraints as part
of the failover procedure.
SharePlex uses the ALTER SEQUENCE command to update sequences in a target database as follows:
SharePlex treats ALTER SEQUENCE operations like a simple SELECT (UPDATE) to a sequence because the redo
log records make no distinctions between the two operations.
(peak number of source database sessions) + (peak number of target database sessions) + (background Oracle
processes) + (value of SP_ORD_LDA_ARRAY_SIZE parameter +3) = setting for PROCESSES
l If the production database has between 500 and 1,000 concurrent users, rebuild the SHAREPLEX_TRANS
table to have an initrans of 30.
l If the production database has more than 1,000 concurrent users, rebuild the SHAREPLEX_TRANS table
to have an initrans value of 40.
The following character sets are tested and supported for SharePlex:
US7ASCII
UTF8
WE8ISO8859P1
AL16UTF16
AL32UTF8
KO16KSC5601
By default, SharePlex allows an Oracle target database to perform character conversion. Post notifies Oracle of
the character encoding of the source data and Oracle performs any required conversion.
Depending on the character sets involved, the Oracle conversion might lead to data loss. For example:
Example 1: The Japanese character for 'rice' in the JA16SJIS character set has no corresponding symbol in the
US7ASCII character set. If you attempt to replicate this symbol into a US7ASCII database, Oracle converts it to a
'?' character.
Example 2: According to Oracle, the WE8ISO8859P1 character set is a superset of the US7ASCII character set, so
it is logical to assume that any character in US7ASCII is posted unconverted into a WE8ISO8859P1 target
database. This is true for characters in the range 0x00 to 0x7F. However, Oracle strips off the top bit of
characters in the range 0x80 to 0xFF. This "conversion" may result in data loss while replicating to a character
set that is a superset of the source.
NOTE: Oracle does not convert characters if the character sets are identical. Thus, posting
WE8ISO8859P1 data to a database with a character set of WE8ISO8859P1 bypasses the Oracle
conversion process.
Parameter Less than Between 5GB Greater than Where to set the parameter
5GB/day and 15GB/day 15GB/day
Use compression
You can enable compression to reduce the amount of data that SharePlex sends across the network. SharePlex
uses LZIP lossless compression. Enabling compression on the source SharePlex instance automatically enables
compression to all targets of the source SharePlex instance.
By default compression is disabled. You can enable compression by itself or in conjunction with encryption.
To enable compression
Set the SP_XPT_ENABLE_COMPRESSION parameter to 1.
sp_ctrl> set param SP_XPT_ENABLE_COMPRESSION 1
To activate the parameter after you set it, stop and start Export.
l (If this was not done during installation) Run Oracle Setup. When prompted to enable TDE replication,
type "y" and then enter the fully qualified path to the TDE wallet file, including the wallet file name,
when prompted. See the SharePlex Reference Guide for more information about this utility.
l Run the sp_wallet utility to provide the Oracle Wallet password to SharePlex. This utility can be run in
manual or auto-open mode.
2. Run sp_wallet.
./sp_wallet [-r port_number]
IMPORTANT! On Windows, if you installed SharePlex on any port other than the default of 2100,
use the -r option to specify the port number. For example, in the following command the port
number is 9400:
./sp_wallet -r 9400
wallet password: walletpw
Wallet loaded into SharePlex
This chapter contains the information that you need to know in order to create a configuration file.
SharePlex takes direction from the configuration file to determine which tables to replicate and where to
send the replicated data. This file also provides any special processing instructions, such as column mapping
and data filtering.
Contents
Ensure compatible source-target mapping
How to create a configuration file
Database specifications in a configuration file
Target specifications in a configuration file
Routing specifications in a configuration file
Configuration examples by datasource and target
Use a script to build a configuration file
Replicate to, or from, a PDB
Use Wildcards to specify multiple objects
Define a unique key
Filter DML Operations
Map source and target columns
Build a configuration file using a script
l For most replication strategies, the name and/or owner of a source object can be different from that of
its target object. SharePlex replicates to the correct object because you specify it by owner and name
within the configuration file. For high-availability configurations, the owner and name of a source table
should be the same as the owner and name of the target table.
l Corresponding source and target columns must contain compatible datatypes (same type, size,
precision).
l Corresponding source and target rows must contain the same values unless transformation is being
used. See Transform data for more information. See Ensure compatible source-target mapping
l The data that you want SharePlex to replicate, including any filtering or partitioning of rows or columns
l The target name and type
l The system (and database if applicable) to which the data must be delivered.
Only a SharePlex Administrator or operator has the authority to create a configuration file.
When your configuration file is completed and the SharePlex environment is set up to support your replication
objectives, you activate the configuration with the activate config command to begin replication.
Additional information:
l See Activate replication in an Oracle production environment for more information about the timing and
process for activating a configuration file.
l See the SharePlex Reference Guide for more information about the activate config command.
Datasource:o.SID
The basic components of a configuration file are as follows. See Additional configuration options for additional
configuration options.
# Comments Lines that describe the file or provide other # This is a comment.
information about the contents to viewers, but
are not used by SharePlex. Precede each
comment line with a pound (#) sign. Comments
may be entered anywhere in the configuration
file.
Datasource Syntax that specifies the source database. This Datasource:o.SID
specification component must always be the first non-
commented line of a configuration file. It has the
following syntax elements, all on the same line
with no spaces:
Routing map One or more routes that send the data to the [email protected]
system that contains the target object specified
[email protected]
with the target specification. A route consists of
the following: [email protected]_alias
Open Target target r. Use to specify the name of an Open Target (non-
Oracle) target database, as in r.mydb. IMPORTANT!
Use the actual name, not the ODBC datasource name
(DNS). If the name is case-sensitive, specify it that
way.
See Configure replication to Open Target targets for
more information about configuring SharePlex to
replicate to a specific Open Target target.
Oracle change-history c. Use in a routing map to specify the Oracle SID, tns_
target alias, or global RAC tns_alias of an Oracle change
history database, as in o.ORA12CH. In this
configuration, SharePlex applies all source
transactions as INSERTs to the target tables, to
maintain a history of every operation performed. For
more information, see Configure replication to
maintain a change history target.
Change history table !cdc:tgt_owner.table The !cdc designator directs Post to insert every data
change to the table as a new row, rather than overlay
the old data with new data. Specify the fully qualified
name of the change history table.
See Configure replication to maintain a change history
target.
Datasource:o.SID
l All one type:All the same database object type or all a JMS queue or all a JMS topic or all a Kafka topic,
or all a file (but no combination of these).
l All with the same fully qualified name, including any table specifications in a JMS, Kafka, or file target
specification.
l All having identical column or key mappings, if used (see Define a unique key and Map source and
target columns).
NOTES:
l Certain routing limitations apply when using vertically partitioned replication. See Configure
vertically partitioned replication.
l If any target has a different qualified name from the other targets of the same source object, you
must use a simple routing map for that target.
Datasource:o.SID
Datasource:o.
database1
Datasource:o.
database1
Routing Limitations
l By default, SharePlex supports replication to a maximum of 19 direct target systems. That is the
maximum number of processes that can read the export queue. To replicate to more than 19 targets,
use named export queues. With each additional queue that you add, you can replicate to 19 additional
targets. See Configure named export queues.
l Each instance of sp_cop on a system permits a maximum of 1024 different routes. This limitation
includes each route that uses a different named post queue (see Configure named post queues.) If
your replication strategy requires more than 1024 routes, consider using one or more intermediary
systems to divide the routes among multiple sp_cop instances. See Configure replication to share or
distribute data).
l By default, each sp_cop instance allows a total of 25 queues on a system. There will always be one
capture queue on a source system and one post queue on a target. Therefore, you can have as many as
24 named export queues on a source system and 24 named post queues on a target system. If a system
serves as both a source and target, you will have both a capture queue and a post queue. That allows
you to create up to 23 named queues of either type (or a mix of both). If system memory permits, you
can change the number of allowed queues by setting the SP_QUE_MAX_QUEUES parameter. See the
SharePlex Reference Guide for more information about this parameter.
Example
The following example replicates table SCOTT.EMP from Oracle instance oraA to target table SCOTT.EMP2 in
Oracle instance oraB on target system sysprod.
Datasource:o.oraA
SCOTT.EMP SCOTT.EMP2 [email protected]
Example
The following example replicates table SCOTT.EMP from Oracle instance oraA to target table Scott2.Emp2 in
Open Target database mydb on target system sys2. The target table is case-sensitive.
Datasource:o.oraA
SCOTT.EMP "Scott2"."Emp2" [email protected]
NOTE: The support of OpenTarget databases is currently in beta testing, with the exception of the ones listed
in the SharePlex Release Notes. Questions or support requests for these features should be emailed to
[email protected]. For more information about the SharePlex beta program, see the
SharePlex Release Notes.
Example
The following example replicates table SCOTT.EMP from Oracle instance oraA to a file on target
system sysprod.
Datasource:o.oraA
SCOTT.EMP !file sysprod
Example
The following example replicates table SCOTT.EMP from Oracle instance oraA to a JMS queue on target
system sysprod.
Datasource:o.oraA
SCOTT.EMP !jms sysprod
Example
The following example replicates table SCOTT.EMP from Oracle instance oraA to a Kafka topic on target
system sysprod.
Datasource:o.oraA
SCOTT.EMP !kafka sysprod
Example
This example replicates table SCOTT.EMP from an Oracle PDB that uses the tns_alias of aliasA to target table
SCOTT.EMP in an Oracle PDB that uses the tns_alias of aliasB on target system sysprod.
Datasource:o.aliasA
SSCOTT.EMP SCOTT.EMP [email protected]
Example
The following example replicates table SCOTT.EMP from Oracle instance oraA to change-history target table
SCOTT.EMP2 in Oracle instance oraB on target system sysprod.
Datasource:o.oraA
SCOTT.EMP !cdc:SCOTT.EMP2 [email protected]
See Configure replication to maintain a change history target for more information.
config.sql Builds a configuration file that includes all tables and sequences that are See Build a
in the database. Source and target object names must be identical. configuration file
using a script
build_ Builds a configuration file that includes all tables in a schema. Source and See Build a
config.sql target object names must be identical. configuration file
using a script
Replicate to a PDB
SharePlex can replicate data from a regular source database to a PDB in a target Oracle CDB. In one
configuration file, you can replicate to any number of target PDBs in the same CDB or a different CDB.
To replicate to a PDB
Specify the tns_alias of the target PDB in the routing map, as shown in the following example where pdb2 is
the target:
[email protected]
Examples
Example 1: This example shows two configuration files, one replicating from pdb1 and the other replicating
from pdb2, both replicating data to pdb3.
Datasource: o.pdb1
hr.emp hr2.emp2 [email protected]
Datasource: o.pdb2
sales.cust sales2.cust2 [email protected]
Example 2: This example shows one configuration file replicating from pdb1 to pdb2 and pdb3, both targets
being on different systems.
Datasource: o.pdb1
hr.sal hr2.sal2 [email protected]
hr.sal hr3.sal3 [email protected]
IMPORTANT! See Control DDL replication for more information about setting these parameters.
You can disable the automatic replication of DML changes made to sequences that satisfy a wildcard by setting
the SP_OCT_REPLICATE_SEQUENCES parameter to 0.
You can exclude objects from a wildcard specification by using the NOT option in the wildcard specification.
Datasource:o.SID
Component Description
The name of the objects on the source must be the same as the
name of the objects on the target, but the objects may belong to
different owners (or reside in different schemas).
not (list) An exclusion list that defines objects to omit from the wildcard
expansion. Use this option to exclude objects that you do not want
to be replicated. NOTE: This not keyword does not have the same
meaning as the SQLwildcard NOT operator.
Examples
Examples of valid wildcard specifications
Example 1: The following wildcard specification directs SharePlex to activate all tables owned by scott,
where the table name is like prod% except if the table name is like %temp%. All tables that match this
description are replicated to tables of the same names on the target in the hal schema. Note that SharePlex
automatically upshifts the names, so that it actually activates all tables where the table name is like 'PROD%'
but not like '%TEMP%'.
Datasource:o.sidA
expand scott.prod% not (%temp%) hal.% [email protected]
Example 2: The following example shows how you can specify special handling for one of the tables in a
wildcarded specification, in this case the photo table. All tables but photo are routed through the default post
queue. The separate entry for the photo table overrides the wildcarded entry and processes the photo table
through a named post queue. For more information, see Configure named post queues.
Datasource:o.sidA
cust.% cust.% [email protected]
cust.photo cust.photo hostB:[email protected]
Datasource:o.sidA
expand scott.%t__t% fred.% [email protected]
Datasource:o.sidA
expand scott.% not (spo%, gen%, prodct) scott.% [email protected]
Datasource:o.sidA
expand scott.prod% not (%temp%) hal.% [email protected]
The following example contains a partially wildcarded target object name, which is not permitted.
Datasource:o.sidA
expand scott.%test% scott.%obj% [email protected]
l Without a primary or unique key, SharePlex uses all of the columns of a table (or all of the columns in a
column partition) as a key, which slows replication performance.
l When a key definition is specified for a table that has a PRIMARY or UNIQUE key, the key definition
overrides the defined key. This can be useful if you do not want any of the existing keys to be used by
SharePlex.
The columns that you specify as a key must meet the following criteria:
Datasource:o.SID
Example
Datasource:o.ora1
scott.tab !key(name,ID) scott.tab2 sysB@oraB
i INSERT
d DELETE
u UPDATE
Examples
Example 1
The following example filters DELETE operations from being replicated to the target table.
Restrictions
l The copy and compare commands do not support tables that include DML filtering in their
specifications.
l If there are multiple specifications of a source table in the configuration file, the DML filter specification
must be identical for all of them. Multiple specifications of the same source table occur if you are
routing to multiple targets without using a compound routing map (see Routing specifications in a
configuration file), or if you are combining full-table replication with horizontally partitioned replication
(see Configure horizontally partitioned replication).
Datasource:o.SID
src_owner.table and tgt_ The specifications for the source and target tables, respectively.
owner.table
routing_map The routing map. You can use a simple routing map, such as sysb@oraB,
or a compound routing map, such as sysb@oraB+sysc@oraC.
Configuration example
Datasourceo.oraA
sales.prod (ID,name,vendor,length,width) mfg.prod
(UPC,product,supplier,length,depth) [email protected]
l config.sql: configure all tables and optionally all sequences in the database.
l build_config.sql: configure multiple or all tables in a schema
Use config.sql
The config.sql script enables you to build a configuration that lists all of the tables, and optionally all of the
sequences, in all of the schemas of a database. This script saves time when establishing a high-availability
replication strategy or other scenario where you want the entire database to be replicated to an identical
secondary database.
To run config.sql
1. Change directories to the config sub-directory of the SharePlex variable-data directory. The config.sql
script puts configurations in the current working directory, and SharePlex configurations must reside in
the config sub-directory.
cd /vardir/config
2. Log onto SQL*Plus as SYSTEM.
3. Run config.sql using the full path from the util sub-directory of the SharePlex product directory.
@ /proddir/util/config.sql
oracle schema from being replicated, which would cause replication problems. If a valid name is not
username provided, the script fails.
NOTE: The name assigned by SharePlex to the configuration is config.file. If you run the script again to create
another configuration file, it overwrites the first file. To preserve the original file, rename it before you create
the second one.
Next steps:
l If any tables or owners are case-sensitive, open the configuration file with the edit config command in
sp_ctrl, then use the text editor to enclose case-sensitive table and owner names within double-quote
marks, for example scott.emp. The script does not add the quote marks required by Oracle to
enforce case-sensitivity.
sp_ctrl> edit config filename
l To ensure that the configuration is in the correct location, issue the list config command. If the name of
the configuration is not shown, it was created in the wrong directory. Find the file and move it to the
config sub-directory of the variable-data directory.
sp_ctrl> list config
Use build_config.sql
The build_config.sql script enables you to build a configuration that contains multiple (or all) tables in a
schema. It is an interactive script that prompts for each component of the configuration step by step. Instead of
entering the information for each object and the routing individually, you can use a wildcard to select certain
tables at once, or you can select all of the tables in the schema.
Target machine The name of the target machine, for example SystemB.
Source database SID The ORACLE_SID of the source (primary) Oracle instance, for example oraA. Do not
include the o. keyword. The ORACLE_SID is case-sensitive.
Target database SID The ORACLE_SID of the target (destination) Oracle instance, for example oraB. Do not
include the o. keyword. The ORACLE_SID is case-sensitive.
Name of the output A name for the configuration. The script gives the file a .lst suffix, for example Scott_
file to create config.lst.
Next steps:
l If any tables or owners are case-sensitive, open the configuration with the edit config command in sp_
ctrl, then use the text editor to enclose case-sensitive table and owner names within double-quote
marks, for example scott.emp. The script does not add the quote marks required by Oracle to
enforce case-sensitivity.
sp_ctrl> edit config filename
l To ensure that the configuration is in the correct location, issue the list config command. If the name of
the configuration is not shown, it was created in the wrong directory. Find the file and move it to the
config sub-directory of the variable-data directory.
sp_ctrl> list config
This chapter contains instructions for configuring SharePlex to replicate data from Oracle Database to Open
Target (non-Oracle) targets. Post must be configured to process data to the intended target in the correct
manner and format. This chapter guides you through the Post configuration process for each supported target.
NOTE: The support of OpenTarget databases is currently in beta testing, with the exception of the ones listed
in the SharePlex Release Notes. Questions or support requests for these features should be emailed to
[email protected]. For more information about the SharePlex beta program, see the
SharePlex Release Notes.
Contents
Configure replication to a Microsoft SQL Server target
Configure replication to anEDB Postgres Advanced Server target
Configure replication to an SAP ASE target
Configure replication to aHANAtarget
Configure replication to a Teradatatarget
Configure replication to other Open Target databases
Configure Replication to a JMS target
Configure Replication to a Kafka target
Configure Replication to a SQL or XML file target
Overview
SharePlex can post replicated Oracle data to a Microsoft SQL Server target database through an Open Database
Connectivity (ODBC) interface. These instructions guide you through the configuration processes that are
required to support this target.
NOTE: For the datatypes and operations that are supported when using SharePlex to replicate to a SQL Server
target, see the SharePlex Release Notes.
Configure replication
On the source, create a SharePlex configuration file that specifies capture and routing information. The
components that are required in a configuration file vary, depending on your replication strategy. However,
the most important part of the configuration file as it relates to replication to an Open Target target is the
portion of the routing map after the @ symbol.
NOTE: See Create configuration files for additional information about creating a configuration file.
To configure replication to an Open Target target, use the following syntax in the configuration file:
Datasource:o.SID
where:
* IMPORTANT!If target owner or table name is defined in the database as anything other than UPPERCASE, be
certain to:
1. Install the Microsoft SQL Server ODBC Driver. It must be that driver, not the Microsoft SQL Server
Native Client, or SharePlex will return an error when you run mssql_setup to configure Post to connect
to the database. To tell the difference between the two drivers:
l The Microsoft SQL Server ODBC Driver has versions such as 06.02.9200.
l The Microsoft SQL Server Native Client has versions such as 11.00.3513.
2. Create a Data Source Name (DSN) for the SQLServer database on the target Windows system. The DSN
can use either Windows NT authentication or SQL Server authentication. If you configure the DSN to
use NT authentication and are using SQL Server 2012 or later, grant the NTAuthority\SYSTEM user the
sysadmin fixed server role. ( For earlier versions of SQL Server, sysadmin is granted to the NT
Authority\SYSTEM user by default.)
3. Test the DSN and make certain the ODBC connection works before proceeding to the next step.
4. If you did not do so when you installed SharePlex, run the mssql_setup utility, which performs the
following target setup:
l Establish a SharePlex database account with privileges to post to the target SQL Server database
l Establish a target connection configuration
l Install tables and indexes for use by SharePlex and owned by the SharePlex account
See the SharePlex Reference Guide for more information about this utility.
Overview
SharePlex can post replicated Oracle data to an EDB Postgres Advanced Server target database through an
Open Database Connectivity (ODBC) interface. These instructions guide you through the configuration processes
that are required to support this target.
NOTE: For the datatypes and operations that are supported when using SharePlex to replicate to EDB Postgres
Advanced Server, see the SharePlex Release Notes.
Configure replication
On the source, create a SharePlex configuration file that specifies capture and routing information. The
components that are required in a configuration file vary, depending on your replication strategy. However,
the most important part of the configuration file as it relates to replication to an Open Target target is the
portion of the routing map after the @ symbol.
NOTE: See Create configuration files for additional information about creating a configuration file.
To configure replication to an Open Target target, use the following syntax in the configuration file:
Datasource:o.SID
where:
* IMPORTANT!If target owner or table name is defined in the database as anything other than UPPERCASE, be
certain to:
Overview
SharePlex can post replicated Oracle data to an SAP ASE target database through an Open Database
Connectivity (ODBC) interface. These instructions guide you through the configuration processes that are
required to support this target.
NOTE: For the platforms, datatypes and operations that are supported when using SharePlex to replicate to a
Sybase target, see the SharePlex Release Notes.
Configure replication
On the source, create a SharePlex configuration file that specifies capture and routing information. The
components that are required in a configuration file vary, depending on your replication strategy. However,
the most important part of the configuration file as it relates to replication to an Open Target target is the
portion of the routing map after the @ symbol.
NOTE: See Create configuration files for additional information about creating a configuration file.
To configure replication to an Open Target target, use the following syntax in the configuration file:
Datasource:o.SID
where:
* IMPORTANT!If target owner or table name is defined in the database as anything other than UPPERCASE, be
certain to:
Set up ODBC
1. Install and test the ODBC driver that is appropriate for your target database. SharePlex provides the
OTS utility for testing the ability of SharePlex to connect to and post through ODBC. For more
information, see the OTS documentation in the utilities section of the SharePlex Reference Guide.
2. On the target system, configure ODBC connection information for use by Post to connect to the target
database. You have the following options for configuring this connection information:
l On Windows, create a user or system DSN (Data Source Name) by using Data Sources (ODBC) in
the Administrative Tools section of the Windows control panel. See the Windows
documentation or your system administrator. If using a DSN, you must set the Post user name
and password for the target database with the connection comand. See Configure replication
to an SAP ASE target.
l On Unix and Linux, you can do either of the following:
l Configure a user or system DSN on the target system according to the instructions
provided with the database. Test the DSN by using it to connect to the target database. If
l Set the Post user name and password if you created a DSN.
l Set all of theODBC connection information if a DSN does not exist.
1. Create a user account for SharePlex in the target database. This account must be granted the privileges
to connect, query the metadata structures of the database, create and update tables in the SharePlex
database or schema, and perform full DML and supported DDL operations. Make certain that this user
can connect successfully to the database through ODBC outside SharePlex.
2. Run sp_ctrl.
3. Execute the connection command with the set option, once for each keyword.
connection r.database_name set keyword=value
Option 2: Input when a DSN does not exist (Unix and Linux)
driver The full path to the ODBC driver on the database server.
DSN exists
connection r.mydb set user=myuser
connection r.mydb set password=mypassword
connection r.mydb set dsn=mydsn
Overview
SharePlex can post replicated Oracle data to a HANA target database through an Open Database Connectivity
(ODBC) interface. These instructions guide you through the configuration processes that are required to
support this target.
NOTE: For the datatypes and operations that are supported when using SharePlex to replicate to a HANA
target, see the SharePlex Release Notes.
Configure replication
On the source, create a SharePlex configuration file that specifies capture and routing information. The
components that are required in a configuration file vary, depending on your replication strategy. However,
the most important part of the configuration file as it relates to replication to an Open Target target is the
portion of the routing map after the @ symbol.
NOTE: See Create configuration files for additional information about creating a configuration file.
To configure replication to an Open Target target, use the following syntax in the configuration file:
Datasource:o.SID
where:
* IMPORTANT!If target owner or table name is defined in the database as anything other than UPPERCASE, be
certain to:
Overview
SharePlex can post replicated Oracle data to a Teradata target database through an Open Database
Connectivity (ODBC) interface. These instructions guide you through the configuration processes that are
required to support this target.
NOTE: For supported Teradata versions and drivers and the datatypes and operations that are supported when
using SharePlex to replicate to a Teradata target, see the SharePlex Release Notes.
Datasource:o.SID
where:
* IMPORTANT!If target owner or table name is defined in the database as anything other than UPPERCASE, be
certain to:
l a database user by which SharePlex Post will operate (which also owns a database)
l a database into which SharePlex can install its internal objects (which can be the database owned by
the SharePlex Post user or a different one)
If you want to replicate to target tables in databases other than those two databases, you must issue the
following grant to the SharePlex user for each of the other databases. The command in BTEQ is:
grant all on database to SharePlex_user;
See the following configuration example for additional explanation.
In this example, the person who ran Teradata Setup (td_setup) specified the following:
Thus, the "hr" user has the required privileges to connect to both the "hr" and "fin" databases, but for
SharePlex to replicate to the tables in "sales" and "mfg" you must issue the following grants:
GRANTALLONsales TO hr;
GRANTALLON mfg TO hr;
Overview
SharePlex can connect to a database that supports Open Database Connectivity (ODBC). For the platforms,
datatypes and operations that are supported by SharePlex, see the SharePlex Release Notes.
NOTE: The support of OpenTarget databases is currently in beta testing, with the exception of the ones listed
in the SharePlex Release Notes. Questions or support requests for these features should be emailed to
[email protected]. For more information about the SharePlex beta program, see the
SharePlex Release Notes.
Configure replication
On the source, create a SharePlex configuration file that specifies capture and routing information. The
components that are required in a configuration file vary, depending on your replication strategy. However,
the most important part of the configuration file as it relates to replication to an Open Target target is the
portion of the routing map after the @ symbol.
NOTE: See Create configuration files for additional information about creating a configuration file.
To configure replication to an Open Target target, use the following syntax in the configuration file:
Datasource:o.SID
* IMPORTANT!If target owner or table name is defined in the database as anything other than UPPERCASE, be
certain to:
Set up ODBC
1. Install and test the ODBC driver that is appropriate for your target database. SharePlex provides the
OTS utility for testing the ability of SharePlex to connect to and post through ODBC. For more
information, see the OTS documentation in the utilities section of the SharePlex Reference Guide.
2. On the target system, configure ODBC connection information for use by Post to connect to the target
database. You have the following options for configuring this connection information:
l On Windows, create a user or system DSN (Data Source Name) by using Data Sources (ODBC) in
the Administrative Tools section of the Windows control panel. See the Windows documentation
or your system administrator. If using a DSN, you must set the Post user name and password for
the target database with the connection comand. See Configure replication to other Open
Target databases.
l On Unix and Linux, you can do either of the following:
l Set the Post user name and password if you created a DSN.
l Set all of theODBC connection information if a DSN does not exist.
1. Create a user account for SharePlex in the target database. This account must be granted the privileges
to connect, query the metadata structures of the database, create and update tables in the SharePlex
database or schema, and perform full DML and supported DDL operations. Make certain that this user
can connect successfully to the database through ODBC outside SharePlex.
2. Run sp_ctrl.
3. Execute the connection command with the set option, once for each keyword.
connection r.database_name set keyword=value
Option 2: Input when a DSN does not exist (Unix and Linux)
driver The full path to the ODBC driver on the database server.
Option 3: Connect string when a DSN does not exist (Unix and Linux)
DSN exists
connection r.mydb set user=myuser
connection r.mydb set password=mypassword
connection r.mydb set dsn=mydsn
Map datatypes
To support the accurate posting of replicated Oracle ALTERTABLEcommands to the correct datatypes in an
Open Target target, you need to map Oracle datatypes to the datatypes of the target database. Use the target
command with the set datatype option to perform this mapping.
NOTE: For DML operations, SharePlex queries the target database to determine the appropriate
datatype mapping for replicated data.
To map datatypes
target r.database [queue queuename ] set datatype src_datatype=tgt_datatype
Where: src_datatype is the Oracle datatype and tgt_datatype is the target datatype to which you are
mapping the Oracle datatype.
See the SharePlex Release Notes for mapping options.
For more information about the target command, see the SharePlex Reference Guide.
Overview
The SharePlex Post process can connect and write to a JMS (Java Messaging Service) queue or topic. The data is
written as XMLrecords that include the data definitions, the operation type, and the changed column values.
This data is written as a sequential series of operations as they occurred on the source, which can then be
posted in sequential order to a target database or consumed by an external process or program.
NOTE: For the platforms, datatypes and operations that are supported when using SharePlex to replicate to
JMS, see the SharePlex Release Notes.
Configure replication
On the source, create a SharePlex configuration file that specifies capture and routing information. The
structure that is required in a configuration file varies, depending on your replication strategy, but this shows
you the required syntax for routing data through a JMS queue or topic.
Datasource:o.SID
where:
NOTE:For more information about how to create a configuration file, see Create configuration files.
Name Directory
3. Download and expand the ActiveMQ files to the activemq directory under SharePlex/lib/providers.
4. Configure the JAVA_HOME and JRE_HOME variables to point to the activemq directory.
5. Add the new JAVA_HOME to the PATH variable.
6. Set all values of producerFlowControl="true" to "false". Additional content about this parameter is
available at: http://activemq.apache.org/producer-flow-control.html.
7. Copy the following provider JAR files and HS dependencies to the directory that you created.
Name Directory
l queue queuename is the name of a Post queue. Use this option if there are multiple Post processes.
l property and value are shown in the following table.
factory_class=factory_class Required Fully qualified class name of the factory class. None
Sets the JNDI environmental property
java.naming.factory.initial to specify the class name of
the initial context factory for the provider.
provider_url=url Required RMI URL with no object name component. This None
sets the JNDI environmental property
java.naming.provider.url to specify the location of the
registry that is being used as the initial context.
lib_location=path Required Path to the directory where you installed the None
JAR files.
destination={queue | topic} Messaging domain. Valid values are queue (port-to-port) queue
or topic (publisher-subscriber model).
persistent={yes | no} yes logs messages to disk storage as part of send yes
operations.
no prevents logging.
properties Use this option if the JMS provider that you are using None
cannot consume messages that contain the default set of
properties supplied by SharePlex. It enables you to
remove or add properties. Supply the properties as a
comma-delimited list.
client_id Use this option if the JMS provider that you are using None
cannot consume messages that contain the default
SharePlex client ID. Set this value to the client ID that
your provider accepts.
commit_frequency Use this option when Post is configured to post to a JMS 1500
server in transactional style (issue a JMS commit at
intervals, rather than after every message as directed by
the session_transacted property of the target
command). This parameter specifies the interval
between JMS commits. It works in conjunction with the
SP_OPX_READRELEASE_INTERVAL parameter. Valid values
are 1 to any positive integer.
Property Description
Example
target x.jms set metadata time, userid, trans, size
Configure debugging
You can configure Post to log whether each write to a queue or topic succeeded or failed. This is controlled
with the debugging setting.
To enable debugging
Open the openbridge.ini file and set the -OB_debugToLog parameter to true.
id ID of current transaction
cmd Operation metadata (In the case of a schema, there are no operations.)
ops Type of record generated for this table. For a schema, the value is schema.
<tbl
name="xs:string"
<cmd ops="xs:string">
<row id="xs:string">
<col name="xs:string"></col>
<lkup>
<col name="xs:string"></col>
</lkup>
</row>
</cmd>
</tbl>
</opentarget>
Supported datatypes
See the SharePlex Release Notes for a chart that shows how Oracle datatypes are converted to XML.
Source table
This is the table for which the sample operations are generated.
SQL> desc products
DESCRIPTION VARCHAR2(600)
PRICE NUMBER
Schema record
<?xml version="1.0" encoding="UTF-8"?>
<?opentarget version="1.1"?>
<opentarget>
<txn id="2218316945" commitTime="2014-10-10T13:18:43" userId="85"
oracleTxnId="3.10.1339425" />
<tbl name="MFG.PRODUCTS" utcOffset="-5:00">
<cmd ops="schema">
<schema>
<col name="PRODUCT_ID" xmlType="decimal" key="true" nullable="false" length="22" />
<col name="DESCRIPTION" xmlType="string" key="false" nullable="true" length="600" />
<col name="PRICE" xmlType="decimal" key="false" nullable="true" length="22" />
</schema>
</cmd>
</tbl>
</opentarget>
Insert record
<?xml version="1.0" encoding="UTF-8"?>
<?opentarget version="1.1"?>
<opentarget>
<txn id="2218316945" msgIdx="1" msgTot="1" commitTime="2014-10-10T13:18:43"
userId="85" oracleTxnId="3.10.1339425" />
<tbl name="MFG.PRODUCTS">
<cmd ops="ins">
<row id="AAAmDbAAEAAApRrAAA">
<col name="PRODUCT_ID">230117</col>
<col name="DESCRIPTION">Hamsberry vintage tee, cherry</col>
<col name="PRICE">4099</col>
</row>
</cmd>
</tbl>
</opentarget>
Delete record
<?xml version="1.0" encoding="UTF-8"?>
<?opentarget version="1.1"?>
<opentarget>
<txn id="2218319446" msgIdx="1" msgTot="1" commitTime="2014-10-10T13:19:25"
userId="85" oracleTxnId="5.23.1391276" />
<tbl name="MFG.PRODUCTS">
<cmd ops="del">
<row id="AAAmDbAAEAAApRrAAA">
<lkup>
<col name="PRODUCT_ID">230117</col>
</lkup>
</row>
</cmd>
</tbl>
</opentarget>
Truncate record
<?xml version="1.0" encoding="UTF-8"?>
<?opentarget version="1.1"?>
<opentarget>
<txn id="2218319938" commitTime="1988-01-01T00:00:00" userId="85"
oracleTxnId="11.4.939801" />
<tbl name="MFG.PRODUCTS">
<cmd ops="trunc" />
</tbl>
</opentarget>
Overview
The SharePlex Post process can connect and write to a Kafka broker. The data is written as XMLrecords that
include the data definitions, the operation type, and the changed column values. This data is written as a
sequential series of operations as they occurred on the source, which can then be posted in sequential order to
a target database or consumed by an external process or program.
NOTE: For the platforms, datatypes and operations that are supported when using SharePlex to replicate to
Kafka, see the SharePlex Release Notes.
Datasource:o.SID
where:
NOTE:For more information about how to create a configuration file, see Create configuration files.
l queue queuename is the name of a Post queue. Use this option if there are multiple Post processes.
l property and value are shown in the following table.
broker Required. The host and port number of the Kafka localhost:9092
broker.
topic Required. The name of the target Kafka topic. shareplex
threshold_size Optional. The approximate network packet size*, in 10000KB
kilobytes, that Post sends to the Kafka broker.
NOTES:
* To avoid latency, if Post detects no more incoming messages, it sends the packet to Kafka immediately
without waiting for the threshold to be satisfied.
Property Description
Example
target x.kafka set metadata time, userid, trans, size
id ID of current transaction
cmd Operation metadata (In the case of a schema, there are no operations.)
ops Type of record generated for this table. For a schema, the value is schema.
<tbl
name="xs:string"
<cmd ops="xs:string">
<row id="xs:string">
<col name="xs:string"></col>
<lkup>
<col name="xs:string"></col>
</lkup>
</row>
</cmd>
</tbl>
</opentarget>
name Column name with the before value or the key value (depending on the operation)
for that column
Supported datatypes
See the SharePlex Release Notes for a chart that shows how Oracle datatypes are converted to XML.
Source table
This is the table for which the sample operations are generated.
SQL> desc products
DESCRIPTION VARCHAR2(600)
PRICE NUMBER
Schema record
<?xml version="1.0" encoding="UTF-8"?>
<?opentarget version="1.1"?>
<opentarget>
<txn id="2218316945" commitTime="2014-10-10T13:18:43" userId="85"
oracleTxnId="3.10.1339425" />
<tbl name="MFG.PRODUCTS" utcOffset="-5:00">
<cmd ops="schema">
<schema>
<col name="PRODUCT_ID" xmlType="decimal" key="true" nullable="false" length="22" />
<col name="DESCRIPTION" xmlType="string" key="false" nullable="true" length="600" />
<col name="PRICE" xmlType="decimal" key="false" nullable="true" length="22" />
</schema>
</cmd>
</tbl>
</opentarget>
Update record
<?xml version="1.0" encoding="UTF-8"?>
<?opentarget version="1.1"?>
<opentarget>
<txn id="2218318728" msgIdx="1" msgTot="1" commitTime="2014-10-10T13:19:12"
userId="85" oracleTxnId="1.17.970754" />
<tbl name="MFG.PRODUCTS">
<cmd ops="upd">
<row id="AAAmDbAAEAAApRrAAA">
<col name="PRICE">3599</col>
<lkup>
<col name="PRODUCT_ID">230117</col>
<col name="PRICE">4099</col>
</lkup>
</row>
</cmd>
</tbl>
</opentarget>
Delete record
<?xml version="1.0" encoding="UTF-8"?>
<?opentarget version="1.1"?>
<opentarget>
<txn id="2218319446" msgIdx="1" msgTot="1" commitTime="2014-10-10T13:19:25"
userId="85" oracleTxnId="5.23.1391276" />
<tbl name="MFG.PRODUCTS">
<cmd ops="del">
<row id="AAAmDbAAEAAApRrAAA">
<lkup>
<col name="PRODUCT_ID">230117</col>
</lkup>
</row>
Truncate record
<?xml version="1.0" encoding="UTF-8"?>
<?opentarget version="1.1"?>
<opentarget>
<txn id="2218319938" commitTime="1988-01-01T00:00:00" userId="85"
oracleTxnId="11.4.939801" />
<tbl name="MFG.PRODUCTS">
<cmd ops="trunc" />
</tbl>
</opentarget>
Overview
SharePlex can post replicated Oracle data to a file formatted as SQL or XML. This data is written as a sequential
series of operations as they occurred on the source, which can then be posted in sequential order to a target
database or consumed by an external process or program.
This chapter guides you through the configuration process to support replication to this target.
NOTE: For the platforms, datatypes and operations that are supported when using SharePlex to replicate to a
SQL or XML file, see the SharePlex Release Notes.
Datasource:o.SID
where:
NOTE:For complete instructions for creating a configuration file, see Create configuration files.
file max_ Maximum size of the file, measured by the number of 50,000
records=number records
length=number
data record={SQL | Format of the output records, either SQL or XML xml
XML}
sql legacy={yes | no} Required in SharePlex 8.6. Use legacy SQL date and legacy={yes | no}
timestamp formatting of:
MMDDYYYYHH24MISS and
MMDDYYYYHH24MISS.FFFFFF(yes/no)
sql name_ Character that delimits SID, table, owner, column name_
delimiter names delimiter=character
=character
Command examples
This sets the record format to SQL for a post process with a named queue of myqueue1.
target x.file queue myqueue1 set format record=sql
This sets the maximum file size to contain no more than 320 records.
target x.file queue myqueue1 set file max_size = 320
id ID of current transaction
cmd Operation metadata (In the case of a schema, there are no operations.)
ops Type of record generated for this table. For a schema, the value is schema.
<tbl
name="xs:string"
<cmd ops="xs:string">
<row id="xs:string">
<col name="xs:string"></col>
<lkup>
<col name="xs:string"></col>
</lkup>
</row>
</cmd>
</tbl>
</opentarget>
col Before image of column (One of these elements appears for every changed column
in the operation.)
name Column name with the before value or the key value (depending on the operation)
for that column
Supported datatypes
See the SharePlex Release Notes for a chart that shows how Oracle datatypes are converted to XML.
Source table
This is the table for which the sample operations are generated.
SQL> desc products
DESCRIPTION VARCHAR2(600)
PRICE NUMBER
Schema record
<?xml version="1.0" encoding="UTF-8"?>
<?opentarget version="1.1"?>
<opentarget>
<txn id="2218316945" commitTime="2014-10-10T13:18:43" userId="85"
oracleTxnId="3.10.1339425" />
<tbl name="MFG.PRODUCTS" utcOffset="-5:00">
<cmd ops="schema">
<schema>
<col name="PRODUCT_ID" xmlType="decimal" key="true" nullable="false" length="22" />
<col name="DESCRIPTION" xmlType="string" key="false" nullable="true" length="600" />
<col name="PRICE" xmlType="decimal" key="false" nullable="true" length="22" />
</schema>
</cmd>
Insert record
<?xml version="1.0" encoding="UTF-8"?>
<?opentarget version="1.1"?>
<opentarget>
<txn id="2218316945" msgIdx="1" msgTot="1" commitTime="2014-10-10T13:18:43"
userId="85" oracleTxnId="3.10.1339425" />
<tbl name="MFG.PRODUCTS">
<cmd ops="ins">
<row id="AAAmDbAAEAAApRrAAA">
<col name="PRODUCT_ID">230117</col>
<col name="DESCRIPTION">Hamsberry vintage tee, cherry</col>
<col name="PRICE">4099</col>
</row>
</cmd>
</tbl>
</opentarget>
Update record
<?xml version="1.0" encoding="UTF-8"?>
<?opentarget version="1.1"?>
<opentarget>
<txn id="2218318728" msgIdx="1" msgTot="1" commitTime="2014-10-10T13:19:12"
userId="85" oracleTxnId="1.17.970754" />
<tbl name="MFG.PRODUCTS">
<cmd ops="upd">
<row id="AAAmDbAAEAAApRrAAA">
<col name="PRICE">3599</col>
<lkup>
<col name="PRODUCT_ID">230117</col>
<col name="PRICE">4099</col>
</lkup>
</row>
</cmd>
</tbl>
</opentarget>
Delete record
<?xml version="1.0" encoding="UTF-8"?>
<?opentarget version="1.1"?>
<opentarget>
<txn id="2218319446" msgIdx="1" msgTot="1" commitTime="2014-10-10T13:19:25"
userId="85" oracleTxnId="5.23.1391276" />
<tbl name="MFG.PRODUCTS">
<cmd ops="del">
<row id="AAAmDbAAEAAApRrAAA">
<lkup>
<col name="PRODUCT_ID">230117</col>
Truncate record
<?xml version="1.0" encoding="UTF-8"?>
<?opentarget version="1.1"?>
<opentarget>
<txn id="2218319938" commitTime="1988-01-01T00:00:00" userId="85"
oracleTxnId="11.4.939801" />
<tbl name="MFG.PRODUCTS">
<cmd ops="trunc" />
</tbl>
</opentarget>
SQL current_legacy.sql
XML current_prodsys.XML
XML files:
/installed/vardir> ls -1 opx
0000000000_20140305130858_prodsys.XML
0000000001_20140305131130_prodsys.XML
This chapter contains instructions for configuring SharePlex to support different replication objectives.
Production implementations can vary widely from basic configurations with one source and target, to multiple
instances of SharePlex with named queues,multiple targets, partitioned data, and more.
It is difficult to foresee and document every possible way that an organization may want to deploy SharePlex.
The goal of this documentation is to present instructions for setting up the basic deployment types in a way
that is clear enough for you to be able to combine them and expand upon them to suit your needs. Additional
deployment assistance is available through our Professional Services organization.
Contents
Configure replication to share or distribute data
Confgure replication to maintain a central data store
Configure replication to maintain multiple peer databases
Configure replication through an intermediary system
Configure replication to maintain high availability
Supported targets
Oracle and Open Target
Requirements
l Prepare the system, install SharePlex, and configure database accounts according to the instructions in
the SharePlex Installation Guide.
l Prepare the environment for replication. See Prepare an Oracle environment for replication.
l No DML or DDL should be performed on the target tables except by SharePlex. Tables on the target
system that are outside the replication configuration can have DML and DDL operations without affecting
replication.
l If sequences are unnecessary on the target system, do not replicate them. It can slow down replication.
Even if a sequence is used to generate keys in a source table, the sequence values are part of the key
columns when the replicated rows are inserted on the target system. The sequence itself does not
have to be replicated.
IMPORTANT! These instructions assume you have a full understanding of SharePlex configuration files. They
use abbreviated representations of important syntax elements. See Create configuration files for more
information.
IMPORTANT!
l See Create configuration files for more information about the components of a configuration file.
l Within one Oracle instance, replicate to different tables within the same schema or to the same table
in different schemas.
l Replicate to from an Oracle instance to any SharePlex-supported target on the same system.
On the Windows platform, SharePlex does not support replication between Oracle databases that reside on the
same system, but you can replicate to Open Target targets on the same system.
Configuration options
Datasource:o.SID
Example
This example shows how you can replicate data to the same Oracle instance, to a different Oracle instance
(Unix and Linuxonly), and to different target types, all on the same local system.
Datasource:o.oraA
hr.emp hr.emp2 [email protected]
hr.sal hr.sal2 [email protected]
fin.* fin.* [email protected]
act.* !file hostA
Datasource:o.SID
Datasource:o.SID
Configuration options
Datasource:o.SID
Datasource:o.SID
Example
NOTE: This example does not cover all possible source-target combinations. The last entry in this example
shows the use of horizontally partitioned replication to distribute different data from the sales.accounts table
to different regional databases. See Configure horizontally partitioned replication.
Datasource:o.oraA
hr.emp hr.emp2 [email protected]
hr.emp hr."Emp_3" [email protected]
hr.emp !jms hostX
Supported targets
Oracle and Open Target
Capabilities
This replication strategy supports the following:
Requirements
l Prepare the system, install SharePlex, and configure database accounts according to the instructions in
the SharePlex Installation Guide.
l Prepare the environment for replication. See Prepare an Oracle environment for replication.
l No DML or DDL should be performed on the target tables except by SharePlex. Tables on the target
system that are outside the replication configuration can have DML and DDL operations without affecting
replication.
l Each source system must replicate a different set of data to the central target. If any source systems
replicate the same data to the central target system, it is considered to be active-active replication,
and conflict resolution routines must be used to determine which source "wins" when the same row is
updated from two different sources at the same time. To establish active-active replication, see
Configure replication to maintain multiple peer databases.
l If sequences are unnecessary on the target system, do not replicate them. It can slow down replication.
Even if a sequence is used to generate keys in a source table, the sequence values are part of the key
columns when the replicated rows are inserted on the target system. The sequence itself does not
have to be replicated.
In either deployment, if any source system cannot make a direct connection to the target system, you can use
cascading replication for that route to enable SharePlex to cascade the data an intermediary system that
allows connection to the target. See Configure replication through an intermediary system.
NOTE: The SharePlex compare and repair commands cannot be used in a cascading configuration.
l An event that interrupts processing to and from the disk that contains the variable-data directory will
affect all replication streams.
l Any cleanup utilities that you use will affect all of the replication streams, because the cleanup is
performed across the entire variable-data directory.
l A purge config command that is issued on one source system also deletes the data that is replicated
from the other source systems, because the purge affects the entire variable-data directory. The use of
named post queues eliminates this risk, but adds complexity to the naming, monitoring and
management of the SharePlex objects in the deployment.
By running multiple, distinct instances of SharePlex, you can isolate each source-target replication stream from
the others. It enables you to:
l Avoid contention problems that can occur if multiple processes must compete for access to the same
queues in a single variable-data directory.
l Purge one configuration, or clean up and resynchronize one replication stream, while allowing the
others to continue processing data.
l Place the variable-data directories on separate disks so that problems with one disk do not affect the
variable-data directories on the other disks.
Configuration
Create a configuration file on each source system that replicates the objects from that system to the central
target. For more information about creating a configuration file, see Create configuration files.
Datasource:o.SID
where:
l SID is the Oracle SID of the source Oracle database. This specification can also be a tns_alias if capturing
from a RAC cluster or a PDB.
l source_specification is the fully qualified name of a source object (owner.object) or a wildcarded
specification.
l target_specification is the fully qualified name of a target object (owner.object) or a wildcarded
specification.
l central_host is the target system.
l db is a database specification. The database specification consists of either o. or r. prepended to the
Oracle SID, tns_names alias, or database name, as appropriate for the connection type. A database
identifier is not required if the target is JMS, Kafka or a file.
Example
This example is an Oracle example, but the target can be any supported SharePlex target. The example shows
data from datasource oraA on hostA and datasource oraB on hostB replicating to oraC on system hostC.
l Maintain the availability of mission-critical data by operating multiple instances in different locations.
l Distribute heavy online transaction processing application (OLTP) loads among multiple points of access.
l Limit direct access to an important database, while still enabling users outside a firewall to make
updates to their own copies of the data.
An example of peer-to-peer replication is an e-commerce company with three identical databases. When users
access the application from a web browser, the web server connects to any of those databases sequentially in a
round-robin configuration. If one of the databases is unavailable, the server connects to a different available
Supported targets
Oracle
Capabilities
This replication strategy supports the following:
l Replication of LOBs. If tables with LOBs are included in replication the LOBs will be bypassed by conflict
resolution, causing the potential for data to be out of synchronization.
l Column mapping and partitioned replication is not appropriate in a peer-to-peer configuration.
Requirements
l Every table involved in peer-to-peer replication must have a primary key or a unique key with no
nullable columns. Each key must uniquely identify the same owner.table.row among all of the
databases that will be involved in replication. See additional requirements in this topic.
l Enable supplemental logging for primary keys, unique keys, and foreign keys on all databases in the
peer-to-peer configuration.
l Enable archive logging on all systems.
l Prepare the environment for replication. See Prepare an Oracle environment for replication.
l You must understand the concepts of synchronization as outlined in Understand the concept of
synchronization.
Overview
In peer-to-peer replication, DML changes are allowed on copies of the same tables in different databases,
usually on different systems, while SharePlex keeps them all current through replication. If a record is
changed in more than one database at (or near) the same time, conflicts can occur, and conflict-resolution logic
must be applied to resolve the discrepancy.
l Post applies a replicated INSERT but a row with the same key already exists in the target. Post applies
the following logic:
o If all of the current values in the target row are the same as the INSERT values, Post considers
the rows to be in-sync and discards the operation.
o If any of the values are different from those of the INSERT, Post considers this an out-of-
sync condition.
NOTE: You can configure Post so that it does not consider non-key values when posting an INSERT.
See the SP_OPO_SUPPRESSED_OOS parameter in the SharePlex Reference Guide.
l Post applies a replicated UPDATE but either cannot find a row in the target with the same key value as
the one in the UPDATE or Post finds the correct row but the row values do not match the before values
in the UPDATE. Post applies the following logic:
o If the current values in the target row match the after values of the UPDATE, Post considers the
rows to be in-sync and discards the operation.
o If the values in the target row do not match the before or after values of the UPDATE, Post
considers this an out-of-sync condition.
NOTE: You can configure Post so that it returns an out-of-sync message if the current values in
the target row match the after values of the UPDATE. See the SP_OPO_SUPPRESSED_OOS
parameter in the SharePlex Reference Guide.
l A DELETEis performed on the source data, but Post cannot locate the target row by using the key. When
Post constructs its DELETE statement, it includes only the key value in its WHERE clause.
NOTE: See Appendix A: Peer-To-Peer Diagram in the appendixes for a visual representation of this scenario.
Deployment
To deploy peer-to-peer replication, perform the following tasks:
1. Evaluate the data for suitability to a peer-to-peer environment. Make any recommended alterations.
2. Configure replication so that data from each system replicates to all other systems in the peer-to-peer
environment.
3. Develop conflict resolution routines that direct the action of the Post process when there is a conflict
because Post cannot locate a row, or when a row that needs to be changed already was changed.
l isolate keys
l prevent changes to keys
l control sequence generation
l control trigger usage
l eliminate cascading deletes
l designate a trusted host
l define priorities
These requirements must be considered during the architectural phase of the project, because they demand
cooperation with the application. Consequently, many packaged applications are not suitable for a peer-to-
peer deployment because they were not created within those guidelines.
Following are more detailed explanations of each of the requirements.
Keys
The only acceptable key in peer-to-peer replication is a primary key. If a table has no primary key but has a
unique, not-NULL key, you can convert that key to a primary key. LONG columns cannot be part of the key.
If you cannot assign a primary key, and you know all rows are unique, you can create a unique index
on all tables.
The primary key must be unique among all of the databases in the peer-to-peer replication network, meaning:
l it must use the same column(s) in each corresponding table in all databases.
l key columns for corresponding rows must have the same values.
The primary key must be created to contain enough information about a row so there can be no question about
the uniqueness of that row, and so that there will be a conflict if a replicated operation would violate
uniqueness. Additionally, the primary key value cannot be changed.
Using only a sequence as the primary key probably will not suffice for peer-to-peer replication. For example,
suppose the sample table uses sequences to generate values for key column EmpNo. Suppose UserA gets the
next sequence value on SysA and inserts a row for Jane Wilson. UserB gets the next sequence value on SysB
and also inserts a row for Jane Wilson. Even if the sequence numbers are different on each system, so there
are no unique key violations on the replicated INSERTs, data integrity is compromised because there are now
two entries for Jane Wilson in the databases, each with a different key. Subsequent UPDATEs will fail. The
solution is to include other unique columns in the key, so that there is enough information to ensure
uniqueness and ensure a conflict that can then be resolved through resolution logic.
Sequences
SharePlex does not support peer-to-peer replication of sequences. If the application uses sequences to
generate all or part of a key, there must be no chance for the same range of values to be generated on any
other system in the peer-to-peer configuration. You can use a sequence server or you can maintain sequences
Triggers
DML changes resulting from triggers firing on a source system enter the redo log and are replicated to the
target system by SharePlex. If the same triggers fire on the target system, they return out-of-sync errors.
To handle triggers in a peer-to-peer configuration, you can do either of the following:
ONDELETECASCADEconstraints
ONDELETECASCADEconstraints can remain enabled on all instances in the peer-to-peer replication
configuration, but you must set the following parameters to direct Post to ignore those constraints:
l SP_OPO_DEPENDENCY_CHECK parameter to 2
l SP_OCT_REDUCED_KEY parameter to 0
l SP_OPO_REDUCED_KEY parameter to 0 (although in other replication scenarios this parameter can be set
to different levels, it must be set to 0 in a peer-to-peer configuration)
1. A customer buys a book through the database on one server. The quantity on hand reduces from 100
books to 99. SharePlex replicates that UPDATE statement to the other server. (UPDATE inventory SET
quantity = 99 WHERE book_ID = 51295).
2. Before the original UPDATE arrives, another customer buys two copies of the same book on another
server (UPDATE inventory SET quantity = 98 WHERE book_ID = 51295), and the quantity on that server
reduces from 100 books to 98.
3. When the Post process attempts to post the first transaction, it determines that the pre-image (100
books) on the first system does not match the expected value on the second system (it is now 98 as a
result of the second transaction). Post returns an out-of-sync error.
A conflict resolution procedure could be written, but how would the correct value be determined? The correct
value in both databases after the two transactions should be 97 books, but no matter which of the two UPDATE
statements is accepted, the result is incorrect.
1. Suppose a row (an account) in the example table has a balance of $1500 on SysA. CustomerA makes a
deposit of $500 on that system. The application uses an UPDATE statement to change the balance to
$2000. The change is replicated to SysB as an UPDATE statement (such as UPDATE...SET balance=$2000
WHERE account_number=51295).
2. Before the change arrives, CustomerAs spouse makes a withdrawal of $250 on SysB, and the application
updates the database on that system to $1250. When CustomerAs transaction arrives from SysA and Post
attempts to post it to SysB, there is a conflict, since the pre-image from the source system is $1500, but
the pre-image on the target is $1250 because of the spouses transaction not a match.
You can write a conflict resolution routine to accommodate this kind of transaction by calculating the absolute
(or net) change in the account, then using that value to resolve the conflict. For example:
if existing_row.balance <> old.balance then old.balance - new.balance = balance_change; update
existing_row set balance = existing_row.balance - balance_change;
The result of this procedure would be to update the account balance to $1750, the net effect of depositing
$500 and withdrawing $250. On SysB, the routine directs SharePlex to subtract the new (replicated) balance of
2000 from the old balance of 1500 for a net change of -500. The UPDATE statement sets the balance value to
1250 - (-500) = 1750, the correct value.
On SysA, the replicated value of 1250 is subtracted from the old balance of 1500 to get the net change of 250.
The UPDATE statement subtracts that value from the existing balance of 2000 to get the correct value of 1750.
Priority
When the environment is established to avoid or resolve conflict when SharePlex searches for the correct row
to change, the only remaining conflict potential is on fact data which change to accept when the values for
the same column in the same row differ on two or more systems. For this, your application must be able to
Trusted source
You must assign a particular database or server to be the prevailing, or trusted, source for two reasons:
l The conflict resolution routine has the potential to get quite large and complex the more systems you
have. There are bound to be failures that require resynchronization at some point. One of the systems
in the configuration must be considered the true source from which all other systems will be
resynchronized if necessary.
l You can write your conflict resolution routines so that operations from the trusted source system take
priority over conflicting operations from other systems. For example, changes on the server at corporate
headquarters could take priority over the same changes made by a branch office.
Timestamp
It is recommended that you include a timestamp column in the tables and assign priority in the conflict
resolution routine to the earliest or latest timestamp. However, the timestamp must not be part of a key, or it
will cause conflicts. SharePlex cannot locate rows if a key value changes and the key value will change if one
of the columns is a timestamp.
For timestamp priority to work, you must make sure all of the servers involved agree on the date and time.
Tables on servers in different time zones can use Greenwich Mean Time (GMT).
The default date format for SharePlex conflict resolution is MMDDYYYY HH24MISS. Tables with default dates
must use that format, or conflict resolution will return errors. Before creating a table with a default date, use
the following command to change the date format in SQL*Plus.
ALTER SESSION SET nls_date_format = 'MMDDYYYYHH24MISS'
Configure replication
The configuration files on the systems in a peer-to-peer configuration are identical with the exception of the
datasource specification and the routing.
IMPORTANT!
l See Create configuration files for more information about the components of a configuration file.
Configuration on hostA
Datasource:o.oraA
Note:If all owner names and table names are the same on all systems, you can use a compound routing map for
each of these configuration files. For example, the compound routing for replication from hostA is as follows:
Datasource:o.oraA
Configuration on hostB
Datasource:o.oraB
Configuration on hostC
Datasource:o.oraC
Example
Datasource:o.oraA
hr.emp hr.emp [email protected]
hr.sal hr.sal [email protected]
cust.% cust.% [email protected]
l A generic PL/SQL interface that you can use to write basic routines based on DML operation types. See
How to write a routine using the SharePlex generic interface.
l Packaged routines that perform basic conflict resolution based on a key or column value, which can be
used as a backup measure in case the custom routines fail. See How to use use the SharePlex
prepared routines.
IMPORTANT!
l This documentation provides guidelines, examples and templates to assist you, but do not use them as
your own routines.
l Test your conflict resolution routines before you put them into production to make sure they work as
intended, and to make sure that one routine does not counteract another one.
l By default, SharePlex does not stop for out-of-sync conditions. If failed attempts at conflict resolution
are not resolved, the databases can become more and more out of synchronization. Check the Event Log
frequently to monitor for out-of-sync warnings by using the show log command in sp_ctrl. See the
SharePlex Reference Guide for more information about show log and other SharePlex commands.
l Updates are occasionally made to the conflict resolution logic, so refer to the Release Notes and
documentation for your version of SharePlex for any additional information that augments or supersedes
these instructions.
l The same PL/SQL package is used for both generic conflict resolution and transformation (its name is sp_
cr). Use either generic conflict resolution or transformation for a table, but not both. Transformed
tables cannot be compared by SharePlex and conflict resolution cannot succeed. If both are used,
SharePlex only calls the transformation routine. If appropriate, you can use generic conflict resolution
and transformation for different tables in the same configuration. For more information about
transformation, see Transform data.
l Conflict resolution cannot be used for DDL changes.
l Any table to be accessed through PL/SQL for conflict resolution requires implicitly granted privileges
from the owner of the object to SharePlex.
l Conflict resolution does not support changes to LONG or LOB columns.
NOTE: If you ran the SharePlex conflict resolution demonstration in the SharePlex Installation Guide, you can
view a sample generic conflict resolution routine by viewing the od_employee_gen routine that was installed
in the database used for the demonstration.
where:
Package definition
SharePlex defines PL/SQL record and table structures in a public package named sp_cr in the SharePlex
database schema. The package uses the following parameters.
"CREATE or REPLACE PACKAGE %s.sp_cr AS
"TYPE row_typ IS RECORD
"(src_host VARCHAR2(32),
"src_ora_sid VARCHAR2(32),
"src_ora_time VARCHAR2(20),
"source_rowid VARCHAR2(20),
"target_rowid VARCHAR2(20),
"statement_type VARCHAR2(6),
"source_table VARCHAR2(78),
"target_table VARCHAR2(78), \n\t"
"oracle_err NUMBER,
"status NUMBER,
"action NUMBER,
"reporting NUMBER
");
IN variables
For each row operation that causes a conflict, SharePlex passes this metadata information to your procedure.
Variable Description
src_host The name of the source system (where the operation occurred). It is
case-sensitive and is passed using the same case as on the source
system, for example SysA . If there are named post queues in use on the
target system, this variable consists of the name of the post queue, for
example postq1.
src_ora_sid The ORACLE_SID of the source database. It is case-sensitive and is passed
in the same case as in the oratab file, Windows Registry or V$PARAMETER
table.
src_ora_time The timestamp of the change record in the source redo log.
source_rowid The row ID of the source row. It is passed as a literal within single
quotes, for example 123456.
target_rowid The row ID of the corresponding row in the target database. SharePlex
obtains the row ID by querying the target database. It is passed as a
literal within single quotes, for example 123456. If the row cannot be
found using the PRIMARY key, the value is NULL.
statement_type A letter, either I, U or D, indicating whether the operation is an INSERT,
UPDATE or DELETE statement.
source_table The owner and name of the source table, expressed as owner.table.
This value is case-sensitive and matches the way the table is named in
the database. It is passed within double quotes, for example
"scott"."emp."
target_table The owner and name of the target table, expressed as owner.table. This
value is case-sensitive and matches the way the table is named in the
database. It is passed within double quotes, for example "scott"."emp."
oracle_err This is different, depending on whether the procedure is being used for
conflict resolution or transformation.
Transformation: SharePlex passes a value of 0 for this variable. This
variable is only used for conflict resolution.
Conflict resolution: The Oracle error number that caused the conflict.
OUT variables
These variables direct the action of SharePlex based on whether the procedure succeeded or failed).
Variable Description
status Defines whether or not the procedure succeeded. You must specify a
value for this parameter.
action Defines the action that you want SharePlex to take. This is different,
depending on whether the procedure is used for transformation or
conflict resolution.
col_def_type table
SharePlex creates a col_def_tabtyp PL/SQL table for each replicated operation. This table stores column
information. It is different depending on whether the procedure is used for transformation or conflict
resolution.
l Transformation: For each row operation, SharePlex writes column information to col_def_type.
l Conflict resolution: For each row operation that causes a conflict, SharePlex writes column information
to col_def_tabtyp.
All fields are passed by SharePlex to your routine, although not all will have values if SharePlex cannot
locate the row.
Following is the datatype that is used to populate the col_def_tabtyp table.
type col_def_typ is record
(column_name user_tab_columns.column_name%type
,datatype user_tab_columns.datatype%type
,is_key boolean
,is_changed boolean
,old_value varchar2(32764)
,new_value varchar2(32764)
Description of col_def_tabtyp
Column Description
column_name Tells your procedure the name of the column that was replicated from
the source table, for example emp_last_name. This value is not case-
sensitive.
datatype Tells your procedure the datatype of the data in the replicated column,
for example VARCHAR2. This value is always in capital letters.
is_key Tells your procedure whether or not the column is a key column. If it is
a key column, SharePlex passes a value of TRUE. If the column is not
part of a key, SharePlex passes a value of FALSE.
is_changed Tells your procedure whether or not the column value has changed. If it
is changed, SharePlex passes a value of TRUE. If the column is not
changed, SharePlex passes a value of FALSE.
old_value Tells your procedure the old value of the replicated column, before it
was changed on the source system. This column is NULL for INSERTs,
because the row did not exist in the target database before the INSERT.
Conflict resolution only: This is the pre-image against which SharePlex
compared the source and target columns as part of its synchronization
check for UPDATEs and DELETEs. If the old value passed by SharePlex
does not match the current_value value obtained from the target row,
then there is a conflict.
new_value Tells your procedure the new value of the replicated column, as
changed on the source system.
current_value Tells your procedure the current value of the column in the target
table. If SharePlex cannot locate the target row, the value is NULL .
1 When an INSERT fails, it is because a row with the same PRIMARY key already exists in the target database.
SharePlex does not return the current value for INSERTs.
UPDATE operation
1 (Conflictresolution) When an UPDATE fails, it is because SharePlex cannot find the row by using the PRIMARY
key and the pre-image. If the row cannot be found, SharePlex searches for the row by using only the PRIMARY
key. If SharePlex finds the row, it returns the current value for the key column as well as the changed
columns. If SharePlex cannot find the row by using just the PRIMARY key, then SharePlex returns a NULL.
2 (Transformation) For an UPDATE, SharePlex cannot locate a row using the PRIMARY key and the pre-images,
because the pre-images are different due to transformation. As an alternative, it searches for the row using
just the PRIMARY key. If it finds it, SharePlex returns the current value for the key column as well as the
changed columns. If it cannot locate the row using just the PRIMARY key, then current_value is NULL
DELETE operation
1 When a DELETE fails, it is because SharePlex could not find the row by using the PRIMARY key. Therefore,
SharePlex returns a NULL.
owner.table1 u owner.procedure_up_A
owner.table1 u owner.procedure_up_B
owner.table1 u !UpdateUsingKeyOnly
The !UpdateUsingKeyOnly name is case sensitive. It must be typed exactly as shown in these instructions, with
no spaces between words. Do not list an owner name with this routine in the configuration file. See List the
routines in conflict_resolution.SID.
For INSERT and DELETE operations, custom logic must be used.
owner.table1 u owner.procedure_up_A
owner.table1 u !UpdateUsingKeyOnly
owner.table1 u !MostRecentRecord(C2)
l owner.object is the owner and name of a target object, or a wildcarded entry. (See Syntax rules)
l i| u | d is the type of operation that creates the conflict that is resolved with the specified procedure.
You can specify any or all operation types, for example id or iud. Upper or lower case are both valid.
l owner.procedure is the owner and name of the conflict resolution procedure that will handle the
specified object and operation type.
Syntax rules
l There must be at least one space between the object specification, the operation type specification,
and the procedure specification.
l You can use the LIKE operator and a SQL wildcard (%) to specify multiple objects by using a search
string. (See the Example.)
l You can use an underscore (_) to denote a single-character wildcard. For table names that contain an
underscore character (for example emp_sal), SharePlex recognizes the backslash (\) as an escape
character to denote the underscore as a literal and not a wildcard, for example: like:scott.%\_corp\_
emp. If you are not using the LIKE operator, the backslash escape character is not required if an object
name contains an underscore.
l The order in which you list the procedures in the conflict resolution file determines their priority of use
(in descending order). If you list a table-specific procedure, SharePlex uses it before procedures that
are specified with a wildcarded object name.
l You a comment line anywhere in the file. Start a comment line with the pound symbol (#).
How it works:
l The scott.sal_cr routine is used for the scott.sal table before the scott.emp_cr1 procedure is used for
that table.
l The scott.emp_cr1 procedure is used before the scott.emp_cr2 procedure for all tables meeting the
search criteria, and so forth.
l For scott.cust, a procedure is called for UPDATEs before the other routines are used for all operations.
!DEFAULT U !UpdateUsingKeyOnly
!DEFAULT D !UpdateUsingKeyOnly
james.table1 U james.procedure_upd
james.table1 I james.procedure_ins
james.table1 D james.procedure_del
l Your replication strategy exceeds the 1024 routes that are allowed directly from a given source system:
You can send data to the intermediary system and then broadcast to the additional targets from there.
l The source has no direct connection to the ultimate target, because of firewall restrictions or other
factors. You can cascade to a system that does allow remote connection from the source system.
To use a cascading strategy, the source machine must be able to resolve the final target machine name(s),
although the ability to make a direct connection is not required.
Supported targets
Oracle (intermediary system)
Oracle and Open Target (final target)
Requirements
l Prepare the system, install SharePlex, and configure database accounts according to the instructions in
the SharePlex Installation Guide.
IMPORTANT! Create the same SharePlex user on all systems if you will be using SharePlex to post to a
database on the intermediary system.
l Prepare the environment for replication. See Prepare an Oracle environment for replication.
l Disable triggers that perform DMLon the target objects.
l No DML or DDL should be performed on the target tables except by SharePlex. Tables on the target
system that are outside the replication configuration can have DML and DDL operations without affecting
replication.
l If sequences are unnecessary on the target system, do not replicate them. It can slow down replication.
Even if a sequence is used to generate keys in a source table, the sequence values are part of the key
columns when the replicated rows are inserted on the target system. The sequence itself does not
have to be replicated.
IMPORTANT! These instructions assume you have a full understanding of SharePlex configuration files. They
use abbreviated representations of important syntax elements. See Create configuration files for more
information.
IMPORTANT!
l See Create configuration files for more information about the components of a configuration file.
l If there is an Oracle database on the intermediary system, you can configure SharePlex to post to that
database and then capture the data again to replicate it to one or more remote targets.
l If there is not a database on the intermediary system, you can configure SharePlex to import, queue,
and then export the data to one or more remote targets. There is no Capture process on the system.
This is known as a pass-through configuration. It passes the data directly from the source system to the
target(s).
Datasource:o.SID
Datasource:o.SID
l An Oracle instance must be installed on the intermediary system, and an ORACLE_SID must exist in the
oratab file (Unix and Linux systems) or the Windows Registry. The database can be empty.
l DDL replication is not supported.
l You create one configuration file, which is on the source system.
Datasource:o.SID
Example
Datasource:o.oraA
hr.emp hr.emp2 hostB*[email protected]
hr.emp hr."Emp_3" hostB*[email protected]
cust.% cust.% hostB*[email protected][email protected]
l Disaster recovery
l Continuous operation of business applications throughout maintenance cycles or mechanical failures
Supported targets
Oracle
Capabilities
This replication strategy supports the use of named export and post queues.
NOTE: Column mapping and partitioned replication is not appropriate in a high availability configuration. Source
and target objects can have different names but this makes the management of a high-availability structure
more complicated.
Requirements
l Prepare the system, install SharePlex, and configure database accounts according to the instructions in
the SharePlex Installation Guide.
l Prepare the environment for replication. See Prepare an Oracle environment for replication.
l All objects must exist in their entirety on both systems.
l The target objects must have the same structure and qualified names as their source objects.
l Enable archive logging on all systems.
l Create a script that denies INSERT, UPDATE and DELETE operations to all users except SharePlex.
l Make the applications used on the primary system available on the secondary system.
l Copy non-replicated database objects and critical files outside the instance to the secondary system.
l Create a script that grants INSERT, UPDATE and DELETE privileges to all users, which can be run during a
failover procedure.
l Create a script that enables constraints on the secondary system to be used during a failover
procedure.
l Develop a failover procedure for relocating users to the secondary system.
NOTE: If you use an Oracle hot backup to create the secondary instance, keep the script. It can be modified to
re-create the primary instance.
IMPORTANT!
l See Create configuration files for more information about the components of a configuration file.
Configuration
A high availability configuration uses two configurations that are the reverse of each other. To replicate all
objects in the database, you can use the config.sql script to simplify the configuration process. See Build a
configuration file using a script
Datasource:o.oraA
Datasource:o.oraB
This chapter contains instructions for using the advanced SharePlex configuration options of horizontally
partitioned and vertically partitioned replication. These options provide an additional level of flexibility to
divide, parallelize, and filter data to meet specific requirements. Before proceeding, make certain you
understand the concepts and processes in Create configuration files.
Contents
Configure horizontally partitioned replication
Configure vertically partitioned replication
l Replicate a subset of rows to the target, while retaining the rest of the rows in the source.
l Replicate different subsets of rows to different targets.
l Divide the replication of a source table into parallel Post processes for faster posting to the
target table.
l You can combine horizontally partitioned and vertically partitioned replication for maximum control
over which information is distributed, and to where.
For example:
A company has a headquarters and regional divisions. The headquarters maintains the corporate
database, and each region maintains a regional database. The headquarters uses vertically
partitioned replication to share some of the column data of a table to those locations, while
How it works
To implement horizontally partitioned replication, you do the following:
1. Define partitions
2. Define partition schemes
3. Specify partition schemes in the configuration file
Define partitions
A partition is a subset of the rows in a table that you want to replicate. To create a partition, you specify a
column condition or a hash value, depending on your objectives. The following explains these concepts.
Column condition: A column condition is based on a standard WHEREclause. Use one or more column
conditions for the following purposes:
o Use a column condition to replicate only a subset of the rows of a table. For example, you can replicate
only those rows where the value of the YEAR column is greater than 2000.
o Use multiple column conditions to partition the rows of a table so that each set of rows replicates to a
different target. For example: replicate changes where the value of the REGIONcolumn is EAST to one
location and rows where REGIONis WEST to a different location.
o Use multiple column conditions to divide the rows of a table into parallel processing streams (parallel
Export-Import-Post streams) for faster posting to the target table. For example, you can improve the
flow of replication to a heavily updated target table. This use of column conditions for this purpose is
appropriate only if the table contains a column that enables you to split the processing evenly among
Hash value: A hash partition (known as hash horizontal partitioning) directs SharePlex to create row partitions
by using a hash algorithm based on the rowid. You can use a hash value to divide the rows of a table into
parallel Post processing streams if it is not practical to use a column condition for this purpose. The advantage
of using a hash partition rather than a column condition is that the rows are divided evenly and automatically,
without the need for you to reference table columns in WHERE clauses.
IMPORTANT: The following restrictions apply:
l When hash partitioning is in use, the table cannot be compared or repaired with the compare and
repair commands.
l Hash horizontal partitioning cannot be enabled on an index-organized table (IOT) or tables that contain
LOBs or LONGs.
l Hash horizontal partitioning cannot be combined with horizontal partitioning that uses a
column condition.
l Hash horizontal partitioning is not supported for tables with operations that may cause rows to migrate.
Examples of operations that cause rows to migrate are:
o Export or import of the table
o ALTER TABLE with the MOVE option
o ALTER TABLE with the SHRINK SPACE option
o FLASHBACK TABLE
o Split a partition or combine two partitions
o Update a value so that it moves to a new partition
o Online table reoraganization
o Redefine a table by using dbms_redefinition
o DML applied to a regular, non-partitioned table that can cause row shift: UPDATE that changes
row size so that the data does not fit into the current block, DELETE of a row and then re-insert.
NOTE: On a Windows system, the use of numerous queues may require the number of semaphores to be
increased. If Post returns the error message "shs_SEMERR: an error occurred with the semaphore,"
see Post stopped in the Solve replication problems topic.
l Issue and commit a separate INSERT statement for each target table that has a different owner or name
from the other target tables.
l Each INSERT must be identical, except to specify the appropriate name values in the TARGET_
TABLE_OWNER and TARGET_TABLE_NAME columns, in relation to the target system specified in the
ROUTE column.
l When you create an entry for this partition scheme in the configuration file, specify any target table.
SharePlex will detect the other target names when the configuration is activated.
l Set the SP_ORD_FIRST_FIND parameter to 0 so that SharePlex checks all of the column conditions in the
partition scheme. By default SharePlex assumes that any given row change will satisfy only one column
condition in the partition scheme. For more information, see the SharePlex Reference Guide.
ROUTE VARCHAR2(1024) The routing map for this partition. This can
be one of the following, depending on
whether you are using a column condition or
a hash to create the partitions.
If creating a partition with a column
condition:
Partition shift case 1: The column value is updated and the new value no longer satisfies any
column condition:
l SharePlex performs the operation, but future operations on that row are not replicated. The reason:
the row no longer satisfies a column condition.
l The source and target tables of the original partition are now out of synchronization, but Post
returns no errors.
l Example:
Column condition is C1=A and C2=B.
1. INSERT a row into the database. C1 and C2 values satisfy the column condition, so the row is
replicated to the target system.
C1 C2 C3 C4
A B 1 2
C1 C2 C3 C4
B B 1 2
Partition shift case 2: A row that satisfies one column condition gets updated to meet a
different condition:
l Post cannot find a matching target row. The reason: the original change was not replicated because it
did not meet the column condition.
l Post returns an out-of-sync error.
l Example:
Column condition is C1=A and C2=B.
1. INSERT a row into the database. C1 and C2 values do not satisfy the column condition, so the row
is not replicated to the target system.
C1 C2 C3 C4
B B 1 2
How to repair out-of-sync rows caused by changes to the values of column conditions
You can do either of the following to repair the out-of-sync rows:
l Set the SP_ORD_HP_IN_SYNC parameter to a value of 1. This setting directs SharePlex to detect and
correct the out-of-sync condition. Enabling this parameter causes some performance degradation,
depending on how many tables are configured for horizontally partitioned replication. For more
information about this parameter, see the SharePlex Reference Guide.
l Use the compare command to repair the out-of-sync rows. For more information about this command,
see the SharePlex Reference Guide.
NOTE:If you are using a column other than a key to base the column condition on, and you notice reduced
performance with horizontally partitioned replication enabled, add a log group for that column.
l For the DATE datatype, SharePlex uses nls_date_format, with the syntax specified as
MMDDSYYYYHH24MISS. For example:
hiredate<1111 2011000000
l value can be a string or a number. Enclose strings and dates within single quote marks (west). Do not
use quote marks for numbers (10).
l column is the name of a column in the table that you are configuring to use horizontally partitioned
replication.
column=value
not(column=value)
column>value
value>column
column<value
column<=value
column>=value
column<>value
column!=value
columnlikevalue
columnbetweenvalue1andvalue2
not(columnbetweenvalue1andvalue2)
columnis null
columnis not null
Conditions can be combined into nested expressions with parentheses and the AND, OR, and NOT logical
connectives.
Datasource:o.SID
! routing_map
Where:
l src_owner.table and tgt_owner.table are the specifications for the source and target tables,
respectively.
l ! partition_scheme is the name of the partition scheme to use for the specified source and target
tables. The ! is required. The name is case-sensitive. Compound routing of multiple partition schemes is
not supported, for example !schemeA+schemeB. Create a separate entry for each partition scheme
that you want to use for the same source table. See Examples.
l ! routing_map is a placeholder routing map. This component applies only to partitions using a column
condition. It is required only if a route that you used in a partition scheme is not listed somewhere in
the configuration file. This applies to different named queue routes as well as to routes to different
target hosts. All routes must be listed in the configuration file so that SharePlex can build a routing
cache. This requirement usually is satisfied if partitioned replication is combined with full-table
replication. However, if a route in a partition scheme does not appear in a regular (non-partitioned)
configuration entry or the entry for a different partition, you must provide a placeholder routing map
for that route on a separate configuration line. You can use a compound routing map if the names of all
target tables are identical. See Examples.
Examples
Configuration file entry to specify a partition scheme
Correct way to specify multiple partition schemes for the same source table
Datasource:o.myora
! targsys1
! [email protected][email protected]
l Vertically partitioned replication is appropriate for reporting and other data sharing strategies, but it is
not appropriate for high availability environments. Once you configure a table for vertically partitioned
replication, SharePlex does not recognize the other columns, so data in those columns is not replicated.
l You can combine horizontally partitioned and vertically partitioned replication for maximum control
over which information is distributed, and to where.
For example:
A company has a headquarters and regional divisions. The headquarters maintains the corporate
database, and each region maintains a regional database. The headquarters uses vertically
partitioned replication to share some of the column data of a table to those locations, while
retaining other sensitive data at headquarters. Row changes made to the shared columns are
further partitioned horizontally, for replication to the appropriate regional database.
l A table cannot be configured to replicate some columns to one target system and all columns to
another (combination of vertically partitioned replication and full-table replication). You can, however,
configure full-table replication to an identical table on one target, and then configure vertically
partitioned replication from that target to a second target that contains the table that requires only
the partition columns.
l A target table can, but does not have to, contain all of the same columns as its source table. The target
can contain just the columns being replicated from the source table. The names of corresponding
source and target columns do not need to be the same. Corresponding columns must contain the same
datatypes (same type, size, precision).
l ALTER TABLE to add a column to a table configured for vertically partitioned replication is not
supported.
l A column partition replicates data changes that are made to the specified columns.
l An excluded column partition replicates all data changes except those made to the specified columns.
Use one configuration file for all of the data that you want to replicate from a given datasource, including
tables that will have full-table replication and those that will use partitioned replication. For general
instructions on creating a configuration file, see Create configuration files. To configure entries for vertically
partitioned replication, use the following syntax.
Datasource:o.SID
src_owner.table and tgt_ The specifications for the source and target tables, respectively.
owner.table
(src_col, src_col,...) The source columns to be replicated. Can be one of the following:
and l (src_col, src_col,...) specifies a column partition that lists
!(src_col,src_col,...) columns to replicate.
l !(src_col,src_col,...) specifies an excluded column partition that
lists columns not to replicate. The remaining columns comprise
the actual column partition.
(tgt_col,tgt_col,...) The target columns. Use this option to map source columns to target
columns that have different owners or names. If the source and target
columns have identical owners or names, the target columns can be
omitted.
To map source columns to target columns, follow these rules:
l The syntax rules for the source column partition also apply to
the target column list.
l The target columns must have identical definitions as their
source columns, except for their names.
routing_map The routing map for the column partition. The routing map can be one of
the following:
Configuration examples
The following is a vertically partitioned replication configuration replicating to multiple targets by using
a compound routing map. To use a compound routing map for this source table, all targets must be
named scott.sal.
Datasourceo.oraA
The following is a vertically partitioned replication configuration replicating to a single target where the target
columns have different names from those of the source.
Datasourceo.oraA
The following configuration file is not valid because it repeats the same column partition of scott.emp (c1, c2)
twice in the configuration file.
This chapter contains instructions for using the advanced SharePlex configuration options of named queues.
These options provide an additional level of flexibility to divide and parallelize data to meet specific processing
and routing requirements. Before proceeding, make certain you understand the concepts and processes in
Create configuration files.
Contents
Configure named export queues
Configure named post queues
l Individual configurations: By default, SharePlex sends data from all active configurations through one
export queue-process pair per target system, but the use of named Export queues enables you to
separate each of those replication streams into its own export queue and Export process. In this way,
you ensure that purge config or abort config commands that are issued for one configuration do not
affect any of the others.
l Selected database objects: You can use a named export queue to isolate certain objects such as tables
that contain LOBs. Because each named export queue has its own Import process, post queue, and Post
process on the target, you are able to isolate the data the entire way from source to target. For more
information about the benefits of named post queues, see Configure named post queues.
Additional benefits:
l You can stop the Export or Import process for one data stream, while allowing the others to continue
processing.
l You can set SharePlex parameters to different settings for each export queue-process pair. This
enables you to tune the performance of the Export processes based on the objects replicating
through each one.
NOTE: On a Windows system, the use of numerous queues may require the number of semaphores to be
increased. If Post returns the error message "shs_SEMERR: an error occurred with the semaphore,"
see Post stopped in the Solve replication problems topic.
Datasource:o.SID
NOTES:
Examples
The following configuration files show two different datasources that are being replicated to two different
databases on the same target system. Each datasource is routed through a named export queue.
Datasource:o.oraA
scott.emp scott.emp sysA:QueueA*[email protected]
scott.sales scott.sales sysA:QueueA*[email protected]
Datasource:o.oraB
scott.prod scott.prod sysA:QueueB*[email protected]
scott.cust scott.cust sysA:QueueB*[email protected]
The following shows how to separate a table that contains LOBs from the rest of the tables by using named
export queues.
Datasource:o.oraA
scott.cust scott.cust sysA:QueueA*[email protected]
scott.sales scott.sales sysA:QueueA*[email protected]
scott.prod scott.prod sysA:QueueA*[email protected]
scott.emp_LOB scott.emp_LOB sysA:QueueB*[email protected]
Alternatively, you could simply define a named export queue for the LOB table and allow the remaining tables
to be processed through the default export queue.
Datasource:o.oraA
scott.cust scott.cust [email protected]
scott.sales scott.sales [email protected]
scott.prod scott.prod [email protected]
scott.emp_LOB scott.emp_LOB sysA:lobQ*[email protected]
See the SharePlex Reference Guide for more infomation about theses commands.
l objects that have LOB columns. Named post queues are recommended for objects that contain LOBs.
l objects that involve large transactions.
l any objects whose operations you want to isolate.
Process the remaining objects through additional named post queues, or use the default post queue. Objects
in the configuration file with a standard routing map (host@target) are replicated through a default post queue.
You can use horizontal partitioning to divide the rows of very large tables into separate named post queues as
an added measure of parallelism. See Configure horizontally partitioned replication.
You can set SharePlex parameters to different settings for each queue-process pair. This enables you to tune
the performance of the Post processes based on the objects replicating through each one.
NOTE: On a Windows system, the use of numerous queues may require the number of semaphores to be
increased. If Post returns the error message "shs_SEMERR: an error occurred with the semaphore,"
see Post stopped in the Solve replication problems topic.
Datasource:o.SID
o.tns_alias
o.PDBname
r.database_name
c.oracle_SID
NOTES:
l Allow no spaces between any components in the syntax of the routing map.
l For more information about the components of a configuration file, see Create configuration files.
Examples
The following configuration creates one post queue named Queue1 that routes data from table scott.emp and
another post queue named Queue2 that routes data from table scott.cust.
Datasource:o.oraA
scott.emp scott.emp sysB:[email protected]
scott.cust scott.cust sysB:[email protected]
The following shows how a named post queue is specified when you are routing data in a pass-through
configuration using an intermediary system. For more information about this replication strategy, see Configure
replication to share or distribute data.
Datasource:o.oraA
scott.emp scott.emp sysB*sysC:[email protected]
l the name of an associated named export queue (if the Import is linked to a named export queue)
l the user-assigned post-queue name (if the Import is linked to a default export queue).
See the SharePlex Reference Guide for more infomation about theses commands.
This chapter contains instructions for how to configure SharePlex to maintain a change-history target.
SharePlex enables you to maintain this history, while also replicating the same data set to maintain up-to-
date targets.
Contents
Overview of the change-history target
Configure change history
Capabilities
This replication strategy supports the following:
Supported targets
Oracle target
Operations supported
SharePlex supports adding a change history row for these operations:
l INSERT
l UPDATE
l DELETE
l TRUNCATE
l ALTER TABLE to DROP COLUMN (NOTE: for ADD COLUMN, Post adds a column to the table, but does not
create a change history row.)
SharePlex can be configured to include the before image of update operations in the history or to control which
operation types are included in the history. For example, you could include only updates and deletes.
Datasource:o.SID
where:
l o.SID is the source Oracle instance.
l src_owner.table is the fully qualified name of a source object (owner.object) or a wildcarded
specification.
l !cdc: identifies the target as a change-history table.
l tgt_owner.table is the fully qualified name of the target history table or a wildcarded
specification.
l host is the target system.
l c.SID specifies the target Oracle instance.
6. (Optional) Run the following script on the target tables to add default metadata columns with their
default names. Post automatically populates the default metadata columns without any additional
configuration. You can customize the script to meet your requirements.
product_dir/util/add_change_tracking_columns.sql
The script only adds the default columns. To add optional columns, or to change a column name, use
the target command to add them to the Post configuration. For a list of default and optional metadata
columns, see the target command in the SharePlex Reference Guide.
NOTE: The default columns are automatically added to new tables that are added to the SharePlex
change history configuration.
1. Turn on supplemental logging for all columns of the source tables that are being tracked. For example:
Alter table emp ADD SUPPLEMENTAL LOG DATA (ALL) COLUMNS;
2. Set the SP_OCT_USE_SUPP_KEYS parameter to 1.
NOTE: When both SP_OCT_USE_SUPP_KEYS and SP_OPO_TRACK_PREIMAGE are enabled, the before image
includes all column values as they were before the change.
Include COMMITs
By default, the COMMIT record is not included in the history tables. To configure Post to insert a row for every
COMMIT, set the SP_OPO_TRACK_COMMITS parameter to 1.
This chapter contains the information that you need to know in order to replicate DDL that is supported
by SharePlex.
Contents
DDL that SharePlex supports
Control DDL replication
Filter DDL Replication
Best practices for ALTERTABLE DDL
DDL logging and error handling
SharePlex provides default DDL support for objects in the configuration file. You can expand this support
through parameter settings.
See the SharePlex Release Notes for detailed information about the DDL that is supported by SharePlex.
l the affected object exists in the source and target at the time of activation and
l its name is listed in the configuration file (explicitly or through wildcard).
The Auto-Add feature is controlled by the SP_OCT_AUTOADD_ENABLE parameter, which is set to 1 (enabled)
by default.
NOTE: Auto-Add is not supported to Open Target targets. If you are replicating data to an Open Target target,
SP_OCT_AUTOADD_ENABLE should be set to 0 and SP_OCT_REPLICATE_ALL_DDL should be set to 0.
See the SharePlex Reference Guide for details about this parameter.
NOTE: SharePlex does not replicate materialized views to materialized views. SharePlex converts a
CREATEMATERIALIZEDVIEW to a CREATETABLE, applies the CREATETABLEto the target, and then replicates the
To auto-add sequences
1. Make certain the SP_OCT_AUTOADD_ENABLE parameter is set to 1.
2. Set the SP_OCT_AUTOADD_SEQ parameter to 1.
3. Set the SP_OCT_TARGET_COMPATIBILITY parameter to at least 8.6.3.
See the SharePlex Reference Guide for details about these parameters.
Name Type
------------- ------------
DDL_PARAMETER NUMBER
DDL_CODE NUMBER
SCHEMA_FILTER VARCHAR2(32)
OBJECT_FILTER VARCHAR2(32)
A null value in the DDL_CODE column means that the filter applies to all of the DDL types A null in the SCHEMA_
FILTER or OBJECT_FILTER column means that the filter applies to any schema or object name.
NOTE: The DDL_PARAMETER column is not an active column as of this release of SharePlex.
To filter DDL
Insert a row into the table with the desired values in the active columns.
Examples
The following filters out of replication the DDL for ALTERTABLE:
INSERT INTO SPLEX.SHAREPLEX_DDL_CONTROL (DDL_CODE, SCHEMA_FILTER, OBJECT_FILTER)
values (0x0F,null,null);
The following filters out of replication all DDL for all objects with names that begin with TEST_ in any schema:
INSERT INTO SPLEX.SHAREPLEX_DDL_CONTROL (DDL_CODE, SCHEMA_FILTER, OBJECT_FILTER)
values (null,null,'TEST_%');
The following filters out of replication the DDL for CREATE TABLE for the "Sales"schema and objects with names
that begin with "TEST_":
INSERT INTO SPLEX.SHAREPLEX_DDL_CONTROL (DDL_CODE, SCHEMA_FILTER, OBJECT_FILTER)
values (0x01,'Sales','TEST_%');
DDL codes
DDLType DDL_CODE
CREATETABLE 0x01
ALTER TABLE 0x0F
DROP TABLE 0x0C
ASSOCIATE STATISTICS 0xA8
DISASSOCIATE STATISTICS 0xA9
COMMENTONTABLE
CREATE SEQUENCE 0x0D
ALTER SEQUENCE 0x0E
DROP SEQUENCE 0x10
CREATE CLUSTER 0x04
DROP CLUSTER 0x08
CREATE USER 0x33
ALTER USER 0x2B
DROP USER 0x35
CREATE_ROLE 0x34
ALTER_ROLE 0x4F
DROP_ROLE 0x36
GRANT 0x11
REVOKE 0x12
CREATE SYNONYM 0x13
DROP SYNONYM 0x14
CREATE VIEW 0x15
ALTER VIEW 0x58
DROP VIEW 0x16
CREATE TYPE 0x4D
Whether the Post process stops on RENAME operations or not depends on the setting of the SP_OPO_STOP_ON_
DDL_ERR parameter.
ALTERTABLE...MOVE
ALTERTABLEDDL commands that change the rowid of a table can affect subsequent DML operations if the
primary or unique keys of the tables in replication are not being logged. When the keys are not logged,
SharePlex fetches their values based on the rowid. Any operation that changes the rowid, such as
ALTERTABLE...MOVE, can cause the wrong key values to be used for subsequent DML operations.
This chapter contains an overview of the tools that SharePlex provides to handle errors that are returned by
the Post process.
Contents
Continue to post when there is a DML error
Continue to Post when there is a DDL error
Increase the number of retries on error
Stop Post when data is out-of-sync
5. Starting at the end of the file, add the number of each Oracle or SharePlex error, one per line as shown
in the preceding example. The messages need not be in numerical order.
6. Save and close the file.
7. Stop Post (if running).
sp_ctrl> stop post
8. If you edited a copy of the oramsglist file, save the copy to the original name of oramsglist.
9. Change the value of the SP_OPO_CONT_ON_ERR parameter to 1.
sp_ctrl> set param SP_OPO_CONT_ON_ERR 1
10. Start Post.
sp_ctrl> start post
NOTE: There are certain errors for which Post will stop, even if you list those errors in the message file.
3. If replication is not active, open the file in a text editor. If replication is active, make a copy of the file
and then open the copy in the editor.
4. Starting at the end of the file, add the number of each error, one per line as shown in the example. The
messages need not be in numerical order.
Example:
sqlservermsglist:
8102
8180
544
2627
3621
If you use this feature, make certain to monitor replication frequently. If Post stops, latency increases and data
accumulates in the queues. For more information, see the parameter documentation in the SharePlex
Reference Guide.
This topic contains instructions for using the transformation feature of SharePlex. Transformation enables
SharePlex to manipulate data before, or instead of, posting it to a target.
Contents
Overview of transformation
Considerations when using transformation
Deploy transformation
Overview of transformation
Transformation directs the Post process to call a PL/SQL procedure (defined as a transformation routine)
instead of applying a SQL operation to the target database. Transformation enables replicated data to be
manipulated before, or instead of, posting to a target.
For example, if a source table and its target table are dissimilar in construction like when a persons first and
last name are in one column in the source table but in separate columns in the target table you can write a
transformation routine to convert the data for those columns so that replication succeeds. You can use
transformation routines to convert datatypes, units of measurement, or character sets. You can use them
instead of database triggers to reduce I/O overhead, and for many other business requirements.
When you specify transformation for a table, Post takes no action on the replicated data. Instead, it passes
data values to your transformation routine, enabling you to control both the form and destination of the data
with the procedure. You can post to the target table, post to an alternate location, or both. Therefore,
when writing your routine, is your responsibility to include in your procedure the necessary SQL operations
for posting.
Supported databases
Oracle source and target only
Supported operations
Transformation supports only INSERT, UPDATE and DELETE operations. You can do the following when
developing procedures:
l You can create one procedure for all three operation types, or you can create a procedure for each
operation type.
l You can use one procedure for all tables, or use different procedures for different tables. SharePlex
allows this through the use of wildcards to specify the tables.
If a transformation routine is specified for an individual table, and the table also is part of a group of tables for
which another routine is specified, only the table-specific routine is used for that table when the associated
DML operation occurs.
Privileges
Any table that will be accessed through PL/SQL for transformation requires implicitly granted privileges from
the owner of the object to SharePlex.
Keys
A PRIMARY or UNIQUE key is required for all tables using transformation. SharePlex locates the target row for
UPDATEs and DELETEs by using the key, which enables it to return values to your transformation routine from
the target table for UPDATE operations. Do not allow keys to be changed on the target system, or SharePlex
will not be able to locate the row to pass values to your routine.
Other considerations
l Transformation does not support changes to LOB and LONG columns.
l The processing overhead for passing data to your procedure, combined with that of executing the
procedure itself, degrades overall performance on the target system compared to normal replication
and posting.
l The same PL/SQL package is used for both generic conflict resolution and transformation (its name is sp_
cr). Use either generic conflict resolution or transformation for a table, but not both. Transformed
tables cannot be compared by SharePlex and conflict resolution cannot succeed. If both are used,
SharePlex only calls the transformation routine. If appropriate, you can use generic conflict resolution
and transformation for different tables in the same configuration. For more information about conflict
resolution, see Configure replication to maintain multiple peer databases.
Deploy transformation
Deployment of transformation involves the following steps.
l Create configuration entries for the source and target tables to be transformed. There are no special
configuration procedures for tables that use transformation. Configure them as you would any other
table. See Create configuration files.
l Create transformation routines.
l Complete the transformation file
Procedure interface
Follow this template to create your procedure.
where:
Package definition
SharePlex defines PL/SQL record and table structures in a public package named sp_cr in the SharePlex
database schema. The package uses the following parameters.
"CREATE or REPLACE PACKAGE %s.sp_cr AS
"TYPE row_typ IS RECORD
"(src_host VARCHAR2(32),
"src_ora_sid VARCHAR2(32),
"src_ora_time VARCHAR2(20),
"source_rowid VARCHAR2(20),
"target_rowid VARCHAR2(20),
"statement_type VARCHAR2(6),
"source_table VARCHAR2(78),
"target_table VARCHAR2(78), \n\t"
"oracle_err NUMBER,
"status NUMBER,
"action NUMBER,
"reporting NUMBER
");
IN variables
For each row operation that causes a conflict, SharePlex passes this metadata information to your procedure.
Variable Description
src_host The name of the source system (where the operation occurred). It is
case-sensitive and is passed using the same case as on the source
system, for example SysA . If there are named post queues in use on the
target system, this variable consists of the name of the post queue, for
example postq1.
src_ora_sid The ORACLE_SID of the source database. It is case-sensitive and is passed
in the same case as in the oratab file, Windows Registry or V$PARAMETER
table.
src_ora_time The timestamp of the change record in the source redo log.
source_rowid The row ID of the source row. It is passed as a literal within single
quotes, for example 123456.
target_rowid The row ID of the corresponding row in the target database. SharePlex
obtains the row ID by querying the target database. It is passed as a
literal within single quotes, for example 123456. If the row cannot be
found using the PRIMARY key, the value is NULL.
statement_type A letter, either I, U or D, indicating whether the operation is an INSERT,
UPDATE or DELETE statement.
source_table The owner and name of the source table, expressed as owner.table.
This value is case-sensitive and matches the way the table is named in
the database. It is passed within double quotes, for example
"scott"."emp."
target_table The owner and name of the target table, expressed as owner.table. This
value is case-sensitive and matches the way the table is named in the
database. It is passed within double quotes, for example "scott"."emp."
oracle_err This is different, depending on whether the procedure is being used for
conflict resolution or transformation.
Transformation: SharePlex passes a value of 0 for this variable. This
variable is only used for conflict resolution.
Conflict resolution: The Oracle error number that caused the conflict.
OUT variables
These variables direct the action of SharePlex based on whether the procedure succeeded or failed).
Variable Description
status Defines whether or not the procedure succeeded. You must specify a
value for this parameter.
action Defines the action that you want SharePlex to take. This is different,
depending on whether the procedure is used for transformation or
conflict resolution.
Transformation: You must specify a value of 0 for this parameter, which
directs SharePlex NOT to post the SQL statement. Your transformation
routine is responsible for posting the results of the transformation
either to the target table or another table. The outcome of this action
depends on what you specify for the reporting variable
Conflict resolution: Specifies the action to take as a result of an
unsuccessful conflict resolution procedure. You must specify a value for
this parameter.
The outcome of this action depends on what you specify for the
reporting variable.
l The value of 1 is reserved for internal SharePlex use. Do not use
it.
l A value of 2 directs SharePlex to try the next conflict resolution
procedure that you listed in the conflict resolution file, if one
exists.
col_def_type table
SharePlex creates a col_def_tabtyp PL/SQL table for each replicated operation. This table stores column
information. It is different depending on whether the procedure is used for transformation or conflict
resolution.
l Transformation: For each row operation, SharePlex writes column information to col_def_type.
l Conflict resolution: For each row operation that causes a conflict, SharePlex writes column information
to col_def_tabtyp.
All fields are passed by SharePlex to your routine, although not all will have values if SharePlex cannot
locate the row.
Following is the datatype that is used to populate the col_def_tabtyp table.
type col_def_typ is record
(column_name user_tab_columns.column_name%type
,datatype user_tab_columns.datatype%type
,is_key boolean
,is_changed boolean
,old_value varchar2(32764)
,new_value varchar2(32764)
,current_value varchar2(32764)
);
type col_def_tabtyp is table of col_def_typ
Description of col_def_tabtyp
Column Description
column_name Tells your procedure the name of the column that was replicated from
the source table, for example emp_last_name. This value is not case-
sensitive.
datatype Tells your procedure the datatype of the data in the replicated column,
for example VARCHAR2. This value is always in capital letters.
is_key Tells your procedure whether or not the column is a key column. If it is
a key column, SharePlex passes a value of TRUE. If the column is not
part of a key, SharePlex passes a value of FALSE.
is_changed Tells your procedure whether or not the column value has changed. If it
is changed, SharePlex passes a value of TRUE. If the column is not
changed, SharePlex passes a value of FALSE.
old_value Tells your procedure the old value of the replicated column, before it
was changed on the source system. This column is NULL for INSERTs,
because the row did not exist in the target database before the INSERT.
Conflict resolution only: This is the pre-image against which SharePlex
compared the source and target columns as part of its synchronization
check for UPDATEs and DELETEs. If the old value passed by SharePlex
does not match the current_value value obtained from the target row,
then there is a conflict.
new_value Tells your procedure the new value of the replicated column, as
changed on the source system.
current_value Tells your procedure the current value of the column in the target
table. If SharePlex cannot locate the target row, the value is NULL .
INSERT operation
UPDATE operation
1 (Conflictresolution) When an UPDATE fails, it is because SharePlex cannot find the row by using the PRIMARY
key and the pre-image. If the row cannot be found, SharePlex searches for the row by using only the PRIMARY
key. If SharePlex finds the row, it returns the current value for the key column as well as the changed
columns. If SharePlex cannot find the row by using just the PRIMARY key, then SharePlex returns a NULL.
2 (Transformation) For an UPDATE, SharePlex cannot locate a row using the PRIMARY key and the pre-images,
because the pre-images are different due to transformation. As an alternative, it searches for the row using
just the PRIMARY key. If it finds it, SharePlex returns the current value for the key column as well as the
changed columns. If it cannot locate the row using just the PRIMARY key, then current_value is NULL
DELETE operation
1 When a DELETE fails, it is because SharePlex could not find the row by using the PRIMARY key. Therefore,
SharePlex returns a NULL.
l owner.object is the owner and name of a target object, or a wildcarded entry. (See Syntax rules)
l i| u | d is the type of operation to be transformed by the specified procedure. You can specify any or all
operation types, for example id or iud. Upper or lower case are both valid.
l owner.procedure is the owner and name of the procedure that will handle the specified object and
operation type.
Syntax rules
l There must be at least one space between the object specification, the operation type specification,
and the procedure specification.
l You can use the LIKE operator and a SQL wildcard (%) to specify multiple objects by using a search
string. (See the Example.)
l You can use an underscore (_) to denote a single-character wildcard. For table names that contain an
underscore character (for example emp_sal), SharePlex recognizes the backslash (\) as an escape
character to denote the underscore as a literal and not a wildcard, for example: like:scott.%\_corp\_
emp. If you are not using the LIKE operator, the backslash escape character is not required if an object
name contains an underscore.
l You a comment line anywhere in the file. Start a comment line with the pound symbol (#).
SharePlex provides a number of security features that help protect replicated data on the local system
and during transfer across a network. This chapter provides guidelines for the configuration and use of
these features.
Contents
Secure connections to SharePlex
Secure data with SSH
Encrypt data across the network
Assign SharePlex users to security groups
Requirements
l If used, the auth_hosts file must contain valid entries. If this file exists but is empty or contains invalid
entries, SharePlex sends an error message similar to the following example to the Event Log:
unauthorized connection attempt.
l If an auth_hosts file does not exist on a system, SharePlex accepts all requests from all systems that
attempt to connect to sp_cop.
l The name of the local system must be the first non-commented line of this file, or host authorization
will not function.
l All entries, including comments, must end with a return.
Value Description
4. Save the file as auth_hosts in the data sub-directory of the SharePlex variable-data directory. If running
multiple instances of sp_cop, make certain to save the file to the correct variable-data directory.
Example
Note the name of the local host is on the first non-commented line.
Requirements
l Purchase and install the SSH software. SSH is not included with Shareplex.
l Using SSH with SharePlex requires the use of local port forwarding (also known as tunneling) within the
SSH configuration. Port forwarding allows you to establish a secure SSH session and then tunnel TCP
connections through it.
l SharePlex can be configured to work with SSH software between a source system and one target
system. If a source replicates to multiple targets, only one of the routes can be configured with SSH.
l This feature is supported on Unix and Linux.
To configure encryption
1. Review the Encryption guidelines.
5. Run the set encryption key command. See Set the key on the source and target.
Encryption guidelines
l Use one encryption key for all Export processes in the SharePlex instance.
l SharePlex on both the source and target must be of a version that supports encryption (version
8.6.3 or later).
To set a key
Run the following command in sp_ctrl on the source and target systems.
sp_ctrl> set encryption key key
Component Description
key The encryption key that was generated by the create encryption key command.
The key must be set to the entire value that was generated by create encryption
key. It must be 64 bytes long.
Without further options, the command affects all routes.
Example:
sp_ctrl> set encryption key
E5F5D4CBA329D2C86B5D7ABA096C18600595490129F55A1422AAB0248B28D0E4
Example
The following example creates and sets the encryption key.
On the source:
sp_ctrl> create encryption key
On target 1:
1 Administration spadmin* You need at least one user with Administrator rights on each source and
target system.
Can issue all SharePlex commands. Commands that can only be issued by
a SharePlex Administrator are:
l startup, shutdown
l all configuration commands relating to an active configuration
l all parameter commands except list param
l start capture
l stop capture
l abort capture
l truncate log
The SharePlex Administrator user must be in the Oracle dba group. For
Oracle RAC and ASM 11gR2 and above, the user must also be in the Oracle
Inventory group. For example: $ useradd g spadmin G dba,oinstall. The
membership in Oracle Inventory group must be listed explicitly in the
etc/group file.
On Unix and Linux, unless you install SharePlex as a root user, the
SharePlex Administrator user and the SharePlex admin group must exist
prior to installation.
2 Operator spopr Can issue all SharePlex commands except those listed above.
3 Viewer spview Can view lists, status screens, and logs to monitor replication only.
NOTE: The default name for the SharePlex administrator group is spadmin, but you can designate any group or
specify any name for that group during installation.
l If you install as non-root, create the groups in the /etc/group file before you run the SharePlex
installer. In a cluster, create them on all nodes.*
l If you install SharePlex as a root user, you can direct the installer to create the groups in the
/etc/group file. If you install in a cluster, the installer creates the groups on the primary node, but you
must create them yourself on the other nodes.
* The groups must exist because the installer adds the SharePlex Administrator user to the spadmin
group during the installation process. In a cluster, this user is only added to the primary node. You must
add the SharePlex Administrator user to the other nodes.
If the password field is null, no password is associated with the group. In the example, the asterisk (*)
represents the password, 102 represents the numerical group ID, and spadmin is the group. The
group ID must be unique.
3. Save the file.
Users can verify their authorization levels by issuing the authlevel command in sp_ctrl.
This chapter contains instructions for the initial startup of replication from an Oracle source database to an
Oracle target database on production systems.
Contents
What is activation?
Activation commands
Requirements for activating a configuration
Test the configuration before activation
Frequently Asked Questions about activation
How to activate multiple configuration files
Activate replication with an Oracle hot backup on an active database
Activate replication with an Oracle hot backup on a quiet database
Activate replication with Oracle transportable tablespaces
Activate replication with cold copy/transfer methods
What is activation?
When you activate a configuration, through the activate config command in sp_ctrl, SharePlex does
the following:
l Copy the source data to the target database to establish an initial synchronization point. SharePlex does
not establish or populate the target database, but it does capture and store active source transactions
while the target is being established.
l Activate (read) the configuration file to build a series of internal structures that identify objects and
routes. Only one configuration can be active for any given datasource at a time. Configurations for
different datasources on a system can be active at the same time.
l Start the processes that maintain the capture and replication of source transactions.
l Reconcile replicated data with the copied data. SharePlex applies transactions that occurred after the
copy was taken and discards transactions that occurred before the copy (and thus were applied by the
copy and would be redundant if applied by replication). The reconcile process is only required for
procedures that start replication while the source database is active.
During the activation of a configuration file, SharePlex performs the following procedures.
Activation commands
Use sp_ctrl commands to activate, deactivate and view information about a configuration activation. For more
information about these commands, see the SharePlex Reference Guide.
l deactivate config gracefully terminates replication for an active configuration. It stops all Capture
activity for the configuration, posts all data currently in the queues, and removes the associated
SharePlex processes and queues.
l abort config is a forceful deactivation. It stops all replication activity for the configured datasource on
the source and target systems, whether or not data in the queues has been posted.
Deactivating or aborting a configuration stops replication. If users continue making changes to the configured
objects, the source and target data can go out of synchronization.
Understand the commands you will use during SharePlex Reference Guide
activation. See the documentation for the following
commands:
l activate config
l show activate
l reconcile
l status
l qstatus
Make certain your SharePlex configuration and setup Create configuration files
are complete and any optional features are included
Configure partitioned replication
in the configuration or setup.
Configure named queues
Configure SharePlex security features
Transform data
Set up error handling
Prepare the database to support replication. Set up Oracle database objects for replication
Set up an Oracle database to support SharePlex
Set up Oracle redo logging to support SharePlex
Set up SharePlex to support Oracle data
Set up TDE Support
Open and mount the source and target databases. Database documentation
The verify config command does not verify how long the activation will take, nor will it verify the target
objects or database connection (as represented by the database identifier listed in the routing map.)
For more information, see the verify config command in the SharePlex Reference Guide.
Preliminary considerations
Read these points before you proceed.
Supported databases
Oracle source and Oracle target
Limitation Description
applies to:
Consolidated To establish consolidated replication, the use of a hot backup from all source systems is not
replication possible. A backup from one source will override the data that was applied by a backup from a
(many different source. You can use a hot backup of one of the source instances to establish a target
sources to
instance, and then use another copy method to apply the objects from the other source
one target)
instances. Possible methods include:
peer 1. Quiet all of the systems except the trusted source system for the duration of this
procedure.
2. Move all users to the trusted source system, and then follow this procedure.
Only after this procedure has been performed on all of the secondary systems may users may
resume activity on them.
Windows To use a hot backup between Windows systems, the target system must have an instance
systems already created containing an identical ORACLE_SID and directory structure created with the
Oracle creation tools. Oracle runs as a service on Windows, and the Registry entries must exist
before starting the database recovery process. The database can start empty, because the
hot backup will populate it.
Requirements
l [Unix and Linux systems] Verify that the ORACLE_SID and ORACLE_HOME in the oratab file are correct for
the instance you will be establishing with the hot backup. The SID must be the SID used in the routing
map in the configuration file that you will be activating.
l Read the requirements in Requirements for activating a configuration before you start this procedure.
l Make certain a SharePlex database account exists in the source database (only). This account usually is
created when SharePlex first is installed. See the SharePlex Installation Guide for more information.
l Before you start, review this procedure and see the SharePlex Reference Guide for more information
about the commands that are used.
Procedures
There are two procedures for activation with a hot backup, depending on your replication strategy.
Activate replication with an Oracle hot backup on an active database
Activation with hot backup:cascading replication
1. On the source and target systems, go to the bin sub-directory of the SharePlex product directory, and
start sp_cop and sp_ctrl.
2. On both 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 database has been recovered and reconciled.
sp_ctrl> stop post
4. On the source system, run the Oracle hot backup.
1. On all systems, go to the bin sub-directory of the SharePlex product directory, and start sp_
cop and sp_ctrl
2. On all systems, verify that the SharePlex processes are running.
sp_ctrl> status
3. On the intermediary and target systems, stop the Post process. This allows replicated data to
accumulate in the post queue until the databases are recovered.
4. sp_ctrl> stop post
5. On the source system, run the Oracle hot backup to the intermediary and target systems.
6. When the backup is finished, activate the configuration on the source system.
sp_ctrl> activate config filename
7. On the source system, view activation status.
sp_ctrl> show activate
NOTE: The command retains control of sp_ctrl until activation is finished.
8. When activation is complete, switch log files on the source system.
svrmgr1> alter system switch logfile;
9. Make a note of the highest archive-log sequence number.
Preliminary considerations
Read these points before you proceed.
Supported databases
Oracle source and Oracle target
Limitation Description
applies to:
Consolidated To establish consolidated replication, the use of a hot backup from all source systems is not
replication possible. A backup from one source will override the data that was applied by a backup from a
(many different source. You can use a hot backup of one of the source instances to establish a target
sources to
instance, and then use another copy method to apply the objects from the other source
one target)
instances. Possible methods include:
Windows To use a hot backup between Windows systems, the target system must have an instance
systems already created containing an identical ORACLE_SID and directory structure created with the
Oracle creation tools. Oracle runs as a service on Windows, and the Registry entries must exist
before starting the database recovery process. The database can start empty, because the
hot backup will populate it.
Requirements
l [Unix and Linux systems] Verify that the ORACLE_SID and ORACLE_HOME in the oratab file are correct for
the instance you will be establishing with the hot backup. The SID must be the SID used in the routing
map in the configuration file that you will be activating.
l Read the requirements in Requirements for activating a configuration before you start this procedure.
l Users must stop accessing the production database while the hot backup and configuration activation
take place.
l Make certain a SharePlex database account exists in the source database (only). This account usually is
created during SharePlex installation. See the SharePlex Installation Guide for more information.
l Before you start, review this procedure and see the SharePlex Reference Guide for more information
about the commands that are used.
Procedure
NOTE: If you are not using cascading replication, ignore all references to an intermediary system. For more
information about cascading replication, see Configure replication through an intermediary system.
Preliminary considerations
Read these points before you proceed.
Supported databases
Oracle source and Oracle target
Requirements
l Read the requirements in Requirements for activating a configuration before you start this procedure.
l Make certain a SharePlex database account exists in the source database (only). This account usually is
created when SharePlex is first installed. See the SharePlex Installation Guide for more information.
l Before you start, review this procedure and see the SharePlex Reference Guide for more information
about the commands that are used.
In this procedure, the "intermediary" system only needs to be part of this procedure if SharePlex will be
posting to, and capturing from, an intermediary system in a cascading configuration.
In this procedure, the "target" system is one of the following:
l The target system of a single-direction replication configuration, including cascading and consolidated
replication.
l The secondary systems in a peer-to-peer replication configuration.
Procedure
1. On the source system, set the source tablespaces that you want to copy to READ ONLY.
svrmgr1> alter tablespace name read only;
2. On the source system, activate the configuration file.
sp_ctrl> activate config filename
3. On the source system, start sp_cop and sp_ctrl from the bin sub-directory of the SharePlex
product directory.
4. On the source system, verify that sp_cop and sp_ctrl are running.
sp_ctrl> status
5. On the intermediary and target systems, stop Post. Stopping Post allows replicated data to accumulate
in the post queue until the databases have been recovered.
sp_ctrl> stop post
6. On the source system, export the metadata to an export file.
7. When the export is finished, copy the datafiles to another location on the source system. This minimizes
the impact on the source database of copying the files to the target system.
8. Set the source tablespaces back to read/write mode.
svrmgr1> alter Tablespace name read write;
9. If any of the copied datafiles and tablespaces exist in the intermediary or target database, drop them so
that the copied files can be applied.
10. Copy the files from the new location on the source system to the intermediary and target systems.
11. On the intermediary and target systems, use the Oracle import utility to import the metadata and the
tablespace definitions.
12. On the intermediary and target systems, set the tablespace(s) to read/write mode.
13. On the intermediary and target systems, open the Oracle instances.
14. On the intermediary and target systems, disable triggers on the tables, or run the sp_add_trigger.sql
utility script so that the triggers ignore the SharePlex user.
15. On the intermediary and target systems, disable check constraints and scheduled jobs that
perform DML.
16. [Partitioned replication only] If you are using vertically partitioned or horizontally partitioned
replication for any tables, delete the unneeded columns and rows from those tables on the
intermediary and target systems.
17. [Intermediary system only] Set the SP_OPO_REPLICATE_POSTER parameter to 1. This directs SharePlex
to capture posted changes on that system and replicate them to the target system.
sp_ctrl> set param SP_OCT_REPLICATE_POSTER 1
18. [Intermediary system only] Activate the configuration file.
sp_ctrl> activate config filename
l Import/Export/Data Pump
l Store/Restore from tape
l FTP
NOTE: This document does not provide instructions for how to perform the chosen copy method. This
procedure should be performed by someone who has a solid understanding of database copy methods.
Preliminary considerations
Read these points before you proceed.
Supported databases
Oracle source and Oracle target
Requirements
l [Unix and Linux systems] Verify that the ORACLE_SID and ORACLE_HOME in the oratab file are correct for
the instance you will be establishing with the hot backup. The SID must be the SID used in the routing
map in the configuration file that you will be activating.
l Read the requirements in Requirements for activating a configuration before you start this procedure.
l Users must stop accessing the production database while the copy and configuration activation
take place.
l The target instance must exist.
In this procedure, the "intermediary" system only needs to be part of this procedure if SharePlex will be
posting to, and capturing from, an intermediary system in a cascading configuration.
In this procedure, the "target" system is one of the following:
l The target system of a single-direction replication configuration, including cascading and consolidated
replication.
l The secondary systems in a peer-to-peer replication configuration.
In this procedure, the SharePlex commands in the procedure apply to all sp_cop instances that apply to the
replication strategy you are using (for example, all sp_cop processes on a target in consolidated replication).
Procedure
1. On the source system, stop user access to the objects that are in the replication configuration.
l If deploying consolidated replication, you can either stop access to all of the source systems at
once and make the copies at the same time, or you can synchronize each source system one at a
time using these instructions.
l If deploying peer-to-peer replication, stop access to all databases in the peer group, including
the trusted source.
2. Copy the files from the source system to the intermediary and target systems.
3. On the source system, start sp_cop and sp_ctrl.
4. On the source system, activate the configuration file (all files if using consolidated replication).
sp_ctrl> activate config filename
5. On the intermediary and target systems, start sp_cop and sp_ctrl.
6. On the intermediary and target systems, stop Post. Stopping Post allows any data that gets replicated
before the target data is established to collect in the post queue.
sp_ctrl> stop post
7. On the source system, allow users to resume access to the source database.
8. On the source system, verify that the sp_cop, Capture, and Read processes are running.
sp_ctrl> status
9. Start and mount the intermediary and target databases, but do not allow users access.
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 terminate SharePlex processes
View events and errors
Monitor with sp_ctrl commands
Run monitor scripts on Unix
Run a monitor script on Windows
Monitor replication with SNMP
Each child process has the same -u identifier as its parent sp_cop process. This makes it easier to identify
related processes when multiple session of sp_cop are running.
l From the Command Prompt console using the tlist program provided with the SharePlex software.
l 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:
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.
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:
l Oracle errors
l Failure of a network connection or SharePlex process
l Start or stop of a utility or script
l Login or logout of a user
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.
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.
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:
Activation log
When you activate a configuration, it generates a log.
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.
See the SharePlex Reference Guide for details about these commads.
l sp_eventmon monitors the SharePlex Event Log and reports errors that you specify in a special file.
l sp_logmon monitors how well Capture is keeping pace with the changes entering the redo logs. If
Capture loses pace by a specified number of logs, sp_logmon alerts you before the logs wrap so that you
can take corrective action.
l sp_ps monitors the SharePlex processes and notifies you if one or more are stopped so that you can
correct the problem before the logs wrap or the queues exceed available disk space.
l sp_qstatmon monitors the status of the SharePlex queues and sends a warning if the backlog exceeds a
threshold (limit) that you define. This enables you to take corrective action before the queues exceed
available disk space and replication is adversely affected.
IMPORTANT!
Satisfy requirements
See the requirements in Requirements for using the monitoring scripts for usage requirements. NOTE:The
script must be run in the ksh shell.
1. Open the script in the app-modules directory of the SharePlex product directory.
2. Add any number of address strings after the MailUserName= variable. Use the full e-mail and/or pager
address. Separate multiple entries with a comma, as shown in the following example:
[email protected],[email protected]
IMPORTANT! If the person modifying the script is someone other than a SharePlex user, he or she needs to have
these Oracle privileges:
l CONNECT privileges
l SELECT privileges for the V$LOG table
l SELECT privileges for the SharePlex internal tables
Syntax
nohup sp_logmon -p port -t interval -l integer [-m ] [/dev/null] &
Table 16: Required arguments
Argument Description
nohup sp_logmon Directs the script to continue running in the background if the user logs out. This
ensures continuous monitoring. The sp_logmon component runs the script.
-p port Sets the port number for the instance of sp_cop that you are monitoring. You can
monitor different SharePlex instances by running sp_logmon for each one, using
different values for this argument.
-t interval Sets the time interval between scans in seconds. The value can be any positive
integer.
-l integer Sets the maximum permissible number of redo logs between where Oracle is
writing and where Capture is reading. This value triggers the warning generated
by sp_logmon. Valid values are positive integers from 1 to the number of redo
logs in the group.
& Runs the script in the background.
Argument Description
/dev/null Redirects the notification output to the /dev/null device on the local system so
that the monitoring process continues to run in the background and generate
output. To have the output appear on screen, omit this argument.
-m Enables the e-mail/paging option. Without this parameter, sp_logmon only logs
errors to the log file.
l When sp_eventmon detects an error that you defined, it prints a notification to the error.splex log file
and an e-mail message, if that option is enabled.
The script relies on the iwgrep program, the error_list file (described later), and a marker file named
username.mrk (where username is derived from the string that you enter with the -s argument when you
run sp_eventmon). These three components must be kept in the same directory as the script, or it will
not function.
NOTE: The username.mrk file prevents duplicate warning messages from being sent to the log and to your e-
mail or pager. Without this file, the script starts scanning the Event Log from the beginning every time it starts.
Warnings that were previously generated are sent again.
Satisfy requirements
See the requirements in Requirements for using the monitoring scripts for usage requirements. NOTE:The
script must be run in the ksh shell.
Set IW_HOME
The IW_HOME variable in the script must be set to the correct value on each machine. This variable must point
to the directory in which the monitoring scripts and iwgrep reside.
If the path is not correct:
1. Open the script in the app-modules directory of the SharePlex product directory.
2. Set the path as shown in the following example:
IW_HOME=/export/home/splex/monscripts
1. Open the script in the app-modules directory of the SharePlex product directory.
2. Add any number of address strings after the MailUserName= variable. Use the full e-mail and/or pager
address. Separate multiple entries with a comma, as shown in the following example:
[email protected],[email protected]
Run sp_eventmon
NOTES:
To run sp_eventmon
Run the script from the util sub-directory of the SharePlex product directory, not from app-modules. When you
run it from the util directory, you actually make a soft link that runs a utility which first sets up the correct
environment before running the script itself.
Syntax
nohup sp_eventmon -s 'sp_copname' -t interval -p path [-n name ] [-m] /dev/null &
Table 18: Required arguments
Component Description
nohup sp_eventmon Directs the script to continue running in the background if the user logs out.
This ensures continuous monitoring. The sp_eventmon component runs the
script.
-s 'sp_copname' Sets the name of sp_cop that was used when sp_cop was started with the -u
option. The name of sp_cop must be enclosed within single quote marks. You
can use this parameter more than once to monitor multiple sp_cop instances on
a system. Without this parameter, sp_eventmon will not start.
& Runs the script in the background.
-t interval Sets the time interval between scans in seconds. The value can be any positive
integer.
Component Description
Satisfy requirements
See Requirements for using the monitoring scripts for usage requirements. NOTE:The script must be run in
the ksh shell.
1. Open the sp_ps file in the app-modules directory of the SharePlex product directory.
2. Set the interval= parameter to the required scan interval. Use any positive integer, for example:
interval=1500
1. Open the script in the util directory of the SharePlex product directory.
2. Add any number of address strings after the MailUserName= variable. Use the full e-mail and/or pager
address. Separate multiple entries with a comma, as shown in the following example:
[email protected],[email protected]
NOTE: The e-mail/paging option is enabled by default for sp_ps, but confirm that it was not changed. In the
script, MAILOPTION=TRUE enables e-mail notifications and MAILOPTION=FALSE disables them.
Syntax
nohup sp_ps ['sp_cop -u name'] CONFIGURATION [> /dev/null] [ &]
Argument Description
nohup sp_ps Directs the script to continue running in the background if the user logs out.
This ensures continuous monitoring. The sp_ps component runs the script.
'sp_cop -u name' Use this parameter if you are running more than one sp_cop process. Use it to
specify each one of those processes that you want to monitor. This argument
must reflect exactly the same name that was used when sp_cop was started
with the -u option. It must be enclosed within single quote marks.Without the -
uname option, sp_ps assumes you want to monitor the sp_cop that uses the
default SharePlex port of 2100.
CONFIGURATION Specifies the type of configuration of the SharePlex instance being monitored.
This value must be entered in CAPITAL letters. Valid values:
SOURCE Use for uni-directional replication to monitor the Capture, Read and
Export processes on the source system.
TARGET Use for uni-directional replication to monitor the Import and Post
processes on the target system.
MULTI-SOURCE Use for peer-to-peer replication. It directs the script to
monitor the Capture, Read, Export, Import and Post processes on each system.
NOTE:If replicating between source and target tables on the same system,
there are no Export or Import processes.
> /dev/null Redirects the notification output to the /dev/null device on the local system
so that the monitoring process can continue to run in the background and
generate output. To have the output appear on screen, omit this argument
& (Ampersand) Runs the script in the background.
1. Open the sp_qstatmon script in any ASCII text editor. The script is in the .app-modules directory in the
SharePlex installation directory.
2. Add the address strings after the MailUserName= variable. Use the full e-mail and/or pager address.
Separate multiple entries with a comma, as shown in the following example.
[email protected], [email protected]
Run sp_qstatmon
Run the script from the util sub-directory of the SharePlex product directory, not from app-modules. When you
run it from the util directory, you actually make a soft link that runs a utility which first sets up the correct
environment before running the script itself.
Syntax
nohup sp_qstatmon -v path -t n -p port_number [-c integer ] [-d integer ] [-m] > /dev/null &
Table 21: Required arguments
Argument Description
nohup sp_qstatmon Directs the script to continue running in the background if the user logs out. This
ensures continuous monitoring. The sp_qstatmon component runs the script.
-v path Sets the path to the SharePlex variable data directory for the instance of sp_cop
that you want to monitor. Without this variable, sp_qstatmon fails and prints an
error message requesting a valid path.
-t n Sets the time interval between scans in seconds. This value can be any positive
integer.
-p port Sets the port number for the instance of sp_cop that you are monitoring. You can
monitor different SharePlex instances by running sp_qstatmon for each one,
using different values for this argument.
& Runs the script in the background.
Argument Description
/dev/null Redirects the notification output to the /dev/null device on the local system so
that the monitoring process continues to run in the background and generate
output. To have the output appear on screen, omit this argument.
-c integer Sets the number of messages in the capture queue at which the script issues a
warning message. This value can be any positive integer. Without this
parameter, sp_qstatmon defaults to 100 messages.
-d integer Sets the number of messages in the post queue at which the script issues a
warning message. This value can be any positive integer. Without this
parameter, sp_qstatmon defaults to 100 messages.
-m Enables the e-mail/paging option. Without this parameter, sp_qstatmon only
logs errors to the log file.
l The status of the Capture, Read, Export, Import, Post, and Sp_Copsrv.exe processes.
l The volume of the capture and post queues.
l Latency between redo logs being processed by Oracle and by SharePlex.
l Specific messages in the Event Log (described later in this topic)
Time Interval 60 seconds Sets a time interval, in seconds, between monitoring polls.
Send Email 1 (enabled) Enables or disables email alerts. Email is the only reporting option.
alert
0 = disabled
1 = enabled
SMTP Server none Specifies the name of the SMTP server for the e-mail account.
Name
Email Address none Specifies one or more email addresses that will receive monitor
notifications. Separate each email address with a space, for
example:
Email Address: [email protected]
[email protected]
Capture 0 (do not Sets the maximum number of messages that a queue can contain
Threshold monitor) before an alert message is triggered.
Post Threshold Set a positive numeric value for each queue that you want to
monitor. Set a value that is well below the amount of disk space
that is allocated to this queue. This gives you enough time to add
disk space or resolve any problems that are causing a backlog.
Monitor the 0 (do not Enables or disables the monitoring of supported Event Log
Event Log monitor) messages.
0 = disabled
1 = enabled
The following messages are monitored:
SharePlex was shutdown
System call error
Queue partition is full
Host is down
Internal error
Out of sync
Poster failure
Parameter was changed Activate config
Deactivate config
Bad config file
sp_cop was shutdown
Child process failed
Error
ORA-error number errors
Monitor Redo 0 (do not Enables or disables the monitoring of Capture latency, which is
Logs monitor) the number of redo logs that Oracle has processed ahead of
SharePlex in the redo stream.
0 = disabled
1 = enabled
Redo Threshold 2 logs Sets a value for the maximum permissible number of logs for
Oracle to be ahead of SharePlex in the redo stream. When the
value is reached, an alert is triggered. Use when Monitor Redo
Logs is enabled.
5. Click Start to run the script. The script starts and the word Start becomes Stop. The script runs
continuously to monitor SharePlex until you click Stop.
Enable SNMP
To enable SNMP monitoring of SharePlex replication, set the SP_SLG_SNMP_ACTIVE parameter to 1. By default,
the parameter is set to 0 (disabled).
SP_SLG_SNMP_HOST The name of the system (host) to which the traps will be sent
SP_SLG_SNMP_COMMUNITY The community security string
SP_SLG_SNMP_MJR_ERRNUM The major error number to be used by the traps
SP_SLG_SNMP_MNR_ERRNUM The minor error number to be used by the traps
Parameter Value
SP_SLG_SNMP_ENTERPRISE_ The enterprise object identifier to send with the trap. The default is
OID 1.3.6.1.4.1.3.1.1 .
SP_SLG_SNMP_TRAP_OID A custom object identifier to bind to the trap. The default is 1.3.6.1.2.1.1.1.0.
SP_SLG_SNMP_TRAP_ The name of the trap program. The default is iwsnmptrap.
PROGRAM
SP_SLG_SNMP_INT_ERROR SharePlex logic errors and errors that cause processes to exit
SP_SLG_SNMP_SYS_ERROR System-related errors encountered by SharePlex
SP_SLG_SNMP_ERROR Other SharePlex errors
SP_SLG_SNMP_OUT_OF_SYNC Replication is out of synchronization
SP_SLG_SNMP_STARTUP SharePlex starts up
SP_SLG_SNMP_SHUTDOWN SharePlex shuts down
This section contains solutions to many of the common questions and problems that can arise during replication,
and it also suggests preventive measures for avoiding problems.
Contents
Find the solution in the SharePlex Knowledge Base
Solve Oracle setup problems
Solve configuration file problems
Solve activation problems
Solve replication problems
Solve DDL replication problems
Solving queue problems
Solve Synchronization Problems
Solve compare command errors
Solve other replication problems
How to resynchronize source and target tables
How to restore the archive logs
How to release semaphores after process failure
How to resolve disk space shortage
How to find the ORACLE_SID and ORACLE_HOME
Incorrect If SharePlex cannot interact with Oracle, it 1. See How to find the ORACLE_SID and
ORACLE_SID might be using the wrong ORACLE_SID ORACLE_HOME to determine the
and/or ORACLE_ and/or ORACLE_HOME. Oracle values.
HOME
2. Rerun the Oracle Setup (ora_setup)
program.See the SharePlex
Installation Guide for more
information.
Insufficient If Oracle Setup fails, the person who runs it See the SharePlex Installation Guide for
database may not have the correct privileges the required privileges.
privileges
Asterisk as the Sometimes, the oratab file has an * Ensure that a valid ORACLE_SID is in the
ORACLE_SID (asterisk) symbol instead of a value for the oratab file, and then try running the setup
entry ORACLE_SID. program again.
The parameter for The name you gave this Use a different name. To see a list of
create config must configuration already exists for configurations on a system, use the list
be a new file name. another configuration file. config command.
or... Destination
file exists - file
must not exist prior
to operation.
Couldnt fork editor. SharePlex failed to open the Make sure the editor still exists on the
or Editor execution default text editor. system. The default editors are vi on
failed. Unix and Linux and WordPad on
Windows. To change the default text
editor, see Set a default editor for sp_
ctrl .
Destination file The name you specified when Use a different name. To see a list of
exists - file must copying the configuration file configurations on a system, use the list
not exist prior to already exists in this SharePlex config command.
operation. instance.
Problems in reading The edit config command could not Confirm the name of the file you are
or writing file used open the specified file. trying to edit, including the case, and
in edit -- command check to see if the file is corrupted.
aborted.
Edit config file is SharePlex does not allow editing of 1. Copy the configuration using the
not allowed for an an active configuration. copy config command.
active config file.
2. Edit the copy using the edit
config command.
3. Activate the new configuration
file.
Destination file The new name you are giving this Use a different name. To see a list of
exists - file must configuration already exists for configurations on a system, use the list
not exist prior to another file. config command.
operation.
Invalid file name You could have misspelled the Verify the name and spelling, including
passed to command. configuration name or used the the case, then enter it again. To see a
or File does not wrong case. list of configurations on a system, use
exist. the list config command.
File access denied - You are not authorized to issue the View your authorization level with the
check file command. authlevel command in sp_ctrl , then
permissions. view the reference documentation for
the command to determine its minimum
authorization level. The SharePlex
Administrator assigns authorization
levels.
SharePlex If activation cannot lock the tables in the Assign the SharePlex database user the
cannot configuration file, activation of that table will privilege to lock tables.
lock tables fail.
Invalid You may be trying to replicate objects that are To understand the objects and operations that
objects not supported by SharePlex. SharePlex supports, see the Release Notes
that accompany this release.
Invalid SharePlex could not get routing information. Verify the names of the targets, and fix any
target syntax errors in the routing map. See Routing
systems specifications in a configuration file. Then
activate the affected objects again
Syntax Misspelled names, table names specified Run the verify config command to view the
errors and errors. For help with configuration syntax, see
misspelled without an owner name, and other improper Create configuration files.
words syntax in the configuration specification can
cause activation of an object to fail.
Incorrect The wrong ORACLE_SIDis specified on the Edit the configuration file to specify the
ORACLE_SID Datasource:o.SID line. correct ORACLE_SID. See How to find the
ORACLE_SID and ORACLE_HOME if needed.
Oracle If SharePlex is having trouble connecting to Update the connection information. See
password Oracle and you know the account exists, find out Change the SharePlex database account.
problems if someone changed the password.
Insufficient If Oracle Error 20 (ORA-00020 maximum number Increase the PROCESSES parameter in
PROCESSES of processes (string) exceeded) is the Oracle or decrease the number of
setting cause of an activation failure, it is because activation threads that you are using. The
number of threads is controlled by the
Oracle ran out of resources on the source system
threads option of the activate config
to allow one or more threads to log on. command.
ORA-00942: SharePlex cannot access the Data Dictionary. Make certain that the O7_DICTIONARY_
table or ACCESSIBILITY parameter in the init.ora
view does file is set to TRUE. (This is the default.) The
database must be restarted if the
not exist.
parameter is changed.
Deactivation In rare cases, if you activate a configuration too Before you activate a new configuration
followed too soon after a deactivation, the activation fails. after deactivating one, wait until you see
closely by the following message in the Event Log:
activation Notice: sp_ordr (for o.ora10
queue o.ora10) Deactivated.
The Oracle sid SID Either the datasource See How to find the ORACLE_SID and
specified in the config specification in the configuration ORACLE_HOME
file is invalid. file was entered incorrectly, or
To determine whether there is a
one of the following is the cause.
SharePlex account, query the
l A database account does database for tables that start with
not exist for SharePlex. SHAREPLEX_.
Objectname may not be The object is probably one of the Remove the object from the
replicated because it's types of objects that SharePlex configuration file.
neither a table or a does not replicate.
sequence. Sp_conf exit.
line n, source object name The owner name may be missing Specify object names as
(T_HFL_1) not of form from one or more objects listed in ownername.objectname.
OWNER.TABLE the configuration file.
syntax error in line n. There is a syntax error on the Fix the incorrect syntax. See Create
specified line of the configuration configuration files for help.
file.
line n, bad routing spec There is a syntax error in the Make sure the routing map is
(o.ora10) routing map. written correctly, for example
[email protected]. See Routing
specifications in a configuration
file for help.
File does not exist. SharePlex cannot find the Issue the list config command. If
configuration file. the file you want to activate is not
listed, it may not be in the config
sub-directory of the variable-data
directory. Find the file and move it
to that directory, then issue the
activate config command again.
Ineffective Capture reads archive logs if the redo logs See Set up Oracle redo logging to support
redo log wrap before Capture is finished with SharePlex for more information.
configuration them, but this can slow down replication
and consume disk space. In most cases,
the redo logs should be configured so that
SharePlex can avoid using the archive logs.
SharePlex If Capture, Read, or both slow down during Ideally, the SharePlex priority should match
has low hot backups or other Oracle-intensive Oracle's priority.
process operations, view the process-priority
priority
settings on the system to determine if
SharePlex can be assigned more
resources.
Keys are not If PK/UK logging is not enabled for the Enable PK/UK logging.
being logged tables in replication, SharePlex must
query the database to get the key values
for update and delete operations.
Network Network factors can cause data to transfer Make certain that all Export and Import
problems to a target system too slowly, or not at all. processes are running, and ask the network
administrator to check the network for causes
of slowdowns.
Parameter Some SharePlex parameters, when To determine if any parameter settings are
settings changed from their default settings, can responsible for reduced performance, issue
inhibit replication performance. the list param modified command to view
parameters that have non-default settings.
Review the documentation for those
parameters in the SharePlex Reference Guide
to determine whether a particular setting is
affecting replication speed.
Temporary Temp tables receive numerous changes Remove temporary tables from replication.
tables and that cause replication overhead and
FND tables performance degradation.
Full table scans If a target table does not have a key, Do one of the following:
Post must perform a full table scan
l Add an index or key if possible, and
to find the correct row. This slows
use a hints file. See Use Oracle
Bitmap indexes on Bitmap indexes are beneficial for Avoid using bitmap indexes on target tables
target tables queries, but they slow down the in replication, or only use them on tables
DML operations applied by Post. For that do not have frequent DML activity.
more information, see Bitmap
indexes.
Disk I/O bottleneck Disk I/O bottlenecks on the target Disk I/O is the nature of the database
system are a common cause of slow environment, but you can reduce the
Post performance. Post can spend a bottleneck by placing the redo logs on
high percentage of its time waiting faster hard drives or on a solid-state drive.
for Oracle to commit data. The
effect is worse when there is a
Capture process reading from the
same log device in peer-to-peer
replication.
High number of buffer Review any table with SQL If there are more buffer gets than four, the
gets statements that cause a high index probably needs to be rebuilt. You
number of buffer gets. There should can rebuild an index without the need to
reactivate the configuration file.
only be two to four buffer gets on an
index, depending on its size and
whether or not it is a unique index.
Oracle write-rate By default, one buffer writer writes If this is a constant problem, you can
bottlenecks all dirty Oracle blocks to disk. consider increasing the number of writers.
Whenever that buffer writer process See the database documentation.
wakes up to write, it locks portions
of shared memory and, in effect,
blocks the processes that are either
modifying or reading data blocks
including the Post process.
Small transaction size Normally, Post performs an internal If most of your transactions are small, try
read/release after it receives each changing the value of the Post SP_OPO_
COMMIT, which means it purges that READRELEASE_INTERVAL parameter. See
data from the queue as part of the the SharePlex Reference Guide for more
checkpoint recovery process. For information about this parameter.
smaller transactions, this can cause
excessive I/O on the target system
and hinder the Post process.
Sequences not cached If the sequences in replication are Cache sequences. If replicated sequences
not cached, they add unnecessarily are part of a key, replicate the tables that
to the replication volume. contain those keys, and remove the
sequences from the replication
configuration. You should see significant
performance improvement.
Low ulimit An error similar to the following Solution: Set the ulimit as close to the
means that the system file optimal value of 1024 as possible.
descriptors setting on the target
The ulimit can be set either as a system
system needs to be increased:
hard limit or a session-based soft limit, as
Error 07-24-08 follows:
12:11:40.360226 8693 12345
Poster error: /var/quest/ l Set a hard limit: (Recommended) A
vardir/log/event_log: Too root user and system restart are
many open files (posting required to change the hard limit,
from ora102, queue prodsys, but the value remains fixed at the
to ora10b) correct level to support SharePlex.
Consult your System Administrator
for assistance.
l Set a soft limit: A soft limit setting
stays in effect only for the duration
of the sp_cop session for which it
was set, and then it reverts back to
a default value that may be lower
than the hard limit and too low for
SharePlex.
Compare process locks The repair command locks all rows If you do not want Post to wait for a repair
that need repair, or the entire table process to finish, you can kill the compare
if there are more than 1000 out-of- process. To avoid issues with locks caused
sync rows, throughout the repair by repair processes, consider running the
process. This could block Post if Post repairs during non-peak hours.
tries to apply data to the table being
repaired.
Difference in Capture SharePlex reads and processes See Tune the Post process.
and Post speed records from the redo logs faster
than it can post those operations to
the target database with standard
SQL statements.
Full archive log If Post appears stalled and will not Move some of the old archive logs to
directory another device, or delete them to make
shut down normally, but the only room for new ones.
error in the Event Log is sp_opst_
mt - operation taking too
long, it could be that the archived
log directory on the target system is
full. If so, then Oracle cannot create
new logs, and it suspends
processing. Post stalls because it is
waiting for Oracle.
Capture stopped
If Capture is stopped, issue the status command in sp_ctrl to verify whether or not it was stopped intentionally
by an authorized SharePlex user. If it was, find out why and make certain that it is not stopped for too long.
The following are other reasons why Capture could stop unexpectedly.
archive logs When Capture detects a log wrap and the Restore the archive logs from the one that
not archive logs are not available, Capture Capture last processed or point SharePlex to
available stops and returns a Log wrap their location with the SP_OCT_ARCH_LOC
detected error. It waits a certain amount parameter. To determine the log that Capture
of time and then starts again, continuing needs, use the show capture command with the
this process until the logs are restored. detail option. See also How to restore the
archive logs .
Compressed Capture cannot read compressed archive Uncompress the current log that Capture needs
archive logs logs. and all those after it so that Capture can process
them. To determine the log that Capture needs,
use the show capture command with the detail
option.
archive logs Capture stops if it cannot locate the If you are storing the archive logs in a location
in archive logs it needs. When the redo logs other than the normal Oracle location, make
unexpected wrap, Capture looks for the archives in sure this parameter is set to the full path name
location
Oracles archive-log list, and if the logs are of the directory containing the archive logs.
not there, Capture looks in the location
specified by the SP_OCT_ARCH_LOC
parameter.
No access to Capture stops when it cannot read or find Find out if someone changed permissions such
the redo the logs, then it tries to read the log again. that SharePlex does not have permission to read
logs the redo logs.
No access to Capture stops if it is unable to write to the Verify the permissions and space for the variable-
the SharePlex logs because of restrictive data directory.
variable- permissions on the state sub-directory in
data the variable-data directory, or if there are
directory space restrictions in that directory.
Corrupted Capture stops due to the error a Restore the current log that Capture needs and
archive logs portion of redo logs could not be all those after it so that Capture can process
parsed.... This error occurs because of them. To determine the log that Capture needs,
corrupted archive logs. use the show capture command with the detail
option. See also How to restore the archive logs .
Post stopped
If Post stops, issue the status command in sp_ctrl to find out why.
An idle status means there is no data in the post queue to post.
A stopped by user status means that a SharePlex user stopped the Post process. To find out which user is
responsible, view the user issued commands in the Event Log.
A stopped due to error status means a replication or Oracle error caused Post to stop.
The following are some potential causes for Post to stop unexpectedly.
Correctable Post stops for Oracle errors that can be Use the information in the SID_errlog.sql
Oracle errors corrected, so that you can fix the problem file to correct the problem, then start Post
without risk of the data going out of again. Posting resumes from the point
synchronization. The errors and the faulty SQL where it stopped.
statement are logged to the SID_errlog.sql file
in the log sub-directory of the variable-data
directory on the target system.
Non- Some Oracle errors, such as out-of-sync If the errors cannot be corrected but you
correctable conditions, cannot be corrected. In that case, want Post to continue processing, list the
Oracle errors SharePlex reports the error to the Event Log, errors in the in the oramsglist file and then
writes the error and SQL statement to the SID_ set the SP_OPO_CONT_ON_ERR parameter
errlog.sql file, and continues processing. to 1, which directs SharePlex to ignore
Sometimes, errors that cannot be corrected those errors and continue posting. For more
cause Post to stop. information, see Continue to post when
there is a DML error.
Locks on If a target table is locked, the Post process To find out if the table is locked, check the
target tables cannot apply a SQL statement and generates an V$LOCK system statistics table, and resolve
error message: Currently involved in a the situation accordingly. You might have
transaction. This message could mean that a to resynchronize the data if DML was
user, application, or job is accessing the table performed on the table. See How to
and might have caused an out-of-sync condition. resynchronize source and target tables.
Or, it could mean that a repair command has
locked the table.
No more If you see the following error, Post has View the current database OPEN_CURSORS
open cursors exceeded the available open cursors. value using the following SQL statement:
Warning: sp_opst_mt (for select value from V$PARAMETER
o.oracle-o.oracle queue oracle) where name = 'open_cursors' ;
Configuration When you are using named export queues, and To start Post and finish replication, shut
deactivation you deactivate the configuration, Post could down SharePlex, then start it again.
when there stop with the following error instead of posting
are named
the remaining data from the queues:
export
queues sp_opst_mt (for o.qa920-o.qa920 queue
q5) 15007 - Can't open poster queue
que_NOEXIST: Queue does not exist.
Queue name Post stops if a queue name is too long. Make certain the name assigned to named
is too long queues in the configuration file are no
longer than 15 characters.
Post If Post returns an error message of "shs_ 1. In the Windows Control Panel, open
generates a SEMERR: an error occurred with the Configure PTC MKS Toolkit.
semaphore semaphore" on a Windows system, SharePlex
error requires more semaphores than are available. 2. Select Runtime Settings.
This usually occurs when named queues or
3. From Category, select Semaphores.
horizontally partitioned replication are being
used. You can increase the number of 4. Set the following semaphores:
semaphores through the MKS Toolkit.
Max Number of Semaphore IDs: 10
Max Number of Semaphores: 512
Max Number of Semaphore Undo
entries: 90
SharePlex Sometimes machine names cannot be resolved Add the IP addresses and names of all servers
cannot between Unix or Linux and Windows systems. (Unix, Linux, and Windows) in the replication
resolve a network to the /etc/hosts file on all Unix and
machine Linux machines, and add the same information
name to the hosts file on all Windows machines.
sp_cop is SharePlex may be performing its overhead Increase the idle time of sp_cop with the SP_
using too activities too frequently. COP_IDLETIME parameter. See the parameter
much CPU documentation in the SharePlex Reference
time
Guide.
Corrupted If a source table is corrupted or there is To disable posting for a table, use the SP_
source another reason that you do not want the OPO_DISABLE_OBJECT_NUM parameter, which
table replicated data to be posted to the target disables posting of both DML and DDL
Conflict If you encounter compile problems with your This issue does not affect replication;
resolution conflict resolution routines, check whether any SharePlex replicates data for tables with
generates tables have the same names as their owners. A identical owner and table names.
compile known issue in PL/SQL prevents the SharePlex
errors conflict resolution logic from compiling the
PL/SQL for tables whose names are the same as
their owners. Oracle has stated that the issue
will not be fixed. See Oracle TAR 2577886.996
for more information.
sp_cop cannot setup; memory Processes that access the Kill those processes. SharePlex
segment n in use. queues were still running processes start with sp_. When all
when you last shut down sp_ have been killed, sp_cop should
cop. start.
Error: sp_cop can't setup There are already one or To run multiple sessions of
shared memory statistics more SharePlex sp_cop SharePlex, you need to use
capability - exiting Error: processes pointing to the separate variable-data directories
sp_cop(shs) Cannot delete same variable-data for each one. See Run multiple
previous memory segment 303. directory. instances of SharePlex.
Please check to see if any
Shareplex processes are
running (ps -ef | grep sp_).
If there are some processes
running then kill them and
restart sp_cop.
DEST_1: ORA-00001: unique the redo log, but Oracle error because of the way Oracle
constraint (.) violated. rolled it back. The rollback handles the violation.
also entered the redo log.
SharePlex detects the
constraint violation on the
target.
Warning: sp_opst_mt (for The SQL Cache size is set to No action is required if this is your
o.oracle-o.oracle queue 1, and more cursors are still intended configuration. For more
oracle) Too many concurrent needed. SharePlex disables information about SQL Cache, see
transactions. Will disable the the SQL Cache feature in Tune SQL Caching.
SQL Cache capability. this case.
Warning: sp_opst_mt (for Post detected that it will No action is required unless the
o.oracle-o.oracle queue exceed its maximum number value gets to 1 and there are still
oracle) Running out of of cursors and is trying to not enough cursors. For more
cursors. Number of cursors decrease the SQL Cache information about SQL Cache, see
size. Tune SQL Caching.
opened so far is number. Will
attempt to decrease SQL Cache
size.
or...
Notice: sp_opst_mt (for
o.oracle-o.oracle queue
oracle) Shrinking SQL Cache
size to number per session.
SQL Cache disabled. The SQL Cache feature is No action is required if this is your
disabled. intended configuration. For more
information about SQL Cache, see
Tune SQL Caching.
Hints file error messages
15050 hint file not found SharePlex looks for the To prevent this message, create a
hints.SID file whether you blank hints file in the data sub-
use it or not. The location of directory of the variable-data
directory. Name it hints.SID.
this file is the data sub-
directory of the SharePlex
variable-data directory. If
this file gets moved or
deleted, SharePlex returns
this error message.
15051 missing column in the The hints file is not See Use Oracle INDEX hints for more
hint file (either table of configured correctly. information about using index hints.
index name)
15052 syntax error for
tablename
15053 syntax error for
indexname
15054 source tables object_ The hints file includes a If this table is in the configuration,
id not found in object cache source table that is not in make certain that the owner name
the active configuration. All and table name are spelled in the
tables in the hints file must hints file the same way as they are
be listed in the active in the configuration.
configuration.
15055 more than n valid The hints file permits only as Either remove some of the table-
entries were entered into the many table-index index combinations or increase the
hints file combinations as the value value of SP_OPO_HINTS_LIMIT. For
set by the SP_OPO_HINTS_ more information about this
LIMIT parameter. parameter, see the Post
parameters documentation in the
SharePlex Reference Guide .
15056 error allocation This indicates a system-level If you believe the system memory is
memory for hints memory problem; the hints sufficient, stop the Post process and
file itself does not demand a start it again. If you are not using
the hints file, you can ignore this
significant amount of
error.
memory.
17000 error opening hint SharePlex cannot open the Check the file for corruption. If the
file hints file. file is valid, make certain there is
sufficient read permission for the
Post process. See Use Oracle INDEX
hints for more information about
using index hints.
sp_opst_mt: pid=num date/time The system file descriptors Set the ulimit to 1024.
src host/ sid=db01:N2PB setting is not 1024.
/var/quest/vardir/log/ event_ The ulimit can be set either as a
log: Too many open files system hard limit or a session-based
soft limit, as follows:
shs_SHMERR: an error occurred You ran the qview utility Shut down SharePlex and re-run
with shared memory. without shutting down qview.
SharePlex (sp_cop).
Solution: Make certain the following parameters are set to appropriately. See Control DDL replication for more
information about how to use these parameters to configure DDL replication.
SP_OCT_ Auto-add to replication any tables and indexes that are created after activation. On
AUTOADD_
ENABLE
Set SP_ Auto-add to replication any materialized views that are created after activation. Off
OCT_
AUTOADD_
MV
SP_OCT_ Auto-add to replication any sequences that are created after activation. Off
AUTOADD_
SEQ
SP_OCT_ Replicate DDL for tables and indexes that are not listed in the configuration file. Off
REPLICATE_ SharePlex replicates metadata changes for those objects, but does maintain data
ALL_DDL changes to them. The objects must exist in the source and target prior to
configuration activation.
Stopped When replication processes stop, If a process was stopped by a user, find out why and then
replication data accumulates in the queues. start it as soon as possible so that SharePlex can process the
processes accumulated data. If a process stopped because of an error,
view the Event log with the show log command to find out
what happened, then resolve the problem so that
processing can continue and the queue backlog can be
reduced.
Large The Post queue may become View the post queue with the qstatus command. If the value
operations large when storing large in the Backlog (messages) field remains constant or is
transactions for which there has shrinking, while the value in the Number of messages field
not yet been a COMMIT. To allow is increasing, Post is waiting for a COMMIT before releasing
for rollbacks and data recovery, the data.
SharePlex retains data in the
Use the show post detail command to verify that Post is
post queue until it receives the
processing transactions normally. If possible, set the
COMMIT.
COMMIT point for your application to 500 to generate smaller
Capture is If Capture is processing archive If the location of Capture in the logs is far behind that of the
processing logs, the capture queue database, the latency between the source and target data
archive consumes disk space while the may be too large to be acceptable to the target users.
logs
archived records are being Rather than add more disk space to the variable-data
processed. directory, it might be more practical to run ora_cleansp to
clean up the replication environment and queues,
resynchronize the data, and reactivate the configuration.
If SharePlex continues to run out of disk space because
Capture is processing the archive logs, the SharePlex
Support team can help you tune the performance of
Capture and adjust the redo configuration. For more
information about how to configure the redo logs for
replication, see Set up Oracle redo logging to support
SharePlex.
l Transformation changes the target data, so before and after images cannot be compared.
l The transformation routine posts the data, not SharePlex.
When SharePlex determines that source and target data are different, it generates error conditions but
continues to post other data from the post queue. To direct Post to stop processing altogether when it
detects an out-of-sync condition, change the SP_OPO_OUT_OF_SYNC_SUSPEND (Oracle) or SP_OPX_OUT_OF_
SYNC_SUSPEND (Open Target) parameter. See the Post parameter documentation in the SharePlex
Reference Guide.
When an out-of-sync condition occurs, the Post process logs a message in the Status Database and also to the
Event Log. To view these files in sp_ctrl:
When data goes out of synchronization, SharePlex logs the failed SQL statements to the database_ID_errlog.sql
file in the data sub-directory of the SharePlex variable-data directory.
IMPORTANT: If you see an out-of-sync message in the Status Database and in the Event Log, but there is no
record in the database_ID_errlog.sql file for the transaction, do not ignore those messages. They could be
associated with a ROLLBACK. Regardless of whether or not a transaction is rolled back, SharePlex still compares
the pre-images of the source and target rows. If they are different, that indicates that the data is out of
synchronization. Only when a transaction is committed on the source but fails on the target does SharePlex log
it to the database_ID_errlog.sql file, to give you a record of the statement that should have been applied as a
tool for problem solving and for manually applying the statement if appropriate. Rolled back statements are
canceled operations, and therefore not logged on the target.
Incorrect If ora_cleansp was run on some, but not Determine whether or not ora_cleansp was run on
running of all, systems associated with an active all systems by viewing the Event Log. The log tells
ora_cleansp configuration, SharePlex perceives an you if and when ora_cleansp was run on each
out-of-sync condition. system. It also tells you if and when the
configuration was activated. You can compare the
times for those events to determine what
happened.
If ora_cleansp was not completed on all replication
systems for this configuration, run it on all systems.
Because ora_cleansp removes replication queues
and processes and deactivates the configuration,
you must perform initial synchronization again.
DDL changes Some DDL-related causes of out-of-sync For a list of supported DDL, refer to the SharePlex
conditions are: Release Notes.
l Non-replicated DDL changes are To undo duplicate DDL changes made manually and
made to source objects, but the also by SharePlex:
configuration was not
1. Stop the Post process (it might already be
reactivated so that the objects
stopped).
can be re-analyzed.
sp_ctrl(sysB)> stop post
l DDL that SharePlex replicates
also gets performed manually 2. Alter the target table to undo the DDL
on the target. changes.
3. Start Post and let SharePlex post the
replicated DDL (which is still in the post
queue).
sp_ctrl(sysB)> start post
DML changes If applications or users make Prevent all DML access to the target tables that are
made DMLchanges to the tables on the in replication.
directly to target, the results of those changes
the target will cause hidden out-of-sync conditions You can use the compare and repair commands to
until Post attempts to apply a compare tables for out-of-sync rows and then repair
replicated change to the affected rows. those rows. For more information, see the command
When the change is applied, SharePlex documentation in the SharePlex Reference Guide.
returns an out-of-sync error.
Inadequate Conflict resolution procedures are Revise and test the conflict resolution procedures,
or non- required in a peer to peer (active- then see How to resynchronize source and target
existing active) configuration. SharePlex uses tables.
conflict
the conflict resolution procedures to
Log wrap If the redo logs wrap before Capture l If archiving is not enabled, there are no
can process the data it needs, the data archive logs for SharePlex to read. Data lost
can go out of synchronization if archived after the log wrap cannot be recovered.
logging is not enabled or if the archive Enable archived logging, and resynchronize
logs needed by Capture were removed. the data. See How to resynchronize source
(Normally, Capture would access the and target tables.
archive logs and continue replicating.)
l If SharePlex is many logs behind Oracle,
See Correct the problem first consider resynchronizing the data instead of
restoring the logs. It might take less time
than Capture would take to process the
missing records from the archive logs. In
addition, it eliminates the possibility that
the capture queue could exceed free disk
space while processing the archive logs. You
can base your decision on the size of the
redo logs and the number of tables being
replicated, both of which determine how
much information Capture must process.
Also take into consideration how much
latency the users of the target data can
tolerate.
l If archive logs are available, copy the
appropriate logs back to the archived-log
directory on the source system, or use the
SP_OCT_ARCH_LOC parameter to point
SharePlex to their location.
Triggers on Triggers must be disabled on target If triggers have fired on the target system, the
target objects. The triggers fire on the source objects changed by the triggers are out of
objects system and SharePlex replicates their synchronization and must be resynchronized. See
effects to the target. To determine if How to resynchronize source and target tables.
triggers are enabled on the target
system, query the database. To disable the effects of triggers
SQL> select * from user_ To disable the effects of triggers on target objects
triggers where table_ after the data is resynchronized, you can either of
owner=owner and table_ the following:
name=name;
l Run the sp_add_trigger.sql script, which
directs triggers to ignore the SharePlex
Oracle user. See the utilities documentation
in the SharePlex Reference Guide for more
information about the trigger scripts.
l Disable the triggers if they are not needed.
Unnecessary The only constraints that are necessary See Set up Oracle database objects for replication
constraints on target tables in a one-way
replication configuration are primary
and unique key constraints. CHECK
constraints are not necessary on the
target because they are satisfied on
the source. FOREIGN KEY and
ONDELETECASCADE constraints are also
satisfied on the source, and SharePlex
replicates the child operations to the
correct tables on the target.
You can leave
ONDELETECASCADEconstraints
enabled if you configure SharePlex to
ignore them.
LONG If a table has no primary or unique key, If you can create a key from columns that ensure
columns SharePlex builds a simulated key based uniqueness on the target table(s), you can avoid
on all of the columns except the LONG this kind of out-of-sync condition. After you create
and LOB columns. If the LONG columns the key, resynchronize and re-activate those
in the target rows are the only columns objects so that SharePlex can update its object
that contain unique values, multiple cache.
rows could meet the criteria for the
If adding a primary or unique key is not possible
simulated key. SharePlex could apply
(such as when packaged applications are in use),
the UPDATE or DELETE to the wrong row
uniqueness of rows on the target system cannot be
without the error being detected,
ensured.
causing the table to go out of
synchronization without an error
message.
Changes to If tables use sequences as keys, and a Create the sequences so that the updates cannot
keys key value changes, this may cause result in a duplication of keys on the target system.
duplicity on the target system. If the See Set up Oracle database objects for replication
for additional information.
new value already exists as a key in
another row on the target system,
SharePlex returns a unique-key
constraint violation and out-of-sync
error. This can happen when you
update values using an x +n formula,
where n is an incremental increase. It
is possible that one of the x +n values
will equal an existing value.
DBMS_ The effects of these procedures, such Exclude source and target objects from the jobs.
SCHEDULER as objects being created, manipulated
procedures and dropped outside replication, may
running on not be visible to replication or may not
source be supported, resulting in data changes
and/or that cause out-of-sync conditions.
target
system
Virtual If replicating data that is configured as If you do not need that data replicated to the
private a virtual private database, the target, you can filter it out of the SharePlex
database SharePlex database user may not have configuration by means of partitioned replication.
the access rights to capture the data.
Any changes to that data will not be If you want the data to be replicated, assign the
reflected on the target. SharePlex user the correct access rights.
Duplicate Duplicate entries, where the source, Copy the configuration file to a new file.
entries in target, and routing map are identical,
the cause double posting on the target. Find and remove any duplicates in the new file.
configuration Perform a resynchronization and reactivation by
file.
following the directions in How to resynchronize
source and target tables
Lack of disk Data goes out of synchronization if user See How to resolve disk space shortage .
space transactions continue when SharePlex
does not have enough room to
accommodate them in the queues. This
can happen if:
Changes to Out-of-sync conditions can result from See Configure horizontally partitioned replication
column the use of horizontally partitioned for more information about how to create column
conditions in replication in the following cases: conditions so that partition shift does not occur.
horizontally
l A column condition value is
partitioned
updated and the new value no
replication
longer satisfies the row
selection criteria.
Not If a table was added to the Resynchronize the affected tables, then reactivate
reactivating configuration, but the configuration was the configuration so that SharePlex can update its
after a not reactivated, operations on that object cache. To resynchronize the tables, see How
configuration
table are not being replicated. to resynchronize source and target tables.
change.
Queue If the SharePlex queues are corrupted, To avoid queue corruption during system failure,
corruption such as if there is a system failure, the you can use the parameter SP_QUE_SYNC. See the
data in them can be lost. This requires Queue parameters documentation in the SharePlex
Reference Guide .
a resynchronization.
PK/UK Certain replication problems can be SharePlex recommends that both primary key and
logging not prevented by logging key values. unique key supplemental logging be set, or that a
enabled SharePlex fetches key values based on supplemental log group on unique columns be
the rowid. Any operation that changes defined for every table in replication.
the rowid, such as ALTER TABLE...MOVE,
can cause the wrong key values to be
used for subsequent DML operations.
1. Determine why it happened before you resynchronize the data. Otherwise, the problem can repeat
itself and result in more data going out of synchronization.
2. Stop the Post process to prevent further errors. If the accumulation of messages in the Post queue is
threatening to cause disk space issues, and if there is enough disk space available on the source system,
you can stop Import until Post can clear out some of the operations from other transactions. See How to
resolve disk space shortage for steps.
3. View the Status Database and the Event Log to determine the cause of the problem.
4. Resolve the problem.
Resynchronize data
See How to resynchronize source and target tables to resynchronize data.
Oracle Error 904 calling oexec in de_select_ Do a DESCRIBE on both tables. It probably will
error prepare_to_fetch. show that the tables do not have an equal
904 number of columns or the datatypes are
A comparison failed because the source and
different. After you correct the DDL problem,
target tables being compared are structurally
you can run a repair to resynchronize the
different. The compare and repair commands do
values in the rows.
not detect and repair out-of-sync conditions
caused by unsynchronized DDL operations or
tables that are not structurally identical.
"Too Can not add DataEquator queue reader There is no workaround or way to adjust the
many que_TOOMANYUSERS: User table is full. limit, nor is there a way to determine how
users many compare processes can run
error The maximum number of processes reading from
concurrently without exceeding the limit.
and writing to the SharePlex queues was
exceeded. No more than 20 processes can read TIP: To compare multiple tables at the same
from and write to the post queue at the same time, without being restricted by process
time, including the replication processes and the limitations, use the compare using command.
compare and repair processes. An error is most To limit the tables being compared, create a
likely to occur when a repair option is used, new configuration containing only the ones
because a repair accesses the queue much longer that you want to compare, and use it for the
than a comparison without a repair. comparison. (Do not activate that
configuration.) All of the tables are compared
with one compare using process.
A client When a sp_desvr server process dies, the See Kill compare processes .
process associated sp_declt client processes usually die.
fails to If a process does not die, you can kill it.
die
A server When you kill a sp_declt client process or it dies See Kill compare processes .
process on its own or if the sp_desvr server process has
fails to not communicated with the client the sp_desvr
die server process usually exits after a certain
amount of time, which is controlled by the SP_
DEQ_TIMEOUT parameter.
l By viewing the sp_declt log file In the file, look at the Session IDs of the sp_declt processes and find
the one that matches the PID of the sp_desvr process that died. That is the sp_declt process to kill. The
sp_declt Session ID is the same as the PID of the associated sp_desvr process.
l By viewing the Event Log The Event Log records the startup of each sp_declt client process and its
You can search the log file names for the server process that died, and look for the client process
associated with that log file to determine the correct PID to kill.
On Windows systems, the logs also record the startup of the associated sp_cop process.
On Windows systems, the logs also record the startup of the associated sp_cop process.
l The InstallDir string in the right pane of the Runtime node shows the correct location for the
files. Search for the MKS Toolkit folder and restore the files to the location specified in the
InstallDir entry.
If you cannot locate the files or cannot restore them to the correct location, do the following:
Or...
System call error: sp_ordr.exe(osp) (for o.SERV queue o.SERV) Text file busy
17003 - Can't unlink file R:\Splex2100/state/o.SERVlog_ sp_ordr.30
Host unknown: cannot form Appears when either the host Verify that the system to which
connection command or [on host] option is you want to connect is running and
issued. that you are using the correct
system name.
Network unreachable The network is down. Find out how long the network
administrator expects it to last. If
the downtime could cause the
SharePlex queues to exceed their
disk space, take measures to avoid
having to resynchronize the data.
See How to resolve disk space
shortage .
User is not authorized as a You do not have user permissions SharePlex users must be listed in
SharePlex user -- check to execute the operation. the /etc/group file (Unix and
/etc/group Linux) or in the Users list
(Windows) under one of the
SharePlex user groups: SharePlex
Admin, spoper, spview.
unauthorized connection A connection from a remote See the error message for the
attempt from host hostname. machine was denied because its name of the system. To allow that
net name is not listed in the auth_ system to connect to the sp_cop
hosts file. on the local system, add its name
to the auth_hosts file.
Command was called with an The command contains invalid Issue the help command to view
invalid argument. input. valid input for the command.
or
Unknown keyword used in
command.
Permission denied for command You are not a member of the Issue the authlevel command to
- check your authorization user group that can issue this view your authorization level.
level. command.
Default host is not defined: SharePlex cannot to determine Either establish a default host
use the host command or [on which system you want the with the host command or use
host] option. command to affect. the [on host] option with the
command that you want to issue
(if available).
l If only a few tables are out of synchronization, and they are not large, you can use the compare
command in sp_ctrl to see how many rows are out-of-sync in each one. If the number of out-of-sync rows
is small, you can run the repair command to resynchronize them. See Overview of Compare and Repair
for more information.
l As an alternative to the compare and repair commands, you can use the SQL statement(s) in the SID_
errlog.sql file to patch the tables manually after you correct the problem. See Manually patch out-of-
sync tables
l If the number of out-of-sync tables is large, it might take less time to re-synchronize the databases than
it will to use the compare and repair commands to repair them. You can:
o Resynchronize by copying the source tables
o Resynchronize with Oracle transportable tablespace
o Resynchronize with an Oracle hot backup on an active database
IMPORTANT:
l To resynchronize centralized reporting, such as a data warehouse, you cannot use a hot backup from
all source systems. One backup would override the data from the previous one. You can use a hot
backup of one of the source instances to establish the target instance, and then use another method
such as export/import or transportable tablespaces to copy the tables from the other instances.
l To resynchronize peer-to-peer replication, you must quiet all of the secondary source systems for the
duration of this procedure. Move all users to the primary system, and then follow the procedure. After
the procedure has been performed on all of the secondary systems, users can resume activity on them.
l Before you start, review this procedure and see the SharePlex Reference Guide for more information
about the commands that are used.
1. Determine the sequence number that Capture needs to resume processing from. Capture stops when it
encounters a log wrap and prints a message to the Event Log (event_log) containing the redo log
sequence number it needs. You also can find out this number by querying the SHAREPLEX_ACTID table
and looking at the SEQNO column, as shown in the following example:
SQL> select * from splex.shareplex_actid;
2. Query the Oracle V$LOG_HISTORY table to find out when that sequence number was archived, then
copy the logs from that point forward to the source system.
SQL> select * from V$LOG_HISTORY;
# od -x shstinfo.ipc
0000000 0000 00e0 ee90 0000 4100 9328 0010 0000
0000020 0002 0020
0000024
When you implement this method, monitor the replication services and disk usage on the source system. On
Unix and Linux systems, you can use the sp_ps script to monitor processes and the sp_qstatmon monitoring
script to monitor the queues. On Windows systems, you can use the Sp_Nt_Mon utility to monitor those
components. See Monitor SharePlex for more information.
If a queue disk is almost out of free space, you might be able to add disk space without the need to
resynchronize the data.
This chapter contains an overview of the SharePlex Compare and Repair feature. SharePlex provides this
feature as built-in support to help you maintain data that is synchronized between the source and
target systems.
Contents
Overview of Compare and Repair
Before you use Compare and Repair
How to use the repair and compare commands
l compare: Compares an individual source table to its target table or compares a wildcarded set of tables
in the same schema.
l compare using: Takes input from a file to compare some or all of the tables in the active replication
configuration.
l repair: Repairs an individual target table or a wildcarded set of tables in the same schema.
l repair using: Takes input from a file to repair some or all of the tables in the active replication
configuration.
l All of the SharePlex processes (Capture, Read, Export, Import, Post) must be running when you run a
comparison or repair command.
l The tables that you want to compare or repair must be part of an active configuration file.
l Uncommitted transactions on a source table prevent the compare and repair processes from obtaining
the brief locks they need to obtain read consistency. Make certain that all transactions are committed
before you run a comparison or repair.
l If a table is large, it will probably need to be sorted in the TEMP tablespace. Before running the
compare or repair commands, the TEMP tablespace may need to be made larger. The size depends on
the setting of the SP_DEQ_THREADS parameter or the threads option within the command syntax, both
of which controls the number of processing threads used by SharePlex on the target. Each thread
processes a table. At the default of two threads, the size of the tablespace should be larger than the
sum of the sizes of the two largest tables. If you set the number of threads higher, then increase the
size of the tablespace to accommodate a proportionate number of the largest tables. However,
The following are commonly modified compare and repair parameters. Do not increase the values unless
necessary. For details about these parameters, see their documentation in the SharePlex Reference Guide.
Parameter Description
SP_DEQ_ This parameter is used on the source side to control fetch batch size. The batch size controls
MALLOC the number of rows that SharePlex selects at once for comparison. Larger batch sizes increase
processing speed but require more memory.
SP_DEQ_ This parameter manages the select statement Degree of Parallelism hint. The parallelism
PARRALLISM option of the command overrides this setting.
SP_DEQ_ This parameter controls how the repair commands work on Oracle partitioned tables,
PART_ depending on whether row movement is possible.
TABLE_
UPDATE
SP_DEQ_ This parameter controls the size of the buffer that holds fetched LONG and LOB data and can
READ_ be adjusted based on available system memory.
BUFFER_
SIZE
SP_DEQ_ This parameter sets a threshold that controls whether SharePlex uses row-level or table-level
ROW_LOCK_ locking when a where option is used.
THRESHOLD
SP_DEQ_ This parameter determines whether or not LOBs are included in the compare/repair
SKIP_LOB processing. If LOBs are not modified once inserted, you can speed up processing by setting this
parameter to 0 so that only non-LOB columns are included in the processing.
SP_DEQ_ This parameter sets a queue backlog threshold. High backlogs delay the establishment of a
TIMEOUT connection between the source and target compare/repair processes. If the backlog meets or
exceeds this value, any compare or repair command that is issued on the source will exit and
return an error. If this happens, consider running the compare or repair when the system is
less busy.
l Although the users of the tables are not usually affected by the brief locks that are applied when
tables are compared, they are locked out of the target table for the duration of the repair process. For
a small table, this might not be disruptive, but for a large table needing extensive repairs, the wait can
be significant.
l Locks on a target table can reduce posting performance if Post must wait for the repair to finish before
it can apply changes to that table and move on to other tables. This increases the latency of the target
data and causes operations to accumulate in the post queue. If the objects that Post needs to change
are different from those being repaired, the two processes run simultaneously.
l If you must repair a table immediately, but cannot tolerate locks or replication latency, you can use the
where option to limit the repair to certain rows. An alternative is to use the key option, but this option
may cause the repair to miss some out-of-sync rows.
l If the repair can wait, correct the cause of the problem immediately and then do the repair during non-
peak hours.
l Replication latency can slow down the compare and repair processing. The message sent from the
source to spawn the command processes on the target is sent through the queues along with regular
replicated data. Delays caused by a data backlog will delay the spawn message and cause the process
on the source to lose its read consistency, which results in errors. If possible, perform comparisons and
repairs during off-peak hours.
This chapter contains instructions for recovering replication along with the database and applications during a
failover in a high-availability environment. To support these procedures, SharePlex must be properly
configured to support high availability. See Configure replication to maintain high availability.
Contents
Recover replication if the primary system fails
Recover replication if the secondary Oracle instance fails
Move replication during planned failover and failback
Supported databases
Oracle database on Unix or Linux
Requirements
l SharePlex must be configured correctly to support high availability. See Configure replication to
maintain high availability.
l You must have a backup of the SharePlex replication environment.
l You must know how to run SharePlex. See Run SharePlex.
You are looking for a string that contains the string objcache_sp_opst_mt, followed by a number. This
is the object-cache file that the Post process needs. If you are using named post queues, there will be
more than one error message, each referring to a different object-cache file but ending with the same
number, such as the number .18 in the example.
4. Make a note of the full pathname of the Post object-cache file(s) named in the error message. The path
will be the state directory in the SharePlex variable-data directory, for example:
IMPORTANT! If there are more than one of these files, use the one with the most recent number at the
end of it this number should match the number at the end of the Post object-cache file, such as .18 in
the example.
7. Copy the Capture object-cache file to the primary system and rename it to the full pathname of the
Post object-cache file that you noted previously.
8. On the primary system, start Post.
sp_ctrl> start post
l no users
l an active configuration
l disabled or modified triggers, constraints, and scheduled jobs
l a stopped Export process
Supported databases
Oracle database on Unix or Linux
Requirements
l SharePlex must be configured correctly to support high availability. See Configure replication to
maintain high availability.
l You must know how to run SharePlex. See Run SharePlex.
l You must understand the activate config, reconcile, and delete queue commands. See the SharePlex
Reference Guide.
l This procedure assumes that the secondary system itself is operational so that you can interact with
SharePlex on the system.
Procedure
This procedure is divided into logical segments. Follow them in the order presented.
Supported databases
Oracle database on Unix or Linux
Procedure
This procedure is divided into logical segments. Follow them in the order presented. Do not shut down the
primary instance until prompted in the procedure.
This chapter contains instructions for making datbase changes, or performing system and software
maintenance, on systems where SharePlex replication is active.
Contents
Change an active configuration file
Add or change table specifications in an active configuration
Add Oracle sequences to an active replication configuration
Remove objects from replication
Make DDL changes in an active replication configuration
Make Oracle changes that affect replication
Change the SharePlex database account
Change the name or IP address of a replication host
Set the SharePlex port number
Supported databases
Oracle
Procedure
IMPORTANT! Do not deactivate the original configuration.
1. If the new source and target tables are populated, synchronize them according to the directions in
Activate replication in an Oracle production environment.
2. In sp_ctrl, issue the copy config command to make a copy of the active configuration file.
sp_ctrl> copy config filename to newname
Where: filename is the name of the active file and newname is the name of the new one.
3. Issue the edit config command to open the new configuration file in the default text editor.
sp_ctrl> edit config newname
4. Add the entries for the new tables or change existing entries. For example:
l To change the vertical partitioning of a table, make the required changes to the column
partition in the table specification. See Configure vertically partitioned replication for
assistance.
l To change the horizontal partitioning of a table, change the column conditions as needed in the
SHAREPLEX_PARTITION table, and change the partition scheme in the entry for that table in the
configuration file. If deleting a partition scheme, remove it from the configuration file and either
keep it in the SHAREPLEX_PARTITION table or remove it. See Configure horizontally partitioned
replication for assistance.
l To add a new target system to a partition scheme if that system is not already in a routing map
somewhere else in the configuration file, add a routing map for it in the configuration. Begin the
line with an exception marker (!) and one or more spaces, for example: ! [email protected]
5. Save the configuration file.
6. Activate the new configuration. This deactivates the original configuration.
sp_ctrl> activate config newname
7. Allow users to access the tables.
Supported databases
Oracle
IMPORTANT!
Sequences continue to be incremented even when a transaction is rolled back. If numerous rollbacks are
issued for a source table that uses a replicated sequence, it causes the sequence values to increase without
actually being used in columns in the table. As a result, when Post applies the next valid operation, the
sequence value on the target system could be less than the value in the replicated row.
When there are numerous rollbacks, view the target table regularly to ensure that the current value of the
target sequence remains greater than the maximum value in the table. If the current value of the target
sequence is less than the maximum value in the table, repeat the preceding procedure to re-establish the
sequence relationships.
Supported databases
All databases supported by SharePlex
Procedure
1. In sp_ctrl, issue the copy config command to make a copy of the active configuration file.
sp_ctrl> copy config filename to newname
Where: filename is the name of the active file and newname is the name of the new one.
2. Issue the edit config command to open the new configuration file in the default text editor.
sp_ctrl> edit config newname
3. In the new configuration file, delete the entries for the objects that you want to remove from
replication. If the object that you want to remove from replication satisfies a wildcard, use the not
notation to exclude the object. See Use Wildcards to specify multiple objects for more information.
4. Save and close the file.
5. Activate the new configuration. This deactivates the original configuration.
sp_ctrl> activate config newname
6. Allow users to access the removed objects.
Supported databases
Oracle database
Requirements
l You must know how to run SharePlex. See Run SharePlex.
l You must understand how to activate a configuration file with the activate config command.
l You must understand the SharePlexflush command. See the SharePlex Reference Guide.
Procedure
1. On the source system, stop access to the source objects (on all systems if using peer-to-peer
replication).
2. On the source system (trusted source in peer-to-peer), flush the data from the source system to the
target systems. This command stops the Post process and places a marker in the data stream that
establishes a synchronization point between the source and target data.
sp_ctrl> flush datasource
where: datasource is the database specification of the source instance, for example o.oraA.
3. On the target system (all secondary systems in peer-to-peer) verify that the number of messages in the
post queue is 0 on each system and that Post stopped.
sp_ctrl> lstatus
4. On the source system, make the DDL changes.
5. On the source system, reactivate the configuration file.
sp_ctrl> activate config filename
6. On the source system, allow user activity to resume. Their replicated changes will accumulate in the
post queue.
SharePlex resumes replication from the last stop point and the data remains synchronized.
Supported databases
Oracle on Linux and UNIX
Supported databases
All SharePlex-supported databases
Procedure
This procedure changes the user account name and/or password of the SharePlex user account in a database.
This user account is the one that the SharePlex processes use to connect to the database when performing
replication tasks.
IMPORTANT! If using multiple variable-data directories, you must run this procedure for each one that you
want to change.
1. (Unix and Linux only) If you are using multiple variable-data directories, export the environment
variable that points to the variable-data directory for the SharePlex instance for which you are running
Oracle Setup.
ksh shell:
Description
Use the provision utility to change a host name or IP address in the SharePlex configuration.
Supported databases
All databases supported by SharePlex on all supported platforms
Run provision
1. Stop sp_cop. If sp_cop is running, provision will fail. NOTE: provision prevents sp_cop from being
started while it is running.
2. Using the command line of the operating system, run provision from the SharePlex variable-data
directory with the following syntax:
provision -f old_name[:old_ipaddress] -t new_name[:new_ipaddress] [-n]
Argument Input
Example:
provision -f oldname -t newname -n
3. View the event log to view every change that was made. If the provision run fails or you do not agree
with the changes that were made, you can undo them by running the undo_provision script. See Undo
changes made by provision
Known issues
The following may occur but do not affect the integrity of the replication environment:
l The provision utility does not change the active configuration file.This means that the configuration file
no longer represents the current state of replication after provision is run. If you need to run the
compare config command, or if you decide to reactivate the configuration, update the host name or
IPaddress in the configuration file first.
l If an Export or Import error occurred when SharePlex connected to a machine before the name or
address was changed, the error status persists and cannot be cleared.
l If the new or changed machine is a source machine, provision generates new routing information, but
the Read process may still have the old routing in its cache. When you start sp_cop, Read might
generate a warning that the stored IP address does not match the one for the machine. You can ignore
this error.
l After provision is run for a source host, it might not update the "hostname" column in SHAREPLEX_ACTID
table with the new host name details. If that column is not correctly updated, you must update the
SHAREPLEX_ACTID table manually to specify the new host name. This is only required if the name
change affected a source machine.
l If your replication strategy requires multiple instances of sp_cop on a system, you must set a unique
port number for each one. See Run multiple instances of SharePlex.
l When an non-default port is required, the same number must be used for both the TCP and UDP ports,
and it must be used for the TCP and UDP ports of all other instances of sp_cop that are involved in the
same replication configuration. If the ports are different, sp_cop on one system cannot connect to the
sp_cop on another system to send or receive messages and data.
l On the Windows platform, SharePlex permits a maximum of 64 port numbers (SharePlex instances) on
one system.
1. (If using multiple variable-data directories] Export the SP_SYS_VARDIR environment variable to point to
the correct variable-data directory for the port you are setting.
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 following environment variables.
ksh shell:
export SP_COP_TPORT=port
export SP_COP_UPORT=port
csh shell:
setenv SP_COP_TPORT port
setenv SP_COP_UPORT port
where: port is the new port number
3. Change directories to the SharePlex product directory.
4. Start sp_cop and sp_ctrl. NOTE:If you are using multiple variable-data directories, start sp_cop with
the -uport option, where port is the port number that you have chosen for the variable-data directory
that you exported.
./sp_cop [-uport] &
5. Run sp_ctrl.
./sp_ctrl
6. In sp_ctrl, set the following SharePlex parameters.
set param SP_COP_TPORT port
This chapter contains procedures to follow when you need to apply an application patch or upgrade and there
is an active replication configuration. These procedures apply to Oracle databases.
Contents
Before you patch or upgrade an application
Apply patch/upgrade to source then copy it to target
Apply patch/upgrade to source and target
Apply patch to source and replicate it to the target
Does any of the following: Follow Before you patch or upgrade an application
l Adds indexes, stored NOTE:Because this procedure assumes that SharePlex can replicate all of
procedures and/or the changes that the patch or upgrade applies, the patch/upgrade is not
packages to source applied to the target.
system
l Changes users and
security on source
system (other than
SharePlex)
l Performs DML changes.
l Performs DDL changes
that SharePlex
replicates.
And:
Does not make any of the
changes listed in the
previous rows of this
table.
Adds columns that do not satisfy the column (Optional) Drop the columns from the target table after the
partition of the table patch or upgrade is applied.
Adds columns that need to be in the column Add those columns to the source and target column partition
partition of the table lists in the configuration file.
Drops columns that are part of the column Remove those columns from the source and target column
partition of the table partition lists in the configuration file.
Changes the name of a column that is in the Change the column name in the source and target column
column partition of a table partition lists in the configuration file.
Adds rows that need to be in a Add a column condition for the rows in the SHAREPLEX_PARTITION
partition scheme table.
Deletes rows that are part of a Remove the column condition from the partition scheme in the
partition scheme SHAREPLEX_PARTITION table.
l The target system of a single-direction replication configuration, including cascading and consolidated
replication.
l The secondary systems in a peer-to-peer replication configuration.
In this procedure, the SharePlex commands in the procedure apply to all sp_cop instances that apply to the
replication strategy you are using (for example, all sp_cop processes on a target in consolidated replication).
Supported databases
Oracle on all supported platforms
l Duplicate DML and DDL from the patch or upgrade operations that were replicated but also applied by
the backup.
l Production transactions that were replicated but also applied by the backup.
NOTE: It could be less time-consuming to apply a patch or upgrade manually to the target system, instead of
using a hot backup. Examples of such situations are when the operation only adds an index or stored
procedures, or when it only changes security. See Apply patch/upgrade to source then copy it to target.
Supported databases
Oracle on all supported platforms
Supported databases
Oracle on all supported platforms
This topic contains procedures for making backups of source and target Oracle data while replication is active.
Contents
Perform a partial backup of the source system
Perform a full backup on the source system
This chapter contains instructions for improving the performance of the Capture process to prevent Capture
from losing pace with the volume of redo that an Oracle source database generates.
Contents
Disable LOB Mapping
Tune Capture on Exadata
Tune checkpointing
l greater than 1.
l an even divisor of the number of disks in the ASM disk group that stores the redo logs. For example, if
there are 16 disks, the values of 2, 4, 8, and 16 are valid.
l not larger than the number of disks in the ASM disk group that stores the redo logs.
A large number of threads is not required, and performance actually diminishes with too many threads. The
more threads, the more memory Capture requires.
Start with a small number of threads and monitor performance, then add threads if needed until you obtain an
ideal balance between performance gain and memory usage. For example, if there are 16 disks, you could start
with a value of 2.
NOTE: Capture automatically adjusts its buffer size to the value of the AU_SIZEparameter that is set for the
disk group where the logs reside. This is the recommended buffer size for best performance and should not be
changed. The SP_OCT_ASM_MULTI_OCI_BLOCK_SIZE parameter can override the default behavior if necessary.
Tune checkpointing
Capture checkpoints it state to disk on a regular basis to support recovery. This information includes the log
and location within that log of the most recently processes data. In a database environment where there are
frequent log switches, a switch can occur before SharePlex writes its checkpoint. You can use the SP_OCT_
CHECKPOINT_LOG parameter to ensure that Capture issues a checkpoint before a log switch.
The checkpoint is triggered when Capture lags a specified number of logs behind Oracle. For example, with the
default of 2, Capture does a checkpoint when it falls 2 or more logs behind Oracle.
The range of permissible values for this parameter is from 2 (the default) to a value equal to the number of logs
you are using. A value of 0 disables this feature.
This chapter contains instructions for improving the performance of the Post process. Because replicated
data is applied through standard SQL mechanisms, the Post process provides the most potential for
performance tuning.
Contents
Use Oracle INDEX hints
Tune SQL Caching
Adjust open cursors
Skip large maintenance transactions
Make small transactions faster
Split a large transaction into a smaller one
When SharePlex performs UPDATEs and DELETEs on a target table, Oracle sometimes does not pick the most
efficient index for SharePlex. Without the right index, the Post process slows down when multiple UPDATEs and
DELETEs are performed. SharePlex enables you to make use of Oracles INDEX hints to enforce the use of the
correct index on target objects.
To use INDEX hints, use the hints.SID file, where SID is the ORACLE_SID of the target instance. When Post
applies a SQL statement, it reads the hints file. If the file contains entries, Post reads the data into memory and
then checks each UPDATE and DELETE statement that it processes. If any of those operations involve tables
listed in the hints file, Post sends the hints to Oracle.
Use hints only for tables that need them. For example, if Post is doing full-table scans on tables where there
are defined indexes, use hints only for those tables. The use of hints causes Post to read the hints.SID file for
each operation on tables listed in the file. This can slow down processing if numerous tables are listed.
The default maximum number of hints (table/index pairs) is 100. You can adjust this value with the SP_OPO_
HINTS_LIMIT parameter. See the SharePlex Reference Guide for more information.
Make certain all indexes are valid. Although SharePlex will use an invalid index as a hint, Oracle ignores invalid
hints and returns no errors. SharePlex writes the following information to the event_Log if it detects abnormal
conditions relating to the specified hints.
15050 hint file not found
src_owner.table tgt_owner.index
Example
scott.emp scott.emp_index
SharePlex caches frequently-used SQL statements for reuse so that they do not have to be parsed and bound
every time they recur. This is an adjustable feature of SharePlex that is named SQL Cache. You can tune this
feature to maximize its advantages based on the amount of repetitive statements your application generates.
SQL Cache improves the performance of Post only if the same SQL statements are issued over and over again,
with no variation except the data values. If that is not true of your environment, then SQL Cache adds
unnecessary overhead to the Post process, and you should disable it.
SP_OPO_ Enables or disables SQL Cache. Enabled by default with a setting of 0. To disable SQL Cache set
SQL_ the parameter to 1. To disable SQLCache only for batch operations set the parameter to 3,
CACHE_ which reduces the amount of memory that Post uses.
DISABLE
SP_OPO_ Determines the number of active statements to cache per Post session. Post opens 50 cursors
MAX_CDA per session by default. You can increase or decrease this setting if needed. See Adjust open
cursors for additional important information.
OpenTarget
Parameter Description
SP_OPX_SQL_CACHE_ Enables or disables SQL Cache. Enabled by default with a setting of 0. To disable
DISABLE SQL Cache set the parameter to 1.
Use the target Determines the number of active statements to cache per Post session. For Open
command: Target databases, Post gets the number of allowed active statements from the
ODBC driver. If that value is lower than the setting for max_active_statements,
target r.database
Post stops and returns an error. You can either disable the SQL Cache feature or
[queue queuename] set
reduce the value of max_active_statements.
resources max_
active_
statements=number_
of_active_statements
1. Determine the hit ratio for cached statements by running sp_ctrl and issuing the show post
detail command.
2. Look for the SQL cache hit count field. It shows the ratio of the total number of messages that are
executed without parsing and binding divided by the total number of INSERT, UPDATE and
DELETEoperations. For example, a hit ratio of 36% indicates that Post is using cached statements 36
percent of the time.
3. View the hit ratio after several days of typical replication activity to gauge the ideal setting for the
number of active statements. If the hit ratio is under 50 percent, increase the parameter value in a
small increment of about 5 statements.
4. Monitor the hit ratio over the next few days. If the hit ratio increases, it means your applications are
using all of the cursors allowed for active statements. Continue to increase the parameter value in
small increments until the hit ratio remains constant.
The value of the Oracle parameter OPEN_CURSORS needs to be set high enough to support the level of
performance expected of the Post process. This parameter defines the maximum number of cursors that a
process (such as Post) can open.
Internally, Post establishes its maximum total number of open cursors from the value of OPEN_CURSORS, minus
the 10 required for routine calls. You view this value in the event_log. For the following example, OPEN_
CURSORS is set to 512.
Notice: sp_opst_mt (for o.oracle-o.oracle queue oracle) Post will not open more
than 502 cursors (OPEN_CURSORS 10).
Post maintains a record of the number of cursors it has open. If Post detects that it will exceed the maximum
number of cursors, it closes the least-recently used cursor in the least-recently used session.
To avoid running out of cursors, the Post process queries the OPEN_CURSORS value when it starts. If the value is
not high enough, Post writes the following warning to the event_log:
Warning: (sp_opst_mt for o.oracle-o.oracle queue oracle)Oracle parameter 'OPEN_
CURSORS' is < number. Check 'OPEN_CURSORS' setting.
To estimate a value for OPEN_CURSORS that is high enough for the Post process
1. Estimate the peak number of concurrent transactions (sessions) that will be expected for the target
instance. Post opens a session on the target system for each one on the source system. You can get a
good estimate of the number of transactions by issuing the show post detail command in sp_ctrl when
production is at its maximum level. The Number of Open Transactions field in the display shows the
number of concurrent transactions.
2. Use the following formulas to determine the correct setting for OPEN_CURSORS to support SharePlex
(and other applications that may be accessing the target data).
SQL Cache enabled (default): By default, Post needs to reserve 10 cursors for routine calls that are
closed once they finish, plus a minimum of 7 cursors per transaction (the base minimum of 2 plus an
additional 5). The formula is:
10 + (peak number of concurrent transactions x 7) = minimum open cursors needed
SQL Cache disabled: The Post process needs to reserve 10 cursors for routine calls that are closed once
they finish, plus a minimum of 2 cursors per transaction. The formula is:
10 + (peak number of concurrent transactions x 2) = minimum open cursors needed
l Assuming there are no referential relationships between those operations and the user data, configure
those operations to process through a dedicated named post queue. For more information, see
Configure named post queues.
l Configure Post to skip the operations, and then apply the SQL statement directly through Oracle. See
the following instructions.
NOTE: Only DML operations are affected by the SHAREPLEX_IGNORE_TRANS procedure. It does not cause
SharePlex to skip DDL operations, including TRUNCATE. DDL operations are implicitly committed by Oracle, so
they render the procedure invalid.
Use the Post Enhanced Performance (PEP) feature to improve the speed of Post when it is processing mostly
small transactions, such as those most commonly found in OLTP.
This performance tool has two levels:
Example:
target r.mydb queue q1 set resources commit_frequency=10000
This diagram visually explains the concept of peer-to-peer replication. See Configure replication to maintain
multiple peer databases for more information.
SharePlex uses the following environment variables, which you may need to set in certain situations. Usually
you must perform additional steps before or after setting a variable, so refer to the recommended instructions
before setting a SharePlex variable.
EDITOR Sets the default ASCII text editor for sp_ctrl commands that use one, for
example the create config command. See Set a default editor for sp_
ctrl .
HOST Sets a host name for all locally run sessions of sp_ctrl . To set a per-
session host, see Execute commands in sp_ctrl .
SP_COP_TPORT Sets a non-default port number for an instance of SharePlex. The
default port number is 2100. You may need to set a different port
number if you are setting up additional instances of sp_cop (see Run
multiple instances of SharePlex) or if a different port number than 2100
must be used (see Set the SharePlex port number).
SP_SYS_HOST_NAME Sets the virtual IPaddress (also known as the global cluster package
name) on a clustered system, such as Oracle RAC. This variable must be
set on all cluster nodes. For more information about configuring
SharePlex in a cluster, see the SharePlex Installation Guide .
SP_SYS_VARDIR Sets the full path to the SharePlex variable-data directory so that sp_
cop can locate the configuration data, queues, logs and other
information. If there is only one instance of sp_cop on the local system,
this variable is set by default*. If there are multiple instances of sp_cop
on the local system, always set this variable to point to the correct
variable-data directory of an instance before setting any other
SharePlex variables for that instance. For more information, see Run
multiple instances of SharePlex.
*On Unix and Linux, the variable-data directory is set in the proddir/data/defaults.yaml file. On Windows, it is
set in the Windows Registry.
5. Right click the port number of the SharePlex instance to which you want to add a variable, then select
New, then String Value.
6. Under the Name column, right click the new variable, then select Rename.
7. Type the correct name.
8. Double click the new variable.
9. Under Value Data, enter the string for the new variable and then click OK.
10. Exit the Registry.