You are on page 1of 541

SharePlex ®

For Oracle
Administrator’s Guide
Version 8.0 (document revision 2)

© 2013 Quest Software, Inc. ALL RIGHTS RESERVED.
U.S. Patent Numbers: 7,065,538 and 7,461,103 Additional patents pending.
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 purchaser’s personal use without the written permission of Quest Software, Inc.
The information in this document is provided in connection with Quest 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 Quest products. EXCEPT AS SET FORTH IN QUEST'S TERMS AND
CONDITIONS AS SPECIFIED IN THE LICENSE AGREEMENT FOR THIS PRODUCT, QUEST
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 QUEST 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 QUEST HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. Quest 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.
Quest 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:
Quest Software World Headquarters
LEGAL Dept.
5 Polaris Way
Aliso Viejo, CA 92656
Email: legal@quest.com

Refer to our Web site (www.quest.com) for regional and international office information.

Trademarks
Quest, Quest Software, the Quest Software logo Simplicity at Work are trademarks and registered trademarks
of Quest Software, Inc. and its subsidiaries. For a complete list of Quest Software’s trademarks, please see
http://www.quest.com/legal/trademarks.aspx. Other trademarks are property of their respective owners.
Third Party Contributions
For a list of third party components and their applicable licensing please refer to Appendix A in the Shareplex
Administrator’s Guide.

SharePlex® For Oracle
Administrator’s Guide
Version 8.0 Updated 8/19/13

Table of Contents
About this manual

Viewing this manual in PDF format ............................................................................................ xii
Conventions used in this manual ................................................................................................ xiii
About Quest Software.................................................................................................................. xv

Chapter 1: What’s New in 8.0
TDE Support .................................................................................................................................. 1
Target Configuration...................................................................................................................... 3
Change Tracking Enhancements ................................................................................................... 6
Open Target ................................................................................................................................... 9
Consolidated Target..................................................................................................................... 13
Process Tracing............................................................................................................................ 14
Transaction Modeling .................................................................................................................. 16
NLS Simplification ...................................................................................................................... 19
Compare Status Command .......................................................................................................... 20
Compare Sanity Check ................................................................................................................ 23
Deprecated Parameters ................................................................................................................ 24
General Changes .......................................................................................................................... 24

Chapter 2: How SharePlex Works
What is replication? ..................................................................................................................... 26
The roles of source and target data .............................................................................................. 27
The role of SharePlex configurations .......................................................................................... 28
SharePlex for Oracle architecture ................................................................................................ 29
The role of SharePlex queues ...................................................................................................... 30
The SharePlex replication processes............................................................................................ 32
How SharePlex replicates data .................................................................................................... 34

iv SHAREPLEX® FOR ORACLE
Administrator’s Guide Version 8.0 Updated 8/19/13

How SharePlex uses the network................................................................................................. 35
How SharePlex reports errors ...................................................................................................... 35
The SharePlex internal tables....................................................................................................... 36
The SharePlex directories ............................................................................................................ 37
The Registry environment on Windows systems......................................................................... 41
The MKS Platform Components.................................................................................................. 42

Chapter 3: Running the SharePlex Programs
Part 1: Basic operation of SharePlex

Introduction to the SharePlex programs....................................................................................... 44
Process differences between UNIX and Windows systems......................................................... 46
System startup .............................................................................................................................. 47
Starting SharePlex........................................................................................................................ 48
Shutting down SharePlex ............................................................................................................. 52
Running sp_ctrl ............................................................................................................................ 54
Part 2: Alternative Operation of SharePlex

Starting SharePlex without starting replication processes ........................................................... 59
Running SharePlex for Oracle and SharePlex FS on the same UNIX system............................. 62
Starting sp_cop with the -u option on UNIX systems ................................................................. 63
Running multiple instances of SharePlex .................................................................................... 64
Running different versions of SharePlex concurrently ................................................................ 70

Chapter 4: Planning SharePlex Replication
Part 1: What you can replicate with SharePlex

What SharePlex replicates ........................................................................................................... 76
What SharePlex does not replicate............................................................................................... 76
SharePlex Best Practices.............................................................................................................. 77
Part 2: SharePlex replication strategies

Replication to maintain a reporting instance................................................................................ 81
Replication for high availability and data recovery ..................................................................... 83
Replication to distribute data ...................................................................................................... 84
Replication for distributed processing and load balancing .......................................................... 85
Replication using an intermediary system ................................................................................... 86

TABLE OF CONTENTS v

Replication for centralized reporting ...........................................................................................87
Peer-to-peer replication ................................................................................................................88
Part 3: Before you begin replication

Understanding synchronization ....................................................................................................90
Configuring system resources for replication...............................................................................92
Configuring the database for replication ......................................................................................95
Configuring the system for replication .......................................................................................122
Other implementation considerations .........................................................................................129

Chapter 5: Preparing for SharePlex Replication
Part 1: SharePlex configuration construction

Configuration options .................................................................................................................132
Configuration guidelines ............................................................................................................134
Components of a SharePlex configuration .................................................................................135
Routing maps in cluster environments .......................................................................................142
Routing limitations .....................................................................................................................142
Creating a basic configuration using sp_ctrl ..............................................................................145
Configuration for replicating to multiple target systems............................................................148
Configuration for isolating data using named export queues .....................................................150
Configuration for faster posting using named post queues ........................................................155
Configuration for horizontally partitioned replication ...............................................................160
Configuration for vertically partitioned replication....................................................................172
Scripting a configuration to replicate numerous tables in a schema ..........................................179
Scripting a configuration to replicate an entire database............................................................183
Part 2: Establishing replication

Establishing replication for reporting .........................................................................................186
Establishing replication for high availability and data recovery ................................................190
Establishing replication for data distribution or distributed processing .....................................194
Establishing replication through an intermediary system...........................................................197
Establishing combined cascading/broadcast replication ............................................................202
Establishing replication for centralized reporting (standard method) ........................................204
Establishing replication for centralized reporting using multiple sp_cop processes..................207
Establishing peer-to-peer replication .........................................................................................211

vi SHAREPLEX® FOR ORACLE
Administrator’s Guide Version 8.0 Updated 8/19/13

Chapter 6: SharePlex Optional Setup
Part 1: Enhancing Post performance

Using INDEX hints for faster posting........................................................................................ 238
Caching SQL statements for faster posting................................................................................ 240
Part 2: Using transformation with SharePlex

Considerations for using transformation.................................................................................... 245
Creating transformation routines ............................................................................................... 249
Creating entries for the transformation.SID file ........................................................................ 255
Changing the transformation file ............................................................................................... 257
Part 3: Setting environment parameters

Setting the SP_SYS_VARDIR environment variable ............................................................... 258
Setting an alternative port for sp_cop ........................................................................................ 259
Setting a default port for sp_ctrl ................................................................................................ 265
Defining an alternative editor .................................................................................................... 266
Part 4: Using security with SharePlex

Enhancing security with host authorization ............................................................................... 268
Data encryption and SharePlex .................................................................................................. 270
Part 5: Turning on Change Tracking

Part 6: Other optional features

Configuring SharePlex startup status on Windows systems...................................................... 276
Setting SharePlex process priority on Windows systems .......................................................... 280
Changing SharePlex Registry entries on Windows systems...................................................... 282

Chapter 7: Starting SharePlex Replication
Part 1: Synchronizing data for the first time

Synchronizing data using an Oracle hot backup on an active database..................................... 289
Synchronizing data using an Oracle hot backup on a quiet database ........................................ 296
Synchronizing data with export/import or store/restore from tape ............................................ 299
Synchronizing data with FTP..................................................................................................... 302
Synchronizing data with transportable tablespaces ................................................................... 305

TABLE OF CONTENTS vii

Part 2: Activating and deactivating configurations

About configuration activation ...................................................................................................308
Before you activate a configuration............................................................................................310
Viewing activation status............................................................................................................311
Viewing configuration statistics .................................................................................................311
Deactivating a configuration ......................................................................................................311
Part 3: Changing Configurations

Adding objects to an active configuration ..................................................................................312
Adding sequences to an active configuration .............................................................................314
Removing objects from an active configuration.........................................................................318
Changing partitioned replication ................................................................................................319

Chapter 8: Using SharePlex in a High-Availability Environment
Failing over to a secondary system after an unplanned system failure ......................................322
Failing back to the primary system after an unplanned system failure ......................................324
Restoring replication when the secondary instance fails............................................................330
Planned failover and failback .....................................................................................................334

Chapter 9: Unattended SharePlex Monitoring
Part 1: Monitoring SharePlex on UNIX systems

Overview of the SharePlex Monitoring Utilities ........................................................................340
Requirements for using the monitoring utilities .........................................................................341
Upgrade instructions...................................................................................................................342
Monitoring the Event Log with sp_eventmon ............................................................................343
Monitoring the Capture process with sp_logmon.......................................................................347
Monitoring the SharePlex processes with sp_ps ........................................................................350
Monitoring the queues with sp_qstatmon...................................................................................353
Part 2: Monitoring SharePlex on Windows systems

Overview of Sp_Nt_Mon ...........................................................................................................356
Configuring Sp_Nt_Mon ............................................................................................................357
Running Sp_Nt_Mon..................................................................................................................360

viii SHAREPLEX® FOR ORACLE
Administrator’s Guide Version 8.0 Updated 8/19/13

Part 3: Using SNMP with SharePlex

Overview of the SharePlex SNMP agent................................................................................... 361
Configuring SNMP monitoring ................................................................................................. 362

Chapter 10: Changing Oracle Characteristics Of Replicated Objects
Part 1: Performing DDL changes to replicating objects

CREATE TABLE ...................................................................................................................... 366
Making other non-replicated DDL changes............................................................................... 367
Part 2: Making other Oracle changes

Moving the location of ORACLE_HOME on UNIX systems .................................................. 369
Changing the target ORACLE_SID........................................................................................... 370

Chapter 11: Performing Administrative Operations
Part 1: Installing patches and upgrades

Installing application patches and upgrades on systems running SharePlex ............................. 380
Installing SharePlex upgrades.................................................................................................... 389
Installing SharePlex patches ...................................................................................................... 389
Downloading SharePlex .tpm files for installs, upgrades, and patches ..................................... 389
Installing OS and Oracle patches on systems running SharePlex.............................................. 389
Migrating your Oracle database................................................................................................. 390
Part 2: Administering the SharePlex Oracle account

Changing the SharePlex password on UNIX systems ............................................................... 402
Changing the SharePlex user (or user and password) on UNIX systems .................................. 406
Running ora_setup on UNIX systems........................................................................................ 407
Running OraSetup on Windows systems................................................................................... 410
Part 3: Performing other administrative operations

Performing system backups on systems running SharePlex...................................................... 412
Removing SharePlex from a UNIX system ............................................................................... 414
Removing SharePlex from a Windows system.......................................................................... 416

Chapter 12: SharePlex Utilities
Preventing DML transactions from replicating with create_ignore.sql..................................... 424

TABLE OF CONTENTS ix

Using the SharePlex trigger scripts ............................................................................................426
Viewing and manipulating queue files with qview ....................................................................428
Purging the variable-data directory with clean_vardir.sh...........................................................433
Truncating the SharePlex tables with cleanup.sql ......................................................................435
Debugging networking and/or firewall issues using the socket_test utility ...............................436
Restoring replication to an initial state with ora_cleansp...........................................................439
How ora_cleansp works..............................................................................................................439
Other alternatives to ora_cleansp ...............................................................................................439
Before running ora_cleansp........................................................................................................440
Running ora_cleansp on a UNIX system ...................................................................................441
Running OraCleanSp on a Windows system..............................................................................442
Using the SharePlex license key utilities....................................................................................444
Using the SpUtils utility .............................................................................................................451
Using the SpClient remote-access utility....................................................................................454

Glossary .......................................................................................................................................463

Index ..............................................................................................................................................483

x SHAREPLEX® FOR ORACLE
Administrator’s Guide Version 8.0 Updated 8/19/13

• Descriptions of SharePlex tuning parameters and how to set them. • Failover/failback in a high-availability environment. See the SharePlex Reference Manual for reference information that you will need from time to time. For instructions on installing the SharePlex software. It includes: • Descriptions and syntax for sp_ctrl commands that monitor and control replication. • Using the SharePlex utilities. • Tools and tips for preventing and solving common replication problems. see the SharePlex Installation and Demonstration Guide. • Performing administrative operations on replication systems. ABOUT THIS MANUAL xi About this manual This manual provides instructions for: • Operating SharePlex. . • Planning and implementing a replication strategy.

.com. The PDF document is viewable with Adobe Acrobat® Reader Version 7 or 8 which is free software that can be downloaded from the Adobe web site at http://www.adobe.xii SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8.0 Updated 8/19/13 Viewing this manual in PDF format This manual is available in Adobe® PDF format on a documentation CD provided with the SharePlex software and from the Quest SupportLink web site at http://support.quest.com if it is not installed on your system.

• [Brackets] represent optional command components and may also be used in exam- ple command strings to emphasize required user defined variables in long strings. Click Apply. Find the value for ORACLE_HOME. Examples: The sp_ctrl program is located in the bin directory. • Bold represents required components of a command or option that must be typed as shown. Examples: sp_ctrl(sysA)> User is a viewer (level=3) . programs. System displays. or “pipe” character ( | ) within brackets or braces indicates that you can use only one of the enclosed components. other names are expressed in capital letters using the default font. ABOUT THIS MANUAL xiii Conventions used in this manual The following typographic conventions are used in this guide. The following explains the syn- tax components. Open the oramsglst file. • {Braces} enclose available required arguments. Command-line syntax is expressed in Arial Narrow. such as prompts and command output. are expressed in Courier. named or entered by the user. • Bold Italics represents required user defined variables in example command strings. Example: reconcile queue {queuename} for {datasource-datadest} [on host] • A vertical bar. directories and files are expressed in Arial Bold. • Italics represent variables defined. Example: abort service {service | all} Names of commands.

The following icons are used to highlight important or helpful information: This icon This icon This icon calls This icon refers denotes addi. prevent prob.xiv SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. that can help cal issues that documentation tion that you you save time or must not be for more infor- should know. and so forth. and options within dialog boxes are expressed in Arial Bold. System names are expressed generically or fictitiously. lems. select Print. with italics and bold styles used either for emphasis or warnings. SysD. Target systems (or secondary systems) are referred to as SysB. the source sys- tem (or primary system) is referred to as SysA. SysC. mation. Text is set in Times New Roman. denotes advice attention to criti.0 Updated 8/19/13 Windows menu items. you to related tional informa. Example: From the File menu. When necessary. . dialog boxes. ignored.

Quest Sup- port provides unlimited 24x7 access to our Support Portal at: http://quest.quest. Inc. Contact Quest Support Quest Support is available to customers who have a trial version of a Quest product or who have purchased a Quest product and have a valid maintenance contract. you can do the following: • Retrieve thousands of solutions from our Knowledge Base • Download the latest releases and service packs • Create. visit www. update and review Support cases . CA 92656 USA Web site: http://www. From our Support Portal. monitoring.com. identity and access management. Quest products solve complex IT challenges ranging from database management. Accessibility Quest Software is committed to providing products and solutions that are accessible to all people regardless of their capabilities.com/support.aspx.quest. data protection. user workspace management to Windows management. Quest Software (Nasdaq: QSFT) provides simple and innovative IT management solutions that enable more than 100.com Refer to our Web site for regional and international office information.000 global customers to save time and money across physical and virtual environments. ABOUT THIS MANUAL xv About Quest Software Established in 1987.quest. For more information.com Mail: Quest Software. Contact Quest Software Email: info@quest. Section 508 compliance details are available by product in the Voluntary Product Accessibility Templates (VPATs) published on our web site at: http://www.com/public-sector/vpat. World Headquarters 5 Polaris Way Aliso Viejo.

com/support. The guide is available at: http://quest. .xvi SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. and policies and procedures. contact information. online services.0 Updated 8/19/13 View the Global Support Guide for a detailed explanation of support programs.

Limitations are: • Support limited to Oracle 11G • Cannot use the "copy" command for any table with encrypted data • Does not include support for encrypted SecureFile LOBs To check whether the Oracle database is "encryption replication" ready do the follow- ing: • Check to see that the kernel is ready by looking for the symbol 'kzekm_get_dek': nm $ORACLE_HOME/bin/oracle | fgrep kzekm_get_dek • Check that the following file exists: ls $ORACLE_HOME/rdbms/admin/prvtclkm.0 can support encrypted data whether the column. Setup A separate key is used to provide SharePlex access to the encrypted data. download and apply Oracle Patch 10395645.0 support encrypted column support was added to SharePlex. the table. 1 What’s New in 8. Note that closing the wallet disables TDE within Oracle which might require application downtime. or the tablespace is encrypted. SharePlex version 8. the wallet must be closed and then reopened in order to make the key visible to Oracle.6. To define the key and initiate its use in Oracle: .plb If the above checks fail. Because the wallet is changed outside of Oracle. The key is defined in the wallet using the external utility "mkstore".0 This release of SharePlex includes the following new features: TDE Support In release 7.

.2 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. close it and re-open it using sqlplus: alter system set encryption wallet close identified by "<password>".6.0 release: 1 Verify that the source database is "encryption replication" ready as described above.6.OK The Shareplex TDE Shared Secret parameter has not been specified yet. 2 Create Shareplex's stored secret in the wallet. alter system set encryption wallet open identified by "<password>".CL. Enter the shared secret : Please confirm the shared secret : Again. run ora_setup in each instance to define the SharePlex key for each SharePlex instance Upgrade Upgrading from 7.ENCRYPTION. The SharePlex encryption key will be defined for Shareplex during this interchange: Do you want to enable replication of tables with TDE? [y] : If the answer is yes. The next step is to run ora_setup. copy the new wallet to each node and then perform steps 3 & 4 on each of the other nodes.0 Updated 8/19/13 1 Create the wallet directory if necessary. If the database is RAC.x requires special care if the 7. 4 Switch the log file: alter system switch logfile. ora_setup will prompt for the Shareplex encryption key: Checking the TDE Support procedures. and you are using copies of the wallet on each node.SECURITY. Note that In order for capture to decrypt the data the SharePlex user must have sysdba privileges. 2 Create the SharePlex encryption key as described above (this may require down- time). and if SharePlex is installed on each instance.SPLEX 3 If the wallet is open in the database. $ORACLE_BASE/admin/ <instance-name>/wallet. For instance.. The mkstore utility will prompt for the key: mkstore -wrl <path for wallet> -createEntry ORACLE.x instance is using column encryp- tion support as provided in the 7.. if the database is RAC. Ora_setup will detect that the version is "encryption replication" ready and will ask whether encryption replication is desired.6.

1. The following is the type of information configured using the target configuration: • List of metadata columns Post will update on the target table • The names of the metadata columns if not using the default names • Source id values for a consolidated post (Consolidated Target) • Long parameter values such as URI for JMS queue (Open Target) The target configuration is identified by the name of the target sid. or all. target show . of the target's configuration.0. Type 'help target' and a command action for a full description and syntax . 7 The source activity can be restarted. 4 Upgrade to 8. To get basic help for the target command: sp_ctrl > help target Define target configuration. CHAPTER 1 3 What’s New in 8. The command name is “target”. 5 Run ora_setup.Display part. target reset . 6 Bring up SharePlex and re-activate immediately. target set . Target Configuration Target configuration capability has been added to SharePlex to provide for configura- tion that is more complex than was provided by the paramdb.Reset a value in the target's configuration.Set a value in the target's configuration.0 3 Quiesce the source TDE tables. specify the SharePlex encryption key when prompted as described above.

value used for 'source' metadata jms .4 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. Usage: target {target} [queue {queuename}] set metadata {metadata list} target {target} [queue {queuename}] set source {source id} target {target} [queue {queuename}] set jms {keyword=value} Types of configuration data metadata .parameters for jms target Type 'help target' and the type of data to set for a full description .0 Updated 8/19/13 For help on setting a value in the target configuration: sp_ctrl > help target set Set a value in the target's configuration.metadata to be updated on the target source .

op. .ora112 queue prod1932 set metadata host:my_column_name If you want Post to update the time. and 'custom column name' is the user defined name of the column in the target table Keyword Column type Default column name Description -------. userid. op:my_op. you would use the following command: target o.) scn NUMBER SHAREPLEX_SOURCE_SCN Source SCN when operation was applied rowid ROWID SHAREPLEX_SOURCE_ROWID ROWID of row that changed trans VARCHAR2 SHAREPLEX_SOURCE_TRANS Transaction ID for the operation seq NUMBER SHAREPLEX_OPERATION_SEQ Operation order within transaction host VARCHAR2 SHAREPLEX_SOURCE_HOST Source host queue VARCHAR2 SHAREPLEX_QUEUENAME Queue name source VARCHAR2 SHAREPLEX_SOURCE_ID User defined source identifier Example with default column names: target o. scn .0 The ‘set metadata’ command defines which metadata columns Post will update for either a change tracker target table or a replication target table. . CHAPTER 1 5 What’s New in 8. scn. DELETE.. . and you want to change the name of the op column to my_op.orasid queue prod1932 set metadata time. UPDATE. op and scn metadata columns. For detailed help on set- ting metadata: sp_ctrl > help target metadata Configuration: metadata to be updated on the target Usage: target {target} [queue {queuename}] set metadata {metadata list} target {target} [queue {queuename}] reset metadata target {target} [queue {queuename}] show metadata When the target is a table in Oracle: 'metadata list' is: keyword[:custom column name].orasid set metadata userid.----------. keyword[:custom column name]. rowid Example with user defined column name: target o. userid.----------------------------- time TIMESTAMP SHAREPLEX_SOURCE_TIME Time operation applied on source userid NUMBER SHAREPLEX_SOURCE_USERID User ID that performed operation op VARCHAR2 SHAREPLEX_SOURCE_OPERATION Type of operation (INSERT..------------------------. .

1 from VARCHAR2 to TIMESTAMP.sql script to specify the column name being used.value used for 'source' metadata jms . For upgrades. If the name of the "time" metadata column in the target table is not "SHAREPLEX_SOURCE_TIME". the SHAREPLEX_SOURCE_TIME column in existing target tables can be changed from VARCHAR2 to TIMESTAMP by running the upgrade_cdc_timestamp_column script which can be found in the <optdir>/ util directory: <optdir>/util/upgrade_cdc_timestamp_column.0.6 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8.0 Updated 8/19/13 You can issue the ‘help target source’ command for help on setting the source which is used for Consolidated Target.metadata to be updated on the target source . . or all. several enhancements have been made to the Change Tracking functionality. of the target's configuration. You can also issue the ‘help target JMS’ command for help on setting the target JMS which is used for Open Target.parameters for jms target Type 'help target' and the type of data to show for a full description Note that the type of the "time" metadata column in the target table changed in 8. Usage: target {target} [queue {queuename}] show target {target} [queue {queuename}] show metadata target {target} [queue {queuename}] show source target {target} [queue {queuename}] show jms Types of configuration data metadata . Change Tracking Enhancements In 8.0. For help on how to display the existing configuration: sp_ctrl > help target show Display part.sql The script will change the type of the SHAREPLEX_SOURCE_TIME column and con- vert the column data. modify the upgrade_cdc_timestamp_column.

see Deprecated Parameters. Note: If the source table is an IOT. For information on how deprecated parameters are handled after the 8. the ROWID column will be set to "AAAAAAAAAAAAAAAAAA". CHAPTER 1 7 What’s New in 8." in front of it instead of the "o.1. the SP_OPO_TRACK_CHANGES parameter will be in effect until the source configuration is changed and activated. Data type of SHAREPLEX_SOURCE_TIME column changed When the change tracking functionality was introduced. For upgrades.0 Control changed from parameter to source configuration Change tracking functionality was introduced in version 7.2 or 7. the SHAREPLEX_SOURCE_TIME column in existing target tables can be changed from VARCHAR2 to TIMESTAMP by running the .0.<target sid> There are two important features of a change tracker configuration entry: 1 The target table name is prefixed with the string "!cdc:" (case insensitive) 2 The target sid has a "c. In 8. SP_OPO_TRACK_CHANGES has been depre- cated.6.6. the SHAREPLEX_SOURCE_TIME column was a VARCHAR2 type column. this designation is now done using the configuration on the source rather than using this parameter on the target. In 8. on the target. To configure a change tracker stream.sql will add the column SHAREPLEX_SOURCE_TIME column as TIMESTAMP.0.2. This was done via the parameter.6. In that release.table <target host>@c. SP_OPO_TRACK_CHANGES. it is of type TIMESTAMP. use the following new control in the source dur- ing setup: owner. The add_change_tracking_columns.0. a Post process could be designated for applying change information to the target table(s) instead of performing replication." For those upgrading from 7.0 upgrade.3 to 8.table !cdc:owner. Note: Since it is no longer being used.

is set to 1. the "UPDATE BEFORE" record may not include the before image of a changed non-key column. or source configuration). modify the script to specify the column name being used. There are more choices in columns that the change tracker post can be configured to update. the change tracker post process will update the same seven metadata columns that were updated by the 7.0 provides the user with the means to cus- tomize the metadata columns that are updated in the target table by change tracker post. New parameter: SP_OPO_TRACK_PREIMAGE I restart_process int(0:1) 0 Note: If the SP_OPO_TRACK_PREIMAGE parameter is set to 1.sql script will operate on a column named "SHAREPLEX_SOURCE_TIME". Users define which columns change tracker post will update and can also specify names for the columns other than the ones defined in 7. If a post process is configured as a change tracker post (whether by parameter. SP_OPO_TRACK_PREIMAGE.0 Updated 8/19/13 upgrade_cdc_timestamp_column script which can be found in the <optdir>/util direc- tory: <optdir>/util/upgrade_cdc_timestamp_column.6. New parameter to track pre-image Change Tracker can now be configured to track the update pre-image as well as the result of the update. If the name of the source time metadata col- umn in the target table is not "SHAREPLEX_SOURCE_TIME".2.2 change tracker post: . and there is no target configuration for that post process. If the new parameter. Configure which metadata columns to update A new target configuration mechanism in 8. Note that the upgrade_cdc_timestamp_column. the post process inserts two rows for every update: one with the key columns and the before image of the updated columns ("UPDATE BEFORE") and the other with the key columns and the after image of the updated columns ("UPDATE AFTER").6.8 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8.sql The script will change the type of the SHAREPLEX_SOURCE_TIME column and con- vert the column data.

refer to the section Target Configuration. Currently the follow- ing JMS providers are supported: • ActiveMQ • OpenMQ Note: To support this functionality. Note: JMS broker should be configured to allow producer to automatically create queues or the destination queue must be manually created prior to send messages.0. JMS broker should be configured with proper authentication credentials for the producer user and SharePlex should be similarly configured to use the same authentication credentials SharePlex will need access to the provider JAR files. PK/UK supplemental logging must be enabled on the source table. SharePlex requires an Oracle client even if the SharePlex install is on a machine that will only write to JMS. SharePlex provides ability to post changes to a JMS queue. SharePlex installation will create the following directory: <opdir>/lib/providers .0 SHAREPLEX_SOURCE_TIME TIMESTAMP SHAREPLEX_SOURCE_USERID NUMBER SHAREPLEX_SOURCE_OPERATION VARCHAR2(20) SHAREPLEX_SOURCE_SCN NUMBER SHAREPLEX_SOURCE_ROWID ROWID SHAREPLEX_SOURCE_TRANS VARCHAR2(60) SHAREPLEX_OPERATION_SEQ NUMBER For details on defining and using the target configuration. CHAPTER 1 9 What’s New in 8. The post process will not write data changes in a transaction to the JMS until post has received the commit for the transaction and has resolved all rollbacks. Open Target In 8.

or consists of.TABLE !jms prodsys PROD.TABLE !jms prodsys:myjms expand PROD. For instance: <opdir>/lib/providers/activemq/activemq-all.jms".10 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8.jar Use the following syntax in the source configuration file to configure a stream replicat- ing to JMS: <source specification> !jms[:target table] <hostname[:queuename]> The following configuration lines are valid: PROD. to a directory created under the providers directory (best practice is to use the provider name).% !jms prodsys Note that if the target table name is preceded by. . a target sid can- not be specified.TABLE prodsys PROD.0 Updated 8/19/13 After installing SharePlex on the target machine.jar <opdir>/lib/providers/activemq/slf4j.TABLE !jms:LOCAL. SharePlex will define the target as "x. copy the JAR file. and any JAR file dependencies it may have. "!jms:".

url) destination queue JMS destination type (queue or topic) factory_name connectionFactory JNDI connection factory lookup names (jndi. provider_url and lib_location.-----------------. password Password of user attaching to JMS persistent yes JMS delivery mode (yes or no) queuename OpenTarget Name of JMS queue session transacted no Local (session) transactions are enabled user Username attaching to JMS *-Required parameter Example: target x.ActiveMQInitialContextFactory”: sp_ctrl> target x. see the section “Target Configuration Reference” below). CHAPTER 1 11 What’s New in 8.naming..apache.ActiveMQInitialContextFactory Note that if the parameter is being set for a specific open target process.initial) * lib_location Location of provider .-------------------------------------- * factory_class FQDN connection factory class name (java.name1.jndi.activemq. For example.jar files under <optdir>/lib/providers * provider_url Provider URL (java.jndi.provider.jms queue jmsdata set jms factory_class = org.name) or (jndi.activemq.jms set jms factory_class = org.apache..factory.activemq.. to set the factory_class for any open target process to “org. The factory class (java.factory.jndi.naming. For example.naming.ActiveMQInitialContextFactory .name2. if the queue name was “jmsdata”: sp_ctrl> target x.initial) is the JNDI environment property speci- fying the class name of the initial context factory for the provider (for more information about this and the other JMS target parameters.jndi. use the queue option.0 Use the target command (Target Configuration) to manage required and optional param- eters for connecting to the JMS queue: sp_ctrl (alvspxl11:8567)> help target jms Configuration: parameters for jms target Usage: target {target} [queue {queuename}] set jms {keyword=value} target {target} [queue {queuename}] reset jms {key} target {target} [queue {queuename}] show jms 'keyword' is one of: Keyword Default value Description ------------.apache.jms set jms user = jwalters There are three required parameters: factory_class.

jms set jms provider_url=tcp://w2k3-64bit:61616 The “lib_location” should be set to the directory name under which the JAR files were copied.naming. if the JAR files were copied into <optdir>/lib/providers/activemq. For example.12 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8.provider. to set the provider URL to “tcp://w2k3-64bit:61616”: sp_ctrl> target x.0 Updated 8/19/13 The provider URL (java.url) is the JNDI environment property speci- fying the location of the registry being used as the initial context. For example.jms set jms lib_location = activemq The datatypes supported are: Oracle Type XML Type BLOB base64Binary CHAR string CLOB string DATE dateTime FLOAT decimal LONG string NCHAR string NCLOB string NUMBER decimal NVARCHAR2 string RAW base64Binary ROWID string VARCHAR2 string INTERVAL YEAR TO MONTH yearMonthDuration INTERVAL DAY TO SECOND dayTimeDuration TIMESTAMP dateTime TIMESTAMP WITH TIME ZONE dateTimeStamp . enter the following command: sp_ctrl> target x.

For instance.0 TIMESTAMP WITH LOCAL TIME dateTimeStamp ZONE Note: If the source table is an IOT. CHAPTER 1 13 What’s New in 8. they might be configured as follows: target cons11 queue prodsys718 set source eastern target cons11 queue prodsys92 set source south target cons11 queue prodsys101 set source 12345 The post process for queue “prodsys718” will update column SHAREPLEX_SOURCE_ID with the value “eastern” for every insert or update to a table. The name of the column that is updated with the source id value can also be configured. In the example above. Consolidated Target In an environment where the data from multiple source databases is being replicated to the same target database. if there are three post processes. The following configuration will satisfy this requirement. In addition. each posting data from a different source database. new configuration parameters can be used to cause post to update a column that will differentiate the data in the target database. These parameters allow you to add a column to the target table that will be set to a different value by every post process. This functionality is configured using the new Target Configuration. the compare process will use the source id column and value to select only the rows that are valid for that source. Any target configuration entry that is entered without a queue name specification will be applied to all queues: target cons11 set metadata source:source_name target cons11 queue prodsys718 set source eastern target cons11 queue prodsys92 set source south target cons11 queue prodsys101 set source 12345 . the ROWID column value will be "AAAAAAAAAAAAAAAAAA". the name of the source id column on all target tables is “SOURCE_NAME”.

Opening/reopening file.Getting data. The filename has the form: <process_id>_trace_<time> For example: ora112_ocap_trace_Feb_5_17_24_2013 ora112_ord_trace_Feb_5_17_24_2013 ora112_spdl02_opo_trace_Feb_5_17_24_2013 The "trace capture" command outputs process utilization data. the process writes out the trace data to a file in the var- dir/log directory. 24% .14 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. The new commands are: trace capture [minutes] [for datasrc] trace read [minutes] [for datasrc] trace post [minutes] [for datasrc-datadst] [queue quename] When the trace time is complete.0 Updated 8/19/13 Process Tracing The trace command can be used to get performance and process activity about capture.Waiting to send data to next thread RAC threads: Data read Time spent in thread Instance 1 0% 91% .Idle waiting for data Instance 2 99% 44% . The following example is for a capture trace where the source SID is a RAC database: CAPTURE TRACE: Started: Sun Feb 3 15:51:55 2013 Completed: Sun Feb 3 15:52:56 2013 Time Elapsed #Operations Kbytes read Kbytes processed %Processed 1:01 0 215885 62 0% Time breakdown: Idle Processing QWrite Other 0:47 0:04 0:00 0:10 77% 6% 0% 16% Log reader threads: %Data read Time spent in thread Instance 1 0% 50% .Idle waiting for data . 39% . read and post.

In addi- tion. 4% ."SRC_TEST4" 4820 108 0 Insert "ELLIOT".Getting data Sequencer thread: 95% .0. ----.0.Idle waiting for data. ------. CHAPTER 1 15 What’s New in 8. --------."SRC_TEST3" 3126 123 0 Insert "ELLIOT"."SRC_TEST5" 4282 125 0 Insert "ELLIOT". as well as breakdown of the most costly operations.Idle waiting for data The "trace read" command has been in the product since SharePlex version 6. ----."SRC_TEST6" 7409 123 0 Insert "ELLIOT"."SRC_TEST1" 1008 125 0 .---- Insert 716 0% 2 2% Update 84 0% 0 0% Delete 172687 58% 65 69% Commit 24 0% 0 0% Batch Delete 123706 41% 24 26% Operation Table Avg(usec) Count Total(sec) --------. Here is an example of the output: POST TRACE: Started: Tue Dec 18 18:44:13 2012 Completed: Tue Dec 18 18:47:16 2012 Number Executions Cost Operation Count Pct Seconds Pct --------. the trace output is written to a separate file instead of reader's process log. It writes out utilization information about time spent getting the Oracle key.0 Instance 2 99% 85% . ---------- Insert "ELLIOT". In SharePlex 8.---. ----. the following statistics have been added to the output: ============================ Statistics================================== Total Time Total op Oracle time SharePlex time %Idle 1:02 1638 0:00 0:06 90% The "post trace" command generates timing information for the different operations.

"SRC_TEST6" 149 39281 5 Transaction Modeling It can be helpful when setting up replication configuration to have information about the activity of the tables that need replication.16 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8."SRC_TEST4" 263 39128 10 Batch Delete "ELLIOT"."SRC_TEST2" 2697 17 0 Delete "ELLIOT"."SRC_TEST1" 8761 16 0 Update "ELLIOT". The following must be considered to analyze a datastream: • Run the analysis in a separate replication stream if SharePlex is already installed as the analysis will behave the same as activation • Create a configuration file including all the tables that are being considered for replication. The SharePlex analyze feature has been intro- duced to provide this information. There cannot already be an active configuration: Usage: analyze config <filename> [<number of hours>] [<number> hours] [<number> minutes] ."SRC_TEST3" 336 95412 32 Commit 4078 24 0 Batch Delete "ELLIOT"."SRC_TEST5" 182 39098 7 Batch Delete "ELLIOT". start cop and then issue the following command."SRC_TEST3" 274 6199 1 Batch Delete "ELLIOT"."SRC_TEST6" 7668 15 0 Delete "ELLIOT"."SRC_TEST1" 439 38177 16 Delete "ELLIOT"."SRC_TEST6" 10631 19 0 Update "ELLIOT". To analyze."SRC_TEST2" 426 39068 16 Delete "ELLIOT".0 Updated 8/19/13 Update "ELLIOT"."SRC_TEST4" 15986 23 0 Update "ELLIOT".

quest.0 [<number> days] [on {host}] | [on {host}:{port}] | [on {login}/{password}@{host}] | [on {login}/{password}@{host}:{port}] For instance: analyze config testconf 5 days SharePlex will start a replication stream."SRC_TEST3" at 03/17/12 10:59:17 Activation id : 1573 Operations processed : 1497 Transactions processed : 398 .---------.w111a64f Running 2968 Analyze o. CHAPTER 1 17 What’s New in 8.-------------------.com Operations Source Status Processed Since Total Backlog ---------.w111a64f Running 2976 The analyze process can be stopped and started and the show command will display per- tinent information: sp_ctrl (alvspxl11:8567)> show analyze detail Host: alvspxl11.---------. Capture will be started and then the analysis process which is the end of the stream: sp_ctrl (alvspxl11:8567)> show Process Source Target State PID ---------.--------------.-----------------------.------ Capture o.w111a64f Running 1497 17-Mar-12 10:41:54 1496 0 Last operation processed: Redo log: 295 Log offset: 32327800 UPDATE of "TEST".---------- o.-----------.-----------------.

"SRC_TEST3" 178 "TEST"."SRC_TEST6" 174 Tablename Inserts Updates Deletes Rollbacks Total "TEST".0 Updated 8/19/13 Analysis complete : 20-Mar-12 10:41:54 The analyze process will write out the analysis based upon the data gathered at the time specified and then the replication stream will clean itself up.<actid> The analyze process maintains information about the activity for each object in replica- tion as well as transaction information."SS2_TEST3" 306 Group 2 of related tables: 1124 total operations in group "TEST". The transaction information is used to identify groups of tables that are inter-related in such a way that they should be replicated in the same stream.w111a64f-analysis. The analysis will be written out in the vardir/log directory."SRC_TEST5" 188 "TEST". For example: >cat o."SS2_TEST2" 146 169 33 0 348 "TEST"."SS2_TEST1" 346 "TEST"."SRC_TEST1" 232 "TEST"."SRC_TEST2" 177 "TEST"."SRC_TEST4" 175 "TEST". the total number of operations per table . and the total number of operations for the group. The analysis can be com- pleted early by issuing the "abort config" or "deactivate config" commands or by modi- fying the SP_ANL_RUN_TIME parameter.1575 Activity Analysis Group 1 of related tables: 1000 total operations in group "TEST". The name of the file is: o. The analysis will list out each group of related tables.<datasource>-analysis.18 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8."SS2_TEST1" 140 176 30 0 346 ."SS2_TEST2" 348 "TEST".

Deprecated parameters: SP_ORD_NLS_LANG SP_OPO_NLS_LANG SP_OPO_CHARACTERSET SP_OPO_NCHAR_CHARACTERSET SP_DEQ_NLS_LANG SP_DEQ_NLS_LANG_SELECTOR SP_DEQ_CHARACTERSET SP_DEQ_NCHAR_CHARACTERSET Note: For information on how deprecated parameters are handled after the 8."SRC_TEST2" 69 77 21 10 177 "TEST". CHAPTER 1 19 What’s New in 8. SP_OPO_NLS_CONVERSION int(0:1) 1 # Convert by default Note that the various parameters pertaining to NLS language conversion in previous versions have been deprecated as of 8."SRC_TEST6" 61 79 25 9 174 NLS Simplification A new parameter. determines whether or not the data posted by SharePlex is converted from the source character set to the target character set."SRC_TEST1" 75 114 29 14 232 "TEST".0 but will still work in an upgraded environment."SRC_TEST4" 54 89 19 13 175 "TEST".0 "TEST".0 upgrade. . SP_OPO_NLS_CONVERSION. see Deprecated Parameters."SRC_TEST3" 69 73 28 8 178 "TEST"."SS2_TEST3" 116 158 32 0 306 "TEST"."SRC_TEST5" 61 94 22 11 188 "TEST". The default behavior is to convert.

In this release the ‘show compare’ command has been replaced by the new status com- mand output that is similar to the ‘copy status’ output. . copy.0 Updated 8/19/13 Compare Status Command In SharePlex version 7. The status command for jobs is now: Usage: [job] status [all] | [{job_id}] | [{job_id}. append. Note: The execution of commands that have been de-supported in this release will return the output from the closest corresponding new command. To get status for the compare/ repair command use the new 'compare status' or 'repair status' command instead of 'show compare'.20 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8.6. the compare command interface was replaced with an inter- face similar to the copy/append command.{table_id}] [full] [detail] ["{status}"] [for o.{source_sid}] [on {host}] | [on {host}:{port}] | [on {login}/{password}@{host}] | [on {login}/{password}@{host}:{port}] Note that the word "job" in the above command can be replaced by any of: compare. repair.

"SRC_TEST5" Init 0:01 27498 0:01 Note that 3 objects are complete.com Started : 06-NOV-12 11:07:05 Job Type : Compare Status : Processing ."SRC_TEST6" Skipped ."SRC_TEST3" Out Sync N/A 19 100 0:06 4 "SCOTT".---------. CHAPTER 1 21 What’s New in 8.6 objects completed ID Tablename Status Time Total Rows %Comp Total Time -----."SRC_TEST1" Out Sync N/A 19 100 0:05 3 "SCOTT".---------.----.3 objects completed ID Tablename Status Time Total Rows %Comp Total Time -----.--------- 1 "SCOTT".---------.----. and those that are in a failed state.---------.--------------------.---------.0 The command will display the line items currently active. When done the job status indicates the job is complete and how many items compared: Job ID : 861 PID : 20571 Host : alvspxl11."SRC_TEST3" Out Sync N/A 19 100 0:06 6 "SCOTT".com Started : 06-NOV-12 11:07:05 Job Type : Compare Status : Processing . but one of those is not listed as it is in sync."SRC_TEST4" WaitMarker 0:02 27392 0:04 5 "SCOTT".quest."SRC_TEST1" Out Sync N/A 19 100 0:05 3 "SCOTT".---------. For instance: Job ID : 861 PID : 20571 Host : alvspxl11.--------- 1 "SCOTT".--------------------.quest.

----. use the full option: sp_ctrl (alvspxl11:8567)> compare status full Job ID : 861 PID : 20571 Host : alvspxl11.---------.--------------------.22 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8."SRC_TEST4" In Sync N/A 27556 100 0:05 5 "SCOTT"."SRC_TEST6" Skipped .---------."SRC_TEST1" Out Sync N/A 19 100 0:05 2 "SCOTT".--------- 1 "SCOTT".---------.0 Updated 8/19/13 To display the status with all the items listed.6 objects completed ID Tablename Status Time Total Rows %Comp Total Time -----."SRC_TEST5" In Sync N/A 27578 100 0:05 6 "SCOTT".quest.com Started : 06-NOV-12 11:07:05 Job Type : Compare Status : Done ."SRC_TEST2" In Sync N/A 27297 100 0:08 3 "SCOTT"."SRC_TEST3" Out Sync N/A 19 100 0:06 4 "SCOTT".

If the difference in the number of rows is large enough."SRC_TEST6" alvspxl11. CHAPTER 1 23 What’s New in 8. Compare gets the source and target row count using the row count from the last analy- sis. SP_DEQ_COPY_CHECK_ROWS. the process is inefficient.quest. Status Elapsed : N/A Total Elapsed : 0:06 Compare Sanity Check When a compare is run against a target table that is very different from the source table."SRC_TEST6" From : alvspxl11. Use copy command or re-issue with 'override' option.0 To display detail information about one line item: sp_ctrl (alvspxl11:8567)> compare status 861. the compare or repair will not run. In this scenario.w111a64f To : "COPY".prod. SP_DEQ_COPY_CHECK_ROWS int(0: 2147483647) 50000 . If they are not the same.w111a64f Started : 06-NOV-12 11:07:18 Percent complete : N/A Total Rows : 53741 Rows processed : N/A Status : Skipped Status Detail : The difference in size between source and target is too large to process : efficiently.000’. To guard against the compare command being used in this case. and if either the source row count or the target row count is greater than the number defined in the new parameter. a sanity check has been added.6 Job ID: 861 Table ID: 6 Compare "SCOTT".corp@o.quest. The default value for SP_DEQ_COPY_CHECK_ROWS is ‘50. the copy command should be used as it is much more efficient. then the compare is not run. and if the difference between the two values is greater than 1000000 rows or 20%.com@o. It compares the number of rows in the source and target tables.

Deprecated Parameters New in 8. General Changes Additional Data Type Support SharePlex now supports Binary Float and Binary Double. or on the tablespace: COMPRESS FOR QUERY [ HIGH | LOW ] COMPRESS FOR ARCHIVE [ HIGH | LOW ] Queue shared memory size for post queue The queue shared memory size parameter. Deprecated parameters cannot be set in 8. If you do not want SharePlex to use the deprecated parameter.0 Updated 8/19/13 To override the sanity check. A parameter that had been set in the paramdb in a prior release is still available and used by SharePlex in the release where the parameter was flagged as deprecated.0. Use the set param command with the queue ov for option. SP_QUE_POST_SHMSIZE. HCC Support SharePlex now supports Oracle’s Hybrid Columnar Compression on Exadata. Share- Plex supports the replication of tables where one of the following compression options were specified on the table. re-issue the compare command with the 'override' option.24 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. you can issue the reset command on it. . a parameter can be flagged as “DEPRECATED”.0. For example: set param SP_QUE_POST_SHMSIZE queue specialque 134217728 SharePlex cop must be restarted for the parameter to take effect. can be set for individual post processes.

Read this chap- ter before any others because it explains terms and processes that you need to know before you establish and begin replication. Contents What is replication? The roles of source and target data The role of SharePlex configurations SharePlex for Oracle architecture The role of SharePlex queues The SharePlex replication processes How SharePlex replicates data How SharePlex uses the network How SharePlex reports errors The SharePlex internal tables The SharePlex directories The Registry environment on Windows systems The MKS Platform Components . 2 How SharePlex Works This chapter provides an overview of how SharePlex replication works.

These copies are used if the production system needs to be offline for backups or routine maintenance (high availability). so the alternate database is an up-to-date representation of the original data. The reports provide the same results as if you had run them on the production system. without interrupting production processing. SharePlex replication SharePlex transcends the issues with other technologies in several ways: • SharePlex replicates only the changes that are made to the production data. Data can be updated or available. see the Introduction in the SharePlex Installation & Demonstration Guide. but not both. those solutions have sig- nificant shortcomings because they require choosing between replication and access. greatly improving the performance of online transaction processing (OLTP) on that system.0 Updated 8/19/13 What is replication? Replication is the process of maintaining copies of production data that can be used as alternate data sites on other systems. getting stale as time passes.26 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. • Alternate databases maintained by SharePlex can be used in read-only mode to offload query and report processing from the production system. or in an emer- gency when the production system fails (disaster recovery). but only if no one is accessing it. • SharePlex replicates continuously as changes are made. They are static copies of the production data at a specific point in time. Other replication technologies can update a replicated copy of data. For more information about SharePlex benefits. Other replication options A simple backup restored on an alternate system can be considered a form of replica- tion. . but they are equally insufficient because they negatively affect production processing in order to maintain a copy. so it is very fast and lightweight — but also accurate. Although better than relying on simple backups. Other solutions are available. but with the same limitations as those associated with snapshots or export/import.

Likewise. This data is called the source data. see Chapter 4 and Chapter 5. sending data to other target systems. In addition. A source system can have many target systems. FIGURE 1: Examples of source and target systems For more information about the ways to establish replication for your database environ- ment. and it can simul- taneously serve as a source system. . The object of replication is to keep the source and target data identical. and the machine it is copied to is the target system. SharePlex can even be configured to replicate between tables on the same system. the two sets of data are synchronized or in sync. a source system can simultaneously serve as a target system. CHAPTER 2 27 How SharePlex Works The roles of source and target data SharePlex replication uses the concepts of source and target. When target data is identical to source data. The copy of the data is called the target data. As changes are made to source data. taking into account varying differences caused by delays in transport over a network. a target system can receive data from many source systems. The source system is the primary system that contains the original data to be replicated. SharePlex continuously replicates them to an Ora- cle instance on the target system. receiving data from other source systems. either within the same database or in different databases. SharePlex replication is much more versatile than simply replicating data from one machine to another.

[o. Configurations reside in the con- fig sub-directory on the source system and define the following: • The datasource — the ORACLE_SID of the source Oracle instance that contains the source data to be replicated. Multiple configurations.sales jane. see Chapter 5.sales] • The target objects — the names of the objects in the database on the target system that will receive the replicated data.salary jim.oraA #source objects target objects routing map jim. which are user-defined specifications that tell SharePlex which objects to replicate and where to send the data.oraA] • The source objects — the names of the objects within the source database that con- tain the source data to be replicated. You create a configuration file in an ASCII text editor.sales sysB@o. but only the changes made to objects within it. the datasource specification directs SharePlex to the one containing the data specified in the configuration. Datasource: o. [jim.0 Updated 8/19/13 The role of SharePlex configurations SharePlex gets its replication instructions from configurations. Datasource is a SharePlex term for the Oracle instance containing the source data to be replicated.28 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. replication begins. any intermediary systems or named queues. SharePlex does not replicate the instance itself. can be active at the same time. A basic routing map includes the target system(s). . Important! Do not confuse datasource with source data.oraB] This is an example of a basic SharePlex configuration.sales] • The routing map — the route for transporting the data. [jim. Because there can be several Oracle instances on a system.salary and jane. You can replicate some or all of the tables and sequences within a database. and the ORACLE_SID of the target database. For more information about creating a configuration.oraB jane. but only one of them can be active at a time. [sysB@o.salary and jane. When you activate a configuration. each replicating a dif- ferent Oracle instance.salary sysB@o.oraB You can create as many configurations as you need for a source Oracle instance.

there could be multiple Export and Post processes and queues. . CHAPTER 2 29 How SharePlex Works SharePlex for Oracle architecture FIGURE 2: This illustration explains the basic SharePlex replication process. Depend- ing on how you establish your replication configuration.

30 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. for example. By default. and it holds the data outside the Oracle instance for further process- ing by SharePlex. or when replica- tion is started again. For example. SharePlex continues replicating from the point where it stopped and sends the accumulated data to the next process on its route. A capture queue is identified by the datasource. one capture queue for each Oracle instance. Export Queue The export queue resides on the source system. If a system slows down or fails. Data travels through the queues in the sequence in which it was gener- ated. It holds data that has been processed by SharePlex and is ready for transport to the target system. The data is written to disk within a few seconds if the receiving process has not received it and acknowledged its receipt. It helps SharePlex obtain data from the Oracle logs quickly. On each target system.0 Updated 8/19/13 The role of SharePlex queues Queues are interim data repositories that hold replicated data (target data) as it is trans- ported from the source system to the target system. there is one export queue on a source system regardless of the number of active configurations or target systems. When the system or connection is restored. asynchronous transport of data. The replication process that sends data to a queue and the process that reads the queue establish handshaking to acknowledge receipt of the data in the correct order. if OraA and OraB are both . there is one post queue for the replication stream between a source and target Oracle instance. or if connections fail or a replication process stops. It holds data that is ready for writing to the target database. Queues are part of a checkpoint recovery system that facilitates safe. A default export queue is identified by the name of the source system on which it resides. data accumulates in the queues.oraA. Post Queue The post queue resides on the target system. There is one capture queue for each datasource being replicated — in other words. Data is not read-released (deleted) from one queue until it is written to the next one. SharePlex replication uses the following queues. for example o. You can instruct SharePlex to create additional named export queues for more complex replication strategies. Queues function outside the Oracle instance being replicated so that the I/O required to maintain them does not affect access to the source data by the production applications. Capture Queue The capture queue resides on the source system. SysA.

Queue names are case-sensitive on all platforms. CHAPTER 2 31 How SharePlex Works replicating to OraC.oraB). . Note: All SharePlex queue files are created and maintained in the rim sub-directory of the SharePlex variable-data directory. You can instruct SharePlex to create additional named post queues for more complex replication strategies. A default post queue is identified by the name of the source system and the source and target Oracle instances. for example SysA (o.oraA-o. there are two post queues.

0 Updated 8/19/13 The SharePlex replication processes SharePlex replicates data using a series of replication processes. where it accumulates until the next Share- Plex process is ready for it. By default. Cap- ture writes the data to the capture queue. These processes start automatically as they are needed. which moves data between systems over a TCP/IP net- work. There is a separate Read process for each data- source. Import builds one post queue on a target system for each datasource being replicated from the source system. . The Read process is named sp_ordr (Oracle Reader) and resides with the other SharePlex processes in the bin sub-direc- tory of the SharePlex product directory. also commonly called services. there are two Import processes. The Import pro- cess is named sp_mport and resides with the other SharePlex processes in the bin sub-directory of the SharePlex product directory. and so forth. The Capture pro- cess is named sp_ocap (Oracle Capture) and resides with the other SharePlex pro- cesses in the bin sub-directory of the SharePlex product directory. The following describes the SharePlex replication processes in their functional order. 3 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. There is a separate Capture process for each datasource being replicated. there are two Export processes. and so forth. see Figure 2 on page 29 in this chapter. 4 The Import Process: The Import process is the second half of the Export/ Import transport pair. By default. Each Export process controls transmission of all data from all configurations that are replicating from a source system to a target system. If there are two source systems replicating to a target system. If there are two target systems. By default. after processing the data it sends it to the next queue. all Read pro- cesses on a system share the same export queue. each functioning concurrently and independently. a source system has one Export process for each of its target systems. but they can be con- trolled with commands issued by a SharePlex user. 2 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.32 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. each functioning concurrently and independently. 1 The Capture Process: The Capture process reads the redo logs or archive logs on the source system for changes to objects listed in the active configuration. The Export process is named sp_xport and resides with the other SharePlex processes in the bin sub-directory of the SharePlex product directory. The Export process is the first part of the Export/Import transport pair. For a visual representation of the SharePlex sequence of events. operating on the target system to receive data and build a post queue.

. and it resides with the other SharePlex processes in the bin sub-direc- tory of the SharePlex product directory. Note: SharePlex binaries reside in the bin sub-directory of the SharePlex product direc- tory. The Post process is sp_opst_mt. construct SQL statements for replicated operations. 5 The Post Process: The Post process operates on the target system to read the post queue. There is a Post process for each post queue on a target system. CHAPTER 2 33 How SharePlex Works Note: For replication between Oracle instances on the same system. Export and Import processes are not created. and multiple Post processes can operate simultaneously on a system. The Read process places data directly into a post queue on that system. and apply them to target objects.

the Post process compares a pre-image of the values of the source columns to the existing values of the target columns. In general. such as array inserts of small records. Other operations. The pre-image is the value of each changed column before the UPDATE. have the inverse effect: There could be one record for numerous opera- tions. From the information that it has about an operation. then Post logs the operation to an error file and SharePlex returns an “out-of- sync” error.The following explains how SharePlex builds its SQL statements on the target system. • If the change is an INSERT. SharePlex uses only the key to build a WHERE clause to locate the correct row. Large operations like those on LONG or LOB columns can require more than one mes- sage because a message has a size limitation. In this way. Before applying changes to the database. COM- MIT. depending on the data. On the target system. (For more information about keys. SharePlex constantly validates the target data. For example. If the pre-image and the existing target values match. If a table lacks a key. SharePlex replicates only the changes made to the source data. Post applies the changes.0 Updated 8/19/13 How SharePlex replicates data SharePlex reads the blocks of the redo logs for operations that need to be replicated. TRUNCATE or a supported DDL operation. SharePlex creates one or more mes- sages that are sent from Capture to the Read process. • If the change is a DELETE. If not. UPDATE. SharePlex simulates one using the val- ues in all of the columns. A message can reflect a SQL operation or an internal SharePlex operation. an array insert of 70. providing a fast and reliable replication solution. SharePlex determines which operations to replicate based on the information provided in the configuration file and in the object cache that is constructed when a configuration is activated. SharePlex uses all of the columns in the row to build an INSERT statement. see Chapter 4. you can assume that the number of messages that you see in a process or queue status dis- play approximately corresponds to the same number of SQL operations. the Post process receives the messages and constructs standard SQL statements to post replicated changes to the target database. but most of the time it is an INSERT. DELETE. . except LONG and LOB columns. confirming a synchronized state. SharePlex uses the key and the values of the changed columns to build a WHERE clause to locate the correct row. unless you are replicating numerous changes to LONGs and BLOBs.34 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8.) • If the change is an UPDATE.000 rows might be accommodated with only 700 messages. and from Read to all of the other replication processes in sequence.

• SharePlex reports operational errors. which is a file named event_log that resides in the log sub-directory of the SharePlex variable-data directory. When the network is unavailable. while conserving communication band- width. Ordinarily. You can control when SharePlex uses the network. It contains a detailed summary of the conditions reported in the Event Log. for example. How SharePlex reports errors SharePlex reports errors and other abnormal conditions in the following ways. but you can delay transmission by stopping the Export process — to send data when network connections cost less. SharePlex recovers from network failures. including . CHAPTER 2 35 How SharePlex Works • If the change is an UPDATE or DELETE statement that affects multiple rows on the source machine. For example. This design also minimizes latency between source and target systems. using an asynchronous stream protocol with TCP/IP con- nections that is very efficient for large data transfers. rather than on a commit or refresh schedule. notices and warning conditions to the Event Log. It can be viewed directly from the UNIX com- mand-line or through the sp_ctrl command-line interface. data is transferred from source to target continuously. SharePlex can replicate over any TCP/IP network. Because SharePlex replicates changes as they occur. SharePlex will issue multiple statements on the target to complete the task. The data remains safely in the export queue until you start Export again. including WAN environ- ments. it reduces the impact of replication on the network and does not cause spikes in network performance. The Event Log provides a perpetual step-by-step record of the replication process. • The Status Database is generated when you issue the show statusdb command. How SharePlex uses the network All communication and movement of data by SharePlex is handled by an internal mes- saging and transport system. SharePlex detects when the network is available again and resumes transmission. This method delivers optimal performance. reliability and restart capabilities. the UPDATE statement update tableA set name = ‘Lisa’ where rownum < 101 will actually send 100 UPDATE statements through the SharePlex pipe even though only one statement was issued on the source. data is queued on the source system.

it logs the first 100 SQL statements and data for the out-of-sync transactions to an error file on the target system named SID_errlog.36 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. TABLE NAME DESCRIPTION SHAREPLEX_ACTID Each row in this table corresponds to a configura- tion activation. The tables reside in the SharePlex schema and belong to the SharePlex Oracle user account. SHAREPLEX_OBJMAP This table contains the object ID records for each configuration activation. which is used for key caching. . SHAREPLEX_DATAEQUATOR This table maintains information when the com- pare command has been issued. (SID is the ORACLE_SID for the target instance. For more information about these and other tools for problem-solving. The Status Database is viewed through the sp_ctrl command-line interface. see Chapter 2 of the SharePlex Reference Manual. so do not alter them in any way. SHAREPLEX_MARKER This table is updated whenever SharePlex gener- ates a read-consistency marker.) You can use this log to determine the extent of the out-of- sync condition. purge config. SHAREPLEX_LOBMAP This table maintains information about LOBs when they are being replicated. SHAREPLEX_COMMAND This table controls the flush. It also contains the last checkpoint from the redo log. and you can use the SQL statements to repair target tables if the con- dition is not too severe.0 Updated 8/19/13 events that did not generate an error message or warning at the sp_ctrl user inter- face. • When the Post process detects that source and target tables are out of synchroniza- tion. The SharePlex internal tables Much of the replication process is controlled and tracked through a series of internal tables that were installed when you ran ora_setup during the installation of SharePlex. They are essential for SharePlex to operate. and abort config commands. This information alerts you to potential problems and helps you resolve exist- ing ones. SHAREPLEX_CONFIG A new row is inserted into this table whenever a new configuration is activated.sql. after first correcting the cause of the problem.

Some directories contain hidden files that are essential for replication. Some files appear empty but must exist under their original names because they are referenced by one or more SharePlex processes. log files and other components that comprise the current replication environment are stored. DEMO_SRC This table is used as the target table for the Share- Plex demonstrations. The sub-directory structure within the two main directories differs slightly between the UNIX and Windows platforms. where the queue files. respectively. DEMO_DEST This table is used as the source table for the Share- Plex demonstrations. a Quest Systems Consultant. SHAREPLEX_TRANS This table is used by the Post process to keep track of the state of the transactions it is processing. . but the basic structure appears as follows: SharePlex product directory on UNIX systems: • bin contains executables for running SharePlex. Some items in the util sub-directory are for use only under supervision of Quest Techni- cal Support or by Quest Systems Consultants in conjunction with a support call or via- bility evaluation or installation. rename or edit any files or directories installed by SharePlex unless you are directed to do so by Quest Technical Support. or a doc- umented SharePlex procedure. In addition. If you do not find documentation for something in the util sub-directory or another SharePlex direc- tory. do not attempt to run it. where the SharePlex pro- grams and libraries are stored. files and directories often vary from ver- sion to version of SharePlex as features and functionality change. and the variable-data directory. • data contains default parameter settings. Utilities meant for general use in a production environment are documented in the published SharePlex documentation. These directories are often referred to as productdir and vardir. The SharePlex directories SharePlex uses two main directories—the product directory. and some files might exist in a Windows version but not in a UNIX version (or vice versa). CHAPTER 2 37 How SharePlex Works SHAREPLEX_PARTITION This table maintains information when partitioned replication is used. Do not remove.

. • dump contains core files in the event of process failure. • util contains SharePlex utilities. • state contains information about the current state of SharePlex when a configura- tion is active. • data contains the Status Database. configuration activation information. • temp is used by copy/append and other SharePlex sync related processes. user- defined parameter settings. licensing and upgrades. • lib contains SharePlex shared libraries. • .app-modules is a hidden internal directory that contains raw executables which cannot be launched directly as they require environment parameters. • rim contains the replication queue files.0 Updated 8/19/13 • install contains scripts relating to installation. SharePlex variable-data directory on UNIX systems: • config contains configuration files for this installation of SharePlex. • .app-modules directory is a hidden directory and should not be used to launch processes. • save contains information about active and inactive configurations. and other user-defined files that direct certain replica- tion activities. SharePlex users will encounter errors if processes are launched from this directory. • log contains SharePlex log files. such as the object and sequence caches.meta-inf is a hidden internal directory that contains meta information used during the installation process.38 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. • db contains a configuration database for each activation. Note: The .

the variable-data directory is installed inside the product directory. • util contains SharePlex utilities. • The product directory also contains installation-related programs and files. • data contains default parameter settings. On Windows systems. the variable-data directory and the product directories are sepa- rate directories under splex. while on UNIX systems. as well as the variable-data directory. CHAPTER 2 39 How SharePlex Works SharePlex product directory on Windows systems • bin contains executables for running SharePlex. . Note: The directory structure in Windows differs from the directory structure in UNIX.

configuration activation information. • state contains information about the current state of SharePlex when a configura- tion is active.0 Updated 8/19/13 SharePlex variable-data directory on Windows systems • config contains configuration files for this installation of SharePlex. • dump contains core files in the event of process failure. • data contains the Status Database. .40 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. • log contains SharePlex log files. and other user-defined files that direct certain replica- tion activities. • save contains information about active and inactive configurations. • rim contains the replication queue files. user- defined parameter settings. • db contains a configuration database for each activation. such as the object and sequence caches.

Each instance of SharePlex is defined in the Registry as a port num- ber. it refers to the Windows Registry for default directory locations and other environment information. . Warning! Do not add. CHAPTER 2 41 How SharePlex Works The Registry environment on Windows systems SharePlex does not utilize a marker file on Windows systems as it does on UNIX sys- tems. Instead. The SharePlex Registry location is: \HKEY_LOCAL_MACHINE\Software\Wow6432node\Quest Software\SharePlex That is where any environment variables must be entered. consult your Systems Administrator for assistance. change or remove Registry entries unless you are familiar with the functionality of the Registry and the Windows platform. Errors when changing Registry settings can adversely affect the operation of the software or the system itself. such as SP_SYS_VARDIR as shown in Figure 3. and each has its own set of environment variables. If you are not familiar with the Registry.

42 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8.” The default folder for MKS Toolkit is C:\Program Files\MKS Toolkit. The MKS Toolkit files must not be moved after they are installed. The MKS Toolkit runs as a service and enables SharePlex to be ported to the UNIX and Windows platforms in a uniform manner. “Mortice Kern Systems. other than to ensure that its service is running when the SharePlex service is running. There is a Windows Registry entry for MKS Toolkit under the manufacturer’s name. The MKS Toolkit is installed in automatic startup mode by default when it is installed during SharePlex installation.0 Updated 8/19/13 The MKS Platform Components SharePlex on the Windows platform uses the MKS Toolkit® operating environment from Mortice Kern Systems (MKS). SharePlex users have no interaction with the MKS Toolkit software. . but a different folder might have been selected during installation.” and another under the name “DataFocus.

3 Running the SharePlex Programs This chapter explains how to run the two main SharePlex programs. sp_cop and sp_ctrl. and monitor replication status. The chapter is divided into parts. create configurations. Contents Basic operation of SharePlex Alternative Operation of SharePlex . and the second part addresses advanced methods of operation. You need to know how to run these two programs in order to establish replica- tion. control replication. The first part addresses basic operation of the Share- Plex software.

Import. Export. the SharePlex control pro- gram. sp_ctrl There is an sp_ctrl command-line interface on each system involved in replication. Once started. There is an sp_cop process on each system involved in rep- lication. sp_cop The sp_cop program coordinates the main SharePlex processes (Capture. The sp_cnc process works in the background. In general. It contains the following topics: • Introduction to the SharePlex programs • Process differences between UNIX and Windows systems • System startup • Starting SharePlex • Shutting down SharePlex • Running sp_ctrl Introduction to the SharePlex programs There are two programs with which users interact: sp_cop. most SharePlex users have little interaction with sp_cop other than to start and stop it. and sp_ctrl. which is an sp_cop child process that executes user commands. direct and monitor SharePlex activities. and users do not interact with it at all.0 Updated 8/19/13 Part 1: Basic operation of SharePlex This section introduces you to the SharePlex programs and explains basic ways to run them. Read. sp_cop runs in the background. Post) and the SharePlex queues. It also maintains communication with other systems in the replication network. stop. and it initiates all of the other background pro- cesses that perform specific tasks. You will do most of your interacting with SharePlex through sp_ctrl by issuing commands that start. configure.44 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. . The sp_ctrl program interfaces with the sp_cnc (command and control) process. the command-line user interface.

CHAPTER 3 45 Running the SharePlex Programs FIGURE 4: The sp_cop and sp_ctrl processes .

exe process. • One Sp_Xport (Export) process plus one child Sp_Copsrv. there is an additional Sp_Copsrv. . Read. Export. sp_ctrl spawns the background processes such as sp_cnc. sp_cop. On the target system • One parent Sp_Copsrv.46 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8.exe process for each one. For a standard uni-directional configuration replicating through default queues to one target system.exe process. Each instance of sp_cop that you start is a parent to its own set of child replication processes. runs as a service. • One Sp_Ocap (Capture) process plus one child Sp_Copsrv. • One Sp_Opst_Mt (Post) process plus one child Sp_Copsrv.). How SharePlex runs on UNIX systems On UNIX systems. you start SharePlex by running sp_cop. In the Task Manager it appears as Sp_Copsrv. • If there are any additional SharePlex processes running. Once you start sp_cop and sp_ctrl.exe service. Post. you start SharePlex. • One Sp_Ordr (Read) process plus one child Sp_Copsrv. sp_ctrl. on source and target machines independently.exe. It appears as SharePlex [port#] in the Services console panel.exe process spawns child Sp_Copsrv. there would be the following processes: On the source system • One parent Sp_Copsrv.exe process. The parent Sp_Copsrv. After you success- fully activate a configuration. SharePlex. spawns the necessary child replication processes. Import. The operating system controls the parent Sp_Copsrv. • One Sp_Mport (Import) process plus one child Sp_Copsrv. like Oracle. such as sp_ctrl. When you start the SharePlex service.exe process. and so forth.exe process.exe process. How SharePlex runs on Windows systems On Windows. such as Capture and Export.0 Updated 8/19/13 Process differences between UNIX and Windows systems There are some differences in the way the SharePlex software runs on UNIX and Win- dows systems.exe process.exe processes — one for each replication process (Capture.

look in the SharePlex Event Log for the message stating when the replication process started.exe processes consume less memory than the parent process. look for the one that is using the largest amount of memory. the SharePlex processes do not start. How to identify Sp_Copsrv. 6 Verify that the SharePlex processes are started by issuing the lstatus command. there is an additional Sp_Copsrv. 2 Start the Oracle instance(s). See “The MKS Platform Components” on page 42 for more information about the NuT- CRACKER service. Important! When SharePlex is running. . such as sp_ctrl.exe process. CHAPTER 3 47 Running the SharePlex Programs • If there are any additional SharePlex processes running.exe process for each one.exe process.exe will be running. System startup When you start systems that are involved in replication. The child Sp_Copsrv.exe process in the Windows Task Manager. To identify which replication process is associated with a child Sp_Copsrv. 3 Start SharePlex (instructions follow). This entry provides the PID for that process and the PID of the associated Sp_copsvr. or start the network later to control user access. the NuTCRACKER service must be running. If there are no active configurations. and just the parent Sp_Copsrv. start the components in this order: 1 Start the system. sp_ctrl(sysA)> lstatus 7 Start the network if it was not started earlier. 4 Start sp_ctrl (instructions follow).exe processes on Windows systems To identify the parent Sp_Copsrv. 5 [OPTIONAL] Start the network.

because the way it handles background processes is not compatible with SharePlex. follow these guidelines: • Only a SharePlex Administrator (member of the SharePlex admin group) can start sp_cop. Do not use the Bourne shell (sh).0 Updated 8/19/13 8 Allow users on the system. switch shells to ksh or csh to run Share- Plex. Capture can keep pace with the changes. If SharePlex has not captured all of the changes before the logs wrap. Startup precautions When starting replication. . then exit the shell and return to the Bourne shell. If Capture loses pace with Oracle’s processing.48 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. • Start sp_cop as soon as (or before) users access the data on the source system. so that all essential SharePlex processes are ready to start replicating transactions. • sp_cop must be running on all source and target systems involved in replication. Starting SharePlex on UNIX systems You can start sp_cop in one of two ways: • From the operating system command line • At system startup as part of the startup file Run SharePlex from either the korn (ksh) or C shell (csh) shell. Familiarize yourself with this procedure before using more advanced methods of run- ning SharePlex. 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. That way. it accesses the archive logs. If you must use the Bourne shell. In that case. it might be more practical to resynchronize the data. the redo logs could wrap before Cap- ture is finished reading them. but by then there could be unacceptable latency between source and target data. Starting SharePlex This section shows you the basic method for starting a single instance of SharePlex.

Your user name must be assigned to the SharePlex Admin group in the /etc/ group file. 2 Start sp_cop either by typing its full directory path. and then the UNIX prompt reappears... If a configura- tion was activated during a former session of sp_cop. Configure Oracle to start before SharePlex. then running sp_cop. replication begins immediately. CHAPTER 3 49 Running the SharePlex Programs Warning for Exceed X users: When using an Exceed X window emulator. or by changing directories to the bin sub-directory of the SharePlex product directory. Without an active configuration. To start sp_cop on a UNIX system at machine startup You can add the sp_cop & command to your system's rc files so that replication begins at system startup. The system returns a process ID number for this session of sp_cop. then run sp_cop from the ksh shell only. Use the & to run it in the background. sp_cop runs passively in the background. . Syntax $ /productdir/bin/sp_cop & Or. To start sp_cop at the UNIX command line 1 Log onto UNIX as a SharePlex Administrator using your UNIX password and user name. switch from the default shell of POSIX to the ksh shell. $ cd /productdir/bin $ ./sp_cop & Every session of sp_cop has a process ID number.

. replica- tion cannot take place. The nohup command directs a com- mand (in this case the startup of SharePlex) to continue in the background after the cur- rent user (the script) logs out.edu) Bad file number Can't dup2 stderr.mcit. start or stop the SharePlex service. 3 Click the SharePlex Services tab.med.. Or. SharePlex is installed in auto-startup mode. SharePlex returns an error similar to "System call error: sp_cnc (connecting from cdrpx. Your user name must be assigned to the SharePlex Admin group. When you are directed in a documented SharePlex procedure to start or stop sp_cop on the Windows platform. 2 Double-click the SpUtils desktop shortcut. then select Programs and navigate to SpUtils in the SharePlex product group." try adding nohup to your startup script. The SharePlex Utilities dialog box opens. You can change the startup option in the Computer Management Administrative Tool in Win- dows. .0 Updated 8/19/13 If. If the SharePlex service is not running.50 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. The syntax is: #!/bin/ksh cd [product_dir]bin nohup sp_cop & Starting SharePlex on Windows systems Because SharePlex runs as a service on the Windows platform.umich. the only way to start sp_cop is to start the SharePlex service. which starts the SharePlex service automat- ically when the system starts so that replication begins as soon as possible. when the script runs. Click the Start button on the Windows taskbar. To start the SharePlex service 1 Log onto Windows as a SharePlex Administrator using your system password and user name.

Always enter a license key when you reinstall SharePlex after an uninstall. . the paramdb file is retained and the license remains intact. See page 454 for more information. 6 When the Current State text box shows that the service has started. it checks for a license key. 5 Under SharePlex Service Status. select the port number for the instance of SharePlex that you want to start. it stops running. click Start. which is overwrit- ten if you uninstall and then reinstall SharePlex. During upgrades. Tip: You can control the SharePlex service from a remote system with the SpClient util- ity. CHAPTER 3 51 Running the SharePlex Programs 4 In the Port list box. If it does not find a valid license. Important! When SharePlex starts. The license key is stored in the paramdb file. click Close to close the dialog box.

You can safely shut down SharePlex while users are accessing the database and there is an active replication configuration. do so after you shut down SharePlex. Reasons to shut down SharePlex include. Your options in that case depend on your environment. Warning! If you intend to shut down Oracle. especially if the Capture process must read the archive logs and transaction volume is high. Shutting it down stops replication. Otherwise. Cautions when stopping SharePlex Use caution when stopping replication if users continue changing data and you want to maintain data synchronization. including available disk space for the queues and your tolerance for latency between source and target data. It might be more practical to resynchronize the data than to wait for SharePlex to process back- logged operations. SharePlex resumes replication at the point in the redo log where it stopped. you can shut down the network and the system. SharePlex will interpret that the instance is failing and generate a warning message. resynchronization is the only option. it can lose pace with Oracle’s processing. After you shut down Oracle.0 Updated 8/19/13 Shutting down SharePlex Normally. but are not limited to: • to cease replication • to activate certain parameters • to run a SharePlex utility • when required by a documented SharePlex procedure or with direction from Quest Technical Support. If the redo logs wrap and the archive logs are unavailable. If you delay starting SharePlex again. . See the SharePlex Reference Manual for more information on this and other SharePlex commands. You can stop individual SharePlex replication processes without shutting down Share- Plex completely by using the stop command in sp_ctrl. and it accesses the archive logs if the redo logs have wrapped (if archive logging is enabled).52 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. you should leave SharePlex running as long as you have data to replicate.

.. 3 Click the SharePlex Services tab. Your user name must be assigned to the SharePlex Admin group. Shutdown can take some time if SharePlex is processing large Oracle oper- ations. performs a checkpoint to disk. This is a graceful shutdown that saves the state of each pro- cess. similar to using the shutdown command in sp_ctrl. see the SharePlex Reference Manual. Syntax sp_ctrl(sysA)> shutdown You can use the [force] option with the shutdown command to forcefully shut down replication if necessary. and removes child pro- cesses. The SharePlex Utilities dialog box opens. Data in the queues remains safely in place. you can shut down SharePlex by stopping the SharePlex service. Or. ready for processing when sp_cop starts again. It is a graceful shutdown. 2 Double-click the SpUtils desktop shortcut. you can shut down SharePlex through sp_ctrl with the shutdown command. then select Programs and navigate to SpUtils in the SharePlex product group. For more information about the shutdown command. It terminates sp_cop immediately. Click the Start button on the Windows taskbar. read/releases buffered data. bypassing normal shutdown procedures. . Stopping the SharePlex service (Windows) On Windows systems. 1 Log onto Windows as a SharePlex Administrator using your system password and user name. CHAPTER 3 53 Running the SharePlex Programs Shutting down through sp_ctrl (UNIX and Windows) On UNIX and Windows systems.

5 Under SharePlex Service Status. and monitor SharePlex activities. otherwise it displays an error message similar to this: Your tcp port is not set properly or “sp_cop” is not running. See page 454 for more information. .0 Updated 8/19/13 4 In the Port list box. Tip: You can control the SharePlex service from a remote system with the SpClient util- ity. stop. configure. Running sp_ctrl The SharePlex sp_ctrl command-line interface program is where users do most of their interacting with SharePlex. From sp_ctrl. you can issue all of the commands that start. 6 When the Current State text box shows that the service has stopped. select the port number for the instance of SharePlex that you want to shut down. control. SharePlex must be running in order to run sp_ctrl.54 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. click Stop. click Close to close the dialog box.

CHAPTER 3 55 Running the SharePlex Programs Any SharePlex user can run sp_ctrl. Substitute the name of the command for commandname in the fol- lowing syntax. You can run sp_ctrl from each machine where SharePlex is installed. spopr (operator). enter the full path name of the sp_ctrl binary. followed by the command name. There are two ways to run sp_ctrl: • from the UNIX command line or the Windows Command Prompt console to issue a single command. Syntax On UNIX platforms: $ /productdir/bin/sp_ctrl commandname on hostname Or… $ cd /productdir/bin $ . or from just one machine to control all other replication machines. such as checking replication status then stopping a SharePlex process. and spview (viewer). The command executes then returns you to the command-line prompt. Note: The sp_ctrl command line allows a total of 256 characters. Substitute the name of the system for hostname in the following syntax. including spaces. even if being run locally. The sp_ctrl program resides in the bin sub-directory of the SharePlex product directory. To run sp_ctrl for one command At the command-line prompt. but in order to execute a command. the command may need to be enclosed within double quotes. for example “d:\Program Files\Quest Software\Share- . The authorization level corresponds to one of the SharePlex user groups: SharePlex Admin group (administrator). a user must have that command’s authorization level or higher. • through an interactive session during which you issue multiple commands./sp_ctrl commandname on hostname On Windows platforms: C:\>drive:\productdir\bin\sp_ctrl commandname on hostname Important! If the Windows path name contains spaces.

as shown in the following example. the command may be followed by a prompt for the user name and password. When the sp_ctrl prompt (sp_ctrl>) appears./sp_ctrl To start a session of sp_ctrl on Windows systems. Tip (Windows): If your sp_ctrl window does not have a scroll bar and command output cannot be displayed in its entirety. double-click the Sp_Ctrl desktop shortcut or use any other Windows method for starting programs. on Windows system. The remote login options are explained in more detail in Chapter 1 of the SharePlex Reference Guide. Syntax $ /productdir/bin/sp_ctrl Or… $ cd /productdir/bin $ .0 Updated 8/19/13 Plex\bin\sp_ctrl”. After sp_ctrl executes a command. To connect to an alternate sp_cop port number When you start sp_ctrl on UNIX systems. If it cannot find the port there. it reads the param-defaults file and uses the default port number of 2100. If the command you are issuing permits remote login.56 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. Additionally. $ /productdir/bin/sp_ctrl status on hostname:portnumber To run sp_ctrl interactively for multiple commands To start an interactive session of sp_ctrl on UNIX systems. see Chapter 1 of the SharePlex Reference Guide for instructions for displaying a scroll bar. The sp_ctrl prompt remains until you exit the interface with the exit or quit command. the interactive session is ready for you to enter one or more SharePlex commands. enter the full path name of the sp_ctrl binary from the command line. you can use one of its remote login options to affect a different system or port number than the default. it reads the paramdb file for the port number for sp_cop. it returns you to the sp_ctrl prompt. or change directories to the bin sub-directory of the SharePlex product directory and run sp_ctrl from there. To run sp_ctrl for an instance of sp_cop other than one .

sp_ctrl> quit As an alternative on Windows systems. To connect to a differ- ent port number than the default. Syntax sp_ctrl> host hostname The prompt now looks like this example: sp_ctrl(sysA)> To exit sp_ctrl To exit the sp_ctrl command-line interface on a UNIX or Windows system. to the one with the lowest port number. CHAPTER 3 57 Running the SharePlex Programs assigned a port number in either the paramdb or param-defaults file. start sp_ctrl and use the port command to specify the alternative port number. is lost when you exit sp_ctrl. start sp_ctrl and use the port command to specify the alternative port number. To define a default system for sp_ctrl To define a default machine where you want all commands to execute for an interactive session of sp_ctrl. If there is no value specified there. Note that the alternative port number is session-specific and thus is lost when you exit sp_ctrl. Syntax sp_ctrl> exit Or. Note that when you define a different machine (other than port number 2100) as the default. type either the exit or quit command at the sp_ctrl prompt. sp_ctrl reads the Registry for a default port number specified with the DefaultPort entry in \HKEY_LOCAL_MACHINE\SOFT- WARE\Wow6432node\Quest Software\SharePlex. . issue the host command. This enables you to enter a series of com- mands without using the [on host] option for each command. therefore.. if there are multiple instances of SharePlex on the system. sp_ctrl connects to port number 2100 by default or. On Windows systems.. the new setting is ses- sion-specific and. you can close the sp_ctrl Command Prompt window to exit sp_ctrl.

58 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. For more information about SharePlex commands and authorization levels.0 Updated 8/19/13 Exiting sp_ctrl does not shut down replication. also shuts down sp_ctrl on UNIX and Windows systems upon completion of the SharePlex shutdown procedures. which shuts down replication by shutting down sp_cop. The shutdown command. see the SharePlex Reference Manual. All active configurations continue to replicate data unless you shut down SharePlex or you stop the Capture process. .

Syntax $ /productdir/bin/sp_cop -s & Or. issue the status command in sp_ctrl. It contains the following topics: • Starting SharePlex without starting replication processes • Running SharePlex for Oracle and SharePlex FS on the same UNIX system • Starting sp_cop with the -u option on UNIX systems • Running multiple instances of SharePlex • Running different versions of SharePlex concurrently Starting SharePlex without starting replication processes To start SharePlex without processes on UNIX systems On UNIX systems. Import and Post processes by using the [-s] option../sp_ctrl sp_ctrl> status .. This starts SharePlex with the processes in the idle state. you can start sp_cop without automatically starting the Capture. CHAPTER 3 59 Running the SharePlex Programs Part 2: Alternative Operation of SharePlex This section explains how to run SharePlex in special ways to meet specific replication or operational requirements. Export./sp_cop -s & To confirm idle status. $ cd /productdir/bin $ . Read. $ cd /productdir/bin $ .

60 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. . Syntax sp_ctrl(sysA)> startup After you issue the startup command. Read. You first must start the replication processes with the startup command. you can stop individual replication processes as needed. To start processes after startup with [-s] When you use the [-s] option to start sp_cop. To start SharePlex without processes on Windows systems Starting SharePlex without automatically starting individual replication processes (Cap- ture. you cannot start SharePlex processes indi- vidually using the start command. you cannot just start Capture. stop the processes with the stop command in sp_ctrl before shutting down SharePlex. which starts them all at once. Import and Post) is not possible on the Windows platform. Syntax sp_ctrl(sysA)> stop {capture | read | export | import | post} The replication processes remain stopped when SharePlex starts until you issue the start command for each process that you want to start. To start the SharePlex service (sp_cop) without replication processes.0 Updated 8/19/13 FIGURE 5: The status of SharePlex processes after starting sp_cop with the -s option. Export. For example.

CHAPTER 3 61 Running the SharePlex Programs Syntax sp_ctrl(sysA)> start {capture | read | export | import | post} For more information about sp_ctrl commands. . see the SharePlex Reference Manual.

0 Updated 8/19/13 Running SharePlex for Oracle and SharePlex FS on the same UNIX system SharePlex for Oracle and the filesystem replication application. can run on the same system concurrently. . use the -u option when starting each sp_cop (see “Starting sp_cop with the -u option on UNIX systems” following this section). both from Quest Software.62 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. The following Share- Plex for Oracle and SharePlex FS processes have identical names: • SharePlex (sp_cop) • Command Line Interface or CLI (sp_ctrl) • Command and Control (sp_cnc) • Export (sp_xport) • Import (sp_mport) To enable users to differentiate between the processes for the two programs while they are running. SharePlex FS.

such as when you are using consolidated replication with different variable-data directories./sp_cop -uname & . CHAPTER 3 63 Running the SharePlex Programs Starting sp_cop with the -u option on UNIX systems You can use the -u option on UNIX systems to start sp_cop with a unique identifier.. Use this method when there are multiple instances of sp_cop running on a system. For example: root 22362 24638 0 13:15:02 pts/3 0:00 sp_cop -umike8570 root 22375 22362 0 13:15:34 pts/3 0:00 /splexdata/mike/src/opt8/bin/ sp_cnc+PN+*+sp_cnc+0xa0101cf R -umike8570 root 22375 22362 0 13:15:34 pts/3 0:00 /splexdata/mike/src/opt8/bin/ sp_opst_mt -umike8570 root 22375 22362 0 13:15:34 pts/3 0:00 /splexdata/mike/src/opt8/bin/sp_mport - umike8570 Some suggestions for -u naming are: • the SharePlex port number (-u2100) • the ORACLE_SID of the instance for which replication is running (-uora10a) • the SharePlex Administrator’s name (-ujad) • an identifier for the SharePlex for Oracle sp_cop (-usp_orcl) Syntax $ /productdir/bin/sp_cop -uname & Or. and if you are running SharePlex FS filesystem replication.. $ cd /productdir/bin $ . which uses its own version of sp_cop.

The following steps create a vari- able-data directory for each sp_cop. Do not start SharePlex until directed to do so. one using port 2101 and one using port 2200. . SharePlex uses the default port of 2100. • Creating an Oracle user account for each variable-data directory. two directories are created. In this example. when replication is configured from multiple source sys- tems to a central target system. The following steps guide you through this process. This separates the queues (and their data) for each sp_cop instance. Before you begin replication. For example. The default port of 2100 is used for the original SharePlex installation. as an example. you can run multiple instances of sp_cop to isolate the replication streams.64 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. • Using the SP_SYS_VARDIR environment variable and the -u option to start each instance of sp_cop. To establish the variable-data directories 1 Install SharePlex in the normal manner according to the instructions in the SharePlex Installation and Demonstration Guide. These instructions assume. Important! The steps that follow must be performed by a user with root privileges. and that the SharePlex variable-data directory is installed in a directory named /splex/vardir. that the SharePlex product directory (con- taining the binaries) is installed in a directory named /splex/proddir. Running multiple SharePlex instances on a UNIX system Running multiple instances of sp_cop on a UNIX system requires the following: • Assigning unique port numbers and variable-data directories for each sp_cop pro- cess.0 Updated 8/19/13 Running multiple instances of SharePlex You can run multiple instances of the same version of SharePlex on a UNIX or Win- dows system. ensure that you follow all recommenda- tions in this manual for establishing your replication strategy. The following instructions are for installing and running the same version of SharePlex on multiple ports.

] Log on as a SharePlex Administrator and run the clean_vardir. 3 Make new variable-data directories. (In the example.loc files may not exist if sp_cop has never been started against this variable-data directory.loc files. Pay close attention to the dots in the tar command./splex. The script removes duplicated replication queues and restores each one to a fresh state.ipc and shmaddr. 8 [PERFORM THIS STEP ONLY IF THERE IS AN ACTIVE CONFIGURATION.sh script for each variable-data directory that you created. $ tar xvf /splex/splex..ipc and shmaddr.tar 6 Repeat steps 4 and 5 for each additional variable-data directory. The following commands put the resulting tar file in /splex (one directory up). $ cd /splex/vardir/splex2101 5 Enter the original variable-data directory structure into this directory. There is a paramdb file in each of the variable-data directories you created.tar 7 Set the port number for each variable-data directory that you created by setting the TCP and UDP port parameters in the SharePlex paramdb. there is only one additional directory. Instructions for running clean_vardir. CHAPTER 3 65 Running the SharePlex Programs 2 Tar the original /splex/vardir and its subdirectories. . See page 259 for instructions on setting the port numbers. Note: The shstinfo. 9 In the rim sub-directory of each variable-data directory. each named for the port number (or another unique identifier) to be used by the associated sp_cop instance. $ mkdir /splex/vardir/splex2101 (for the first instance of sp_cop) $ mkdir /splex/vardir/splex2200 (for the second instance of sp_cop) 4 Change directories to the variable-data directory made for port number 2101. $ cd /splex/vardir $ tar cvf . delete the shstinfo.) $ cd /splex/vardir/splex2200 $ tar xvf /splex/splex.tar .sh are on page 433.

$ export SP_SYS_VARDIR=/splex/vardir/splex2101 (ksh shell) Or. See page 407 for instructions on running ora_setup./sp_ctrl sp_ctrl(sysA)> port 2101 4 Repeat the preceding steps for each variable-data directory. To start and control the sp_cop instances To run multiple sp_cop sessions. Follow these steps. $ .. start sp_ctrl. To create the accounts.. 1 Export the SP_SYS_VARDIR environment variable to point to the first variable-data directory.. use its port number. run the SharePlex ora_setup program for each sp_cop instance. $ setenv SP_SYS_VARDIR /splex/vardir/splex2200 (csh shell) . The account enables the Post process to log into Oracle and post data. $ /splex/proddir/bin/sp_cop -u2101 & 3 To run sp_ctrl for that instance of sp_cop.0 Updated 8/19/13 To establish the Oracle users Create an Oracle user account for each variable-data directory for which there will be an instance of sp_cop. for example splex2101. $ setenv SP_SYS_VARDIR /splex/vardir/splex2101 (csh shell) 2 Start sp_cop by typing the absolute path name and the –uportnumber argument. then issue the port com- mand.. where portnumber is the port number assigned to the first variable-data directory’s sp_cop instance. This points SharePlex to the correct port and allows you to see that sp_cop instance when you use the ps -ef | grep sp_ command. Example syntax for a second variable-data directory $ export SP_SYS_VARDIR=/splex/vardir/splex2200 (ksh shell) Or. To identify an account. Use the & argument to run sp_cop in the background.66 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. start a session of sp_cop and sp_ctrl for each vari- able-data directory.

The installation program locates available ports. 2 Repeat the installation procedure for each SharePlex instance that you want to create. using the same product directory as before but with the following differences: A Use a different variable-data directory and a different port number (2101. including running OraSetup and assigning SharePlex users. Kill the processes associated with that session. Check if SharePlex processes are running and kill them if necessary. . for example) for each SharePlex instance you are creating. You only need to assign SharePlex users once on each system. • Starting each instance of the SharePlex service./sp_ctrl sp_ctrl(sysA)> port 2200 Note: If you receive an error message similar to this: Error cleaning up previous shared memory segment ###. which you can override if necessary. Cannot delete because there are users attached. To install SharePlex 1 Install SharePlex on the source and target systems according to the directions in the SharePlex Installation and Demonstration Guide. CHAPTER 3 67 Running the SharePlex Programs $ /splex/proddir/bin/sp_cop -u2200 & $ . Find out if someone else started a session of sp_cop using the same port number and variable-data directory. Running multiple SharePlex instances on a Windows system Running multiple instances of SharePlex on the same Windows machine requires the following: • Installing the SharePlex service multiple times using a different port number and variable-data directory for each installation. then start sp_cop again.

use the port number for the installation. Follow these steps. 1 Log onto Windows as a SharePlex Administrator. start a session of SharePlex and sp_ctrl for each variable-data directory. select the port number for the installa- tion from the drop-down list. Use the same license key for all instances that you install.68 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. 3 Click the SharePlex Services tab. All instances are controlled through one SharePlex Services dialog box of the SpUtils utility. and specify the ORACLE_SID for which you are creating the SharePlex instance. 2 Double-click the SpUtils desktop shortcut to open the SharePlex Utilities dialog box. C When you run OraSetup. . then enter the license key. To start and control the sp_cop instances To run multiple SharePlex instances. Use a dif- ferent name for each SharePlex user.0 Updated 8/19/13 B When you are prompted for a license key.

click Start. 7 Click Close to close the dialog box. CHAPTER 3 69 Running the SharePlex Programs 4 In the Port list box. select the port number for the instance of SharePlex that you want to start. 5 Under SharePlex Service Status. 8 Run an Sp_Ctrl session for each SharePlex instance by double-clicking the Sp_Ctrl desktop shortcut or browsing to its location in the SharePlex product directory. 9 In Sp_Ctrl. use the port command to specify the port number of the SharePlex ser- vice you want to affect. you can start another instance of SharePlex. 6 When the Current State text box shows that the service has started. sp_ctrl> port 2101 .

0.0 supports replication from a source system running SharePlex Versions 4.0 Updated 8/19/13 Running different versions of SharePlex concurrently You can run different versions of SharePlex on the same system to: • replicate the same source database to the same target database with both versions. the source and target versions must be the same.0 must be used exclusively as a target system. You start.5 to a target system running Version 5. You can apply this procedure to any two versions of SharePlex that you want to run concurrently.0 or 4. The target system where you install Ver- sion 5. For example. Replication from SharePlex Version 5. Installing concurrent versions of SharePlex 1 Review all pre-installation requirements in the SharePlex Installation and Demon- stration Guide for each version. When you are prompted to choose SharePlex prod- uct and variable-data directories.0 to Versions 4. and there is no interaction between them.5 is not supported. • replicate to target systems running different versions of SharePlex.0 and 4. control and main- tain each one separately. SharePlex 5. meaning that it does not concur- rently serve as a source system for another configuration. • replicate different source databases (same or different Oracle version) to different target databases. Running different SharePlex versions on a UNIX system Note: These instructions use Version A and Version B as examples. choose a pair for Version A and a different pair for Version B. This procedure creates autonomous replication instances.70 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. For other versions of SharePlex. a logical naming convention would be: Version A Version B /splex/VerA/prod_dirA /splex/VerB/prod_dirB /splex/VerA/var_dirA /splex/VerB/var_dirB . • test new versions of SharePlex.

do the following: • Enter the SID for the database associated with Version B. • Enter the SharePlex user for this instance of SharePlex. • Enter the password for the SYSTEM account. This number is stored with other SharePlex parameters in the paramdb in the variable-data directory. • Enter the SharePlex user for this instance of SharePlex. using the product and variable-data directories you specified for this version. Navigate to the bin directory for Version B and run ora_setup according to the instructions in the SharePlex Installation and Demonstration Guide. 4 Export the Version A variable-data directory for SP_SYS_VARDIR. 1 Export the following SharePlex system environment variables for the Version A installation. . • Enter the password for the SYSTEM account. Navigate to the bin directory for Version A and run ora_setup according to the instructions in the SharePlex Installation and Demonstration Guide. 3 Install Version B. assign the users who will be operating and viewing SharePlex according to the instructions in the SharePlex Installation and Demon- stration Guide. using the product and variable-data directories you specified for this version. CHAPTER 3 71 Running the SharePlex Programs 2 Install Version A according the instructions in the SharePlex Installation and Dem- onstration Guide. splexB. Do not run ora_setup yet. When prompted by the ora_setup script. • Enter the tablespace for SharePlex. When prompted by the ora_setup script. splexA. 6 If you have not done so already. the temporary tablespace. for example. and the index tablespace. the temporary tablespace. Do not run ora_setup yet. do the following: • Enter the SID for the database associated with Version A. • Enter the tablespace for SharePlex. Setting ports for concurrent versions of SharePlex Each version of SharePlex that you are running must be assigned a port number. for example. 5 Export the Version B variable-data directory for SP_SYS_VARDIR. and the index tablespace.

it created a defaults. Running concurrent versions of SharePlex When you installed SharePlex. such as the version number (-uVerA) or port number (-u2100). using different variables. sp_ctrl(sysA)> set param SP_COP_TPORT port number for Version A sp_ctrl(sysA)> set param SP_COP_UPORT port number for Version A 5 Shut down and then restart sp_cop for the parameter changes to take effect. sp_ctrl(sysA)> shutdown $ /splex/VerA/prod_dirA/bin/sp_cop -uVerA & 6 Repeat steps 1 through 5 for Version B. When you . including the location of the variable-data directory. SharePlex references this file to obtain envi- ronment information. Normally.72 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. use something unique to this instance of sp_cop. Use the -uname option to differentiate this sp_cop from the one you will start for Version B of SharePlex. when sp_cop starts.0 Updated 8/19/13 ksh shell: export SP_COP_TPORT=port number for Version A export SP_COP_UPORT=same port number as SP_COP_TPORT export SP_SYS_VARDIR=full path name of Version A variable-data directory csh shell: setenv SP_COP_TPORT port number for Version A setenv SP_COP_UPORT same port number as SP_COP_TPORT setenv SP_SYS_VARDIR full path name of Version A variable-data directory 2 Start sp_cop for Version A from the bin sub-directory of the product directory you created for Version A. 3 Run sp_ctrl for Version A. $ /splex/VerA/prod_dirA/bin/sp_cop -uVerA & Tip: For the name variable. $ /splex/VerA/prod_dirA/bin/sp_ctrl 4 Issue the set param command for the following SharePlex parameters.yaml file in the /proddir/data/ directory.

This enables you to differentiate between them when you issue the ps -ef | grep sp_ command or you need to kill a process. Use the -uname option to differentiate this sp_cop from the one you will start for Version B. Likewise. Important information about running two versions of SharePlex! • Do not issue Version A commands for the Version B instance of SharePlex. because it contains information only about one version of SharePlex — the last version installed. 1 Export the SP_SYS_VARDIR environment variable for Version A. Each instance must be started and controlled separately. the SP_SYS_VARDIR environment variable must be exported for each sp_cop instance. ksh shell: export SP_SYS_VARDIR=full path name of Version A variable-data directory csh shell: setenv SP_SYS_VARDIR full path name of Version A variable-data directory 2 Start sp_cop for Version A from the bin sub-directory of the product directory you created for Version A. the marker file cannot be used. do not issue Version B commands for the Version A instance of SharePlex. CHAPTER 3 73 Running the SharePlex Programs run multiple versions of SharePlex. . Instead. $ /splex/VerA/prod_dirA/bin/sp_cop -uVerA & 3 Repeat steps 1 and 2 for Version B. • Maintain and upgrade each installation of SharePlex separately.

see “Using the SpClient remote-access utility” on page 454. The Task Manager in the SpClient utility can help you differentiate among the Share- Plex processes when you are running replication on multiple ports. For more information about identifying SharePlex processes on the Windows platform. if desired. For more informa- tion about this utility. install the two different versions in different folders (directories) and on different port numbers.74 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. This creates two separate SharePlex services and two separate Registry entries. see “Process differences between UNIX and Windows systems” on page 46. You can run these services independently at the same time. as though you were installing two different software programs. .0 Updated 8/19/13 Running different SharePlex versions on a Windows system To run concurrent versions of SharePlex on a Windows system.

The first two parts provide an introduction to the operations and replication strategies supported by SharePlex. its imple- mentation requires careful planning and preparation. 4 Planning SharePlex Replication Although SharePlex for Oracle replication requires little user intervention. and the last part addresses important pre-implementation sys- tem and data issues. beginning with this chapter. Contents What you can replicate with SharePlex SharePlex Best Practices SharePlex replication strategies Replication to maintain a reporting instance Replication for high availability and data recovery Replication to distribute data Replication for distributed processing and load balancing Replication using an intermediary system Replication for centralized reporting Peer-to-peer replication Before you begin replication Configuring the system for replication . The chapters after this one help you establish and begin replication. Subsequent chapters guide you through this process. Read them in sequence to establish replication properly. This chapter is divided into parts to make the information easier to find and understand.

quest. Important! Component support is added as SharePlex is upgraded and patched. You also can contact your Quest repre- sentative or visit the Quest Support website at http://support. SharePlex replicates changes to objects listed in the configuration file. this list of exclusions cannot be considered complete.76 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. Because both Oracle and SharePlex continually change and improve. The most current list the Oracle components that SharePlex replicates can be found in the Supported and Non-supported Operations section of Release Notes. assume that SharePlex does not replicate it. Unless a com- ponent is listed in the Release Notes for the version of SharePlex that you are running. See the latest Release Notes for your version of SharePlex for supported and non-supported components that supersede the following lists. Important! Component support is added as SharePlex is upgraded and patched. .com. The changes can be made with any Oracle application. Unless a component is listed in the Release Notes for the version of SharePlex that you are run- ning. assume that SharePlex does not replicate it..0 Updated 8/19/13 Part 1: What you can replicate with SharePlex This section will help you decide which objects to include in your replication configura- tion and which objects to exclude.quest. See the latest Release Notes for your version of SharePlex for supported and non-supported components that supersede the following lists.com. What SharePlex replicates In general. What SharePlex does not replicate The most current list the Oracle components that SharePlex does not replicate can be found in the Supported and Non-supported Operations section of Release Notes. You also can contact your Quest repre- sentative or visit the Quest Support website a http://support.

and XML • If you are replicating LOBs and the Post process receives an ORA-00060 error. Doing so can cause errors and possibly table corruption. If you see the following.994. look at the trace log from Oracle. • Do not add a VARRAY column or abstract-datatype column if you plan to issue an ALTER TABLE to drop a column or set a column unused soon thereafter. it is recommended that bitmap indices not to be used while the Post process is applying the data. create a unique index on both the source and target tables. the Post performance is adversely affected. CHAPTER 4 77 Planning SharePlex Replication SharePlex Best Practices The following recommendations are for your consideration while you are replicating data. • While we support LinuxThreads and Native POSIX Threading Library (NPTL) on Linux. VARRAYs. For performance purposes. we recommend using NPTL for SharePlex. Replicating LOBs. then you have encountered an Oracle issue. • To avoid an out-of-sync condition on range-partitioned tables with LOB columns. LinuxThreads can be enabled per process using the LD_ASSUME_KERNEL environment variable. which includes the range column in the index key columns. Deadlock graph: ---------Blocker(s)-------. Changing supplemental logging • Do not turn off supplemental logging while you are in the process of replication. but setting this has a performance impact and shows individual threads as processes within the pro- . The TAR number is 3661187.---------Waiter(s)--------- Resource Name process session holds waits process session holds waits TX-0008002e-00002d1e 18 18 X 18 18 S session 18: DID 0001-0012-00000002session 18: DID 0001-0012-00000002 Rows waited on: Session 18: no row Information on the OTHER waiting sessions: End of information on OTHER waiting sessions. The known workaround is to issue an ALTER TABLE command with any option on this table and restart the Post process. Performance considerations • When bitmap indices are used on the target system.

. For a very large table. it has not yet received the ALTER TABLE message. • Using the ALTER TABLE operation to add a column with a primary key or unique constraint is not recommended. Oracle issues the ALTER TABLE command to change the column size. When Post receives the UPDATE message. UPDATE tableA set value (col1 = 'ro ') where col1 = 'ro' . Replicating direct-path loads • Use direct-path loads (SQL*Loader) when there is only one load per table (PARAL- LEL=FALSE). and SharePlex replicates it. SharePlex replicates the UPDATE.. Replicating NCHAR and NVARCHAR2 datatypes • Replication of NCHAR and NVARCHAR2 datatypes with the AL16TUF16 charac- ter set for Linux and Windows. NPTL is faster and behaves more like other UNIX OS's. Simultaneous loads on different tables are supported if the database is in archive mode. In such circumstances. Next. • When performing an ALTER TABLE to set a default value for a column when the table has data in it.78 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. This causes Post to stop posting and print an error to the Event Log (ORA-01401: inserted value too large for column).4. the target column is not sized correctly to accommodate the added spaces from the UPDATE. Replicating DDLs • Using ALTER TABLE when replicating from an intermediary system to target sys- tems in a cascading configuration is not recommended. • Do not add a VARRAY column or abstract datatype column if you plan to issue an ALTER TABLE to drop a column or set a column unused soon thereafter. If LD_ASSUME_KERNEL is employed we suggest a setting of 2. Therefore. SharePlex sends one message for each record in the table to the target machine. Replicating partitioned and sub-partitioned tables • To avoid an out-of-sync condition on range-partitioned tables with LOB columns. create a unique index on both the source and target tables that includes the range col- umn in the index key column. this can cause replication to fall significantly behind Oracle as a result of the large number of UPDATEs that Oracle places into the redo logs as part of the DDL transaction...0 Updated 8/19/13 cess list.21. Oracle first issues an UPDATE on each row that adds spaces to the column to make sure there is sufficient space to complete the ALTER TABLE command — for example. unless you reactivate the configuration. • SharePlex does not support ALTER TABLE commands that change the size of fixed- length columns — such as from char (2) to char (5) — when there is data in the col- umn.

Alternatively. • SharePlex replicates all of the storage parameters for a source object. This causes Oracle error 01570. if the MINEXTENTS is changed to 1 on the source. Information for these individual parameters is located in the SharePlex for Oracle Reference Guide. thus allowing the trans- action to process without the Post process failing. Share- Plex uses the ORACLE_HOME to locate the Oracle shared libraries. SharePlex will replicate both the MAXEXTENTS change and the non-changed MINEXTENTS of 20. but MAXEXTENTS is not changed. an Oracle error will be generated. CHAPTER 4 79 Planning SharePlex Replication • Replication with data updates greater than 2000 bytes to an NCHAR column must take into account multi-byte character sets. • During the installation process the user must specify the ORACLE_HOME. Replicating character sets SharePlex supports replication between Oracle compatible charactersets. enable the SP_OPO_DISABLE_OBJNUM parameter. SharePlex replicates both. a table with NCHAR(2000) and a two byte characterset requires 4000 bytes and exceeds the 2000 byte column limit. Other considerations • When updating the columns in the column conditions which may cause data to switch from one horizontal partition to another you need to set SP_ORD_HP_IN_SYNC to 1 and SP_ORD_FIRST_FIND to 0. the Post process can fail on the constraint validation. If the source and target objects were not created with the same storage parameters. and a target table with MAXEXTENTS 505 and MINEXTENTS 4. if the DDL is not supported by Oracle. For example. . SharePlex must link to the binaries and libraries of the lower minor/patch release version of Oracle if more than one Oracle minor/patch release version is installed on the same server. If the MAX- EXTENTS of the source object is changed to unlimited. even though only some of them were changed with the ALTER TABLE command. one of two things can happen: either the target table will assume the source table’s parameters or. For example. consider a source table with MAXEXTENTS 525 and MINEXTENTS 20. which results in target parameters of MAXEXTENTS 525 and MINEXTENTS 1. because MINEXTENTS cannot be larger than the extents currently allocated. Note that the underlying target table still remains out-of-sync until it is resynchronized. To work around this prob- lem. • If constraints are DEFERRED on the target tables and the transaction goes out-of- sync.

see Chapter 5 for details on how to establish your environment for your chosen strategy. high avail- ability. data distribution. determine how you will be using SharePlex for Oracle. It enables you to replicate an entire data- base of data for the purpose of high availability. SharePlex replication strategies at a glance • Replication to maintain a reporting instance • Replication for high availability and data recovery • Replication to distribute data • Replication for distributed processing and load balancing • Replication using an intermediary system • Replication for centralized reporting • Peer-to-peer replication . This section highlights the following SharePlex replication strategies to help you deter- mine which one (or combination) is right for your business environment.0 Updated 8/19/13 Part 2: SharePlex replication strategies Before you create configurations and begin replication. Then. or you can replicate subsets of a database — selected tables or selected columns and rows. SharePlex offers great flexibility for reporting. and disaster recovery.80 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. for example — which typi- cally is all you need for reporting or data distribution.

accessible secondary instance that does not interfere with your on-line transaction processing. This enables you to maintain an up-to-date. there are no Export and Import processes. .emp From one system to another The most common replication strategy is uni-directional replication to replicate from a source machine to a target machine to offload report and query processing. CHAPTER 4 81 Planning SharePlex Replication Replication to maintain a reporting instance scott.emp bill. For multiple reporting sites. you can replicate data to alternate locations on the same system by specifying the local system as the desti. The Read process puts data directly into a post jim. In a reporting environment. you have the additional option to route changes made to a record exclusively to the locations which use that record. On the same system (UNIX only) On UNIX systems. the owners and names of corresponding source and target tables need not match. This eliminates the necessity for all locations to maintain data that is either irrelevant or inappropriate for all users. leaving the production database optimized for online pro- cessing. A reporting instance can contain all of the tables in the produc- tion database or just a subset of the production tables. jim. disseminating only the data required for reporting. You can replicate all of the changes to a table or just the changes made to selected columns or rows. With this strategy. because the network is not being used. The secondary instance can be optimized to meet its users’ own set of needs.emp nation system in the configuration file.salary queue on that system.

0 Updated 8/19/13 Within one Oracle instance. Source and target owners and table names need not match for reporting. SharePlex does not support replication between databases that reside on the same system. On the Windows platform.82 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. you can replicate to a different instance on the system that users can access for reports without using the I/O resources of the pri- mary instance. . Or. The databases must be on separate systems with differ- ent Oracle versions. you can replicate to different tables within the same schema or the same table in different schemas.

emp You can configure SharePlex to replicate over LAN and WAN connections to keep a second Oracle instance constantly updated and ready to take over for the production instance when the source system is scheduled for maintenance or a disaster strikes. This is not possible with some ERP applications. When the primary system is restored. You might be able to use a high-availability instance for reporting if the source and tar- get instances are identical. but when the primary system is offline and users are transferred to the secondary system. the alternate instance is a mirror image of the production environment. which means that all objects exist in their entirety on both systems. Peri- odic physical refreshes are used to update changes to the database structure. SharePlex captures their changes and queues the data on the secondary system. To optimize the effectiveness of this strategy. . In this strategy. because there can be conflict between the H/A tables and the reporting tables.emp scott. CHAPTER 4 83 Planning SharePlex Replication Replication for high availability and data recovery scott. while SharePlex replicates the changes to the data. SharePlex replicates to the secondary system during normal operations. Share- Plex updates it with those changes. A high-availability strategy uses bi-directional replication. all of the secondary objects must have the same owners and names as their source objects on the primary system.

prod scott.cust scott. The illustration above shows data distribution using broadcast replication.prod scott.84 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. In this strategy. which burdens the system and slows online processing.prod scott. They gain access faster.prod scott.0 Updated 8/19/13 Replication to distribute data scott. .cust scott. Rather than the remote users logging onto the production sys- tem to perform queries. they have access to a constantly updated duplicate database against which they can run their queries locally. source and target objects can have the same owners and names or differ- ent ones. and the users of the main database can perform their work more efficiently.cust scott.cust SharePlex can help you overcome accessibility problems when many remote users need to use a central database.

you can send different data to each system. enabling you to replicate all of the changes to a table or just the changes to specific col- umns. which uses broadcast replication. such as when you want to send data to several remote loca- tions for reports or further processing. .emp jane. Or.prod scott.emp scott.emp Because SharePlex can simultaneously replicate to numerous target systems. CHAPTER 4 85 Planning SharePlex Replication Replication for distributed processing and load balancing scott. you can control which rows are replicated to which targets. SharePlex provides different levels of control over how much data is distributed.cust mary.cust jane. This strategy.cust jane. source and target objects can have the same owners and names or dif- ferent ones.prod joe. In these scenarios. you can use it to optimize productivity by offloading non-critical processing to up-to-date sec- ondary systems. In addition. but none that is irrelevant or inappro- priate. the goal being to balance the data load by splitting the replication to several machines. can be used to send the same data to each system. so that each one reflects only the data that its users need.

and then from London to offices in Paris and Rome (target systems). Cascading replication supports different types of replication. DDL replication is not supported from an intermediary system to target systems. • you want to limit network activity or expense affecting the source system. Instead of broadcasting directly to multiple target systems. replicated data is routed through an intermediary system (or pass-through system) to one or more target systems.price reg. replication minimizes the network costs and other logistical issues associated with replicating data to numerous target systems.price loc. Replicated data can be posted to a database on the intermediary system. It is sup- ported only from the source system to the intermediary system. An example of this strategy is replication from New York (the source system) to London (intermediary system). . using some target systems for reporting and others for high availability. For example. or it can be transferred directly to the target systems. you can combine data distribution (see page 84 and page 85) with high availability (see page 83).price loc. or cascading.price Multi-tiered.86 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. It is useful when: • one or more target systems have no direct connection to the source system.0 Updated 8/19/13 Replication using an intermediary system hq.

dat emp. With these options. is ideal for data warehousing or data mart environments. you can blend data from different sources. This strategy.dat SharePlex can be configured to replicate different data from different systems to a single system to provide a centralized reporting base.dat sales. corresponding source and target objects can have the same owners and names or different ones. When needed. .You can replicate any or all tables from a source system to the central target system.dat cust. SharePlex keeps the central instance up to date and accessible enterprise-wide for reports and queries. into central tables that are designed for reporting.dat cust.dat mfg. CHAPTER 4 87 Planning SharePlex Replication Replication for centralized reporting sales. such as human resources and operations. known as consolidated replication. In a consolidated replication configuration. you can confine repli- cation to selected columns and/or rows of a table to control the information that is avail- able in the central data site. Transformation options provide additional versatility by enabling you to manipulate replicated data to conform to the structure and design of the central database and its applications.dat emp.dat mfg.

In all of these circumstances.dat cust. either by disabling the database .dat cust. Peer-to-peer replication with SharePlex can be used to maintain the availability of a mission-critical database should any of the database sites become unavailable due to database. with all objects existing in their entirety on all systems. user access to one of the databases can be stopped temporarily. A peer-to-peer replication strategy also is useful for online transaction processing applications (OLTP) that require multiple points of access to database information for the purpose of distributing a heavy application load.0 Updated 8/19/13 Peer-to-peer replication sales. If one of the databases is unavailable. SharePlex configurations on each system replicate local changes to all other systems. When users access the application using a web browser.dat sales.dat emp. keeping all of the databases synchronized.dat emp. ensuring continuous availability. or providing more localized data access. the server connects to the next available database server.88 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. Thus the configuration serves not only as a failover resource.dat mfg. but also as a means of distributing the load evenly among all the peers in the replication scheme.dat mfg. the databases are usually mirror images of each other. Should the company need to produce business reports. the web server connects to any of those databases sequentially in a round- robin configuration.dat Peer-to-peer replication allows users on multiple databases to make changes concur- rently to the same data in other active databases. system or network failures.dat mfg.dat cust. An example of peer-to-peer replication is an e-commerce company with three different databases that replicate among themselves.dat emp. all databases acting as peers.dat sales.

Peer-to-peer replication is not appropriate for all replication environments. It requires a major commitment to database design that might not be practical when packaged appli- cations are in use. That database then can be used to run the reports. user access can be re-established. In addition. conflict resolution routines are required to prioritize which transactions SharePlex will accept for posting to the target database when more than one user changes the same data at or near the same time. . When the reports are done. CHAPTER 4 89 Planning SharePlex Replication name in the listener or by reconfiguring the web server.

. The basic characteristics of synchronized source and target objects are as follows (unless the transformation feature is used. The INSERT fails. Once replica- tion is underway. you need a basic understanding of how SharePlex replicates and how it determines an out-of-sync condition. Before SharePlex posts replicated data to the target system. as described on page 245). This section helps you review the issues that affect replication. instance and data are optimized and properly prepared. If the following events occur during the Post process. If SharePlex attempts to insert a row that already exists in the target table. but the row already exists in the target database when SharePlex attempts to post it. it causes an Oracle unique-key violation error.0 Updated 8/19/13 Part 3: Before you begin replication SharePlex works best when your system.90 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. Ensuring data integrity is the responsibil- ity of the Post process. SharePlex returns out-of-sync errors: • An out-of-sync condition occurs when an INSERT is performed on the source system. To establish and maintain a synchronized replication environment. When SharePlex constructs its INSERT statement to add a replicated row to the tar- get database. • Corresponding columns have the same attributes and datatypes. you might want to make additional adjustments to the database and environment by reviewing the suggestions in this manual and in the troubleshooting chapter of the SharePlex Reference Manual. Resolving out-of-sync conditions can be time-consuming and disruptive to user activity. unless selective row replication is being used (see “Replication options” on page 96). and SharePlex returns an out-of-sync error. • Data values in corresponding rows are identical. • If a row exists in the source database. it exists in the target database. it verifies that the data is being applied to a synchronized environment. Understanding synchronization It is important to configure your databases and systems to ensure that source and target data remain synchronized. it uses all of the columns in the row.

The SharePlex key can be a --primary key . then at that moment. --unique key . (this is the amount before the salary value was updated to 32000.) • An out-of-sync condition occurs when a DELETE is performed on the source system.One or more fields (columns) whose value or values uniquely iden- tify each row in a table. Example of SharePlex UPDATE statement on the target: SQL> UPDATE scott. The DELETE statement fails on the target database. --user-defined key As an additional measure to verify synchronization. Share- Plex does not check row-by-row for out-of-sync conditions. or if SharePlex cannot locate the row using the key. If the pre-images do not match. SharePlex posts the operation. the SQL statement fails and Share- Plex returns an out-of-sync error. but SharePlex cannot locate the row to be deleted on the target system.Is used to uniquely identify each row in an Oracle table. it uses only the key value in the WHERE clause. When SharePlex constructs its DELETE statement to remove a row from the target database.employee_source SET Salary = 32000 WHERE EmpNo = 3 AND Salary = 30000. . either because the row already was deleted or the key column(s) changed. CHAPTER 4 91 Planning SharePlex Replication • An out-of-sync condition occurs when an UPDATE is performed on the source system. and that design makes it important for all of the requirements in this chapter to be satisfied. There can be one and only one row with each unique key value. A primary key cannot allow NULL values. SharePlex cannot locate the row. This is not an indication of how many other rows in this or other tables are out of synchronization in the target database. SharePlex constructs a WHERE clause consisting of the pre-image (or before values) of the updated columns — the values before the UPDATE. If the key is unavailable on the target system. it uses the SharePlex key to locate the row. SharePlex only compares rows being changed by its SQL statements. that row is deter- mined by SharePlex to be out of synchronization. and SharePlex returns an out-of-sync error. When SharePlex returns an out-of-sync error. but the image of the row on the source system before the change was made does not match that of the target row. If the pre-images and the keys match in the source and target rows. because that would slow posting to unacceptable levels. When SharePlex constructs its UPDATE statement to be applied to the target data- base.

SharePlex does not use BSD or POSIX-style shared memory or semaphores. 4 Restart the system. Before beginning SharePlex replication. Shared memory segment resources Shared memory segments are used by the queue and statistic modules to allow all pro- cesses to see data written by other processes.0 Updated 8/19/13 Tip: After you begin replication. which are available on most systems. therefore. you can use the compare command to compare source and target tables to verify synchronization. if necessary. . Configuring system resources for replication During your planning process. you must 1 Calculate your system resources. consider the demand that will be put on your system resources during the replication process. Note: Whenever you change any system parameters in the kernel configuration file. 2 Edit the kernel's configuration to change those resources. SharePlex uses its own queue module. SharePlex uses the "SystemV" style semaphore and shared memory tools. POSIX mes- sage tools. you might need to modify the kernel and restart your system to ensure those modifications take effect. or named pipes. 3 Rebuild the kernel. To configure your UNIX system to support SharePlex software. you must calculate the kernel resources your SharePlex implementation requires and change those resource parameters. For more information.92 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. see Chapter 1 of the SharePlex Reference Guide. it does not use System V message queues. Configuring UNIX resources for SharePlex SharePlex uses interprocess communication tools provided by most UNIX-based oper- ating systems to maximize cohesion of the SharePlex services while allowing the ser- vices to perform their functions independently.

it is transferred to shared memory before it is processed. The sys- tem configuration parameter SHMMAX must be greater than the larger of these two queue parameters. Location of shared memory segments SharePlex maps shared memory by using the system default mapping. For most systems. You need to specify the maximum number of shared memory identifiers available to support your system configuration. Use the system configuration parameter SHMBRK to set the distance between private and shared data space. SP_QUE_POST_SHMMAX and SP_QUE_Q_SHMMAX. CHAPTER 4 93 Planning SharePlex Replication The queue module uses shared memory for all of its transfers from and to user applica- tions and from and to disk data files. Number of shared memory segments At startup.the queue global area and the SHS segment. When data is read from the disk. The minimum setting recommended for SHMMAX is 60 MB. in most cases. Programs that dynamically expand their private data space can encounter problems if the default map- ping location is not set sufficiently high. Queue performance is related to the shared memory size that is allocated to two queue parameters. which. The data is written to disk at checkpoint. you can divide the number of bytes by the page size to get the parameter value. The value for SHMMAX must be large enough for the largest SharePlex shared-memory segment. One additional shared memory segment is created for each queue. The minimum setting recommended for SHMMNI is 100. is the queue information seg- ment. setting the parameter to 4 MB is adequate. This means the system selects the address at which the shared memory will be mapped. Note that on systems where SHMBRK is expressed in pages. SharePlex creates a minimum of two shared memory segments . . Size of shared memory segments The system configuration parameter SHMMAX is the maximum size permitted for a shared-memory segment. Shared memory identifiers are set using the system configuration parameter SHMMNI. The creation of the per-queue shared memory segment happens dynami- cally when SharePlex is restarted or when activating a configuration.

The recommended setting for SharePlex is 128.0 Updated 8/19/13 Table of Shared Memory Parameters Parameter Name Definition SHMMNI Number of shared memory identifiers SHMMAX The maximum size of shared-memory segments SHMBRK Sets the distance between private and shared data space Shared Semaphore Segment Resources SharePlex requires two shared semaphore segments at startup. The UNDO is used by SharePlex to prevent a semaphore deadlock if a process that is wait- . The value of SEMMNI equals the number of semaphores required for your sys- tem plus double the number of SharePlex instances. Number of semaphores per process The configuration parameter SEMMSL is the maximum number of System V sema- phores that can be in one (1) semaphore set. Number of semaphores per SharePlex instance The configuration parameter SEMMNS is the number of individual semaphores in the system. Number of UNDOs per SharePlex instance The configuration parameter SEMMNU is the maximum number of processes that can have UNDO operations pending on any given IPC semaphore on the system.94 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. Refer to the Installation and Demonstration Guide for the recommended settings for your system. By default the number of queues is set to 25. The number of semaphores required for a SharePlex instance is the number of semaphores required by the SHS module plus three (3) semaphores for general use. Number of shared semaphore segments The configuration parameter SEMMNI is the number of semaphore set identifiers in the system. which implies that you will have 28 sema- phores per SharePlex instance.

the database can be instructed to write data that aids replication to the redo logs. The maximum number of System V semaphores that can be SEMMSL in one semaphore set The number of IPC sempahores that a given process can SEMUME have UNDO operations pending on at any given time Configuring the database for replication Oracle supplemental logging With Oracle 9i. Table of Shared Semaphore Parameters Parameter Name Definition The number of semaphore set identifiers required in the sys- SEMMNI tem SEMMNS The number of individual semaphores in the system The maximum number of processes that can have UNDO SEMMNU operations pending on any given IPC semaphore on the sys- tem. eliminating the need for SharePlex to main- tain this information. The default setting is 64. . as well as key column information in the redo log. CHAPTER 4 95 Planning SharePlex Replication ing for the semaphore exists due to a signal or other reason. This ensures that the rowid information is logged in the redo log. Number of UNDOs per process The configuration parameter SEMUME is the maximum number of IPC semaphores that a given process can have UNDO operations pending on at any given time. SharePlex uses one UNDO in every semaphore operation. SharePlex requires that minimal supplemental logging be set. Commands can be issued at the database level that result in the logging of rowid information. The default setting for SEMMNU is 64.

SharePlex will use the primary key if there is one. SharePlex offers several options. or both from one table to another.com. SharePlex can replicate all of the columns and rows of a table. or that a supplemental log group be defined for every table in replication. Or. Oracle keys logged. then it is possible that the key columns that Oracle logs are not those that SharePlex requires. If a table being rep- licated by SharePlex does not have a primary key. If the key column values for a row update are not in the redo log. If the table does not have a key Oracle will log all columns that are not a LONG or a LOB. Note: If you have questions concerning SharePlex keys vs. Replication options When planning your replication strategy. Oracle has to decide what key to log. SharePlex also has to identify a key to use to replicate data. This is called partitioned replication. • You can use horizontally partitioned replication (also known as selective row repli- cation) to distribute different segments of data to different target systems. determine the “best” (or only) unique key if there is one. even when the target schema is not identical to the source schema. . also known as selective replication. SharePlex can take advantage of the key information logged in the redo log when posting the mod- ifications on the target. please contact Quest using SupportLink at: http://support. such as employee names and locations. If the table has multiple unique keys.quest. such as sending sales and customer data to the individual stores responsible for it. When primary and unique key supplemental logging is enabled. but has multiple unique keys.0 Updated 8/19/13 SharePlex recommends that both primary key and unique key supplemental logging be set. Like Oracle. On a busy system and when data has accumulated. with- out separating the data sets into different objects. Oracle will determine the key that is “best” and log the values of those col- umns for every update. such as sensitive personal information or salaries. selected columns.96 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. otherwise SharePlex will use all the key columns for the key. SharePlex can replicate selected rows. take into consideration how much source data you want to be replicated. this can add additional processing that adversely impacts the performance of the read process. This is known as full- table replication. SharePlex has to retrieve this information from the database. • You can use vertically partitioned replication (also known as selective column repli- cation) to distribute selected information. while protecting other data. and a table does not have a primary key.

the following rules apply to the target table. if there are public and private components of a table. but the values in the extra columns will remain unaffected. load balancing. A DELETE is not affected by extra columns in the target table because SharePlex selects rows based on the key or on column data in the matching columns. there will be Oracle errors. For more information about configuring SharePlex for partitioned replication. For reporting. An UPDATE will update the values in the target columns for which there are corresponding columns in the source table. but it will not insert values for the extra columns. or you can . Default values are recommended for extra columns in target tables. When a target table has more columns than the source table. partitioned replication could be appropriate for some or all tables. but SharePlex will ignore the extra columns in the target table. data marts or other environ- ments where replicas of the production data are not necessary. You can avoid this limitation by using vertically partitioned replication (see “Using vertically partitioned replication” following this topic). rather than just by a limited view. depending on how replication is configured. -or- A target table can have more columns than the source table. CHAPTER 4 97 Planning SharePlex Replication Partitioned replication is not appropriate for high-availability environments where you need full replicas for failover. you could replicate the public elements beyond a firewall so that sensitive information remains protected by the firewall. you can use the com- pare command to verify synchronization and repair out-of-sync rows. • The names of the target columns must be identical to the names of the source col- umns. If the extra columns have NOT NULL con- straints but do not have default values. see “SharePlex configuration construction” on page 132. and it can provide more control over infor- mation dissemination and network load. An INSERT will insert values into target columns for which there are corresponding columns in the source table. For example. • The number of target columns must be identical to the number of source columns in order to be able to use SharePlex data synchronization procedures. Table structure SharePlex supports replication between identical and non-identical target schemas. Replicating entire tables When you are using full-table replication (replicating all of the data in a source table).

the owner and name of a source table and those of its target object must be the same. You can specify column names when you create the configuration file. size. precision). • Corresponding source and target columns must contain the same datatypes (same type. the following rules apply to a target table. see the SharePlex Reference Manual. Because they are not critical database compo- nents. SharePlex replicates to the correct object because you specify it by owner and table name within the configuration file. • Corresponding rows must have the same values. • The target table can contain all of the same columns as the source table. Using vertically partitioned replication When using vertically partitioned replication. .98 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. For example. • A target table cannot have fewer columns than the number of columns in the source table. • The names of corresponding columns need not be identical. then only those eight columns need to exist in the target table. but if you are only replicating data from eight of them. • Corresponding source and target rows must contain the same values. size. • Corresponding columns must contain the same datatypes (same type. or just the columns being replicated from the source table. For high-availability configurations. preci- sion). the source table might have 20 columns. Work tables and any tables that are instance-specific also should be excluded. Tables that should not be replicated Some applications use temporary tables. For more information about the compare command. such tables should be excluded from the replication configuration. Table names For most replication strategies.0 Updated 8/19/13 develop your own set of synchronization procedures. the name and/or owner of a source object can be differ- ent from those of its target object.

Post compares the pre-images. Post uses a WHERE clause to verify synchronization (see “Under- standing synchronization” on page 90). When that change is rep- licated. The following examples illustrate detectable and undetectable out-of-sync conditions that can occur when target objects are changed by a user other than SharePlex. and SharePlex repli- cates it to the target. Hidden out-of-sync condition A user directly updates the COLOR column in the target table from “blue” to “red” in Row2. Any target table within the replication configuration can be accessed for queries and reports while replication is underway. the SharePlex Oracle user created dur- ing ora_setup must be the only user allowed to perform DML or supported DDL on the target objects. if appli- cable) as usual without affecting replication. therefore not replicated. and only then is there an error message. The two tables now are out-of-sync. Requirements for target table access • For reporting and other uni-direction replication: All tables on the target system that are outside the replication configuration can be accessed (and changed. the data will go out of synchronization. the hidden out-of-sync condition for the COLOR column persists (and users on the target have inaccurate information) until someone updates the COLOR column in the source table. For more information. someone makes the same change to the source table. because there is no Post involvement. The example assumes that source and target tables (with columns COLOR. DML or DDL . Tip: After you begin replication. WEIGHT) start out synchronized. but the change is not made to the source table. jobs or applications.” Post generates an out-of-sync error alerting you to the out-of-sync condition. Detectable out-of-sync condition A user directly updates the COLOR column in the target table from “blue” to “red” in Row1. but there is no error message as in the previous example. If DML or DDL changes are made to target objects by other individuals. CHAPTER 4 99 Planning SharePlex Replication Target table access In all scenarios except peer-to-peer replication. but do not allow DML or DDL of any kind to be performed on them. so it expects the pre-image for the target table to be “blue. WEIGHT). you can use the compare command to compare source and target tables to verify synchronization. No matter how many subsequent updates are made to other columns in the row (SIZE. SIZE. Now. see Chapter 1 of the SharePlex Reference Guide.” but it is not—it is “red.

SharePlex uses the best available key column in the following order of priority. Row IDs cannot be used to locate rows on the target system because row IDs are different on the source and target systems. If a key permits NULLs. and the target row ID is not in the redo log. reports and queries might be permissible.100 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8.0 Updated 8/19/13 changes to the target objects must be performed according to the procedures in Chapter 11. see “Establishing replication for high availability and data recovery” on page 190. set the SP_SYS_IN_SYNC parameter. • For high availability: Some ERP applications do not permit using the target data- base for queries or reporting. you can prepare the target system to grant INSERT. See Chapter 2 of the SharePlex Reference Guide for more information about this param- eter. • If SharePlex cannot determine a key. This key is maintained internally and is not created on the . When choos- ing a key to use. so there is a possibility it could change the wrong row on the target system. see “Estab- lishing peer-to-peer replication” on page 211. To control how SharePlex addresses keys that permit NULLs. requires two-way replication with the proper data- base preparation and conflict resolution routines. For more information. For more information. since there can be conflict between the H/A tables and reporting tables. but do not implement them except when that system is used as a failover machine. UPDATE and DELETE privileges. • Primary key • Unique key with the fewest columns. SharePlex uses the key in its SQL statements to locate the correct row in the target table for UPDATEs and DELETEs. When using SharePlex replication for high availability. • For peer-to-peer replication: Peer-to-peer replication. SharePlex cannot ensure the row’s uniqueness for UPDATEs and DELETES. If the source and target databases are identical. where DML is replicated among peer production instances. SharePlex keys Understanding the role of keys in the SQL statement constructed by SharePlex is critical to helping you understand and maintain data synchronization. especially large tables and tables containing LONG columns. SharePlex works fastest when there is a primary key or a unique key on all tables being replicated. where at least one of the columns is NOT NULL • Unique key with the fewest columns. and to ensure that a row being inserted is not already there. it constructs a key using all of the columns except LONGs and LOBs.

Otherwise. For more information about keys in peer-to-peer replication. An alternative to a key definition is to create or use a unique index based on one or more columns that establish uniqueness. Effects on the source system: If a table does not have a unique key and SharePlex has to build its simulated all-column key for UPDATEs. see “Long columns” on page 110. which allows the Post process to use the index upon posting data to that table. create the sequences so that the updates cannot result in duplication of keys on the target system. This causes transaction data to accumulate in the queues. CHAPTER 4 101 Planning SharePlex Replication table itself. To create a key definition. Post (relying on its constructed all-column key) must compare the entire table row by row. It is possible for one of the x+n values to equal an existing . You need to create a non-unique index on the target system and add the index to the SharePlex hints file. if a new value already exists as a key in another row on the target system. That type of error can happen when you update values using an “x +n” formula. Moreover. • User-defined key. see page 216. See “Indices” on page 102 for more information. Effects on the target system: Without the help of a primary or unique key on the target table. you can create a user-defined key by creating a key definition. increasing the latency between source and target instances to unacceptable levels. Changing key values If sequences are used for keys. you use special syntax in the configuration file to list one or more columns that ensure row uniqueness. and if there is a possibility that key values will be updated. and that significantly slows replication. Recommendation: If adding a primary key is not possible (such as when packaged applications are in use). and they must be unique among all of the databases that will be involved in repli- cation. This key overrides any other key created for the table. where n is an incremental increase. This option is the least desirable option. there can be conflict and SharePlex will return unique-key constraint vio- lations and out-of-sync errors. this procedure can be very time- consuming for tables with numerous columns. See “Components of a SharePlex configuration” on page 135 for more information about constructing a key definition. For more information. Keys in peer-to-peer replication: Primary keys are essential in peer-to-peer replica- tion. SharePlex will use those columns as a unique key in its WHERE clause to locate target rows for posting. because the resultant WHERE clause causes Oracle to perform a full table scan on the target table to find the row. the use of a simulated key does not always enforce uniqueness.

commit The new values become the following.0 Updated 8/19/13 value. and they are replicated to the target system: Key_Col 2 5 6 8 SharePlex performs that update using the following individual steps. processes a pre-image value for the target sequence that is the same as the increased value replicated from the source.) The Post process. Indices When replicating a source table with a unique index. Oracle rejects the operation as a unique constraint violation.) update x set a=6 where a=5.102 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. Another example would be a transaction that updates A to B and then updates B to C. Consult the instructions for establishing peer-to-peer replication on page 211 when you are done reviewing the rest of the requirements in this chapter. there are additional key requirements. An index maintains the integrity of the target data and prevents users from entering duplicate data. (This will be successful. (This will fail because 5 already exists. which is responsible for ensuring data integrity. (This will be successful. the target table also should have a unique index. assume that the values in the following sample key column are increased by 1: Key_Col 1 4 5 7 SQL> update table X set a=a+1.) update x set a=8 where a=7. (This will be successful. For example. Important! If you will be running peer-to-peer replication. in the order that the operations enter the redo log: update x set a=2 where a=1. All large tables should have at least a unique index on the target .) update x set a=5 where a=4.

remove unnecessary indices before the batch job. In gen- eral. and you will have more organized indices afterward. . you can ensure that Oracle uses it by employing the hints feature of SharePlex. frequent inserts by multiple concurrent sessions into a table with bitmap indices will incur lock conflicts. try to an index on the column that doesn’t change after an INSERT statement. Once you have identified or created a unique index. Post must detect and resolve the blocking. if possible. • For DELETE statements. As a result. which delays posting significantly if the number of locks is high. updates or deletes a bitmap entry. • Try to use just a few indices for applications that do mainly INSERT statements. Oracle scans the entire table in order to locate the rows to be changed by Post. CHAPTER 4 103 Planning SharePlex Replication system. • When you run large batch jobs that do millions of SQL operations on tables with numerous indices. To proceed. although it was created on one or more columns populated with unique values—such as a person’s name and employee identification number. If no unique index exists for a table. • If tables use referential integrity (foreign keys). When Oracle adds. and therefore a unique index is not created by default. however. Rebuild the ones that are fragmented. A bitmap segment can contain references to hundreds of rows. weigh their benefit for queries against the following impact on Post’s SQL transactions. Often. then rebuild them at the end. See “Using INDEX hints for faster post- ing” on page 238 for more information. it effectively locks all the rows associated with the bitmap segment. This makes SharePlex run faster. as a unique index (not using CREATE UNIQUE INDEX command). it is rec- ommended that you create one or use a user-defined key. Note: SharePlex follows the Oracle recommendation to have a bitmap index on a more static table. • When using bitmap indices on target tables. to limit their maintenance. • For UPDATE statements. but not named. Other planning tips: • Keep your indices up-to-date. remove as many indices as you can. there will be an index that was created. make sure the appropriate columns are indexed so that modifications to the foreign keys do not cause full table scans. If there is no unique index. Some applications do not use primary key constraints. changes made by different Post sessions (there is a Post session for every session on the source system) can block each other if rows they are processing update bitmap entries in the same bitmap segment. but random update and delete activity on such a table will not. or it can slow the Post process.

QSA_KTFBUE view exposing SYS. This associated cost (Oracle time and resources) to rebuild is added to your SQL UPDATE statement. the index is rebuilt. the referential integrity could become corrupted.X$KTFBUE and grants select privilege on this view to the SharePlex Oracle user. Index-organized tables If you will be replicating index-organized tables that are in locally-managed tablespaces. and if they do not exist. Referential integrity Tables with referential integrity to one another must all be included in the configuration file for accurate replication.0 Updated 8/19/13 • Note that replicating bitmap indices is not recommended because every time you change a table with a bitmap index.sh script was run after ora_setup. This causes SharePlex to return out-of-sync errors. SharePlex expects to post replicated operations in the order that they are received. Foreign key constraints/cascading DELETEs Special measures are required on the target system for applications using ON DELETE CASCADE constraints. including replication. This slows the entire system. Oracle must update them all as rows are added and deleted. When these constraints fire during the original transaction. Consider lim- iting the number of indices to the ones that have the most utility. Integrity constraints The following topics address the effects that integrity constraints have on replication. . See Chapter 5 for more information about named queues. Verify that the view and priv- ilege exist. and therefore all must exist in the target database. run the script as an Oracle user with SYSDBA role. If you leave one or more out. SharePlex replicates both the primary (original) DELETE and the dependent (cascaded) DELETE operations to the target system because they all enter the redo logs. Tip: If there are too many indices on a target table. This script creates the SYS. make certain that the iot_setup. all tables with referential integrity to one another must be in the same queue. If the primary DELETE activates foreign-key constraints on the target table that delete dependent rows. those rows will not be there when SharePlex expects to perform the replicated cascaded DELETEs. If you are using named export or post queues.104 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8.

run the sp_add_trigger. A trigger fires for a source transaction to delete the dependent rows in the source database. incorporate the required DELETE func- tions into triggers. No dependent rows are deleted until the replicated dependent DELETE operations arrive from the source. because they are satisfied on the source system and will only increase overhead on the target. instead of using constraints. 'SYS') / If cascading DELETE functionality must be available on the target system for peer-to- peer replication or in preparation for failover. but when SharePlex posts the replicated pri- mary DELETE to the target database.' FROM dba_constraints WHERE constraint_type = 'R' And delete rule=’CASCADE’ AND owner NOT IN ('SYSTEM'. Such checks are redundant. disable check constraints on the target system. the trigger does not fire. For more information about sp_add_trigger. Check constraints For improved performance. you can maintain referential integrity. You can use the following script to disable them. see page 426.' || table_name || ' DISABLE CONSTRAINT ' || constraint_name || '. . After you convert the constraints to triggers. you can build a script that re- enables the constraints as part of the failover procedure. For high-availability purposes. In this way.sql and the other SharePlex trigger scripts. CHAPTER 4 105 Planning SharePlex Replication Recommendation: Disable ON DELETE CASCADE constraints on the target system.sql script to direct the triggers to ignore the SharePlex user. SELECT 'ALTER TABLE ' || owner || '.

re-run sp_add_trigger. SharePlex replicates both INSERTs to the target system. triggers must be enabled for users other than SharePlex. see page 426. specify them in the config- . or use the sp_add_trigger.0 Updated 8/19/13 Triggers DML changes resulting from a trigger firing on the source system enter the redo log and. • High availability and peer-to-peer replication: On all systems in a high-availabil- ity or peer-to-peer replication configuration. Sequences SharePlex replicates changes to sequences that are made during transactions and with the ALTER SEQUENCE command. triggering an INSERT into TableB. when Post attempts to post the replicated INSERT to TableB.sql script to instruct them to ignore the SharePlex user. if an INSERT to TableA on the source system triggers an INSERT into TableB. there will be a unique-key violation—the row already exists because the trigger fired for TableA. Triggers and patches: After applying an Oracle patch (which sometimes creates or modifies triggers). Thus.sql on the target system if triggers are not disabled. The Post process applies the first INSERT to TableA on the target system.sql script. Recommendation: Either disable triggers on target tables within the replication config- uration.sql script. For example. To disable triggers for the SharePlex user. are replicated and posted to the target database by SharePlex. This script puts a WHEN clause into each trigger’s procedural statement that tells it to ignore operations posted by the SharePlex user. either in preparation for failover or because transactions are per- formed on multiple source systems. Conse- quently. run the sp_add_trigger. you can either dis- able triggers entirely on the target system or run the sp_add_trigger. Statement-level trig- gers must be disabled/enabled for the SharePlex user separately. if needed.106 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. For more information about this script. • Reporting: For reporting and other non-data recovery purposes. if the same trigger fires on the target system and initiates the same DML changes (which already were made through replication) there will be out-of-sync errors. To replicate sequences. depending on your replication strategy. Note: The SharePlex trigger scripts support row-level triggers only. Triggers that modify data in tables NOT being replicated: Triggers that modify data in objects not in the replication scheme can fire on the target system. therefore.

• To ensure the uniqueness of sequences on the target system. as you would a table. • SharePlex treats ALTER SEQUENCE operations like a simple SELECT (UPDATE) to a sequence because it cannot tell the difference between the two operations in the redo log. Sequences in reporting: Sequences usually are not replicated for reporting instances. which slows replication of more critical data. The way that SharePlex replicates sequences allows users to begin using the failover database imme- diately without worrying about incrementing the sequences or reusing one. When sequences are not cached. SharePlex must go to disk every time a value is obtained from the sequence. or replication of sequences will fail. It can slow down replication. the sequence values are part of the key columns when the replicated rows are inserted on the target system. For example. use caching and set the cache to increments of at least 20. . SharePlex can replicate the values as a group. keep the following points in mind. Sequences in high availability: Replicate sequences for high availability. CHAPTER 4 107 Planning SharePlex Replication uration by owner and name. Use the fol- lowing formula to determine the target START_WITH value: source current value + [{source_INCREMENT_BY_value} x {source_CACHE_value}] = target START_WITH_value Important! {source_INCREMENT_BY_value} x {source_CACHE_value} should not exceed 2 GB. 3 ALTERS the sequence(s) again by setting the following values: Increment value = source_INCREMENT_BY_value Cache value = source_CACHE_value When working with sequences. do not replicate them. SharePlex updates target sequences with the ALTER SEQUENCE command in the following way: 1 Changes the increment value to {source_INCREMENT_BY_value} x {source_CACHE_value} and sets no caching. • If sequences are unnecessary on the target system. When sequences are cached. if a sequence is used to generate keys in a source table. The sequence itself does not have to be replicated. • If you replicate sequences. 2 UPDATES the sequence(s). the start value of the tar- get sequence must be larger than the start value of the source sequence.

• VARRAY column containing abstract datatypes. • Use one or more named export queues for tables containing LOBs. Object-relational structures SharePlex supports abstract datatypes (also known as user-defined types. replicate them all using the same named queue. A SharePlex post queue actually consists of multiple subqueue files. even though the source and target tables are in the same named schemas. or UDTs. • Record abstract datatypes containing record abstract datatypes that include a VAR- RAY column.0 Updated 8/19/13 Sequences in peer-to-peer replication: SharePlex does not support peer-to-peer repli- cation of identical sequences. • Abstract datatypes for which the SQL statements use the system-defined name instead of the user-defined name. LOB activity can cause an unusu- . Separating the processing of LOB datatypes should improve the overall speed of replication.108 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. see Chapter 5. • Operations to add a VARRAY column or abstract-datatype column if an ALTER TABLE to drop a column or set a column unused is issued soon thereafter. See “Establishing peer-to-peer replication” on page 211 for important instructions concerning sequences in peer-to-peer replication. This automati- cally creates separate Export processes and named post queues with their own Post processes. For instructions on creating named export queues. LOB datatypes Considerations for LOB replication • Use a tuning tool such as Spotlight on Oracle from Quest to remove any I/O conten- tion affecting the redo logs. • If tables containing LOBs have referential integrity among one another. Subqueue files are added dynamically as needed. • Replication of large LOBs has an effect on the SharePlex post queue. each with a size of 8 MB. the Post process will fail with an error. When the UDT or VARRAY belongs to different schemas on the source and target. or UDTs) and varying array collectors (VARRAYs). • Replication of UDTs and VARRAYs is not supported when the source and target schemas have different names. with the following exceptions: • Replication of nested tables.

so make sure enough disk space is available. If you enable LOB replication. Oracle stores this data relative to the DB_TIME_ZONE. CHAPTER 4 109 Planning SharePlex Replication ally high number of subqueue files. If Share- Plex generates shared memory segment errors such as Error: sp_cop process sp_mport/sp_opst_mt killed due to SIGSEGV. Note the following: • For TIMESTAMP WITH TIME ZONE. • A table with LOBs cannot be configured for horizontally-partitioned replication. To ensure that SharePlex has enough shared memory when replicating LOBs. This table is updated fre- quently and must be analyzed frequently so that its indices remain efficient. TIMESTAMP datatypes The TIMESTAMP. Note: A larger shared memory segment can result in a large amount of swap space being used on the system. the timestamp of the replicated data does not change from the timestamp of the source data. increase the setting. SharePlex adjusts the timestamp according to any difference in the DB_TIME_ZONE between the source and target machines. Users selecting data with identical session time zones fetch identical data from both the source and target. which require additional shared memory. • For the TIMESTAMP WITH LOCAL TIMEZONE datatype. • If the database is using the cost-based optimizer (CBO) and there are large numbers of LOBs in the tables that you are replicating. the source machine is in the Pacific time zone and the target machine was in the Eastern time zone. incorporate the SHAREPLEX_LOBMAP table into the analysis schedule. For instructions on setting SP_QUE_POST_SHMSIZE. for example. What this means is if. . the time zone is not changed by replication from a source machine in one time zone to a target machine in a different time zone. causing the potential for data to be out of synchronization. they will be bypassed by conflict resolution. and TIMESTAMP WITH LOCAL TIMEZONE datatypes are supported for Oracle versions 9i and higher. TIMESTAMP WITH TIMEZONE. see Chapter 4 of the SharePlex Reference Guide. • Peer-to-peer replication does not support replication of LOBs. increase the SP_QUE_POST_SHMSIZE parameter to an initial setting of 60 MB.

so SharePlex could post the change to the wrong row. Capture then reads in the DDL statement in the redo log and passes it to the Read pro- . SharePlex con- structs a key using Columns A and B (UPDATE tablename SET Column A to 15 WHERE Column A = 10 and Column B = 20) to locate the row to change. The Capture process picks up the DDL and replicates it to the target database. SharePlex will replicate any CREATE INDEX DDL that creates an index on a table in replication. This functionality is con- trolled via the parameter SP_OCT_REPLICATE_ALL_DDL.110 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. The rows in the table are identical except for the LONG columns. DDL Replication By default SharePlex replicates TRUNCATE TABLE and ALTER TABLE DDL issued against any table that is in replication. This functionality is con- trolled via the SP_OCT_AUTOADD_ENABLE parameter. If this occurs. The following example illustrates the problem. but the LONG columns could have differ- ent values. In addition. Uniqueness cannot be guaranteed if there is a possibility that non-LONG columns in different rows could contain identical values. COLUMN A COLUMN B COLUMN C (LONG) 10 20 100 10 20 200 10 20 300 Suppose a user on the source system changes Column A to 15 in the first row. SharePlex also supports the replication of all other DDL. and there is no primary or unique key. When constructing the SQL statement to apply the change to the target table. SharePlex must build a simulated key internally by using all of the columns except the LONG column in its WHERE clause. There are three rows that meet this criteria. then resynchronize and reactivate those objects so that SharePlex can update its object cache. If this parameter is set. the table can go out of synchronization without being detected by you or SharePlex. any DDL that any user issues against the source database is written to the database redo logs. Recommendation: If possible. This functionality is controlled via that parame- ter SP_OCT_REPLICATE_DDL. add keys.0 Updated 8/19/13 Long columns If tables do not have primary or unique keys.

#scott. all target sys- tems must be identical.table2 Capture will comment out the old entry in the configuration file by putting a pound sign (#) in the first byte of the line. SharePlex changes the name of the table in the active configuration file by commenting out the old configuration line and adding a new line. the new configuration line will reflect the name change on both the source and target.table2 scott. . Refer to Chapter 2 in the SharePlex Refer- ence Guide for more information about this parameter.ora555 Renaming the source table can cause an error on the target if scott.table1 does not exist on the target. SharePlex replicates supported DDL for all schema objects and accounts. the target name will not change.table1 ====> scott. For example. or a SYSMAN user do not get replicated. Renaming tables You can use the ALTER TABLE RENAME command to rename a table. which routes the DDL to the target machines. DDL against objects owned by the SharePlex user.table1 scott. or a SYSTEM user. Since this DDL is “broadcast” by the Read process to all target machines. scott. CHAPTER 4 111 Planning SharePlex Replication cess.table1 renamed to scott.table1 sysA@o. a SYS user.table1. a SYS user. 2003 10:14 scott. If the table is in replication. scott. which might overwrite part of the name.ora555 Then a new entry is added to the end of the configuration file as follows: # Table scott. is replicating to scott. Essentially. or a SYS- TEM user. so those components must exist in the target database for the operations to succeed.table2 ====> scott. scott.table2 sysA@o. Otherwise. Whether the Post process stops or not depends on the setting of the SP_OPO_STOP_ON_DDL_ERR parameter.table1 on the target. and the Post process applies the DDL to the target database(s).table2.table2 August 5. DDL will be replicated only if the DDL operations are performed on objects owned by a user other than the SharePlex user. or a SYSMAN user. the target table name will also change to scott.table2. Setting the SP_OCT_REPLICATE_ALL_DDL requires identical source and target databases in order for the replicated DDL to execute successfully on the target system. the source table.table1 If you rename the source table to scott. If the target table name is the same as the source table name.

The complete DDL is printed in the DDL log for the Post process. 0.ora10_ocap_ddl_01. The Capture process logs the SQL for all of the DDL found in the redo log.112 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. the date and time that the DDL was processed by Post.log Error handling for Oracle DDL replication By default. and the date and time that the DDL was issued against the source database.log The Post process logs all the DDL that it applies to the target database. and all of the DDL that Post processes is logged. You can change this behavior with the SP_OPO_STOP_ON_DDL_ERR parameter. In addition. .ora10a_irvspxub_opo_ddl_01. but statements longer than 2000 characters will be truncated. if Capture replicates the DDL.log For example. o. and not the entire SQL. and the date and time that the DDL was issued against the database. implying that subsequent DML changes also will fail. In addition. An error usually indicates that the database component for which the DDL was executed on the source system does not exist in the target database. The Post log is designated as follows: ORACLE_SID_[machine name]_opo_ddl_[log file number]. the date and time that the DDL was processed by Capture. if the SQL fails. For more information about this parameter. Note: SharePlex prints replicated DDL to the Event Log. see the SharePlex Reference Manual.0 Updated 8/19/13 DDL Logging SharePlex has separate DDL logs on the source and target machines. this information is added to the log. This second message describes the DDL only by the com- mand and the object. the Post process stops if there is an error applying replicated DDL.log For example. The Capture log is designated as follows: ORACLE_SID_ocap_ddl_[log file number]. All of the DDL that Capture retrieves from the redo log. and only the first 60 characters will be recorded in the log. Stopping Post prevents the DML failures and enables you to cor- rect the problem to keep the databases synchronized. Post will log that it failed along with the Oracle error.

Direct-path loads SharePlex replicates changes made to tables through a SQL*Loader direct-path load (DIRECT=TRUE keyword parameter). overwriting the existing data. and if this requires enabling referential and check constraints on those tables after the load. For instructions on changing SP_OCT_REPLICATE_DLOAD. not from an intermediary system to target systems. CHAPTER 4 113 Planning SharePlex Replication Cascading replication and replication of DDL DDL replication is supported only from the source system to the intermediary system. There can be only one load per table (PARAL- LEL=FALSE). If you elect not to replicate a direct-path load and instead repeat the load on the target system. although there can be simultaneous loads on different tables. If you expect the direct-path load to be sustained for a long time on the source system. disable the SP_OCT_REPLICATE_DDL and SP_OCT_REPLICATE_ALL_DDL parameters. A large direct-path load can cause Capture to lose pace with the applica- tion users’ changes entering the redo logs. ALTER TABLE commands are replicated when SP_OCT_REPLICATE_DDL is enabled. The data- base must be in archive mode. Redo and archive logs SharePlex captures data from the online redo logs that Oracle creates as backup for recovery purposes. instead of relying on replication. and table logging must be enabled. The default setting of 1 enables direct-path load replication. TRUNCATES do not get replicated. it might be more efficient to load the data to the target database directly. . thus causing latency between source and tar- get systems. remember to disable the constraints again once they are satisfied. Oracle writes changes to the redo logs until they are full. For cascading replication. The following topics address the requirements for preparing the redo and archive logs for SharePlex replication. Then the logs wrap. which means that Oracle starts writing to the first log again. To stop replication of DDL in cascading replication. see Chapter 4 of the SharePlex Reference Guide. To dis- able replication of direct-path loads. change this parameter to 0. The SP_OCT_REPLICATE_DLOAD parameter controls whether or not direct-path loads are replicated. This design has an important impact on replication for which you should be prepared.

If the redo logs wrap before Capture starts again. If you compress your archive logs. Therefore. It depends on your envi- ronment and tolerance for latency between source and target data.0 Updated 8/19/13 ASM support ASM. To determine the current log for SharePlex. At this point. issue the show . you will need to resynchronize the data if the redo logs wrap and Capture is not finished pro- cessing the data. Capture records its location in the redo log and continues from that point when started again. If the archive logs are not available. Reading the logs involves processing data through the capture queue. There also is the potential for SharePlex to lose information needed to construct SQL statements for posting on the target system. avoid stopping the Capture process for long peri- ods. there is no alternative but to resynchronize the data. Archive logs The archive logs allow replication to continue when the online redo logs wrap before Capture is finished reading them. and it could be more practical to resynchronize the data instead of waiting for SharePlex to restore parity by replicating from the archive logs. so it is possible to run out of disk space on the source system while Capture processes the operations that it missed. The following guidelines help you configure archive logging to ensure successful replication. Otherwise. If the delay before Capture starts again is long. on filesystem devices. For a list of currently supported platforms please refer to the Supported and Non-sup- ported Operations section of the latest Release Notes/Patch Notes. do not compress them until SharePlex is finished processing them.114 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. Capture loses pace with Oracle’s pro- cessing. Automatic Storage Management. SharePlex returns a Log wrap detected error and will not be able to process the data. Redo log size If the Capture process stops (or is stopped by a user) while users are making changes to objects being replicated. Capture reads through the archive logs to locate the records it missed. is an Oracle feature introduced in Oracle 10g. Redo log and datafile locations SharePlex supports replication when the Oracle redo logs and datafiles reside on raw devices. Archive logs on the source system Enable archive logging on the source system. or both.

contact Quest Technical Support. Post will be unable to post changes until the problem is resolved. such as for high availability or peer-to-peer replication. Change the parameters using the set param com- mand in sp_ctrl. If you have any questions or concerns about changing these parame- ters. Archive volume For optimum performance when transaction volume is either very high or very low. If Oracle cannot create the logs. You can compress any logs that were generated previous to the current one. If you must retain archive logging on the target system. the default settings for SharePlex parameters are sufficient. For environments generating between 5 GB and 15 GB of archive log volume daily. Daily log volume less than 5 GB per day RECOMMENDED WHERE TO MAKE THE PARAMETER NAME SETTING CHANGE SP_OCT_CHECKPOINT_FREQ 500 source system SP_ORD_CDA_LIMIT 5 source system SP_ORD_DELAY_RECORDS 50 source system SP_ORD_LDA_ARRAY_SIZE 5 source system SP_ORD_RMSG_LIMIT 20 source system SP_IMP_WCMT_MSGCNT 100 target system SP_COP_IDLETIME 120 source and target systems . maintain enough space in the archive log direc- tory for Oracle to continue creating archive logs. When using compressed archive logs. and no action is needed. refer to one of the following tables that corresponds to your source database’s daily archive log volume. If SharePlex can- not find the archive log there. see the SharePlex Reference Manual. To determine the correct values. it looks in the directory or directories specified by the SP_OCT_ARCH_LOC parameter. set the SP_OCT_ARCH_LOC parameter to the full path name of the directory where the archive logs are located. When the redo logs wrap. CHAPTER 4 115 Planning SharePlex Replication capture command with the [detail] option in sp_ctrl on the source system. For more information about this parameter. Archive logs on the target system Disable archive logging on the target system to eliminate unnecessary Oracle activity on that system. SharePlex looks for the archive logs in Oracle’s archive log list. cer- tain parameter changes are recommended before replication commences.

116 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. SharePlex replicates direct loads when there is one load per table (PARAL- LEL=FALSE). .0 Updated 8/19/13 Daily log volume greater than 15 GB per day RECOMMENDED WHERE TO MAKE THE PARAMETER NAME SETTING CHANGE SP_OCT_CHECKPOINT_FREQ 5000 source system SP_ORD_CDA_LIMIT 20 source system SP_ORD_DELAY_RECORDS 500 source system SP_ORD_LDA_ARRAY_SIZE 10 source system SP_ORD_RMSG_LIMIT 2000 source system SP_IMP_WCMT_MSGCNT 2500 target system SP_COP_IDLETIME 600 source and target systems For more information about SharePlex parameters and the set param command. To ensure that SharePlex does not run out of locks. it locks tables that are added to the configuration when the configuration is re-activated (just the added tables. or higher if you think you will be adding more tables to the configuration. In addition. The exception is SQL*Loader direct-load operations. The database must be in archive mode.ora file to at least the current value plus the number of tables in the configuration. Changes that bypass the redo logs are not replicated. DML (data) locks SharePlex locks the tables specified in a configuration when that configuration is acti- vated for the first time. Operations that bypass the redo logs SharePlex replicates only changes that are written to the redo logs. and only for that activa- tion). set the DML_LOCKS param- eter in the init. see the SharePlex Reference Manual. and table logging must be enabled.

ora file must be set to accommodate connec- tions created by SharePlex and the database users. depending on whether or not you are using SQL Cache. It is suggested that users consult the appropriate Oracle documentation prior to making changes to Oracle parameters. a target system. Its value depends on whether a sys- tem is a source system. issue the list param post command in sp_ctrl and view the SP_OPO_SQL_CACHE_DISABLE parameter. • With SQL Cache enabled: SQL Cache is on by default. query the database using the following SQL statement: select value from V$PARAMETER where name = 'open_cursors'. PROCESSES parameter The PROCESSES parameter in the init. and follow this formula: 10 + (peak number of concurrent transactions x 2) = minimum open cursors needed The OPEN_CURSORS value can be modified or added if absent. See page 241 for more information about setting OPEN_CURSORS for SQL Cache. To view the OPEN_CURSORS value. To determine the correct setting for OPEN_CURSORS. • With SQL Cache disabled: Estimate the peak number of concurrent updating trans- actions (sessions) your applications generate. or a system that serves as both a source and target system. CHAPTER 4 117 Planning SharePlex Replication OPEN_CURSORS parameter SharePlex requires the value of the Oracle OPEN_CURSORS parameter to be set cor- rectly. Source system only If a system serves only as a source system. 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. To view the status of SQL Cache. and a value of 1 means it is disabled. the following formula takes into account log- ins made by the Read process. (peak number of source database sessions) + (background Oracle processes) + (value of SP_ORD_LDA_ARRAY_SIZE parameter +3) = PROCESSES value . do one of the follow- ing. or more if the SQL Cache option is enabled. A value of 0 means it is on.

(peak number of source database sessions) + (peak number of target database sessions) + (background Oracle processes) + (value of SP_ORD_LDA_ARRAY_SIZE parameter +3) = PROCESSES value LOG_PARALLELISM parameter The LOG_PARALLELISM parameter in Oracle 9i is found in the init. The PROCESSES parameter on the target system must be set high enough to accommodate Post’s connections. Note that the Oracle RECOVERY_PARALLELISM parameter. The default value for this parameter is 1. it creates as many connections on the tar- get system as there are sessions on the source system in order to maintain transaction consistency.0 Updated 8/19/13 Target system only Although the Post process is one Oracle user. For Oracle versions 10g and higher. if set to values greater than 1. SharePlex assumes that the transactions within a redo log are written serially. Users typically set the value for this parameter higher than one when they are experiencing long log waits due to heavy activity because the LOG_PARALLELISM parameter helps alleviate conges- tion by allowing redo logs to be written non-serially. check the value for the LOG_PARALLELISM parameter in the init. However. If the value is greater than 1. and restart the Oracle instance for the new value to take effect. SharePlex will detect it and fail. To prevent this problem. . Use the following formula as a guide: (peak number of source database sessions) + (peak number of target database sessions) + (background Oracle processes) = PROCESSES value Combination source and target system If a system serves as both a source system and a target system. the following formula takes into account logins made by the Read process as well as Post’s connections. SharePlex supports writing redo logs non-serially. plus the background Oracle processes those con- nections generate. for Oracle versions 10g and higher.ora file. the LOG_PARALLELISM setting has been depre- cated and now is enabled by default. This parameter sets the maximum number of latches that can be obtained at one time for writing to the redo logs.118 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. which means that SharePlex will not fail if the value of the parameter is greater than 1. If the LOG_PARALLELISM parameter is set to a value greater than 1. is not supported by SharePlex. plus the peak number of users expected to access the target database for queries.ora file before installing SharePlex. back- ground Oracle processes. reset it to 1. and user connections.

Post performs an internal read/release after it receives each COMMIT. Whenever a transaction is committed. see page 34. you can increase the SP_OPO_READRELEASE_INTERVAL parameter default value to 100. more normal- sized transaction is committed. this can cause excessive I/O on the target system and slow the Post process. thus directing Post to read/release only after a certain number of messages have been processed. in that case. For more information about messages. see Chapter 4 of the SharePlex Reference Guide. especially when there are numerous concurrent transactions. Reducing the size of the buffer that is flushed to disk can speed the Post process. but the buffer is large. its buffered data is flushed to disk. Character sets The following character sets are tested and supported for SharePlex: • US7ASCII • UTF8 • WE8ISO8859P1 • AL16UTF16 • AL32UTF8 • KO16KSC5601 Note that Shareplex supports replication between a subset of a character set and a super- set of that character set and not between two different character sets. If most transactions are small. For small transactions. more than 1 MB is too big unless you are rebuilding an index. When a large transaction is committed while another. CHAPTER 4 119 Planning SharePlex Replication Log buffer size The number of database writers has an impact on replication. you need large chunks to be written at once. If most of your transactions are small. Try decreasing the size of the log buffer to 1024 KB. . which means it purges that transaction’s data from the queue as part of the checkpoint recovery process. the second COMMIT must wait while the entire buffer is flushed to disk. this can cause slow posting. Gener- ally. For more information about this parameter. or even 512 KB if possible. Transaction size Normally.

If you attempt to rep- licate this symbol into a US7ASCII database. As SharePlex posts data. consider the Japanese character for "rice" in the JA16SJIS character set. This "conversion" may result in data loss while replicating to a character set that is a superset of the source. There is no corresponding symbol in the US7ASCII character set. Oracle will convert this to a '?' character since there is no such symbol in US7ASCII. however. For example. If. SharePlex does not perform character set conver- sion. Oracle character set conversion can cause unexpected results. Hence. Depending on the character sets involved.0 Updated 8/19/13 Character set conversion SharePlex reliably replicates all characters within the character set you are using if you are replicating between identical character sets. . the Oracle conversion might lead to data loss. Replicating between non-identical character sets If you are replicating between non-identical character sets you should choose to either • use the Oracle character set conversion or . Note that Oracle does not convert characters if the character sets are identical. . Thus. You do not need to set any parameters to achieve this behavior. then some charac- ter set conversion might be required. For example. . the WE8ISO8859P1 character set is a superset of the US7ASCII character set. posting WE8ISO8859P1 data to a database with a character set of WE8ISO8859P1 bypasses the Oracle conversion process.120 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. instead Oracle performs the conversion. you might expect that any character in US7ASCII is posted unconverted into a WE8ISO8859P1 target database. However. This is true for characters in the range 0x00 to 0x7F. according to Oracle. If the data is encoded in a different character set than the character set of the target database. Oracle strips off the top bit of characters in the range 0x80 to 0xFF. you are replicating between non-identical character sets. Oracle is notified about the character set encoding of the data. • bypass the Oracle character set conversion The default behavior for SharePlex is to accept the Oracle character set conversion. Oracle will perform character set conversion.

Note: SharePlex will always convert NVARCHAR and NCLOB data if the source data- base’s NLS_NCHAR_CHARACTERSET is not the same as the target database’s NLS_NCHAR_CHARACTERSET.0. set the parameter to 0.0 but will still work in an upgraded environment. SP_OPO_NLS_CONVERSION int(0:1) 1 # Convert by default To change this behavior. CHAPTER 4 121 Planning SharePlex Replication The parameter. . Dates Oracle JDBC driver classes below version 8. Deprecated parameters can- not be set in 8.0. SP_OPO_NLS_CONVERSION. The default behavior is to convert.5 or above.0. Note that the following parameters pertaining to NLS language conversion in previous versions have been deprecated as of 8. you can issue the reset command on it.0. refer to the SharePlex Reference Guide. A parameter that had been set in the paramdb in a prior release is still available and used by SharePlex in the release where the parameter was flagged as deprecated. Make certain your applications use JDBC driver classes 8. Deprecated parameters: SP_ORD_NLS_LANG SP_OPO_NLS_LANG SP_OPO_CHARACTERSET SP_OPO_NCHAR_CHARACTERSET SP_DEQ_NLS_LANG SP_DEQ_NLS_LANG_SELECTOR SP_DEQ_CHARACTERSET SP_DEQ_NCHAR_CHARACTERSET Note: New in 8. a parameter can be flagged as “DEPRECATED”. determines whether or not the data posted by SharePlex is converted from the source characterset to the target characterset. For more information about this parameter.5 can allow the input of improper date formats. If you do not want SharePlex to use the deprecated parameter.

Data was replicated using insert/update/delete/rollback/truncate. create an alias in the local /etc/hosts file that contains only alphanumeric characters. users granted DBA privileges (such as SharePlex) do not have enough privileges to see those rows without granting a special role from the OLSSYS user. • If the production database has between 500 and 1. The OLS policy data label column was not hidden. Host names SharePlex supports host names that contain letters or numbers only. if used. Also create the alias on the NIS server and the DNS server.0 Updated 8/19/13 initrans setting for SHAREPLEX_TRANS table SharePlex updates the SHAREPLEX_TRANS table to maintain read consistency for the target database. the initrans setting might need to be increased to improve perfor- mance and reduce contention on that table. SharePlex was tested under the following OLS configuration: The SPLEX_USER was granted FULL privilege to the objects in replication. rebuild the SHAREPLEX_TRANS table to have an initrans of 30. • If the production database has more than 1. but some system-level adjust- ments are needed to ensure successful replication. Test tables with OLS security were created. If a host name con- tains a dot or any other non-alphanumeric character (such as “. Because the Post process reconstructs transactions made to the pro- duction instance.122 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. If the OLS policy data label column is defined as hidden the data in that column can not be replicated by SharePlex to the target system. Oracle Label Security (OLS) When Oracle Label Security (row-level security) is enabled for tables in replication. rebuild the SHAREPLEX_TRANS table to have an initrans value of 40. SharePlex cannot process the rows that are protected.000 concurrent users. By default. . Configuring the system for replication SharePlex requires no changes to the operating system.” or “_”). and alter table to add and drop columns.000 concurrent users.

Redo logs and Oracle datafiles can reside on raw devices in a replica- tion environment. segments are the two most write-intensive processes. the following I/O- intensive processes should be on separate drives from each other. and combine the SharePlex processes with the SYSTEM tablespace. or remove SharePlex and reinstall it on a filesystem disk. They should be sep- • The SYSTEM tablespaces arated from the other. Generally. preferably with sepa- rate processors: • The redo logs — preferably without any striping and preferably on solid-state The redo logs and the rollback drives. SharePlex adds a load of between two and five percent to the resources con- . Important! If you move just the rim sub-directory to a separate drive. and • The rollback segments — preferably on the ones with the most sequen- solid-state drives tial access. more • The indices mixed or read-intensive pro- cesses that have more of a ran- • The datafiles dom-access nature. Raw devices SharePlex binaries and queue files cannot reside on raw devices. CHAPTER 4 123 Planning SharePlex Replication Geography Review the disk drives on which the elements of the Oracle database are distributed. and compare them to the location of the SharePlex processes. CPU considerations In a typical business application with a mix of 80 percent queries and 20 percent changes. move all of the files to a filesystem disk that is dif- ferent from the production filesystem. link it to the Share- Plex variable-data directory. • The SharePlex processes (the binaries in the SharePlex product directory) • The SharePlex queues (the files that are created in the rim sub-directory of the Share- Plex variable-data directory) If the SharePlex processes and queues cannot be on their own disk drives. combine the SharePlex queues with the datafiles. If the SharePlex soft- ware was installed on a raw device.

assuming that the network can keep up with the amount of data being transferred. SharePlex will generate an additional 15 seconds of CPU to repli- cate those rows. and more so when replication is stopped by a user or because of a net- work. data accumulates in the export queue on the source system. post). Additional I/O load is minimal. To determine the amount of queue space on each system 1 Use a worst-case scenario and estimate the length of downtime to be tolerated. SharePlex adds about 15 percent to the amount of resources consumed by Oracle. which are periodically written from memory to disk in the rim sub-directory of the SharePlex variable-data directory. if it takes 100 seconds for Oracle to insert 50. [size of a redo log] x [number of log switches in 1 hour] x 1/3 x [number of hours downtime] = amount of disk space needed for the queues on each system . replication stops. For example. Disk space for queue files Queue File Size The main SharePlex consumers of disk space are the queues (capture. using the following formula as a guide. or when Export or Import is stopped. data accu- mulates in the post queue on the target system. If a system runs out of disk space. There must be enough disk space on both systems to hold that queued data for as long as the peak processing or downtime persists. These are guidelines only. export. • When the target Oracle instance is unavailable.000 rows of data. All queue data files are 8 MB. • When the network or target system is unavailable. and you will need to resynchronize the data. Since the queues are dynamic. • When Read stops. SharePlex builds data files for each queue on demand. To accommodate data in a queue. The rest is data used by Oracle to maintain and operate the instance itself.0 Updated 8/19/13 sumed by Oracle. data accumulates in the capture queue on the source system. instance or system failure.124 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. the number of data files can grow considerably during peak activity. or when Post is stopped. This formula multiplies the redo log value by one-third because only about one-third of the redo log is actually data that is replicated. 2 Determine how much data is replicated in that time. and your results can vary depending on your transaction mix. On systems that are DML intensive.

because NFS devices cannot meet the performance demands of SharePlex rep- lication. The queues reside in the rim sub-directory of the SharePlex variable-data directory. especially when there are unexpected peaks in user activity. Tip: Putting the rim sub-directory on solid-state drives can improve performance by as much as 50 percent. Warning! SharePlex queue files must not be located on a raw device. put them on a separate file system from the production files. the queues will not benefit from striping or RAID 5. According to the formula. See Chapter 9 for more infor- mation. you can continue production activity even if replica- tion runs out of space. Queue File Location Because the SharePlex queues consume disk space as data accumulates. including the Oracle datafiles. If you move the rim sub-directory to a separate drive. By isolating the queues. binaries. you need 800 MB of space on the source machine and on the target machine for the SharePlex queues. Typically. 256 MB. You can put the queues on NAS (Network Attached Storage) or SAN (Storage Area Network) devices. CHAPTER 4 125 Planning SharePlex Replication Example: Suppose you expect to recover from 8 hours of downtime and your redo logs are 60 MB. link it to the SharePlex variable-data directory. Establish the queues on a non-striped device. and logs. Memory (UNIX systems) SharePlex requires a per-process memory allocation of greater than. [60 MB redo log] x [5 switches/hour] x [1/3] x [8 hours] = 800 MB disk space Tip: Always monitor disk usage when there is an active configuration. A device with a large disk cache works best. They switch five times an hour. Because reads of the queues are sequen- tial. or equal to. but do not put them on traditional NFS (Network File System) devices. per-process memory usage for SharePlex processes is just a fraction of . SharePlex provides monitoring utilities for UNIX and Windows platforms that monitor queue volume.

The soft limit can be set as high as the hard limit. $ ulimit -aH time(seconds) unlimited file(blocks) unlimited data(kbytes) unlimited stack(kbytes) unlimited coredump(blocks) unlimited nofiles(descriptors) 1024 vmemory(kbytes) unlimited The nofiles(descriptors) value is the one to verify and change if necessary.0 Updated 8/19/13 that amount. When you shut down sp_cop and start it again. The system file descriptors setting (nofiles) determines the number of files that a process can have open at one time. Under some conditions. Consult your Sys- tem Administrator for assistance. the Post and Read processes dynami- cally allocate larger sets of memory. you can set a soft limit for this parameter. the command works in the Bourne shell (sh). On HP-UX systems. System file descriptors (UNIX systems) To ensure fast. which could be lower than the hard limit. but not higher. On Solaris. This parameter can be set either as a sys- tem hard limit or a session-based soft limit. the hard limit usually is set high enough for SharePlex. Changing the system file descriptors value requires root privileges (usually the System Adminis- trator). the soft limit reverts back to its default value. but the soft limit only stays in effect for the duration of the sp_cop session for which it was set. the per-process memory must be large enough to allow SharePlex processes to function. the following command displays the soft limit for file descriptors.126 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. and the system must be rebooted after you make the change. Instead of changing the hard limit. IBM AIX. $ ulimit -aS . but it should be verified. however. The following command displays the hard limit (and other ulimit settings) on Sun Solaris and IBM AIX systems. and HP-UX (Bourne shell) platforms. SharePlex requires a system file descriptors setting of 1024 or as close to that value as your system resources can accommodate. It does not require a root user to change it. problem-free posting to the target database. On most production systems. To prevent process failure.

<pid>" unless the core file is from sp_cop. it indicates that the system file descrip- tors setting needs to be increased: Error 07-24-08 12:11:40. the core file will not be renamed. queue prodsys. Oracle increases its CPU utilization during peak processing. you can use the soft limit to restrict other applications to lower levels. SharePlex only uses about three to eight percent of overhead. SharePlex can be left with a default setting and little resource allocation. Otherwise. This is the "current working directory" for sp_cop and the pro- cesses started by sp_cop. The core file generating process might exit even if a core file was actually created.<pid>". the SharePlex event log might report that a core file was not generated. The SharePlex process priority should be matched to Oracle’s priority. If you see the following error in the event_log. Quest recommends that you use the hard limit setting for SharePlex (sp_cop) to ensure that the system file descrip- tors setting remains at a sufficient value. user. If the OS naming convention is set to "core. or both could lose pace with Oracle during hot backups or other Oracle-intensive operations. In that case. $ ulimit -n value Because of the session-based limitations of the soft limit. so the possibility of overwhelming the system is low. For naming conventions.<pid>".360226 8693 12345 Poster error: /var/quest/ vardir/log/event_log: Too many open files (posting from ora102. . If you increase the hard limit to satisfy Share- Plex. or process-specific placement of application core files. all core files will have that name format. CHAPTER 4 127 Planning SharePlex Replication The following command sets the soft limit for system file descriptors. SharePlex will rename files named "core" to "core. Capture. For core file location. If the SharePlex core file policy is not met. SharePlex supports only the dump subdirectory of the SharePlex variable data directory. Read. Process priority If Oracle or other processes are assigned resource priority. and customizable naming conventions for core files. SharePlex supports "core" and "core. to ora10b) Core File Management Many platforms support system-wide.

if the redo logs are 20 MB in size. and they switch six times an hour. which authorizes connection attempts made by other systems. Do not use the standard Windows Task Manager. so it interprets that it already processed the data and waits for more to process. Also in that chapter are instructions for using the host-authorization feature of SharePlex. While it waits. • On Windows systems. see page 280. which continues generating redo data not . it loses pace with Oracle. so you must run the Windows Task Manager with special priv- ileges to set process priority for SharePlex. The SpUtils and SpClient utilities both have options for running the Task Manager with the correct privileges.0 Updated 8/19/13 To change process priority • On UNIX systems. Typically. For instructions for using SharePlex with SSH. see Chapter 6. SharePlex replicates about 33 percent of the redo log volume. The bandwidth required by SharePlex to transfer data varies. Veritas Quick I/O Because of the way Quick I/O caches disk information. SharePlex will replicate approximately 40 MB each hour: [20] x [6] x [1/3] = 40 MB/hour Security SharePlex can be configured to work with SSH software.128 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. if all of the tables in a database are being replicated. depending on the volatility of the database and the transaction mix of queries and changes. Capture cannot access the cache. use the nice command. You also can use the DTaskmgr program in the bin sub-directory of the SharePlex product directory. The following is a formula for determining bandwidth. the remainder being mostly maintenance data used by the Oracle software. Network requirements Bandwidth SharePlex replicates over any TCP/IP network connection. [size of a redo log] x [number of log switches in 1 hour] x 1/3 = volume of data per hour For example. the NuTCRACKER operating environment controls the SharePlex processes. For more information about setting process priority for SharePlex on Windows systems.

When Capture processes what it missed and returns the redo logs. The eventual result is a log wrap and the necessity to access the archive logs. the same thing happens again because of the Quick I/O cache. CHAPTER 4 129 Planning SharePlex Replication accessible to Capture. activation. or deactivation of a configuration • parameter changes that you want to keep • SharePlex patches that were applied Backups are essential when users need the ability to fail over to a secondary system and back for high availability. Such changes include: • modification. back up the SharePlex environment on all source and tar- get systems and then repeat the backup whenever there is a change in the replication environment. Other implementation considerations Regular SharePlex backups After replication commences.profile file if SharePlex is installed on a cluster Windows platforms • the Windows Registry files (to save the SharePlex environment) • the files containing the user and group information . The only workaround is to remove Quick I/O from the redo and archive logs. The following are the items to back up: All platforms • the entire SharePlex product and variable-data directories UNIX platforms • the oratab file • the /etc/services file (for file descriptor settings) • the /etc/system file (for semaphore information in case of system loss) • the /etc/group file for user information • the . reactivation. but you can use it for the datafiles.

You also can recover the object cache information in the state sub-directory.0 Updated 8/19/13 When you have an archive of the current directories. and the filesystem(s) or machine containing SharePlex components is unrecoverable. resynchronizing data. enabling you to restore the replication environment without recreating and reactivating configurations. re-establishing direc- tory paths. Status Data- base. you can recover the state of the queue files in the rim sub-directory. or resetting parameters. license key.130 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. . and other critical files. You also can restore the SharePlex logs.

5 Preparing for SharePlex Replication Because the previous chapter provided an overview of replication options with Share- Plex and the basic requirements for successful implementation. The chapters that follow help you implement your replication strategy. so read them in sequence for the best results. Contents SharePlex configuration construction Configuration for replicating to multiple target systems Configuration for isolating data using named export queues Configuration for faster posting using named post queues Configuration for horizontally partitioned replication Configuration for vertically partitioned replication Scripting a configuration to replicate numerous tables in a schema Scripting a configuration to replicate an entire database Establishing replication Establishing replication for reporting Establishing replication for high availability and data recovery Establishing replication for data distribution or distributed processing Establishing replication through an intermediary system Establishing combined cascading/broadcast replication Establishing replication for centralized reporting (standard method) Establishing replication for centralized reporting using multiple sp_cop processes Establishing peer-to-peer replication . you now should know your replication strategy and addressed any system issues associated with Shareplex replication.

from one table to another. Configurations reside on the source system—the system hosting the database containing the objects whose data will be replicated. This is full-table replication. or both. For example. also known as selective column replication. The configuration is an ASCII text file that tells SharePlex which data to replicate and where the data needs to go. you have the authority to create a configuration. If you are a SharePlex Administrator or operator. you use horizontally partitioned replication. you use vertically partitioned replication. See “Configuration for vertically partitioned replica- tion” on page 172 for more information. This is partitioned replication.0 Updated 8/19/13 Part 1: SharePlex configuration construction After you configure your data and systems. See “Configuration for horizontally partitioned replica- tion” on page 160 for more information. also known as selective replication. To replicate selected columns. Full-table and selective replication SharePlex offers several configuration options: • The most basic configuration replicates all rows and columns from one table to another. partitioned replication can . • You can replicate selected rows or columns. To replicate selected rows. also known as selective row replication.132 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. so that you can create one that is most suitable for your replica- tion strategy. Configuration options Before you begin creating configurations. This part of the chapter explains the different ways to create configurations. the next step is to create a configuration file that defines the data to be replicated. You can combine horizontally and vertically partitioned replication to control which information is distributed and where it is sent. review the following to familiarize yourself with the options available to you.

or it is sensitive information that cannot be shared. For the vertically partitioned tables. The headquarters replicates many of its tables in their entirety to all regions. • For high-availability or reporting strategies where the corresponding source and tar- get table names are identical. This allows you to specify a group of tables in a specific schema using a single line in the configuration file. • For high-availability strategies. you can configure all tables and sequences in the database with the config. you can use progressive configuration activation to make the process faster. especially if there is extensive row chaining. such as corporate headquarters. • For ease of use SharePlex supports the use of wildcards in the configuration file. but not others. the company uses vertically partitioned replication to replicate data from some of the columns. Replicating numerous objects SharePlex provides options for speeding the creation of configurations. You may also specify a specific set of tables not to be included in replication.sql script to configure all tables in a schema. See page 148 for instructions. But for other tables. See page 183 for instructions. Using wildcards also allows for the automatic addition of any new tables to replication without having to reactivate the configuration. and the remote locations maintain different reporting databases. CHAPTER 5 133 Preparing for SharePlex Replication be used by a business that has a central location. you can use compound routing syntax to configure one routing map for all targets. It might be help- ful to review those instructions before you decide how to build your configuration(s).sql script. excluding regions that have no use for it. The central location maintains the corporate database. See page 179 for instructions. you can use the build_config. • To replicate numerous objects. Replicating to multiple target systems When all target tables for a source table have the same owners and names. the company also can use horizontally partitioned replication to direct each data change to the region that needs it. See page 311 for instructions. See page 137 for instructions. The non-replicated data either is not useful to the regions. Horizontally partitioned replication also can be used when you are replicating all of the columns of a table. . with little or no data in common between them. and a number of remote locations. such as regional divisions or retail locations.

SharePlex uses the specified columns as a unique key in its WHERE clause to locate target rows for posting. viewing. activating and modifying configura- tions. See Chapter 1 of the SharePlex Reference Guide for more information about SharePlex commands. activate the first one and then open another session of sp_ctrl to activate the second one. you can use named export queues to separate the replication streams. For more information. An explanation of how a key is defined follows in “Components of a SharePlex configuration” on page 135. . • Create configurations on the source system—the system containing the data to be replicated. (Certain replication strategies necessitate configurations on two or more sys- tems.) • You can create as many configurations for the same Oracle instance as you want—to replicate different tables at different times for example—but only one can be active at a time. see page 150.0 Updated 8/19/13 Defining a unique key You can specify a key definition in the configuration file if a table was not created with a PRIMARY or UNIQUE key. • Objects listed in the configuration must be part of the Oracle instance specified in the configuration and must contain datatypes that SharePlex supports. To improve Post performance when tables have different transaction types or large datatypes. • To activate multiple configurations for different datasources on the same system. or for replication to multiple target systems.134 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. follow these rules: • Review the commands for creating. Configuration guidelines When creating SharePlex configurations. Open as many sessions of sp_ctrl as you have configurations to activate. Configurations for different Oracle instances on a system can be active at the same time. you can use named post queues to separate the replication streams among two or more Post processes. see page 155. For more information. A list of sup- ported items is on page 76. SharePlex automatically sends configuration information to the target system. Separating replication datastreams For replication from two different Oracle instances.

Methods for determining the ORACLE_SID You can view the ORACLE_SID in a few different ways. There can be only one datasource per configuration. • All configurations must reside in the config sub-directory of the SharePlex variable- data directory. You assign a name to a configura- tion when you create the configuration using the create config command in sp_ctrl. Configuration files outside this directory cannot be activated. Share- Plex places configurations in this directory by default when you create them through the sp_ctrl interface. If an entry in the configuration contains misspellings or is missing a required component. CONFIG1 is not the same as config1. . Configurations con- taining duplicate entries will fail to activate. CHAPTER 5 135 Preparing for SharePlex Replication • Correct syntax is essential. Lines can wrap on-screen. press Enter. consider developing consistent and meaningful naming conventions. The ORACLE_SID is the most accurate way for SharePlex to locate the data. activation of that object will fail. To end a line and start a new one. Datasource Datasource is a SharePlex term for the ORACLE_SID of the Oracle instance containing the data to be replicated. Because the number of configurations that you write probably will increase over time. routing). although you can add it to the file as a comment line. Components of a SharePlex configuration The following are the components of a configuration and the rules for specifying them. • Each line in the configuration can contain only one entry (source object. SharePlex configuration names are case-sensitive. • Do not activate a configuration until you configure your data and systems properly for the type of replication that you are doing. target object. Configuration name The configuration name is not a functioning component within the configuration itself.

.SID . ora10 is the ORACLE_SID and /qa/oracle/ora10/product is the ORACLE_HOME directory. In the configuration file.SID components.0 Updated 8/19/13 • On UNIX and Windows systems. SQL> select name. • On Windows systems. identifies the datasource as an Oracle database and differentiates it from UNIX datasources. The word Datasource is not case-sensitive. but nowhere else in the syntax. The datasource component must be the first non-commented line in the configuration file. The ORACLE_SID must appear in the configuration the same way it appears in the oratab file. Syntax for the datasource The syntax for a SharePlex for Oracle datasource is: o. . which are replicated by SharePlex FS soft- ware.136 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. HP-UX and IBM AIX systems $ cd /etc $ more oratab You will see a display similar to this: ora10:/qa/oracle/ora10/product In this example. • On a UNIX system. The o. ORA10 is not the same as ora10. you can query the V$PARAMETER table through SQL*Plus. ORACLE_SIDs are case-sensitive. you can view the Windows Registry under HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE. you can view the oratab file. value from V$parameter where name = ‘db_name’. where o is the lower-case letter o and SID is the ORACLE_SID of the source Oracle instance— for example o. Windows Registry or V$PARAMETER table..ora10. for example: Datasource:o. the word Datasource and a colon (:) precede the datasource.ora10 A space is permitted between the Datasource: and o.

and named queues (sysA:QueueA*sysB@o. A dot (. identified by the fully qualified name of the object. To specify a set of tables using wild- cards: • Wildcard expansion must be indicated by using the expand keyword. remove. Other characters. a set of source tables (not sequences) can be specified using a wildcard sequence. If there is an oratab file in the /etc directory. multiple target systems in a compound routing map (sysB@o. • The name of the object on the source must be the same as the name of the object on the target. Important! Limit machine names and ORACLE_SIDs to letters and numbers.SID). • An exclusion list may be included to further refine the set of tables. CHAPTER 5 137 Preparing for SharePlex Replication Sun Solaris systems On the Solaris platform. • Wildcards cannot be used to define the owner (or schema) name. the tables may belong to different owners (or reside in different schemas).oraC). rename or relocate it to prevent problems for Share- Plex. Alternatively. Wildcard char- acters are also valid object name characters so it is necessary to inform SharePlex that you are employing wildcards. however. SharePlex will assume that these are part of the owner (or schema) name. Specifying source tables using wildcards A set of tables may be specified using wildcards. the oratab file is typically located in the var/opt/oracle direc- tory. . The exclusion list follows the table specification and is indicated by the keyword not. Each source object can be listed separately. • Valid wildcards are the same as for Oracle and follow Oracles rules of usage. Source objects and owners The source objects are the tables and sequences to be replicated. Sometimes there is an oratab file in the /etc directory as well.oraB). plus sign (+) and asterisk (*) are valid syntax components in a routing map when used to denote the target instance (o.oraB + sysC@o. If wildcards are used in the owner (or schema) name.). such as the dollar sign ($) can cause configuration activation to fail.

It must be the object owner (or schema) name followed by a period and the percent sign. please see the Refer- ence Guide. For more information on the verify config command. The following are valid config file specifications: expand scott. you can first issue the verify config command in sp_ctrl. This will give you a list of all the objects for the specified schema as well as any problems encountered.0 Updated 8/19/13 If SharePlex sees the expand keyword in a configuration line. If you do not want new tables to be auto- matically added into replication. prodct) scott.%. For instance the following sample configuration entry: expand scott. gen%. During activation. activation will continue without error. owned by “HAL”.%t__t% fred.%test% scott.ora920 The following config file specifications are NOT valid: expand rob%.% not (spo%.ora920 expand scott. Using wildcards also allows for the automatic addition of any new tables to replication without having to reactivate the configuration. gen%.ora920 expand scott.% scott. If you are unsure if the wildcard specification will produce the specific list of tables you want to replicate.% sysa@o.% sysa@o. . where the table_name is like “PROD%” and the table_name is not like “%TEMP%”.% sysa@o.% sysa@o.%obj% sysa@o. All the tables that match this description will be replicated to the same table_name on the target.% sysa@o. prodct) scott. The syntax for a wildcard specification in the configuration file is as follows: expand schema.138 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8.%test% not (spo%.prod% not (%temp%) hal.ora920 expand scott.sidb will cause SharePlex to activate all tables owned by “SCOTT”. SharePlex will query Oracle for all objects that match the criteria in the wildcard specification.% sysa@o.ora920 Note: The target object name must be specified in the form of: schema. if no tables are found that meet the wildcard criteria.ora920 expand scott.%test% scott.%test% scott.ora920 expand scott.% sysa@o. this feature can be turned off using the SP_OCT_AUTOADD_ENABLE parameter. Please see the Reference Guide for details on this parameter.{wildcarded name} [not ({list of exclusions})] An example of not notation can be found in the last two lines of the example below.

"Emp" • case-sensitive owner name: "Scott". emp scott smith. owner and object names are converted to upper case. Case-sensitive examples: • case-sensitive table name: scott.EMP.emp or SCOTT.emp • case-sensitive owner and table name: "Scott". user key specification.emp_seq.emp seq scott . The syntax for specifying source objects is: owner.table1 and scott."emp" . or target column name specifica- tions is not supported in a configuration specification using wildcards.) but no spaces — for example scott. emp scot.sequence1. Sepa- rate the items with a dot (. These tables will need to be added to the configuration file separately using the components described in the following sections. CHAPTER 5 139 Preparing for SharePlex Replication Limitations of wildcard support The use of vertical partitioning. such as scott.emp seq Underscores are permissible..object . SharePlex recognizes case-sensitivity for an owner or object name when it is enclosed within double quote marks.emp is the same as scott. SharePlex converts them all to upper case. Owner (or schema) names are used so that if a database has multiple objects with the same name.. Compound routing maps and named queues are explained later in this chapter. SharePlex can differentiate among them. Source objects and owners These optional components can be used for any tables that the wildcard specification does not cover. Non-case sensitive example: Scott. where owner is the object’s owner (or schema) and object is the object’s name. The following are examples of strings that are not permissible because they contain spaces: scott. Otherwise.

scott. type a space after the source object and use the following syntax. The columns must meet the following criteria: • They cannot be LONG or LOB columns.. Target objects and owners The target objects are the tables or sequences on the target system to which data will be replicated.. The !key component must precede the column names. Without some form of key. Emp_ID) Example of wildcard and key specification: expand scott. To create a key definition.c2) scott.. • They must be part of the column partition if vertically partitioned replication is being used.% . SharePlex uses the columns defined in the key definition as a key in its WHERE clause to locate target rows for posting.140 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. SharePlex uses all of the columns of a table (or all of the columns in a column partition) as a key. the key definition overrides the Oracle key. Important! When using exclude column notation in vertical partitioning excluded col- umns cannot be used in the key definition... Specify them the same way as source objects—by owner and name—follow- ing the same syntax rules.% scott.tabnokey .0 Updated 8/19/13 Key definition A key definition is an optional component of a source object that lets you specify one or more columns as a unique key if a table was not created with a PRIMARY or UNIQUE key.. which slows replication performance.. replication could return out-of-sync errors or post to incorrect target rows. col_name) Example: !key (Name. Spaces between column names within the parenthe- ses are optional. including the parentheses.tabnokey !key(c1. !key (col_name. Important! When a key definition is specified for a table that has a PRIMARY or UNIQUE key. • They must be able to uniquely identify a row.. . Otherwise.

corresponding source object and owner names. ora10 Target system names • The target system’s name is not case-sensitive in a configuration.. CHAPTER 5 141 Preparing for SharePlex Replication owner. • For non-partitioned replication (full-table replication) and vertically partitioned rep- lication (replication of selected columns) the routing map is the last component of a table’s configuration entry. • For horizontally partitioned replication (replication of selected rows) the routing map is listed in a partition scheme.object Depending on the replication strategy. create an alias for that system in the local /etc/hosts file that contains .where targetsystem is the name of the target system and targetSID is the ORACLE_SID of the target database — for example sysB@o. If a system name contains a dot (. target object and owner names can be different than. and the partition scheme’s name is the last com- ponent of the table’s configuration entry.targetSID .. The syntax for a routing map is: targetsystem@o.ora10 sysB @ o.ora10 sysB@o. There can be no spaces between any characters in the routing map. • SharePlex supports system names that contain letters or numbers only. or the same as. identifies the instance as an Oracle database and differentiates it from other types of data. The following are examples of strings that are not permissible because they contain spaces: sys B@ o. such as an under- score ( _ ).ora 10 sysB@o. Routing map The routing map directs SharePlex where to send the replicated data. The o. Refer to the appro- priate guidelines for your replication strategy in the procedures beginning with “Estab- lishing replication” on page 185.) or any other non-alphanumeric character.ora10.

142 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. For more informa- tion about configuring SharePlex on clustered systems. in addition to the sp_cop process. Routing limitations Although few SharePlex users encounter routing limitations. . Example: oracluster@o.SID. SP_SYS_HOST_NAME must be set to the same value on all systems in the cluster.) or any other non-alphanumeric characters. dots (. All target systems in the routing map must be accessible by the source system through the replication network or through an intermediary system that is accessible. and they can have an important effect on the way you build your configuration if you are replicating data to numerous target systems and Oracle instances. Target ORACLE_SID The target ORACLE_SID is case-sensitive and must appear exactly as it appears in the oratab file. they do exist. see the SharePlex Installation and Demonstration Guide. if used. Review the following routing limitations before you build a configuration. The reason is that SharePlex limits the number of pro- cesses that can simultaneously read a queue to a maximum of 19. • Using a default export queue. Because SharePlex creates one export queue for all target systems. The package name cannot contain underscores ( _ ). Also create the alias on the NIS server and the DNS server. the global cluster package name must be used instead of the local system’s name in the routing map. following the format Clus- terPackageName@o. you can replicate to a maximum of 19 direct target sys- tems from one source system. Routing maps in cluster environments For a target system that is part of a cluster. • The source system must be able to resolve the names of all target systems listed in the routing map. or Windows Registry.0 Updated 8/19/13 only alphanumeric characters.ora10 The global cluster package name must match the string specified with the SP_SYS_HOST_NAME system environment variable. V$PARAMETER table.

there is a maximum of 25 queues. Each instance of sp_cop on a system permits a maximum of 1024 different routing maps. See page 86 for a description and page 197 for information about establishing this strat- egy. SP_QUE_MAX_QUEUES.SID. However. consider using one or more intermediary systems to route replicated data to its final destination. CHAPTER 5 143 Preparing for SharePlex Replication but creates an Export process for each target (which reads the queue). Note: By default. there can be a maximum of 19 target systems. any named post queues (see page 155) and named export queues that are used by that instance of sp_cop. from 9 to 254. • If your replication objectives require exceeding these limitations. For example. which includes one capture queue. in Figure 6 on page 144. This method permits a maximum of 25 queues per sp_cop instance. • There is a limit of nine queues for AIX systems. This change only takes effect when cop is restarted. constitutes a different routing map. Each combination of targetsys@o. this amount can be changed using the parameter. including routing maps with named queues. . there are four routes. • You can compensate for the preceding limitation by using named export queues (see page 179). • The number of named queues is limited by the maximum number of routes.

0 Updated 8/19/13 FIGURE 6: Routing example: In this illustration. for a total of four routes. . Each system has named post queues.144 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. SharePlex is repli- cating all four tables to SysB and SysC. This sepa- rates the two datastreams into four. there are four routes.

type the word Datasource.sequence targetsystem@o. To replicate selected rows and/or columns from a table. Datasource:o. 4 On the first non-comment line.SID .targetSID To create a basic configuration To create a basic configuration.source- SID source_owner. which is the default editor on Windows sys- tems. This command opens the text editor. These instructions create the most basic SharePlex configuration: a uni-directional con- figuration replicating from one Oracle instance to another. followed by a colon (:). When you issue this command. follow the instructions in “Configuration for horizontally partitioned replication” on page 160 or “Configuration for vertically partitioned replication” on page 172. 2 At the sp_ctrl prompt. To change this default. sp_ctrl(sysA)> create config filename 3 [OPTIONAL] You can enter comment lines to identify the configuration or convey other information. CHAPTER 5 145 Preparing for SharePlex Replication Creating a basic configuration using sp_ctrl These instructions show you how to create a configuration for replication of entire tables (non-partitioned replication). Template 1: Basic SharePlex for Oracle configuration Datasource:o.table target_owner.targetSID source_owner. and end each one by pressing Enter. then the letter o. which is the default text editor for SharePlex on UNIX systems.) followed by the source instance ORACLE_SID. 1 From the bin sub-directory of the SharePlex product directory on the source system. start sp_ctrl. see page 266. use the create config command in sp_ctrl. The word Datasource is not case sensi- tive. issue the create config command. or WordPad.table targetsystem@o. Precede each comment line with a pound (#) symbol to indicate that it is non-functioning. Refer to the following tem- plate as you follow the instructions. Leave no space between any of the items. then a dot (.sequence target_owner. it invokes either the vi editor. sub- stitute the name of your configuration for filename. The ORACLE_SID is case-sensitive. In the syntax below.

). targetsystem@o. see “Target system names” on page 141. Leave no space between any of these entries. Do not press Enter. particularly if there are numerous columns. Do not press Enter. 6 On the next line. target_owner. type the owner and name of the first source object. then o. . separating them with a dot (. followed by the target database ORACLE_SID. type at least one space after the source object. Enclose case-sensitive items within double quotes.). Do not press Enter after you type the source object infor- mation. SharePlex does not recognize case-sensitivity."emp". See page 148 for more information.targetSID 10 Press Enter to start a new line. !key (col_name. then use the following syntax. then type the owner and name of the corresponding target object in the same manner as you did for the source object.146 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. Leave no space between any of the items. followed by the @ symbol. otherwise. * SharePlex does not support system names that contain non-alphanumeric characters. then type the name of the target system*.object 9 Type at least one space or tab. 11 Repeat steps 6 through 9 for the following: • each additional target system to which you want to replicate the same object. source_owner. • each additional object that you want to replicate with this configuration.object 7 [OPTIONAL] If the table has no primary or unique key. To define a key. For more information. This creates the routing map. you can use a compound routing map to reduce the amount of typ- ing for those entries. Tip: When target objects for a source object have identical owners and names on two or more target systems. you can specify a key definition if one or more columns ensure row uniqueness. col_name) 8 Type at least one space or tab.0 Updated 8/19/13 5 Press Enter to start a new line. for example "scott". for example an underscore (_) or a dot (. A key improves replication perfor- mance.

emp_name) 12 When you are finished entering objects to be replicated.emp sysC@o.sales !key jane.salary jim.sales sysB@o.oraB (emp_no. save the file with the :wq command in vi or by selecting Save from the File menu in WordPad. CHAPTER 5 147 Preparing for SharePlex Replication Your configuration should look similar to the following: Datasource: o.salary jane.oraB jim. .oraC jane. and exit the editor. You are returned to the sp_ctrl prompt.salary sysB@o. SharePlex automatically saves config- uration files in the config sub-directory of the SharePlex variable-data directory.fin jim.

for example an underscore (_) or a dot (.oraA * SharePlex does not support system names that contain non-alphanumeric characters. Start a new line for each source table.sourceSID targ_own.targSID e To create a configuration for multiple target systems Start with the first object to be replicated and follow the instructions for creating a basic configuration on page 145. as shown in the example. Instead. Type the routing for the first target system* (for example sysB@o.oraC. in sequence. Add each additional target system to the routing map in the same way. You need not send each set of objects to all of the target systems. but do not press Enter to start a new line. Example configuration on source system sysA: Data- source:o. see “Target system names” on page 141. Press Enter at the end of the line.).tabl srce_own. but instead of using a separate line for each target system.oraB). For more information.0 Updated 8/19/13 Configuration for replicating to multiple target systems When target objects for a source object have identical owners and names on two or more target systems.table targsysB@o.148 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. you specify them all in one routing map. type the routing for the second target system in the following manner. you can use a compound routing map in the configuration entry for those objects. . for example systemC@o.targSID + targsysC@o. without starting a new line (it can wrap to the next line). Template 2: Configuration for replication to multiple target systems Datasource:o. You start with a basic configuration line. • a space • a plus sign (+) • another space • the routing map for the second target system. See “Routing limita- tions” on page 142 for the maximum number of target systems. The additional syntax is shown in italics in the template below.

ord scott.oraA scott.emp sysD@o.emp scott.oraB + sysE@o.emp sysB@o.oraD scott. use a sepa- rate line for each set that is different.oraB + sysC@o.emp sysC@o.emp mary.oraB + sysC@o.cust scott.oraE scott.oraB If any target objects have different owners or names than the source object.emp mary.oraC scott.oraC scott.cust sysD@o. Press Enter after each line. CHAPTER 5 149 Preparing for SharePlex Replication Example configuration on source system sysA: sysB@o.oraD .emp scott. as shown in the following example.oraC + scott.cust sysB@o.ord sysB@o. Datasource:o.

should . Consequently. And.150 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. The default architecture of SharePlex sends data from all active configurations through one export queue and one Export process for each target system. if you issue a purge config or abort config command for one configura- tion. each one generating its own Export process. you are affecting the queues for all other active configurations as well.0 Updated 8/19/13 Configuration for isolating data using named export queues Named export queues enable you to isolate replication of individual configurations or selected database objects into their own export queues. FIGURE 7: SharePlex replication using named export queues Named export queues are essential for separating the data streams of different replicat- ing Oracle instances.

. The queue names for one configuration must be different than those for any other active configuration. CHAPTER 5 151 Preparing for SharePlex Replication you need to stop Export or Import for one datasource. and you can stop Export or Import for one datasource while allowing other Export and Import processes to continue. you are stopping those processes for all others as well. so you can have as many as 24 named export queues. However. For more information about setting process-specific parameters. from 9 to 254. including named post queues.targetSID) will be replicated through a default export queue. You can combine named export queues with default export queues. For more information about named post queues. Tables in the config- uration with a standard routing map (targetsys@o. The maximum number of export queues on a system is reduced by the number of post queues. This is effective for isolating tables with large operations or LOB datatypes. SP_QUE_MAX_QUEUES. Because each Export process creates an Import process on the target system. See “Routing limitations” on page 142 for additional information before you build your configuration. This change only takes effect when cop is restarted. You can set SharePlex parameters for processes associated with named queues on an individual basis. enabling you to tune performance based on the objects replicating through each one. If this system is also a target system. see page 155. You can create a named export queue for each target so that you can stop Export for each one separately. this amount can be changed using the parameter. see the SharePlex Reference Guide. Number of queues on a system You can name several export queues within a configuration. Each sp_cop instance allows a total of 25 queues on a system. there is a maximum of 25 queues. Note: By default. Named export queues eliminate those concerns. There will always be one capture queue. Named export queues can be used to separate data destined for different target systems. You can purge or abort one configura- tion without affecting the others. named post queues with their own Post processes are generated. then it also has to have post queues.

object 7 [OPTIONAL] If the table has no primary or unique key.table target_owner. separating them with a dot (. otherwise. Leave no space between any of the items.table SID 1 From the bin sub-directory of the SharePlex product directory on the source system.SID 5 Press Enter to start a new line. for example "scott". Template 3: Configuration for creating named export queues Datasource:o. sp_ctrl(sysA)> create config filename 3 [OPTIONAL] You can enter comment lines to identify the configuration or convey other information. followed by a colon (:)."emp". Enclose case-sensitive items within double quotes. issue the create config command. source_owner. you can specify a key definition if one or more columns ensure row uniqueness. Precede each comment line with a pound (#) symbol to indicate that it is non-functioning. type the word Datasource. Datasource:o. Do not press Enter. start sp_ctrl. 4 On the first non-comment line. The SID is case sensitive. particularly if there are numerous columns. then a dot (. . SharePlex does not recognize case-sensitivity.sourceSID sourcesys:queue_name*targetsys@o. A key improves replication perfor- mance.). then the letter o. Substitute the name of your configuration for filename. 2 At the sp_ctrl prompt. type the owner and name of the first source object. In Template 3.) followed by the source instance ORACLE_SID. Leave no space between any of the items. The difference is that you add the named-queue information at the begin- ning of an object’s routing map. and end each one by pressing Enter. the named queue specification is highlighted in italics to show how cre- ating a configuration with named export queues differs from a basic configuration. 6 On the next line.152 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8.0 Updated 8/19/13 To create a named export queue Creating a configuration that uses named export queues is similar to creating a basic configuration. This command opens the text editor. Datasource is not case-sensitive.target- source_owner.

object 9 Type at least a space or tab. Queue names are case-sensitive on all platforms.dest_sales sysA:QueueA*sysC@o. . save the file with the :wq command if using vi or with Save on the File menu if using WordPad. then exit the text editor. then type the following information on the same line.dest_emp sysA:QueueA*sysB@o. see “Target system names” on page 141. CHAPTER 5 153 Preparing for SharePlex Replication To define a key. • the name of the source system* (required part of the queue name) • a colon (:) • the name you are giving the export queue (maximum 15 characters).). col_name) 8 Type at least a space or tab. repeat steps 6 through 9 using a different queue name.) source_sys:queue_name*targetsys@o. then use the following syntax. For more information. !key (col_name. with no spaces between them. type at least one space after the source object. Your configuration should look something like the following example: Example configuration for instance oraA on source system sysA Datasource:o. Do not press Enter. 12 When you finish.sales * SharePlex does not support system names that contain non-alphanumeric characters. Underscores are permissible.targetSID 10 Start a new line and repeat steps 6 through 9 for each table or sequence being repli- cated through this named queue. Do not press Enter.emp !key scott. 11 To create additional named queues for other objects. for example an underscore (_) or a dot (. target_owner.oraB (name.oraC scott. in sequence. You are returned to the sp_ctrl prompt. then type the owner and name of the corresponding tar- get object in the same manner as you did for the source object. • the target database ORACLE_SID (This is case-sensitive.oraA scott. • an asterisk (*) • the name of the target system • the @ symbol • the o.ID) scott.

and you can view them with their associated Export processes and other replication processes with the show command.dest_ord sysA:QueueA2*sysC@o.ID) jane. .oraA2 jane.oraC jane.emp destined for sysB and scott.sales destined for sysC.154 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8.0 Updated 8/19/13 Example configuration for instance oraA2 on source system sysA Datasource:o. See Chapter 1 of the SharePlex Reference Guide for more informa- tion about these commands. Tip: You can view the named export queues with the qstatus command.dest_cust sysA:QueueA2*sysB@o.ord The preceding configurations create the following export queues on source sys- tem SysA: QueueA containing transactions for scott.cust destined for sysB and jane.cust !key jane. QueueA2 containing transactions for jane.ord destined for sysC.oraB (name.

each queue generating its own Post process. If you are not using named export queues. The concurrent Post processes facilitate smaller. See “Routing limitations” on page 142 for additional information before you build your configuration. You can create one or more named post queues for the following: • objects in the configuration that have LOB columns (recommended). If this sys- tem is also a source system. named post queues are created by default. enabling you to tune performance based on the objects replicating through each one. Number of post queues on a system Each sp_cop instance allows a total of 25 queues on a system. which delays processing of other transactions in the post queue. There is a noticeable effect on performance when some transactions are extremely large. while devoting one or more separate Post processes to larger operations. create one or more named post queues for the rest of the objects in the configura- tion. . Then. If you are using named export queues (see page 179). then it also has to have one capture queue and one or more export queues. With named post queues. If this system is only being used as a target system. you can isolate data into separate post queues. Tables in the configura- tion with a standard routing map (targetsys@o. The maximum number of post queues on a system is reduced by the cap- ture queue and the number of export queues. CHAPTER 5 155 Preparing for SharePlex Replication Configuration for faster posting using named post queues The Post process is only as fast as the time it takes to apply the changes to the target database using standard SQL. • any objects whose operations you want to isolate. For more information about setting process-specific parameters. you can create named post queues by specifying them in the configuration file.targetSID) are replicated through a default post queue. all of those queues can be named post queues. • objects that involve large transactions. You can set SharePlex parameters for processes associated with named queues on an individual basis. You can combine named post queues with default post queues. Using named post queues can improve Post’s performance. more efficient operations to be posted separately. or use default post queues. see the SharePlex Reference Guide.

With named post queues. there is a maximum of 25 queues. it maintains that sequence of events by using one Post process and one default post queue per sourceSID-targetSID datastream. SP_QUE_MAX_QUEUES. This change only takes effect when cop is restarted. On the target side. However. the following conditions apply: . from 9 to 254.156 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. FIGURE 8: SharePlex replication using named post queues Considerations when using named post queues Under normal replication circumstances. this amount can be changed using the parameter. SharePlex captures data in the order in which it was generated.0 Updated 8/19/13 Note: By default.

CHAPTER 5 157 Preparing for SharePlex Replication • The target objects. Template 4: Configuration for creating named post queues Datasource:o. and the rows within them. • If you implement named post queues for objects in an active configuration (thus changing the routing) SharePlex locks those objects to update its internal directions. sp_ctrl(sysA)> create config filename 3 [OPTIONAL] You can enter comment lines to identify the configuration or convey other information. To avoid this. replicate all related objects in the same queue. might not be changed in the same order that the corresponding source objects were. To create a named post queue Creating a configuration with named post queues is similar to creating a basic configu- ration. 4 On the first non-comment line. followed by a colon (:). . then the letter o.sourceSID source_owner. and end each one by pressing Enter.table target_owner. Precede each comment line with a pound (#) symbol to indicate that it is non-functioning. possibly causing the target database to be inconsistent with the source database.targetSID 1 From the bin sub-directory of the SharePlex product directory on the source system. In Template 4. the unpredictability of the posting order can result in the rejection of a child record if the parent record is not applied to the target instance first.) followed by the source instance ORACLE_SID. Substitute the name of your configuration for filename. This command opens the text editor. issue the create config command. This is acceptable (and recommended for most replication strategies) because the constraints are satisfied on the source system and replicated to the target instance by SharePlex. 2 At the sp_ctrl prompt. type the word Datasource. start sp_ctrl. the named queue specification is highlighted in italics to show how a configuration with named post queues differs from a basic config- uration. • If replicating tables have referential constraints. The difference is that you add the named-queue information in the middle of an object’s routing map. then a dot (.table targetsys:queue_name@o. or disable referential constraints on the objects involved in replication on the target system.

col_name) 8 Type at least a space or tab. for example "scott". you can specify a key definition if one or more columns ensure row uniqueness. otherwise. source_owner. A key improves replication perfor- mance. in sequence. • the @ symbol • the o.object 9 Type at least a space or tab. * SharePlex does not support system names that contain non-alphanumeric characters. then type the following information on the same line.).0 Updated 8/19/13 Leave no space between any of these items. 6 On the next line. • the target database ORACLE_SID (This is case-sensitive. target_owner. type the owner and name of the first source object. then use the following syntax.) targetsys:queue_name@o.158 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. Enclose case-sensitive items within double quotes.object 7 [OPTIONAL] If the table has no primary or unique key. !key (col_name. • the name of the target system* • a colon (:) • the name you are giving the post queue (maximum 15 characters). Queue names are case-sensitive on all platforms. Datasource:o. Do not press Enter.targetSID 10 Repeat steps 6 through 9 for each table or sequence being replicated through the first post queue. Do not press Enter.).SID 5 Press Enter to start a new line. The SID is case-sensitive. Do not press Enter. with no spaces between them. . separating them with a dot (. Datasource is not case-sensitive. Leave no space between any of the items."emp". for example an underscore (_) or a dot (. particularly if there are numerous columns. type at least one space after the source object. then type the owner and name of the corresponding tar- get object in the same manner as you did for the source object. Underscores are permissible. see “Target system names” on page 141. For more information. SharePlex does not recognize case-sensitivity. To define a key.

dest_emp sysB:Queue1@o. Queue2 containing transactions from scott. Your configuration should look something like the following example: Example named post queue configuration for instance oraA on source system sysA Datasource:o.ID) scott. repeat steps 5 through 9 using a new queue name.dest_cust sysB:Queue2@o.cust The preceding configuration will create the following post queues on target sys- tem SysB: Queue1 containing data from the table scott. You are returned to the sp_ctrl prompt. Queue names are case-sensitive on all platforms. and you can view them with their associated Post processes and other replication processes with the show command. then exit the text editor. How named post queues are listed in status displays A named post queue is identified by the datasource and either the name of an associated named export queue (if named export queues are being used on the source system) or the user-assigned post-queue name if a default export queue was used on the source sys- tem. See Chapter 1 of the SharePlex Reference Guide for more information about these commands.emp (with long transactions) des- tined for target instance oraB. . Tip: You can view the named post queues with the qstatus command. save the file with the :wq command if using vi or with Save on the File menu if using WordPad.cust destined for instance oraB. 12 When you finish. CHAPTER 5 159 Preparing for SharePlex Replication 11 To create additional named post queues for other objects.oraB scott.oraB (name.emp !key scott.oraA scott.

FIGURE 9: Horizontally partitioned replication: In this illustration. see page 172. • Replication of sequences. SharePlex does not support that combination when vertically partitioned replication is also used for the same table.0 Updated 8/19/13 Configuration for horizontally partitioned replication These instructions show you how to configure SharePlex for horizontally partitioned replication. a company’s headquarters could use vertically partitioned replication to replicate data from a subset of a table’s columns to a reporting instance in each of its regions. • Referencing other tables in a column condition. You can replicate all rows of a table in this fashion. Restrictions for using horizontally partitioned replication Horizontally partitioned replication does not support the following: • UPDATEs or INSERTs on LONG columns larger than 100k. It can use horizontally partitioned replication to route the appropriate records to each of those instances. • TRUNCATEs of an Oracle partition. . 3 and 5 is replicated to instance oraC. • Tables with LOB columns.160 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. For more information about vertically partitioned replication. For example. or you can be more selective by excluding some rows from replication altogether. • Column conditions that include VARRAYs or abstract datatypes. Horizontally partitioned replication can be combined with vertically partitioned replica- tion. for example to route groups of rows to different reporting sys- tems and all rows to a failover system. where different rows of a table are replicated to different target systems. data in rows where C1 = 2. Horizontally partitioned replication can be used in conjunction with full-table replica- tion for the same table. Data in rows where C1 = 1. 4 and 6 is rep- licated to instance oraB.

refer to the sample table in Figure 10. CHAPTER 5 161 Preparing for SharePlex Replication • Oracle TO_DATE function Important! Using horizontally partitioned replication reduces replication performance. The amount of reduction depends on the number of tables involved and their size. .2) Region char(20) unique index employee_Idx on employee_HQ(EmpNo) Creating partition schemes and column conditions You create one or more partition schemes for each table being configured for horizon- tally partitioned replication. you create the following components. The partition scheme is a logical container for column con- ditions. Different groups of rows are replicated to target tables on systems in four regional headquarters. Components of horizontally partitioned replication To implement horizontally partitioned replication. • Partition schemes • Column conditions • Configuration entries As you follow the instructions for creating these components. It is the central table at a corporate headquarters. FIGURE 10: Sample table scott.employee_HQ EmpNo number(4) not null SocSec number(11) not null EmpName char(30) Job char(10) Salary number(7. You need not replicate all rows in a table. A column condition defines a group of rows to be replicated. You can specify as many column conditions as needed to route rows of a source table to different destinations.

• You can create any number of partition schemes for a table. but there are no errors from Post to notify you of the situation. The tables become out of synchronization. The following problems can occur when there are changes to columns in col- umn conditions. SharePlex repli- cates the update. such as HQ. for which rows are not replicated because the data is used locally. . use columns whose values will not change (such as PRIMARY or UNIQUE key columns). This happens because the row was not replicated when it was inserted into the source database (it did not meet the column condition). Those values determine whether or not a row is replicated. but Post cannot locate the row because it never existed in the target database. • If a row that does not meet a column condition is updated to meet the condition. but future operations on that row are not replicated. Planning for multiple partition schemes There are almost limitless ways you can divide rows for replication. although those rows could be replicated with the entire table to a backup system. If you plan to use numerous partition schemes. • If a column condition value is updated and the new value no longer meets the col- umn condition. The operation fails and causes an error. decide ahead of time their names and which column conditions you want to create for each one. the next operation on that row returns out-of-sync errors. Choosing columns for column conditions When defining a column condition. SharePlex performs the operation. • All partition schemes for a table can be active at the same time (they are active if they are listed in the configuration file and inactive if they are not).0 Updated 8/19/13 For example.162 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. a simple partition scheme for the sample table in Figure 10 could have four column conditions for replication: Region = West Region = South Region = Midwest Region = East There could be a fifth value for the Region column. • Partition schemes can have different or overlapping column conditions. When the row is updated to meet the condition.

CHAPTER 5 163
Preparing for SharePlex Replication

If you expect values for columns in column conditions to change, you have the follow-
ing options for repairing rows for which updates to columns defined in a column condi-
tion cause out-of-sync conditions:
• Set the SP_ORD_HP_IN_SYNC parameter so that SharePlex automatically detects
and corrects the out-of-sync condition. Enabling SP_ORD_HP_IN_SYNC causes
some performance degradation, depending on how many tables are configured for
horizontally partitioned replication. For more information about this parameter, see
the SharePlex Parameters chapter of the SharePlex Reference Guide.
• Use the compare command. For more information about this command, see
Chapter 1 of the SharePlex Reference Guide.

Planning for column conditions that are not mutually exclusive
SharePlex maintains a cache of the column conditions for each partition scheme. It
reads through that cache whenever it receives a row change for a table which uses that
partition scheme. By default, SharePlex assumes that column conditions within a parti-
tion scheme are mutually exclusive, so it stops searching when it locates the first column
condition that the row satisfies and uses that condition’s routing. No other conditions are
checked for that row change.
If you are using column conditions that are not mutually exclusive (such as when a
change to a record must be routed to different target tables), you can set the
SP_ORD_FIRST_FIND parameter to 0 so that SharePlex checks all of the column con-
ditions each time it receives a row change for a partition scheme.

Controlling the processing order of column conditions
You can control the order in which SharePlex checks the column conditions in a cache.
Referring to the sample table in Figure 10, for example, if you know that most of the
changes will be made to the Eastern region’s data, you can direct SharePlex to check the
“East” column condition first, which improves overall replication performance because
the other conditions are not checked (unless SP_ORD_FIRST_FIND is set to 0).
You also can use the ordering option when column conditions in a partition scheme are
not mutually exclusive, directing SharePlex to process one before the other if it is more
important.

To create partition schemes and column conditions
For each group of rows to be replicated (each column condition), you define:
• the partition scheme to which those rows belong

164 SHAREPLEX® FOR ORACLE
Administrator’s Guide Version 8.0 Updated 8/19/13

• the conditional syntax that selects them
• their routing
• the order in which this condition is checked

Use standard INSERT statements to enter this information into the
SHAREPLEX_PARTITION table, which was installed unpopulated in the SharePlex
schema when you ran ora_setup. During configuration activation, SharePlex uses the
SHAREPLEX_PARTITION table to build a routing cache for each group of rows (as
defined by column conditions) in each partition scheme.
• Use one SHAREPLEX_PARTITION table for all configurations that replicate data
from the same Oracle instance.
• You can, but are not required to, use all of your partition schemes in a configuration
file. Only those that are listed in an active configuration file are active.

Issue the INSERT statement for the SHAREPLEX_PARTITION table on the source
system (the system on which you are activating the replication configuration). The fol-
lowing are the columns of the SHAREPLEX_PARTITION table, their datatypes, and
their size.
SHAREPLEX_PARTITION table
PARTITION_SCHEME VARCHAR2(30)
DESCRIPTION VARCHAR2(61)
TARGET_TABLE_OWNER VARCHAR2(30)
TARGET_TABLE_NAME VARCHAR2(30)
ROUTE VARCHAR2(1024)
PRIORITY NUMBER
ORDER NUMBER
OPTIONS VARCHAR2(32)
COL_CONDITIONS VARCHAR2(1024)

Note: When a column condition has multiple targets and not all target owners or table
names are the same, you need to issue an additional INSERT statement for each target
owner or name that is different. The SHAREPLEX_PARTITION table provides a column
for this. The most common owner and name should be listed as the target object on the
configuration line.

1 In the PARTITION_SCHEME column, enter the name of the partition scheme for
which you are creating a column condition. For example, the name of a scheme for

CHAPTER 5 165
Preparing for SharePlex Replication

the sample table in Figure 10 on page 161 could be EMP_SCHEME.

2 In the DESCRIPTION column, enter a description of the column condition. You can
enter a NULL value, but if you are creating numerous column conditions, it helps to
identify or describe each one. For example, the description of a column condition for
the sample table in Figure 10 on page 161 could be “West Coast employees” for
rows that are replicated to the company’s Western region.

3 In the TARGET_OWNER column, enter one of the following for the target table’s
owner:
• a NULL value if the owner is the same as the owner that you are listing in the con-
figuration file. (Typically, all corresponding target table owners are the same.)
Or...
• the target owner name if it is different from the one in the configuration file. This
value overrides the value in the configuration file for this route only. To enforce
case-sensitivity, enclose the string within double quotes, for example “Jane”.

4 In the TARGET_TABLE_NAME column, enter one of the following:
• a NULL value if the table name is the same as the one that you are listing in the
configuration file. (Typically, all corresponding target table names are the same.)
Or...
• the target table’s name if it is different from the one in the configuration file. This
value overrides the value in the configuration file for this route only. To enforce
case-sensitivity, enclose the string within double quotes, for example
“employee_West2”.

5 In the ROUTE column, enter the SharePlex routing map* for this column condition.

FIGURE 11: Routing formats
Basic routing map targetsys@o.targetSID
Compound targetsys1@o.target_SID1 + targetsys2@o.target_SID2
routing map

Routing map with source_sys:queue_name*targetsys@o.targetSID
named export queue

* SharePlex does not support system names that contain non-alphanumeric characters, for example an
underscore (_) or a dot (.). For more information, see “Target system names” on page 141.

166 SHAREPLEX® FOR ORACLE
Administrator’s Guide Version 8.0 Updated 8/19/13

FIGURE 11: Routing formats
Basic routing map targetsys@o.targetSID
Routing map with targetsys:queue_name@o.targetSID
named post queue

• If you are routing the rows to one target system, use a basic routing map.
• If you are routing the rows to more than one target system, you can use a com-
pound routing map if all of the corresponding target owners and names are identi-
cal on those systems.
• If you are using named queues, use the appropriate syntax as shown in Figure 11.
You can use a compound routing map if all of the corresponding target owners and
names are identical.
6 In the PRIORITY column, enter a NULL value. This column is for use by SharePlex.

7 In the ORDER column, either enter a NULL value, or enter any positive number to
specify the order for checking this column condition. Column conditions are checked
starting with the one that has the lowest value in the ORDER column.

8 In the OPTIONS column, enter a NULL value. This field is used internally by Share-
Plex.

9 In the COL_CONDITIONS column, enter the conditional syntax for the columns
and values that define the rows to be replicated to the target table specified in step 4.
Do not include references to other tables in the column condition. SharePlex sup-
ports the following datatypes and conditional syntax, which can be combined into
nested expressions with parentheses and the AND, OR, and NOT logical connec-
tives.

Supported datatypes
CHAR
DATE
NUMBER
LONG VARCHAR
VARCHAR
VARCHAR2

Note: For the DATE datatype, SharePlex uses the nls_date_format, with the syntax
specified as MMDDSYYYYHH24MISS in the COL_CONDITIONS column. In the follow-

CHAPTER 5 167
Preparing for SharePlex Replication

ing example, “hiredate” is in the COL_CONDITIONS column with the DATE syntax spec-
ified as “‘1111 2011000000’

hiredate<‘1111 2011000000’

Note that the Oracle TO_DATE function is not supported in the configuration file.

Supported conditional syntax
In the following syntax, the variable 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).
NULLs are replicated by SharePlex in cases such as this one: not (department_id =
90). If department_id is NULL, then it is replicated. To avoid replicating records
with NULLs in a column condition, include the column is not null syntax as part of
the condition, for example: not (department_id = 90) and department_id is not
null.
column = value
not (column = value)
column > value
value > column
column < value
column >= value
column <= value
column <> value
column != value
column like value
column between value1 and value2
not (column between value1 and value2)
column is null
column is not null
Example column conditions:
not (col1 = 5)
(col2 = 5) and not (col3 = 6)
((col1 is not null) and (col2 = 5))

When parentheses are not used to indicate operator precedence, SharePlex supports
operator precedence in the same order that Oracle does. For example, a condition NOT
x AND y behaves the same way as (NOT x) AND y. A condition x AND y OR z

168 SHAREPLEX® FOR ORACLE
Administrator’s Guide Version 8.0 Updated 8/19/13

behaves the same as (x AND y) OR z. When a condition includes parentheses, the
explicit precedence is respected.

Note: During configuration activation, SharePlex verifies the syntax in the column condi-
tion. If any syntax is incorrect, configuration activation fails. SharePlex prints an error to
the Event Log that indicates where the error was made.

10 Repeat these steps for each combination of partition scheme, column condition and
target object.

11 COMMIT the data to the database.

Creating configuration entries for horizontally partitioned
replication
Follow these instructions to create configuration entries for tables using horizontally
partitioned replication. Use one configuration file for all of the tables that you are repli-
cating, whether or not they are using partitioned replication. To create configuration
entries for tables not using partitioned replication, see page 145. To create configuration
entries for tables using vertically partitioned replication, see page 172.

Template 5: Configuration for horizontally partitioned replication
Datasource:o.sourceSID
targ_own.tabl
srce_own.table !partition_scheme
e
! sysD@o.oraD

Note: The entry on the second line is needed only if a route in a partition scheme does
not exist on a configuration line.

1 From the bin sub-directory of the SharePlex product directory on the source system,
start sp_ctrl.

2 At the sp_ctrl prompt, issue the create config command. In the syntax below, sub-
stitute the name of your configuration for filename. This command opens the text
editor.
sp_ctrl(sysA)> create config filename

CHAPTER 5 169
Preparing for SharePlex Replication

3 [OPTIONAL] You can enter comment lines to identify the configuration or convey
other information. Precede each comment line with a pound (#) symbol to indicate
that it is non-functioning, and end each one by pressing Enter.

4 On the first non-comment line, type the word Datasource, followed by a colon (:),
then the letter o, then a dot (.) followed by the source instance ORACLE_SID.
Leave no space between any of the items. The word Datasource is not case sensi-
tive. The SID is case-sensitive.
Datasource:o.SID
5 Press Enter to start a new line.

6 On the next line, type the owner and name of the first source table to use horizon-
tally partitioned replication, separating them with a dot (.). Leave no space between
any of the items. Enclose case-sensitive items within double quotes, for example
"scott"."emp"; otherwise, SharePlex does not recognize case-sensitivity. Do not
press Enter after you type the source table information.
source_owner.object
7 [OPTIONAL] If the table has no primary or unique key, you can specify a key definition
if one or more columns ensure row uniqueness. A key improves replication perfor-
mance, particularly if there are numerous columns.
To define a key, type at least one space after the source object, then use the following
syntax. Do not press Enter.
!key (col_name, col_name)
8 Type at least one space or tab, then type the owner and name of the target table that is
common to most of the column conditions for the partition scheme to which the col-
umn condition you are defining belongs. Target tables with different owners or
names are specified by entering override values in the TARGET_TABLE_NAME
and TARGET_TABLE_OWNER columns of the SHAREPLEX_PARTITION table.
Do not press Enter.
target_owner.object
9 Type at least one space or tab, then type an exception marker (!) immediately fol-
lowed by the name of the partition scheme. Type the partition scheme name using the
same case and spelling as in the SHAREPLEX_PARTITION table.
!partition_scheme

170 SHAREPLEX® FOR ORACLE
Administrator’s Guide Version 8.0 Updated 8/19/13

Important! There is no compound routing capability for listing multiple partition schemes
for the same source table, for example !schemeA + schemeB. Each partition scheme
must be listed on a separate configuration line with a source and target table owner and
name.

10 Start a new configuration line and repeat steps 5 through 9 for each partition scheme.

11 Enter placeholder routing maps as needed. See “To enter placeholder routing maps”
following these steps before you close the configuration file to determine whether or
not you need to enter placeholder routing maps.

12 Save the file with the :wq command in vi or with Save on the File menu in WordPad,
and exit the editor.

To enter placeholder routing maps
All routing maps in a partition scheme must also be listed on a line somewhere in the
configuration file itself, in order for SharePlex to build its routing list. The requirement
usually is satisfied because partitioned replication generally is combined with full-table
replication. When using a route in a partition scheme but not in a regular (non-parti-
tioned) configuration entry, you must provide a placeholder routing map for that route
on a configuration line so that it is incorporated into the routing list.
If all routes used in your partition schemes exist on a line somewhere in the configura-
tion file, placeholders are not required, and you can close and save the configuration
file. Otherwise, do the following:
1 Press Enter to start a new configuration line.

2 Type an exception marker (!).

3 Type at least a few spaces or, if you are using tabs to maintain columns, tab to the
second or third column.

4 Type the routing map* using one of the following methods.

FIGURE 12: Routing formats
Basic routing map targetsys@o.targetSID
Compound targetsys1@o.target_SID1 + targetsys2@o.target_SID2
routing map

CHAPTER 5 171
Preparing for SharePlex Replication

FIGURE 12: Routing formats
Basic routing map targetsys@o.targetSID
Routing map with source_sys:queue_name*targetsys@o.targetSID
named export queue

Routing map with targetsys:queue_name@o.targetSID
named post queue

• If you are using default (not named) queues, use a basic routing map or a com-
pound routing map, depending on how many target systems you are listing.
Or...
• If you are using named queues, use the appropriate syntax as shown in Figure 12.
5 Press Enter at the end of the line.

Repeat these steps for each placeholder that is needed.

Viewing and changing partition schemes
Because partition schemes are stored in an Oracle table, you can use a graphical data-
base tool such as Toad for Oracle to view them, or you can view them using regular
SQL statements. You can add, delete, or modify partition schemes while the replication
configuration is active. To perform any of these procedures, make the necessary
changes to the SHAREPLEX_PARTITION table and configuration file, then reactivate
the configuration. See “Changing partitioned replication” on page 319 for instructions.

* SharePlex does not support system names that contain non-alphanumeric characters, for example an
underscore (_) or a dot (.). For more information, see “Target system names” on page 141.

172 SHAREPLEX® FOR ORACLE
Administrator’s Guide Version 8.0 Updated 8/19/13

Configuration for vertically partitioned replication
These instructions show you how to configure SharePlex for vertically partitioned repli-
cation, where a subset of the columns of a table are replicated to one or more target sys-
tems. The names of the target columns can be the same as, or different from, the names
of the source columns.

FIGURE 13: Vertically par-
titioned replication: In this
illustration, the data in col-
umns C1, C2, C3 and C4 is
replicated to instance oraB.
The data in columns C5 and
C6 is not replicated.

Vertically partitioned replication can be combined with horizontally partitioned replica-
tion. For example, a company’s headquarters could use vertically partitioned replication
to replicate data from a subset of a source table’s columns to a target table in a reporting
instance in each of its regions. The company can use horizontally partitioned replication
to route relevant records to those instances. For more information about horizontally
partitioned replication, see page 160.
Vertically partitioned replication is appropriate for reporting and other information dis-
tribution scenarios where replicating all of the columns of a table is not desirable. It is
not appropriate for high availability environments. Once you configure a table for verti-
cally partitioned replication, SharePlex does not recognize the other columns in its
object cache, and data in those columns is not replicated.

Restrictions for using vertically partitioned replication
• 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).

emp (c1. Replication to multiple target systems A vertically partitioned source table cannot be listed more than once in a configuration. • ALTER TABLE to add a column to a table configured for vertically partitioned repli- cation is not supported.emp (c1. all col- umns used as column conditions in the partition scheme must be included in the col- umn partition. Permissible: scott. You can work around this limitation by using horizontally partitioned replication.targSID + targsysC@o.targSID For more information about using a compound routing map. To use a compound routing map.c2) scott.targSID Not permissible: scott.sal (c1. but their names can be different. replication of a vertically partitioned table to multiple target systems requires a compound routing map.c2) scott.c2) targsysB@o. all of a source table’s target tables must have the same owners and names.c2) scott.emp (c1. otherwise Post’s INSERT statement will fail.c2) targsysC@o. • A target table can. contain all of the same columns as its source table. • If a table is using horizontally and vertically partitioned replication together. • Source and target columns must have identical definitions. preci- sion). • Columns in the target table that are not part of the column partition and are NOT NULL must have a default insert value. see “Configuration for rep- licating to multiple target systems” on page 148.sales (c1. but does not have to. Therefore. see page 160. • Corresponding columns must contain the same datatypes (same type. You specify column names in the configuration file.sal (c1.c2) targsysB@o. CHAPTER 5 173 Preparing for SharePlex Replication • There can be only one column partition per source table. For more information.targSID scott. This is a normal Oracle requirement. size. .

The word Datasource is not case sensi- tive. followed by a colon (:). To create configuration entries for horizontally partitioned replication. These define the columns for which data is replicated. The SID is case-sensitive. Template 6: Configuration for vertically partitioned replication Datasource:o. sp_ctrl(sysA)> create config filename 3 [OPTIONAL] You can enter comment lines to identify the configuration or convey other information. separating them with a dot (. otherwise.) followed by the source instance ORACLE_SID. 6 On the next line.c2) SID Note: The !key (c1) component is an optional key definition (see step 8). 2 At the sp_ctrl prompt.table !key targ_own. start sp_ctrl. Use one configuration file for all of the tables that you are replicating. This command opens the text editor. Enclose case-sensitive items within double quotes. Datasource:o.table targsysB@o. issue the create config command. then the letter o. 4 On the first non-comment line. Substitute the name of your configuration for filename.). SharePlex does not .0 Updated 8/19/13 To create configuration entries for vertically partitioned replication To implement vertically partitioned replication. Precede each comment line with a pound (#) symbol to indicate that it is non-functioning. see page 145. you specify a column partition or excluded column partition in the configuration file. whether or not they are using partitioned replication."emp". and end each one by pressing Enter.174 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8.SID 5 Press Enter to start a new line. Leave no space between any of the items. type the word Datasource. see page 160.c2) (c1) (c1.targ- (c1. To create configuration entries for replication of entire tables. for example "scott".sourceSID srce_own. then a dot (. type the owner and name of the first source table to use vertically partitioned replication. 1 From the bin sub-directory of the SharePlex product directory on the source system.

You need not replicate key columns. in the parentheses. if necessary — but do not press Enter within the string of column names. Use the following format. • Enclose the string of column names within parentheses. fourth. For example. This is exclude column notation. This creates the column partition. and do not press Enter when you are done listing the columns. A space after the comma is optional. The excluded columns need not be contiguous in the source table. You need not replicate key columns. third and seventh col- umns of a table. src_col_name8) .). The columns need not be contiguous in the source table. not (src_col_name2. src_col_name7) B List the names of the source columns whose data will NOT be replicated. For example. See step 8 for more information. but it might help to define one or more columns as a key.object 7 Type at least one space or tab after the source object. • Separate each column name with a comma (. you can exclude the second. if necessary — but do not press Enter within the string of column names. but it might help to define one or more columns as a key.). Use the following format. This creates the excluded column partition. you can replicate the first. • List any number of excluded columns. are excluded columns. Do not press Enter after you type the source table information. See step 8 for more information. • List any number of columns. src_col_name3. • Enclose the string of excluded column names within parentheses. Proceed using on the following two options: A List the names of the source columns whose data will be replicated. (src_col_name1. • Separate each excluded column name with a comma (. • Use an exclamation point “!” to indicate that the columns that follow. Excluded columns can- not be used in the key definition. source_owner. and eighth columns of a table. • Allow long strings to wrap to the next line. • Allow long strings to wrap to the next line. CHAPTER 5 175 Preparing for SharePlex Replication recognize case-sensitivity. Leave no space between any of the items. A space after the comma is optional. src_col_name4. and do not press Enter when you are done listing the columns.

leaving a space between the !key component and the list of columns. then use the following syn- tax. Without a key. The key column(s) that you define will be replicated as part of the column partition. skip to step 11. A key improves replication performance. type a space after the target table’s name and list the target columns using the same syntax that you used to list the source columns. you can specify a key definition: • the table’s primary or unique key is not part of the column partition. then type the owner and name of the corresponding target table in the same manner as you did for the source table. 8 [OPTIONAL] If the table meets any of the following conditions.object 10 Do one of the following. List the target columns in the same logical order as their cor- responding source columns so that SharePlex builds the correct correlations in the object cache. !key (col_name. col_name) Important! When using exclude column notation in vertical partitioning excluded col- umns cannot be used in the key definition. target_owner.. • the column partition has numerous columns.0 Updated 8/19/13 Important: When using exclude column notation with vertically partitioned tables. 9 Type at least one space or tab on the configuration line. a change to the first column in the source list is repli- cated to the first column in the target list. • If the source and target column names are different.176 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. • the table has no key. Do not press Enter. the corresponding source and target column names must be identical. A change to the second source column is . To define a key. For example. Or. depending on whether or not the names of the correspond- ing source and target columns are identical. • If the source and target column names are identical. type a space after the column partition. SharePlex uses all of the columns in the column partition as a key. Do not press Enter..

FIGURE 15: Routing formats Basic routing map targetsys@o. RepName char(30) not null. Job char(10). targ_col_name2. • If you are using horizontally partitioned replication for the source table. targ_col_name3) scott. CustCount number(7. SalesVol number(7. • If you are not using horizontally partitioned replication for the source table..target_SID1 + targetsys2@o.2). EmpName) mary. !partition_scheme Or.2).employee (EmpNo. Use this format regardless of the actual order of the target columns in the table. Region char(20) Region char(20) FIGURE 14: Source and target tables with dissimilar column names: To replicate data from EmpNo to SalesID and from EmpName to RepName.2).targetSID named export queue .target_SID2 routing map Routing map with source_sys:queue_name*targetsys@o.targetSID Compound targetsys1@o. and then specify the routing in one of two ways. type the routing map using one of the following methods. RepName) Do not press Enter after you are finished creating the target column component. type an exception marker (!) and the name of the partition scheme using the same case and spelling as in the SHAREPLEX_PARTITION table. SalesID number(4) not null.2).employee_HQ mary. CHAPTER 5 177 Preparing for SharePlex Replication replicated to the second column in the target list. SocSec number(11) not null. and so forth. 11 Type at least a space or tab on the configuration line. (targ_col_name1.sales_W EmpNo number(4) not null. you would list them on the con- figuration line as follows: scott. Commis number(7. EmpName char(30).. Salary number(7.sales_W (SalesID.

). . * SharePlex does not support system names that contain non-alphanumeric characters. see “Target system names” on page 141. for example an underscore (_) or a dot (.targetSID named post queue -- --If the columns are replicated to one target system*. 13 Repeat steps 6 through 11 for each table that will use vertically partitioned replica- tion. 12 Press Enter to start a new line.targetSID Routing map with targetsys:queue_name@o. For more information. create a basic routing map. use a compound rout- ing map. use the appropriate syntax as shown in Figure 15. --If the columns are replicated to more than one target system. because a vertically partitioned table cannot be listed more than once in the configuration.0 Updated 8/19/13 FIGURE 15: Routing formats Basic routing map targetsys@o. --If you are using a named export queue. The corresponding target owners and table names must be iden- tical on all target systems.178 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8.

For more information about configuration construction.sql script enables you to build a configuration containing multiple (or all) tables in a schema. Before you activate the configuration. Make certain to eliminate all but one Datasource:o. It is an interactive script that prompts for each component of the configuration step by step. see “Components of a SharePlex configuration” on page 135. • The script does not support sequences. Conditions for using build_config. Do not move the file out of the config sub-directory. SYS and SYSTEM schemas. These schemas cannot be replicated since they are system and/or instance-specific. then use the edit config command to add entries for tables that use partitioned replication. which must be the first non-commented line of the file. Replicating multiple schemas You can run build_config. Instead of entering each object’s information and routing individually. Activate the new configuration. you can use a wildcard to select certain tables at once — or with one key- stroke.SID line. you can select all of the tables in the schema. then combine the resultant config- urations into one configuration using a text editor.sql for different schemas. . • The script does not configure objects in the SharePlex. See Chapter 1 of the SharePlex Reference Guide for more information about SharePlex commands.sql • Source and target table names must be the same. CHAPTER 5 179 Preparing for SharePlex Replication Scripting a configuration to replicate numerous tables in a schema The build_config. • You can use the edit config command to make any other changes as needed after the configuration is built. you can use the edit config command in sp_ctrl to add entries for sequences. • The script does not support partitioned replication. You can use the copy config command to copy the configuration.

SQL> @ /product_dir/util/build_config.sql script puts configurations in the cur- rent working directory. and SharePlex configurations must reside in the config sub- directory for SharePlex to find and activate them. beginning with a request for the target machine.0 Updated 8/19/13 To create a configuration using build_config. The build_config.180 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. Refer to the following table for the prompts and what to enter.sql 4 The script displays a series of prompts. . which resides in the util (utili- ties) sub-directory within the SharePlex product directory. Enter the full path name of the script. $ sqlplus SYSTEM/MANAGER 3 Run the script. $ cd /variabledata_dir/config 2 Log onto SQL*Plus as SYSTEM.sql 1 Change directories to the config (configurations) sub-directory within the SharePlex variable-data directory.

for example Scott_config. a dot (. Owner of the target Enter the owner of the target tables. The ORACLE_SID is case-sensitive. for example Scott. The script configures source and target table names. before the SID as when building a configuration in sp_ctrl. Target database SID Enter the ORACLE_SID of the target (destination) Oracle instance. The script gives to create the file a . Owner of the source Enter the owner of the tables to be replicated. then press Enter. The script will create a configuration for just one table even though it is intended for configuring multiple tables. Or… • Enter an individual table name. then press database tables Enter. then press Enter.lst. CHAPTER 5 181 Preparing for SharePlex Replication Prompt What you should enter Target machine Enter the name of the target machine.lst suffix. Table name to include At this prompt. then press Enter. The ORACLE_SID is case-sensitive. do one of the following. Or… • Enter the wildcard (%) character and a string if you want to select certain tables. then press Enter. then press Enter. You need not enter o. for example SystemA. for example Mary. You need not enter o. . before the SID. Source database SID Enter the ORACLE_SID of the source (primary) Oracle instance. for example oraA. for example oraB. then database tables press Enter. A target system’s name cannot include an underscore (_). then press Enter. Name of the output file Enter a name for the configuration. ) or other non-alphanumeric character. (blank for all) • Enter nothing and press Enter if you want the script to select all tables belonging to the source owner you specified. for example % e_slry&.

and use the text editor to enclose case-sensitive table and owner names within double-quote marks. for example “scott”.182 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. sp_ctrl(sysA)> list config . You should see its name in the display. open the configuration with the edit con- fig command in sp_ctrl. The script does not add the quote marks required by Oracle to enforce case-sensitivity.0 Updated 8/19/13 5 If any tables or owners are case-sensitive. issue the list config com- mand.“emp”. 7 To ensure that the configuration is in the correct location. sp_ctrl(sysA)> edit config filename 6 Save and close the file using the text editor’s standard save command. See Chapter 1 of the SharePlex Refer- ence Guide for more information about this command.

and SharePlex configurations must reside in the config sub-direc- tory for SharePlex to find and activate them. This script saves time when establishing a high-availability replication strategy or other sce- nario where you want the entire database to be replicated. The config. $ sqlplus SYSTEM/MANAGER 3 Run the script. CHAPTER 5 183 Preparing for SharePlex Replication Scripting a configuration to replicate an entire database The config. • The script does not support partitioned replication.sql 4 The script displays a short series of prompts. Enter the full path name of the script. then use the edit config command to add entries for tables that use partitioned replication. Conditions for using config. To create a configuration using config.sql • The script does not configure objects in the SharePlex. SYS and SYSTEM schemas. SQL> @ /product_dir/util/config. You can use the copy config command to copy the configuration. beginning with a request for the target machine. • You can use the edit config command to make any other changes as needed after the configuration is built. all sequences in all of the schemas of a database. . $ cd /variabledata_dir/config 2 Log onto SQL*Plus as SYSTEM.sql 1 Change directories to the config (configurations) sub-directory within the SharePlex variable-data directory. Refer to the following table for the prompts and what to enter.sql script puts configurations in the current working directory. Activate the new configuration.sql script enables you to automate construction of a configuration that lists all of the tables and. which resides in the util (utili- ties) sub-directory within the SharePlex product directory. optionally. See Chapter 1 of the SharePlex Reference Guide for more information about SharePlex commands. These schemas cannot be replicated since they are system and/or instance-specific.

.file. it overwrites the first file. You should see its name in the display. This pre- username vents the SharePlex schema from being replicated. Note: The name assigned by SharePlex to the configuration is config. before the SID as when building a configuration in sp_ctrl. required by Oracle for case-sensitivity. issue the list config command. You need not enter o. but not for reporting or peer-to-peer replica- tion. Shareplex oracle Enter the name of the SharePlex Oracle user. You need not enter o.0 Updated 8/19/13 Prompt What you should enter Name of the Target Enter the name of the target machine. sp_ctrl(sysA)> list config 7 Save and close the file using the text editor’s standard save command. The ORACLE_SID is case-sensitive. Target Database SID Enter the ORACLE_SID of the target (destination) Oracle instance. For more information about sequences and replication. for example “scott”. A target system’s name cannot include an underscore (_). 5 If any tables or owners are case-sensitive.184 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. To preserve the original file. then press Enter. sp_ctrl(sysA)> edit config filename 6 To make certain the configuration is in the correct location. The script does not add the quote marks. open the configuration with the edit con- fig command in sp_ctrl. then press Enter. Source Database SID Enter the ORACLE_SID of the source (primary) Oracle instance. for example SystemA. which would cause replication problems. then press Enter. sequences are replicated for high-availability replication. rename it before you create the second one. for example oraB. and use the text editor to enclose case-sensitive table and owner names within double-quote marks. see page 106. If a valid name is not provided. a dot (.) or other non-alphanumeric character. Replicate Sequences Enter either y or n. the script fails.“emp”. Generally. before the SID. then press machine Enter. See Chapter 1 of the SharePlex Reference Guide for more information about this command. depending on whether or not you are replicating (y/n) sequences. If you run this script again to create another configuration. then press Enter. The ORACLE_SID is case- sensitive. for example oraA.

but the same procedures generally apply to sequences. except where noted. and sysC. and Oracle instances with SIDs such as oraA and oraB. the word table is used. CHAPTER 5 185 Preparing for SharePlex Replication Part 2: Establishing replication Your replication strategy (as defined in Chapter 4) determines how to configure Share- Plex and prepare the Oracle instance and the servers for replication. . examples and instructions are provided for: • Establishing replication for reporting • Establishing replication for high availability and data recovery • Establishing replication for data distribution or distributed processing • Establishing replication through an intermediary system • Establishing combined cascading/broadcast replication • Establishing replication for centralized reporting (standard method) • Establishing replication for centralized reporting using multiple sp_cop processes • Establishing peer-to-peer replication A template for creating the appropriate configuration(s) for each strategy is provided. Configuration templates. review the basic data and system requirements in Chapter 4. sysB. For simplicity. The instructions in this part of the chapter address unique requirements for each replication strategy. If you have not done so already. Conventions used in the examples The examples in these instructions use system names such as sysA.

include the column partition or excluded column par- tition (see page 174). .targetSID To establish reporting from one system to another If replication is used only for reporting.oraA scott.0 Updated 8/19/13 Establishing replication for reporting This configuration from one Oracle instance to another is the most simple. A target table’s owner and name can be the same as those of the source table.oraB On the source system • Install SharePlex and run ora_setup in the normal manner. If you are using vertically parti- tioned replication for a table. you can use the build_config. • Referring to Template 7. It is a uni- directional configuration replicating either to another system or to other tables on the same system.table target_owner. The following examples show you the different ways to establish a report- ing instance. See page 407 for instruc- tions. create partition schemes and use them in the routing map (see page 160).table targetsystem@o. Rep- licating sequences for reporting is not necessary.emp2 sysB@o.emp bill. If you are using horizontally partitioned replication for a table. Template 7: Configuration to replicate for reporting Datasource:o. or one or both can be different. If all of the source tables are in the same schema and the source and target table names are the same.sql script (see page 179).186 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8.sourceSID source_owner. the ORACLE_SIDs can different on the source and target systems. Example configuration on source system sysA Datasource:o. Template 7 applies to all variations of a reporting instance. so do not include them in this con- figuration. create a configuration. without the intention of data recovery.

a target table’s owner and name can be the same as those of the source table. CHAPTER 5 187 Preparing for SharePlex Replication On the target system • Create the target instance. • Install SharePlex and run ora_setup in the normal manner. unless you will be using an Oracle hot backup to synchro- nize the data. • Run ora_setup for each instance. ensure that all data and system issues have been addressed according to the guidelines in Chapter 4. Source tables are replicated to a different instance on the same system (from oraA to oraB in this example). See page 407 for instruc- tions. See the SharePlex Installation and Demon- stration Guide for instructions. To establish reporting from one instance to another on the same system (UNIX only) This configuration is only possible on UNIX systems. ensure that all data and system issues have been addressed according to the guidelines in Chapter 4 for the tables required for reports and queries. If you are using an Oracle hot backup or DBCopy. and activating the configuration. Use any of the procedures in Chapter 7 for the correct sequence of events to follow. • Before you synchronize data to begin replication.emp scott. Example configuration on sysA Datasource:o.oraB • Install SharePlex in the normal manner. .emp sysA@o. • Create the target instance.oraA scott. You will be instructed to do so by the synchronization procedure after the target instance is established. In this con- figuration. applying it to the target instance. if necessary. See page 407 for instructions. Do not run ora_setup if you are establishing the target instance with a hot backup or DBCopy. or one or both can be different. On both systems • Before you synchronize data to begin replication. • Perform initial synchronization by making a copy of the source data. you will create the target instance when you follow the synchronization procedure.

sql script as instructed (see page 179). Source tables are replicated to different tables within the same Oracle instance. To establish replication between tables in the same instance (UNIX systems) This configuration is only possible on UNIX systems.oraA • Install SharePlex in the normal manner. include the column partition or excluded column partition (see page 174). but their owners must be different in order for this configura- tion to succeed. Specify the local machine’s name and the target instance’s ORACLE_SID in the routing map. applying it to the target instance. • Before you synchronize data to begin replication. create a configuration with the source instance’s ORACLE_SID as the datasource. create partition schemes and use them in the routing map (see page 160). If all of the source tables are in the same schema and the names of corresponding source and target tables are identical. . Specify the local system’s name in the routing map. See the SharePlex Installation and Demon- stration Guide for instructions. If you are using vertically partitioned replication for a table.188 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. • Referring to Template 7 on page 186. include the column partition or excluded column partition (see page 174). Example configuration on sysA Datasource:o. Replicating sequences for reporting instances is not necessary. so do not include them in this configuration. If you are using vertically partitioned replication for a table. See page 407 for instructions.0 Updated 8/19/13 • Referring to Template 7 on page 186. If you are using horizontally partitioned replication for a table. ensure that all data and system issues have been addressed according to the guidelines in Chapter 4. If you are using horizontally parti- tioned replication for a table.oraA scott.emp mary. • Run ora_setup for this instance.emp sysA@o. create a configuration using this instance’s ORACLE_SID as the datasource and as the target instance in the routing map. you can use the build_config. See Chapter 7 for an appropriate procedure to follow. and activating the configuration. A target table’s name can be the same as that of the source table. create partition schemes and use them in the routing map (see page 160). • Perform initial synchronization by making a copy of the source data.

including cor- responding source and target tables’ owners and names. so do not include them in this configuration. See Chapter 7 for an appropriate procedure to follow. applying it to the target tables. CHAPTER 5 189 Preparing for SharePlex Replication Replicating sequences for reporting is not necessary. follow the instructions in "Establishing replication for high availability and data recovery. To establish reporting in combination with data recovery and high availability from one system to another Depending on the environment. because there can be conflict between the H/A tables and the reporting tables. Using the target instance for high availability is not appropriate with ERP applications. and activating the configuration." on page 190. . If your environment permits this configuration. you can use a reporting instance as a backup for failover from the primary instance if the source and target instances are identical. • Perform initial synchronization by making a copy of the source data.

0 Updated 8/19/13 Establishing replication for high availability and data recovery The goal for data recovery and high availability is to have a duplicate of the primary instance ready on the secondary system for immediate failover. and the owners and names of corresponding source (primary) and tar- get (secondary) objects are identical. Partitioned replication is not appropriate for this configuration.190 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. This strategy uses bi-directional replication with two configurations that are the reverse of each other. The same objects exist in both databases. The configuration on the secondary (standby) machine .

use the config. Datasource:o. To replicate all of the tables and sequences in the database. • Referring to Template 8 on page 191.sql script to simplify the configuration process (see page 183).tab secondarysystem@o.emp scott. and this will create the secondary instance — but if you are not using one of those methods. you can use an Oracle hot backup or DBCopy to synchronize the data.emp scott. create a configuration on the primary system that replicates to the secondary system. Example reverse configuration on secondary system sysB Datasource:o. On the secondary system • For high availability.emp sysA@o.primarySID e This is intentionally the “reverse” of the configuration on the primary system. CHAPTER 5 191 Preparing for SharePlex Replication remains in an activated state with the Export process on that system stopped in readiness for failover. create the secondary instance now.secondarySID primary_owner. Template 8: High availability configuration on the primary system Important! For high availability.table primarysystem@o.oraA2 scott.secondary- le le SID Example configuration on primary system sysA Datasource:o. See page 407 for instruc- tions.primarySID primary_owner.oraA On the primary system • Install SharePlex and run ora_setup in the normal manner. .oraA2 Template 9: High availability configuration on the secondary system Datasource:o.emp sysB@o.oraA scott.tab secondary_owner.tabl secondary_owner. Include sequences in the configuration. the owner and table names of the primary objects must be identical to those of their corresponding secondary objects.

Do not run ora_setup if you are establishing the secondary instance with a hot backup or DBCopy. (You will disable the constraints during the synchronization pro- cess. If there are any messages in the export queue. create a reverse configuration on the secondary system to replicate the same tables from the secondary system to the primary system. you will be instructed by the synchronization procedure to do this after the secondary instance is established. See the SharePlex Parameters chapter of the SharePlex Reference Guide for more information about SharePlex commands and parameters. • If you used an Oracle hot backup procedure to create the secondary instance. Note: During replication. • Copy non-replicated database objects and critical files outside the instance to the secondary system. View the status of the export queue on the secondary system using the qstatus command in sp_ctrl. • Create a script that grants INSERT. For failover • Make the applications used on the primary system available on the secondary sys- tem. • Referring to Template 9 on page 191. you can verify whether or not there were changes made to the secondary instance.0 Updated 8/19/13 • Install SharePlex and run ora_setup in the normal manner. See page 407 for instruc- tions. keep the script that you ran. • Create a script that enables constraints on the secondary system to be used during a failover procedure. Specify the secondary instance as the datasource. It can be modified to re-create the primary instance.) • Develop a failover procedure for relocating users to the secondary system. activate this configu- ration so that it is ready to replicate when users fail over to this system. UPDATE and DELETE privileges to all users that can be run during a failover procedure. After the data is synchronized.192 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. because the Capture process on a system ignores the Post process on that system. unless the SP_OCT_REPLICATE_POSTER parameter has been enabled. and specify the primary instance and system in the routing map. • Create a script that denies INSERT. Export must remain stopped. It should be empty. • Stop the Export process on the secondary system so that nothing accidentally hap- pening on the secondary system (such as a scheduled job changing data) gets repli- cated back to the primary system. it means those transactions originated on the secondary system. . UPDATE and DELETE operations to all users except SharePlex.

You can use an Oracle hot backup (see page 289) so that users can continue accessing the primary database. • Perform initial synchronization by making a copy of the primary data. On both systems • Before you synchronize data to begin replication. applying it to the secondary instance. CHAPTER 5 193 Preparing for SharePlex Replication • Maintain backups of replication files as recommended in “Regular SharePlex back- ups” on page 129. • Maintain backups of replication files as recommended in “Regular SharePlex back- ups” on page 129. • See “Using SharePlex in a High-Availability Environment” on page 321 to familiar- ize yourself with failover and failback procedures on machines running SharePlex. and activating the configuration. . Use any of the procedures in Chapter 7 for the correct sequence of events to follow. ensure that all data and system issues have been addressed according to the guidelines in Chapter 4.

For data distribution.sourceSID srce_own. or one or both can be different.table targ_own. you can use a compound routing map.targSID + targsysC@o. see page 211 to establish a peer-to-peer replication environment.prod sysB@o. the owner and name of a target table can be the same as those of the source table. In both strategies. Distributed processing assumes that the processing on the target systems is for queries. Datasource:o. output and reporting only. Distributed processing replicates different sets or subsets of tables to different target systems to split up processing.oraA scott.oraB + sysC@o. For assistance with creating a compound routing map.0 Updated 8/19/13 Establishing replication for data distribution or distributed processing Data distribution and distributed processing employ broadcast replication through a direct network connection to each target system.194 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8.prod scott.oraD . If your intention is for users to make DML transactions on the target data. Data distribution typically replicates all tables in the configuration to all of the target systems in the configuration. all of a source table’s target tables can have the same owners and names or different ones.table targsysB@o.oraC + sysD@o.targSID Example configuration on source system sysA Datasource:o. see page 148. Template 10: Configuration to distribute data when target table owners and names are the same If the owners and names of all corresponding target tables are the same on all target sys- tems.

prod sysD@o. Datasource:o.oraA scott.targetSID e2 Example configuration on source system sysA Datasource:o.emp jane.oraC scott.sales scott.sourceSID target_owner. or differ- ent than.emp mary.targetSID source_owner.sourceSID source_owner. Datasource:o.oraB scott.tabl source_owner.oraD Template 12: Configuration for distributed processing In this configuration.cust sysD@o.emp joe. use this configuration.table target_owner. This configuration can be combined with the configura- tion in Template 10.table1 e1 targetsysB@o.oraB scott.table target_owner.tabl targetsysC@o.sales sysC@o.prod sysC@o.oraA scott.targetSID source_owner.table2 target_owner. those of the source tables.oraC scott.tabl 1 e1 targetsysB@o.oraD .tabl targetsysC@o. CHAPTER 5 195 Preparing for SharePlex Replication Template 11: Configuration to distribute data when target table owners and names are different If the owners and/or names of corresponding target tables are different on any target systems.prod jane.emp sysB@o.targetSID 1 e2 Example configuration on source system sysA Datasource:o. the owners and names of target tables can be the same as.emp scott.emp sysB@o.

include them in this configuration. On both systems • Before you synchronize data to begin replication. include the column partition or excluded column partition (see page 174). you will create the target instance when you follow the synchronization procedure. • Install SharePlex and run ora_setup in the normal manner. Do not run ora_setup if you are establishing the target instance with a hot backup or DBCopy. ensure that all data and system issues have been addressed according to the guidelines in Chapter 4. To replicate sequences for distributed processing. If you are using vertically partitioned replication for a table. • Create a configuration. Template 11 or Template 12. • Perform initial synchronization by making a copy of the source data. . give each system its own unique range of sequences. Use any of the procedures in Chapter 7 for the correct sequence of events to follow.196 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. See page 407 for instruc- tions. create partition schemes and use them in the routing map (see page 160). applying it to the target instance. See page 407 for instruc- tions. If you are using an Oracle hot backup or DBCopy. Another option is for all systems to access the same sequences using database links. referring to Template 10.0 Updated 8/19/13 On the source system • Install SharePlex and run ora_setup in the normal manner. and activating the configuration. You will be instructed to do so by the synchronization procedure after the target instance is established. If you are using horizontally parti- tioned replication for a table. On the target systems • Create the target instance unless you will be using an Oracle hot backup or DBCopy to synchronize the data. As an alternative.

. and then have the Capture process on that system replicate those changes to Oracle databases on one or more remote (target) sys- tems. but the database need not be populated. You can use the inter- mediary system to pass the replicated data to the remote (target) systems without posting it to a database on the intermediary system. the source machine must be able to resolve the target machine name(s). You can replicate and post to an Oracle instance on the intermediary system. Scenario A: Replication to intermediary and target instances. but the target machines need not be reachable from the source machine. and then from the intermediary system to one or more remote target systems that do not have direct network connections to the source system. In that case. CHAPTER 5 197 Preparing for SharePlex Replication Establishing replication through an intermediary system Cascading replication replicates data from the source system to an intermediary system. There are two possible ways to configure this strategy. Scenario B: Replication through the intermediary system to the target instance. To use a cascading strategy. The owners and names of corre- sponding source and target tables can be the same or different on any of the systems in the replication route. Oracle must be installed and an ORACLE_SID must exist in the oratab file (UNIX systems) or the Windows Registry.

intermedSID intermed_own.tabl target_own.sourceSID source_own.table intermedsystemB@o.oraA HQ.oraD . See page page 148 for more information.price Reg. Template 13: Cascading replication configuration on the source system Datasource:o.intermedSID Example configuration on source system sysA Datasource:o. Otherwise use a separate line for each set of source-target tables where owners and/or names are different.price sysB@o.targSID + targsysD@o. To replicate to instances on the intermediary and target system Use these templates to post replicated changes to an Oracle instance on the intermedi- ary system and also to forward them to the target system for posting to an Oracle instance there (Scenario A).oraC + sysD@o. all corresponding target tables must have identical owners and names on all target systems.targ- e e SID *Note: To list multiple target systems in one routing map. Example configuration on intermediary system sysB Datasource:o.oraB Template 14: Cascading replication configuration on the intermediary system* Datasource:o.price sysC@o.0 Updated 8/19/13 Warning! DDL replication is not supported from an intermediary system to target sys- tems.198 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8.tabl targsysC@o.price Loc.oraB Reg.table intermed_own. It is supported only from the source system to the intermediary system.

In this scenario. If there are numerous source tables with the same names as their target tables. create a uni-directional con- figuration replicating to the database on the intermediary system. If you are using vertically partitioned replication for a table. Or. and if all source tables are in the same schema. with- out posting to an Oracle database there (Scenario B). • Do one of the following: For Scenario A: Referring to Template 13 on page 198.sql script to configure the . use the config. You can replicate to multiple targets through the intermediary system as shown in the template.price Reg.oraA HQ.oraD Establishing cascading replication for both methods On the source system • Install SharePlex and run ora_setup in the normal manner. create partition schemes and use them in the routing map (see page 160).sql script to build the configuration (see page 179). Otherwise use a separate line for each set of source-target tables where owners and/or names are differ- ent. If you are using horizontally partitioned replication for a table.table + intermedsystemB*targsysD@o. a configuration is unnecessary on the intermediary system. See page page 148 for more information. include the column partition or excluded column partition (see page 174). Template 15: Cascading replication configuration on the source system* Datasource:o. CHAPTER 5 199 Preparing for SharePlex Replication To replicate through the intermediary system to the target instance only Use this template to use the intermediary system only as a pass-through system.targSID *Note: To list multiple target systems in one routing map.table target_own. all corresponding target tables must have identical owners and names on all target systems. See page 407 for instruc- tions. Example configuration on source system sysA Datasource:o.sourceSID intermedsystemB*targsysC@o.targSID source_own.oraC + sysB*sysD@o. you can use the build_config.price sysB*sysC@o.

• (Scenario A only) Referring to Template 14 on page 198. This instructs the Capture process on the intermediary system to capture the changes posted by SharePlex and replicate them to the target system. If you are using ver- tically partitioned replication for a table. If you are using horizontally partitioned replica- tion for a table. If you are using horizontally partitioned replication for a table. For Scenario B: Referring to Template 15 on page 199. unless you will be using an Oracle hot backup or DBCopy to synchronize the data. you will be instructed to do so by the synchronization pro- cedure after the instance is established. Only an Oracle installa- tion (with libraries) and a valid ORACLE_SID in the oratab file (UNIX) or Registry (Windows) are required. For Scenario B: Install SharePlex in the normal manner following the instructions in the SharePlex Installation and Demonstration Guide. include the column partition or excluded column partition (see page 174). create a basic or multi-tar- get configuration that replicates to the target system or systems. It is not necessary to run ora_setup on this system. you will create the intermediary instance when you follow the synchronization procedure. create a uni-directional con- figuration that replicates to the target system using the intermediary system as a pass- through only (no active configuration).) . Do not run ora_setup if you are establishing the intermediary instance with a hot backup or DBCopy. (The default is 0. On the intermediary system • Establish an Oracle instance in one of the following ways: For Scenario A: Create the intermediary instance. run ora_setup for that instance in the normal manner. create partition schemes and use them in the routing map (see page 160). create partition schemes and use them in the routing map (see page 160). If you are using an Oracle hot backup or DBCopy.0 Updated 8/19/13 entire database (see page 183). • Install SharePlex in one of the following ways: For Scenario A: Install in the normal manner following the instructions in the Share- Plex Installation and Demonstration Guide. include the column partition or excluded column partition (see page 174). mean- ing that Capture ignores Post activity on the same system. For Scenario B: You need not create a full Oracle database. • (Scenario A only) Set the SP_OCT_REPLICATE_POSTER parameter to 1. If you are using vertically partitioned repli- cation for a table. Because SharePlex will be replicating to an Oracle instance on this machine.200 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8.

depending on what is required by the synchronization procedure you are follow- ing. • Install SharePlex and run ora_setup in the normal manner. . ensure that all data and system issues have been addressed according to the guidelines in Chapter 4. • Perform initial synchronization by: --making a copy of the source data. On the target system • Create the target instance. --activating the configuration on the intermediary and/or source system. The change takes effect the next time Capture starts. On all systems • Before you synchronize data to begin replication. You will be instructed to do so by the synchronization procedure after the target instance is established. Do not run ora_setup if you are establishing the target instance with a hot backup or DBCopy. If you are using an Oracle hot backup or DBCopy. and issue the following command in sp_ctrl. sp_ctrl(sysB)> set param SP_OCT_REPLICATE_POSTER 1 2 You can either exit sp_ctrl and shut down SharePlex or leave them both running. See page 407 for instruc- tions. you will create the intermediary instance when you follow the synchronization procedure. Choose an appropriate synchronization procedure from the ones in Chapter 7. CHAPTER 5 201 Preparing for SharePlex Replication To change the setting of SP_OCT_REPLICATE_POSTER 1 Start SharePlex and sp_ctrl. --applying the copy to the intermediary system (Scenario A only) and to the target systems (both scenarios). unless you will be using an Oracle hot backup or DBCopy to synchronize the data.

as shown in the illustration. See page 148 for instructions If you are using vertically partitioned replication for a table.table intermedsystemB*targsysC@o.tab source_own. • If the owner and name is the same on all target systems. create a separate line for that set of source-target objects. include the column parti- tion or excluded column partition (see page 174). use Template 16.0 Updated 8/19/13 Establishing combined cascading/broadcast replication You can combine broadcast replication with pass-through cascading replication within the same configuration.price sysB*sysC@o.sourceSID target_own. • If any owner or name is different.oraA HQ.targSID + le targsysD@o. and it is being replicated through a direct network connection to SysD. create partition schemes and use them in the routing map (see page 160). the source table is being replicated from SysA through SysB to target system SysC.price Reg.targSID Example configuration on source system sysA Datasource:o. Template 16: Configuration combining broadcast and cascading replication Datasource:o.oraD In the example. If you are using horizontally parti- tioned replication for a table. or one or both can be different.202 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. . A target table can have the same owner and name as its source table.oraC + sysD@o.

follow the instructions in “Establishing replication for data dis- tribution or distributed processing” on page 194 and “Establishing replication through an intermediary system” on page 197. . CHAPTER 5 203 Preparing for SharePlex Replication To establish replication.

creates post queues and Post processes for each replication stream. all con- trolled by one sp_cop process. in turn. see page 211. Share- Plex creates an Import process for each source system on the central target system. To establish peer-to-peer replication.204 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. Replicating the same tables from different source systems (where users perform DML) to a central database is not consolidated repli- cation. .0 Updated 8/19/13 Establishing replication for centralized reporting (standard method) Centralized reporting uses consoli- dated replication. it is peer-to-peer replica- tion. Considerations for centralized reporting When you start replication. in which multi- ple source systems replicate different tables to the same Oracle instance on one target system. on the central target system. That. These post queues share the same SharePlex variable-data directory FIGURE 16: Centralized reporting using a sin- gle instance of sp_cop.

If you are using vertically partitioned replica- tion for a table. or one or both can be different. This involves run- ning multiple instances of sp_cop. create partition schemes and use them in the routing map (see page 160).targetSID The following configuration examples show two source systems. sysA and sysB. one for each source system. both replicating to target system sysC.dat cust.table target_owner.dat sysC@o. To avoid contention. • Referring to Template 17. you can establish separate variable-data directories on the central target system.sourceSID source_owner.oraC On the source systems • Install SharePlex on each source system (sysA and sysB) in the normal manner and run ora_setup for the source instance. The following instructions are for consolidated replication using a single instance of sp_cop. see page 207.oraB cust. To establish consolidated replication using separate sp_cop processes.dat sales. If you are using horizontally partitioned replication for a table. which enable you to isolate the replication stream for each source system so that events affecting one do not affect the others. See page 407 for instructions.oraA sales. Template 17: Configuration for centralized reporting with one sp_cop instance Create this configuration on each source system. create configurations on each source system that replicate to the central target system (sysC).dat sysC@o.table targetsystem@o. Datasource:o. include the column partition or excluded column partition (see page 174).oraC Example configuration on source system sysB Datasource:o. Sequences need . A target table can have the same owner and name as its source table. Example configuration on source system sysA Datasource:o. this might cause contention for the same queue resources and semaphores. CHAPTER 5 205 Preparing for SharePlex Replication Depending on the system’s resources. Each configuration replicates a differ- ent set of tables.

You can do this one source system at a time. • Install SharePlex and run ora_setup for the target instance in the normal manner. ensure that all data and system issues have been addressed according to the guidelines in Chapter 4. applying it to the target instance. On the central target system • Create the target instance so that all tables from all of the source systems exist in that database. or you can copy and apply the data from all sys- tems at once. but the hot copy only can be used to copy the data for one source system. If you want to use a hot copy as part of this process. so do not include them in the configura- tions. • Perform initial synchronization by making a copy of the source data on each source system. A hot-copy method (Oracle hot backup or DBCopy hot copy) can be combined with cold-copy methods for this. See Chapter 7 for the appropriate procedures to fol- low. See page 407 for instructions. A hot copy overwrites existing data. so you must use a cold-copy method such as import/export for the other source systems.206 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. . On all systems • Before you synchronize data to begin replication. and activating the configurations.0 Updated 8/19/13 not be replicated for reporting or archiving. or use the transportable tablespace feature. Important! Each configuration must replicate a different set of objects. combine it with cold- copy methods as instructed in the synchronization procedure.

Running multiple instances of sp_cop avoids contention for queue resources and sema- phores. In addition. This method establishes separate variable-data directories on the central target system. each running on a different port number. CHAPTER 5 207 Preparing for SharePlex Replication Establishing replication for centralized reporting using multiple sp_cop processes Use this configuration for central reporting to isolate the replication stream from each source system. it gives you the option to locate the variable-data directories on sep- arate disks to ensure that events affecting one replication stream do not affect the others. Each variable-data directory is controlled by a separate instance of sp_cop. . FIGURE 17: Centralized report- ing using separate variable-data directories and multiple instances of sp_cop.

dat sysC@o.targetSID The following configuration examples show two source systems.table target_owner. Replicate different source tables to the target system. • Install SharePlex on each source system. • Create separate Oracle user accounts for each sp_cop instance Template 18: Configuration for centralized reporting using separate sp_cop instances Create this configuration on each source system.oraC On the central target system • Create the target instance so that all tables from all of the source systems exist in that database.oraC Example configuration on source system sysB Datasource:o. To replicate the same tables from different systems to the target system is peer-to- peer replication.oraA sales. • Establish unique port numbers for each variable-data directory. To establish peer-to-peer replication. . Example configuration on source system sysA Datasource:o.dat sales. one for each source system. • Create multiple variable-data directories on the target system.oraB cust.table targetsystem@o. Detailed instructions follow. as summarized below.0 Updated 8/19/13 Replication for centralized reporting through separate variable-data directories is imple- mented in several steps. combine it with cold- copy methods as instructed in the synchronization procedure. • Create a configuration on each source system that replicates to the central reporting instance on the target system. Datasource:o. see page 211. sysA and sysB. If you want to use a hot copy as part of this process.208 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. both replicating to target system sysC.dat cust. which will enable simultaneous sp_cop instances to run on the target system—one for each source sys- tem.dat sysC@o. A target table can have the same owner and name as its source table. or one or both can be different. Each configuration replicates a dif- ferent set of tables.sourceSID source_owner. which isolate each source system’s replication streams.

and how to start the associated instances of sp_cop and sp_ctrl. Make sure the system has enough disk space to accommodate the data received from all of the source systems. create partition schemes and use them in the routing map (see page 160). See page 407 for instructions. See “Setting an alternative port for sp_cop” on page 259. create one variable-data directory for sysA and one for sysB on sysC. On the source systems • Install SharePlex on each source system in the normal manner and run ora_setup for the source instance. so do not include them in the con- figurations. change the SharePlex port number after installation to the port that corresponds to its variable-data directory on the target system. For example. CHAPTER 5 209 Preparing for SharePlex Replication • Install SharePlex in the normal manner on the target system. Important! Each configuration must replicate a different set of objects. how to set a port number for each one. --For each UNIX source system. you avoid having to export the SharePlex environment variables every time you start sp_cop. If you are using horizontally partitioned replication for a table. • Follow the instructions in “Running multiple instances of SharePlex” on page 64 to create one new SharePlex variable-data directory on the target system for each source system. Those instructions also show you how to create an Oracle user account for each of the variable-data directories. install on the port number that corresponds to its variable-data directory on the target system. but do not run ora_setup yet. If you are using vertically partitioned replication for a table. . • Referring to Template 18 on page 208. --For each Windows source system. Sequences need not be replicated for reporting or archiving. include the column partition or excluded column partition (see page 174). if you are replicating from sysA and sysB to target sysC. create a configuration on each source system that replicates to the central target system. That way.

0 Updated 8/19/13 On all systems • Before you synchronize data to begin replication. but the hot copy only can be used to copy the data for one source system. so you must use a cold-copy method such as import/export for the other source systems. or you can copy and apply the data from all sys- tems at once. . See Chapter 7 for the appropriate procedures to fol- low. and activating the configurations. applying it to the target instance. or use the transportable tablespace feature. You can do this one source system at a time. A hot copy overwrites existing data. ensure that all data and system issues have been addressed according to the guidelines in Chapter 4. A hot-copy method (Oracle hot backup or DBCopy hot copy) can be combined with cold-copy methods for this. • Perform initial synchronization by making a copy of the source data on each source system.210 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8.

‘1’).nextval. different users all make DML changes to copies of the same tables in different databases. an out- of-sync error results because Oracle generates a unique-key violation error. the same time. Challenges in peer-to-peer replication Peer-to-peer replication presents unique challenges not found in single-direction repli- cation situations like replicating from a production server to a secondary system for reporting purposes. It also requires PL/SQL conflict resolution routines that control which transactions to accept for posting to the target database when more than one user changes the same record at. SharePlex statement: SQL> INSERT into scott. To construct the INSERT statement. You can predict that out-of-sync (conflict) situations will occur when a DML statement constructed by SharePlex fails to execute on a row in the target table because of the following reasons: • Conflict occurs when an INSERT is performed on the source system. A conflict is defined as an out-of-sync condition — source and target tables are not identical. In those configurations. or near. It requires a major commitment to database design that might not be practical when pack- aged applications are in use. however. while SharePlex replication keeps all of the databases synchro- nized. CHAPTER 5 211 Preparing for SharePlex Replication Establishing peer-to-peer replication Peer-to-peer replication allows users on multiple databases to make changes concur- rently to the same data. . If SharePlex attempts to insert a row containing a key that already exists in the target table. Peer-to-peer replication is not appropriate for all replication environments. SharePlex uses all of the columns. ‘Manager’.employee_source values (emp_seq. If a record is changed in more than one database at (or near) the same time. ‘50000’. while SharePlex keeps them all current through replication. usually on different systems. conflicts can occur. there is never DML access to the secondary system. ‘Mary Smith’. but the row already exists in the target database when SharePlex attempts to post it. In peer-to-peer replication.

If the key is unavailable on the target system. To construct a DELETE statement to remove a row from the target database. SharePlex uses the primary key to locate the row. the SQL statement fails and SharePlex returns an out- of-sync error. but Share- Plex cannot locate the row to be deleted on the target system.212 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. User statement on the source: SharePlex statement on the target: SQL> UPDATE SQL> UPDATE scott. In constructing an UPDATE statement to be applied to the target database. If the pre-images and the keys match in the source and target rows. SysB . Share- Plex posts the operation. Share- Plex uses only the key value in the WHERE clause. either because the row already was deleted or the key column(s) changed. (30000 is the amount before the salary value was updated to 32000. This implies that another user already either changed the target row or deleted it. SharePlex statement: SQL> DELETE from scott.employee_source WHERE EmpNo = 3. Examples of conflict situations To understand how SharePlex determines a conflict.employee_src scott. but the image of the row on the source system before the change was made does not match the existing values in the target row. In addition.0 Updated 8/19/13 • Conflict occurs when an UPDATE is performed on the source system. refer to the following examples of normal and conflict situations. or if SharePlex cannot locate the row using the key. If the pre-images do not match. SharePlex constructs a WHERE clause consisting of the pre-image of the updated columns — the values before the change.) • Conflict occurs when a DELETE is performed on the source system. SharePlex cannot locate the row and returns an out-of-sync error. three systems (SysA.employee_source SET Salary = 32000 SET Salary = 32000 WHERE EmpNo = 3 WHERE EmpNo = 3 AND Salary = 30000. For the sake of simplicity.

At 9:30 that same morning. where EmpNo is 1. UserB on SysB changes the value of Dept to 3. EmpNo number(4) not null.2). EmpName char(30). Salary number(7.2). EmpName char(30). SharePlex replicates that change to SysA and SysC. SharePlex replicates that change to SysB and SysC. Salary number(7. The following table is used in the example. UserA on SysA changes the value of the Dept column to 2. Dept number(2) Dept number(2) unique index employee_Idx on unique index employee_bk on employee_source(EmpNo) employee_backup(EmpNo) Values for both tables EmpN SocSec EmpName Job Salary Dept o 111-22-3333 Mary Smith Manager 50000 1 1 111-33-4444 John Doe Data Entry 20000 2 2 000-11-2222 Mike Jones Secretary 30000 3 3 000-44-7777 Dave Brown Manager 45000 3 4 Example of peer-to-peer replication without a conflict At 9:00 in the morning. Job char(10). and both data- bases remain synchronized. Job char(10). Now the row looks like this: FIGURE 19: Updated Dept column for Emp No 1 EmpNo SocSec EmpName Job Salary Dept 1 111-22-3333 Mary Smith Manager 50000 3 . but there could be more systems replicating among one another. SocSec number(11) not null. CHAPTER 5 213 Preparing for SharePlex Replication and SysC) are used. FIGURE 18: Sample Table for peer-to-peer replication PRIMARY TABLE (owned by scott) SECONDARY TABLE (owned by jane) Employee_source Employee_backup EmpNo number(4) not null. where EmpNo is 1. SocSec number(11) not null. and the databases are still synchronized.

Note: The SharePlex design prevents the data in peer-to-peer replication from looping back from one machine to another. At 11:00 in the morning. By default. The pre-images do not match. Again.0 Updated 8/19/13 Example of peer-to-peer replication with an UPDATE conflict This example is illustrated in Figure 20 on page 215. When SharePlex attempts to post UserB’s change on SysA. but it is not — it is 2 because of UserB’s change. . SharePlex generates an out-of-sync error. where EmpNo is 1. SharePlex transactions performed on the local system by the SharePlex Oracle user (by way of the Post process) are ignored. but it is 1 because of UserA’s change. where EmpNo is 1. it expects the value of the column to be 3. The network is restored at 11:10 that morning. Replicated changes queue on all systems.214 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. UserA on SysA updates the value of Dept to 1. SharePlex generates an out-of- sync error. both of those statements fail because the pre-images do not match. so the Capture process does not replicate those transactions back to their source. When SharePlex attempts to post UserA’s change to the database on SysB. When SharePlex attempts to post the changes made by UserA and User B to the data- base on SysC. before the network is restored. the network fails. as shown in Figure 19). UserB on SysB updates the value of Dept to 2. so SharePlex deter- mines that the row is out of synchronization and it generates an error. Replica- tion data transmission resumes. At 11:05 that morning. At 11:02 that morning. it expects the value in the Dept column to be 3 (the pre-image.

CHAPTER 5 215 Preparing for SharePlex Replication FIGURE 20: Conflicts caused by UPDATE statements .

Can you isolate the keys? Understanding the role of keys in the SQL statement constructed by SharePlex is critical to understanding synchronization issues and minimizing conflicts in a peer-to-peer envi- ronment. you can convert that key to a primary key. The primary key must be unique among all of the databases in the peer-to-peer replica- tion network. meaning • it must use the same column(s) in each corresponding table in all databases. and you know all rows are unique. SharePlex depends on unique. you can create a unique index on all tables. . many packaged applications are not suitable for a peer-to-peer deployment because they were not cre- ated within those guidelines. Consequently. SharePlex normally uses a unique key in the absence of a primary key. not-NULL keys in the SQL statement in order to locate the correct row in the target table for UPDATE and DELETE statements. because they demand cooperation with the application. Following are more detailed explanations of each of the requirements. If you cannot assign a primary key.0 Updated 8/19/13 Considerations for peer-to-peer replication To successfully deploy SharePlex in a peer-to-peer configuration. If a table has no primary key but does have a unique. and to ensure that a row being inserted is not already there. not-NULL key. • key columns for corresponding rows must have the same values. you must be able to: • isolate keys • prevent changes to keys • control sequence generation • control trigger usage • eliminate cascading deletes • designate a trusted host • define priorities These requirements must be considered during the architectural phase of the project. LONG columns cannot be part of the key. The only acceptable key is a primary key.216 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. or it will build a simulated key internally using all columns except LONGs. but this is not acceptable in peer-to-peer replication.

Suppose the sample table in Figure 18 on page 213 uses sequences to generate values for key column EmpNo. Warning! Because SharePlex locates rows on the target system by using the key. The solution is to include other unique columns in the key. Suppose UserA gets the next sequence value on SysA and inserts a row for “Jane Wilson. When you isolate keys. and it can apply a conflict resolution routine for the correct row.A government-assigned Social Security Number. there must be no chance for the same range of values to be generated on any other system in the peer-to-peer configuration. it ensures a conflict. a unique number) and the EmpName column (as added verification with the EmpNo and SocSec columns). resulting in the correct application of a conflict resolution routine. Even so. if needed. CHAPTER 5 217 Preparing for SharePlex Replication The primary key must be created to contain enough information about a row so there can be no question about that row’s uniqueness and location. This is enough information to ensure uniqueness of each row among all databases. How does the application use sequences? Sequences would help ensure uniqueness of a primary key. making sure you partition a unique range to each one. but that might be impractical over WAN and Internet connections. Using just a sequence as the primary key probably will not suffice for peer-to-peer rep- lication. if you have two servers. data integrity is compromised: There are now two entries for “Jane Wilson” in the databases — causing problems for future UPDATE operations. For the sample table. You can use a sequence server.” Because the sequence numbers would be different on each system (and sequences gen- erate the key).S. The concept of ensuring key uniqueness among all databases is defined as key isolation. This ensures that Share- Plex cannot possibly post data to the wrong row and that conflict resolution succeeds. SharePlex can locate and change the correct row in all data- bases. and odd values to the other. For example. the key could also include the SocSec column (U. The following example explains why. As an alternative. but SharePlex does not sup- port peer-to-peer replication of sequences. You need to . Peer-to- peer replication would not be practical in environments where key values are changed.” UserB gets the next sequence value on SysB and also inserts a row for “Jane Wilson. you can assign even values to one. you can maintain sequences separately on each server. there are no unique key violations when those INSERTs are replicated between systems. When there is duplicate user activity on a row. If you are using sequences to generate all or part of a key. it can- not provide conflict resolution when one or more columns of a key are changed.

218 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. those rows will not be there when Share- Plex expects to perform the replicated cascaded DELETEs. you can incorporate the required DELETE functions into trig- gers. then run the sp_add_trigger. If the primary DELETE activates foreign-key constraints on the target table that delete the dependent rows. they must be directed to ignore the SharePlex user by wrapping them with the sp_add_trigger. so they are replicated and posted to the target database by SharePlex. SharePlex expects to post replicated operations in the order they are received. This causes SharePlex to return out-of-sync errors. see page 426. The trigger fires for a source transac- tion to delete the dependent rows in the source database. you can add a location identifier such as the sys- tem name to the sequence value in the primary key to enforce uniqueness. If the same triggers fire on the target system. If triggers must be available to fire when activated by operations from users other than SharePlex. Does the application use triggers? DML changes resulting from triggers firing on the source system enter the redo log. ON DELETE CASCADE constraints must be disabled. Instead of using ON DELETE CASCADE constraints. Depending on the type of application. Quest recommends using n+1 sequence generation (where n = the number of systems in replication). they return out-of-sync errors. SharePlex replicates both the primary (original) DELETE and the dependent (cascaded) DELETE operations to the target system because they all enter the redo logs.0 Updated 8/19/13 anticipate the growth of the number of servers and the number of rows requiring sequences on each system. the trigger does not fire. This puts a WHEN clause into each trigger’s procedural statement that tells it to ignore the Post process. but when SharePlex posts the replicated primary DELETE to the target database. For more information about this script.sql script to direct the triggers to ignore the Share- Plex user. Does your application use cascading deletes? ON DELETE CASCADE constraints require special attention. No depen- dent rows are deleted until the replicated dependent DELETE operations arrive from the source. When these constraints fire during the original transaction.sql script on all instances in the peer-to-peer configuration. . This enables you to maintain referential integrity.

Possible solutions for maintaining quantities and balances If you can use a debit/credit method of maintaining balances. When the Post process attempts to post the first transaction. (UPDATE inventory SET quantity = 99 WHERE book_ID = 51295). If your application must use UPDATE statements. But before the original UPDATE arrives.. but how would the correct value be determined? The correct value in both databases after the two transactions should be 97 books. CHAPTER 5 219 Preparing for SharePlex Replication Does the application maintain inventory quantities or account balances? Applications that use UPDATE statements to record changes in quantity. INSERT statements do not require a before-and-after comparison with a WHERE clause. peer-to-peer replication is not recommended for applications maintain- ing account or inventory balances using UPDATEs. pose a challenge for peer-to-peer replication. such as inven- tory or account balances. The following table describes the bookseller’s Inventory table. For this reason. The following example of an online bookseller explains the reason why. The quantity on hand reduces from 100 books to 99.) instead of UPDATE statements. as do UPDATE statements. the result is incorrect. it discerns 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). you can use INSERT statements (INSERT into inventory values “n”. another customer buys two copies of the same book on another server (UPDATE inventory SET quantity = 98 WHERE book_ID = 51295). A conflict resolution procedure could be written. but no matter which of the two UPDATE statements is accepted. in the case of the preceding online book- . Book_ID (primary key) Quantity Suppose a customer buys a book through the database on one server.. Following are some alternate solu- tions. and the quantity on that server reduces from 100 books to 98. Post returns an out-of-sync error. SharePlex replicates that UPDATE statement to the other server. For example.. you can write a conflict resolution procedure to determine the absolute (or net) change resulting from different UPDATE statements on different systems.

. there is a conflict. The change is replicated to SysB as an UPDATE statement (such as UPDATE.SET balance=$2000 WHERE account_number=51295). the net change (pre-image of 100 minus the new value of 98) is 2.balance .balance then old.. the following conflict resolution procedure fires: if existing_row. Cus- tomerA makes a deposit of $500 on that system.quantity . the net effect of selling three books. When CustomerA’s transaction arrives from SysA and Post attempts to post it to SysB. which equals 97.balance <> old. if the quantity value of the existing row in the target database (98) does not equal the old value (pre-image of 100). Then. In this case. The following example illustrates this concept using an account balance within a finan- cial record: account_number (primary key) balance Suppose a row (an account) in the example table has a balance of $1500 on SysA. When the second user’s change is replicated to the first system. issue an UPDATE statement that sets the Quantity column to 98-1.balance = balance_change. You can write a conflict resolution routine to accommodate this kind of transaction by calculating the absolute (or net) change in the account. Before the change arrives. the same conflict resolu- tion procedure fires.new.balance - balance_change. For example: if existing_row.. CustomerA’s spouse makes a withdrawal of $250 on SysB. The conflict resolution logic tells SharePlex that.quantity . The result of this procedure’s logic is that the Quantity columns on each system are updated to 97 books. then using that value to resolve the conflict. since the pre-image from the source system is $1500. The application uses an UPDATE state- ment to change the balance to $2000. but the pre-image on the target is $1250 because of the spouse’s transaction — not a match. which is 99 (the existing row value after the first customer’s purchase) minus the net change of 2. and the application updates the database on that system to $1250.220 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. update existing_row set quantity = existing_row.quantity <> old.quantity_change. then subtract the new value (the replicated value of 99) from the pre-image to get the net change (1).quantity = quantity_change.0 Updated 8/19/13 seller example. update existing_row set balance = existing_row.quantity then old. when the first customer’s purchase is replicated to the second system.new. The UPDATE statement on this system also results in a value of 97.

For this. Tables on servers in different time zones can use Greenwich Mean Time (GMT). the routine directs SharePlex to subtract the new (replicated) balance of 2000 from the old balance of 1500 for a net change of -500. One of the systems in the configuration must be considered the true source from which all other systems will be resynchronized if necessary. How- ever. changes on the server at corporate headquarters could take priority over the same changes made by a branch office. or it will cause conflicts. 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. the replicated value of 1250 is subtracted from the old balance of 1500 to get the net change of 250. For example. On SysB. The following explains how those columns play a vital role when using a conflict resolution routine to establish priority. you must make sure all of the servers involved agree on the date and time. • You can write your conflict resolution routines so that operations from the trusted source system take priority over conflicting operations from other systems. the correct value. Trusted source: You must assign a particular database or server to be the prevailing. or trusted. The UPDATE statement sets the balance value to 1250 . your application must be able to accept the addition of timestamp and source columns. CHAPTER 5 221 Preparing for SharePlex Replication The result of this procedure would be to update the account balance to $1750. source for two reasons: • 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. 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. SharePlex cannot locate rows if a key value changes — and the key value will change if one of the columns is a timestamp. the timestamp must not be part of a key. with source being the name of the local sys- tem for the table. On SysA. The UPDATE statement subtracts that value from the existing balance of 2000 to get the correct value of 1750. . For timestamp priority to work. the net effect of depositing $500 and withdrawing $250.(-500) = 1750. How will you assign priority? When the environment is established to avoid or resolve conflict when SharePlex searches for the correct row to change.

Example configuration Datasource:o. or when a row that needs to be changed already was changed. Template 19: Peer-to-peer configuration on each system Datasource:o. Target is the database/schema/table/system that receives the replicated operations for the trans- action. Quest periodically updates the conflict resolution logic.oraA sales. so create conflict res- olution rules and syntax that are appropriate for your business.dat1 sales.222 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8.table targetsystem@o. 2 Develop conflict resolution routines that direct the action of the Post process when there is a conflict because Post cannot locate a row. but do not use them as your own routines.table target_owner.sourceSID source_owner.targetSID Source is the database/schema/table/system where a transaction originates. 3 List the conflict resolution routines in a special conflict_resolution. Important! Business rules vary widely from company to company.oraB .SID file. This documentation pro- vides guidelines. examples and templates to assist you. so refer to the Release Notes and documentation for your version of SharePlex for any additional information that augments or supersedes these instructions. Share- Plex refers to this file to determine the correct procedure to use when a conflict occurs.dat2 sysB@o. In addition.0 Updated 8/19/13 Configuring peer-to-peer replication Peer-to-peer replication consists of the following configurational steps: 1 Create a replication configuration on each system that replicates to all other systems in the peer-to-peer environment.

Important: To use a hot- copy method. Do not include sequences in the configuration. • Install SharePlex in the normal manner and run ora_setup. If you intend to use an Oracle hot backup or a DBCopy hot copy for this. See page 407 for instruc- tions. Specify the local instance as the datasource. You will create them with the copy during the synchronization procedure. and specify the remote instances and systems in the rout- ing map. You might be able to automate this task using either the build_config. you must establish a trusted source data- base and system — the primary database and system from which all other systems are initially synchronized and re-synchronized when necessary. Before creating a table with a default date. do not create the instances. SQL> ALTER SESSION SET nls_date_format = 'MMDDYYYYHH24MISS' . or conflict resolution will return errors. See page 407 for instruc- tions.sql script (see page 179) or the config. • Install SharePlex and run ora_setup in the normal manner. Do not include sequences in the configuration. CHAPTER 5 223 Preparing for SharePlex Replication Steps to take on the trusted source system To maintain a peer-to-peer replication strategy.sql script (see page 179) or the config.sql script (see page 183). • Referring to Template 19 on page 222. use the following com- mand to change the date format in SQL*Plus. You will be instructed to do so in the synchronization procedure after the instance is established. You might be able to automate this task using either the build_config. • Referring to Template 19 on page 222. create a configuration on each system that replicates to all other systems. Tables with default dates must use that format.sql script (see page 183). create a configuration that replicates to the other replication system(s). On all other systems • Create the Oracle instances on these systems. Owner and table names can be different than their counterparts on other systems if the table structure is identical. To accommodate the use of sequences. Important: Do not run ora_setup if you are using an Oracle hot backup or DBCopy hot copy. To accommodate the use of sequences. be prepared to quiet all of the secondary source systems for the dura- tion of the procedure. see “How does the application use sequences?” on page 217. see “How does the application use sequences?” on page 217. • The default date format for SharePlex conflict resolution is MMDDYYYY HH24MISS. Perform the following steps on the trusted source system first.

• After you create conflict resolution routines. • Before you synchronize data to begin replication. SharePlex provides some prepared conflict resolution routines. stop and re- start the Post process so that it updates the resolution cache. Conflict resolution for DELETE statements could be as simple as writing a routine that directs SharePlex to ignore out-of-sync errors for DELETEs and discard duplicate trans- actions for UPDATES performed after a DELETE. ensure that all replication consider- ations have been addressed according to the guidelines in Chapter 4 and in “Consid- erations for peer-to-peer replication” on page 216. • Create conflict resolution routines by creating stored PL/SQL conflict resolution procedures that direct the action of SharePlex when a conflict occurs. those routines to satisfy your business rules. • Perform initial synchronization by copying the database from the trusted source sys- tem to the other systems and activating the configurations on each system. Instructions are in “Using generic conflict resolution” on page 224. Choose a procedure from the ones in Chapter 7. complete the SharePlex conflict resolu- tion file on each system by listing the conflict resolution procedures you developed. Using generic conflict resolution Generic conflict resolution enables you to use dynamic SQL to write one or more con- flict resolution routines for use with multiple tables. including the trusted source • If the systems are in different time zones. assuming keys are isolated and the . See page 235 for more information about the prepared routines. Instructions for completing a conflict resolution file follow the instructions for creat- ing the conflict resolution procedures.224 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. or in conjunction with.0 Updated 8/19/13 On all systems. After you change the conflict resolution file. SharePlex sup- ports the following forms of conflict resolution: Generic conflict resolution uses dynamic PL/SQL that enables one conflict resolu- tion routine to be used for multiple tables. but you probably need to write your own procedures instead of. establish timestamps using offsets to Greenwich Mean Time. Changing the conflict resolution file You can change the conflict resolution file any time during replication to add and remove tables and procedures.

SharePlex supports tables with identical owner and table names. If you use both. whether or not they are sup- ported by SharePlex replication. • A known issue in PL/SQL prevents the SharePlex conflict resolution logic from compiling the PL/SQL for tables whose names are the same as their owners. It is good practice to write more than one procedure. but not both. Warning! Test your conflict resolution routines before you put them into produc- tion to make sure they work as intended. Although the same sp_cr PL/SQL package is used for conflict resolution and trans- formation. so procedures for ensuring data integrity can be equally complex. SharePlex invokes one routine after another until one succeeds or there are no more procedures available. • Conflict resolution does not support changes to LONG or LOB columns. Restrictions and requirements for using generic conflict resolution Observe the following limitations before implementing generic conflict resolution. This issue does not affect replication. transformed tables cannot be compared by SharePlex. see page 245. so conflict resolu- tion cannot succeed. and to make sure that one routine does not counteract another one. For more information about transforma- tion. CHAPTER 5 225 Preparing for SharePlex Replication database is configured properly. • Conflict resolution cannot be used for DDL changes. Oracle has stated that the issue will not be fixed. INSERT and UPDATE statements change data values and can be complex. such as for INSERTs. SharePlex will only call your transformation routine.996 for more information. and use it in combination with one or more multi- table procedures. • Any table to be accessed through PL/SQL for conflict resolution requires implicitly granted privileges from the owner of the object to SharePlex. You can write a generic conflict resolution procedure for a specific table and for a spe- cific operation. See Oracle TAR 2577886. If appropriate. . • Use either generic conflict resolution or transformation for a table. such as making site or system pri- ority the primary routine and timestamp a secondary routine. you can use generic conflict resolution and transformation for different tables in the same configuration.

is_key boolean col_def_tabtyp .status number returned to SharePlex to .src_ora_time varchar2(20) .statement_type varchar2(6) These are the OUT vari- .column_name%type used to popu- .datatype%type late the .src_ora_sid varchar2(32) passed to your procedure.226 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8.action number direct its action.old_value varchar2(32764) the information . create package sp_cr as type row_typ is record (src_host varchar2(32) These are the IN variables .source_rowid varchar2(20) .new_value varchar2(32764) needed for your .current_value varchar2(32764) procedure. .is_changed boolean table capturing . ).target_table varchar2(78) ables that must be set in .reporting number ). The package uses the fol- lowing parameters.0 Updated 8/19/13 Creating a generic conflict resolution procedure SharePlex defines PL/SQL record and table structures in a public package named sp_cr that was installed during ora_setup in the SharePlex schema.target_rowid varchar2(20) . type col_def_tabtyp is table of col_def_typ .oracle_err number your procedure and .datatype user_tab_columns. . This is the type col_def_typ is record datatype that is (column_name user_tab_columns.

statement_type This is a letter. indicating whether an INSERT. for example ‘123456’. src_ora_time This is the timestamp of the changed data in the source redo log that is being replicated. for example "scott". this variable consists of the name of the post queue. target_table This is the owner and name of the target table. If the row cannot be found using the PRIMARY key. source_rowid This is the row ID of the source row (the one whose data was replicated)."emp. . U or D. It is case-sensitive and is passed using the same case as on the source system. Win- dows Registry or V$PARAMETER table. If there are named post queues in use on the target system. for example SysA. It is passed as a literal within single quotes." oracle_err This is the Oracle error number that caused the conflict. CHAPTER 5 227 Preparing for SharePlex Replication Explanation of IN variables passed by SharePlex to your procedure For each row that causes a conflict. for example ‘123456’. UPDATE or DELETE statement caused the conflict. expressed as owner. This value is case-sensitive and matches the way the table is named in the database. src_host This is the name of the source system (where the data was changed). SharePlex passes this identifying information. the value is NULL. It is case-sen- sitive and is passed in the same case as in the oratab file. It is passed as a literal within single quotes. either I. target_rowid This is the row ID of the corresponding row in the target data- base. SharePlex obtains the row ID by querying the database. src_ora_sid This is the ORACLE_SID of the source database. It is passed within double quotes. for example postq1.table.

• The value of 1 is reserved for internal SharePlex use. The outcome of this action depends on what you spec- ify for the reporting variable. action The action variable defines the action that you want SharePlex to take as a result of an unsuccessful conflict resolution procedure. You must specify a value for this parameter. • A value of 2 directs SharePlex to try the next conflict resolu- tion procedure that you listed in the conflict resolution file.0 Updated 8/19/13 Explanation of OUT variables passed by your procedure to SharePlex These variables direct the action of SharePlex based on the outcome of the procedure (whether conflict resolution succeeded or failed). • A value of 0 directs SharePlex NOT to post the SQL state- ment. . In this case. if one exists. SharePlex does not write any log entries to the Event Log when conflict resolu- tion succeeds. • A value of 1 implies unsuccessful conflict resolution. status The status variable defines whether or not the conflict resolution procedure resolved the conflict.228 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. • A value of 0 implies successful resolution and directs Share- Plex to proceed with the SQL statement. You must specify a value for this parameter. Do not use it. the action SharePlex takes depends on what you speci- fied as the action variable.

column_name This tells your procedure the name of the column that was repli- cated from the source table. is_key This tells your procedure whether or not the column is a key col- umn. Important! By default. Explanation of col_def_typ datatype For each replicated column of a row that caused a conflict. See the SharePlex Reference Guide for more information about show log and other SharePlex commands. You must specify a value for this parameter. Do not use them. . No conflict resolution available. • A value of 0 directs SharePlex NOT to report an error or write the failed SQL statement to the SID_errlog. for example VARCHAR2. If the column is not part of a key. SharePlex provides the fol- lowing information in the col_def_tabtyp table. This value is always in capital letters.ora102) 15020 . the databases can become more and more out of synchronization. • A value of 3 directs SharePlex to write the failed SQL state- ment to the SID_errlog. This value is not case-sensitive.ora102- o. SharePlex passes a value of TRUE. If it is a key column. datatype This tells your procedure the datatype of the data in the repli- cated column.INVTABLE” is out-of-sync. • Values 1 and 2 are reserved for internal SharePlex use. Check the Event Log frequently to monitor for out-of-sync warnings by using the show log command in sp_ctrl or by using the Replication Monitor component of the Quest CentralTM for Oracle database-management console.sql log. for example emp_last_name. CHAPTER 5 229 Preparing for SharePlex Replication reporting The reporting variable determines how SharePlex reports unsuc- cessful conflict resolution results.Table “ABC. SharePlex does not stop for out-of-sync conditions. SharePlex passes a value of FALSE. If failed attempts at conflict resolution are not resolved.sql log and report the following error to the Event Log: Warning: sp_opst_mt (for o.

If it is changed. because none of the columns existed in the database. before it was changed on the source system. is_changed is FALSE. . but if that key value also was changed on the target system. Possible entries in the col_def_tabtyp table SharePlex creates a col_def_tabtyp PL/SQL table for each operation that caused a con- flict. The following tables illustrate the possible outcomes of each type of operation. although not all will have val- ues if SharePlex cannot locate the row. then there is a conflict. new_value This tells your procedure the new value of the replicated column.0 Updated 8/19/13 is_changed This tells your procedure whether or not the column value has changed. because keys should not change in peer-to-peer replication. For UPDATEs. and conflict resolution could fail. For DELETEs. Share- Plex will pass a value for a changed key column. old_value This tells your procedure the old value of the replicated column. is_changed is TRUE for non-key columns. This column is NULL for INSERTs. For UPDATEs and DELETEs. If SharePlex cannot locate the target row. because Share- Plex replicates only the key values for a DELETE statement. SharePlex passes a value of FALSE. is_changed is TRUE for non-NULL values. is_changed normally is FALSE. if the old value passed by SharePlex does not match the current_value variable obtained from the target row. the value is NULL. For INSERTs. For key columns. is_changed is always FALSE. because the row did not exist in the target database. This is the pre- image against which SharePlex compared the source and target columns as part of its synchronization check.230 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. SharePlex cannot locate the correct row. SharePlex passes a value of TRUE. as changed on the source system. All fields are passed by SharePlex to your routine. If a NULL value is inserted. If the column is not changed. However. current_value This tells your procedure the current value of the column in the target table.

SharePlex returns the current value for the key column as well as the changed columns. . SharePlex searches for the row using just the PRIMARY key. SharePlex does not return the current value for INSERTs. For UPDATE statements column_name is_changed old_value new_value current_value1 is_key C1 TRUE bind bind NULL | target value FALSE C2 FALSE bind NULL NULL | target value TRUE C3 TRUE bind bind NULL | target value TRUE 1 When an UPDATE fails. it is because SharePlex cannot locate the row using the PRIMARY key and the pre-images. If it cannot locate the row using just the PRIMARY key. CHAPTER 5 231 Preparing for SharePlex Replication For INSERT statements column_name is_changed old_value new_value current_value1 is_key C1 TRUE NULL bind NULL FALSE C2 TRUE NULL bind NULL TRUE C3 FALSE NULL NULL NULL TRUE | FALSE 1 When an INSERT fails. If the row was not located. If it finds it. then current_value is NULL. it is because a row with the same PRIMARY key already exists in the target database.

current_value is NULL. which tells SharePlex which procedures to use.SID file per active configuration. If this file does not exist.232 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8.sp_cr. it is because SharePlex could not locate the row using the PRIMARY key. For more information about the SharePlex demonstrations. SharePlex Oracle user for col_values in splex. see the SharePlex Installation and Demonstration Guide. For example. A blank conflict resolution file was installed with SharePlex in the data sub-directory in the SharePlex variable-data directory. 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. construct the conflict_resolution. Creating the conflict resolution file for generic conflict resolution After you create the conflict resolution procedure(s).col_def_tabtyp) “splex.0 Updated 8/19/13 For DELETE statements column_name is_changed old_value new_value current_value1 is_key C1 FALSE bind NULL NULL TRUE 1 When a DELETE fails. Therefore. or SharePlex will not invoke the con- flict resolution routines. Important! There can be only one conflict_resolution. It must be named conflict_resolution. Do not change the name of this file. you can create one in ASCII format in an ASCII text editor. The SID is case-sensitive and must match the case in those locations.SID file.row_typ.” Tip: If you ran the SharePlex conflict resolution demonstration. where SID is the ORACLE_SID of the target instance as listed in the oratab file or Windows Registry.SID. . Creating the generic conflict resolution procedure interface Your procedure must use the following interface. it cannot be orcl8 in the file’s name. Template 20: CREATE/REPLACE PROCEDURE parameter declarations Important! Substitute the (table_info in out splex.sp_cr. if the SID is ORCL8 in the oratab file or Registry.

emp_cr1 procedure is used for that table.emp_cr2 procedure for all tables meeting the search criteria. the order in which you list them in the conflict resolution file determines their priority (in descending order).%\_string I | U | D | IUD owner. If you list a table-specific procedure.sal_cr routine is used for the scott.emp_cr3 scott.sal_cr like:scott. CHAPTER 5 233 Preparing for SharePlex Replication Refer to the following template as you follow the steps to create the file entries. Or.emp_cr1 procedure is used before the scott. and end each one by pressing Enter. .procedure_name For each conflict resolution procedure.%\_corp\_emp IUD scott. the scott.emp_cr1 like:scott. pressing Enter at the end of each one.sal IUD scott. 2 Open the conflict_resolution. If you are using more than one procedure. The fol- lowing is an example conflict resolution file.SID file in either the vi text editor (UNIX) or WordPad (Windows). Type the owner and name.) but no spaces. SharePlex uses it before wildcard-specified procedures. scott. Template 21: Conflict resolution file for generic conflict resolution like:owner. Precede each comment line with a pound (#) symbol to indicate that it is non- functioning. 3 [OPTIONAL] You can enter comment lines to identify the file or convey other informa- tion.cust.sal table before the scott.SID entries 1 Change directories to the data sub-directory in the SharePlex variable-data directory.. To create the conflict_resolution. create one line in the conflict resolution file. You can specify an individual target table for a routine. For scott. The scott. and so forth.sal_cr In the example.cust U scott. 4 Specify the target table(s).%\_corp\_emp IUD scott. Use a separate line to list each procedure. separating them with a dot (. a procedure is called for UPDATEs before the other routines are used for all operations..emp_cr2 like:scott% IUD scott.

a U. scott.. like:scott. For table names containing an underscore character (for example emp_sal).. as shown in Template 21 and in the following examples.%\_corp\_emp U scott.0 Updated 8/19/13 You can use the LIKE operator and a SQL wildcard (%) to specify multiple tables using a search string. 9 When you are finished creating the conflict resolution file. Example: scott..emp U scott. save and close it using the :wq command in vi or Save on the File menu in WordPad. If the procedure is written for all types of SQL statements. like:scott.234 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. 7 Specify the Procedure. Type the owner and name of the conflict resolution proce- dure.emp_cr_u 8 Start a new line and repeat steps 4 through 7 for each additional conflict resolution procedure..%\_corp\_emp IUD scott. Examples: like:scott. 5 Specify the Operation Type(s).emp_tr Or.emp Note: If you are not using the LIKE operator. . If the procedure is operation-specific.%\_corp\_emp scott. or a D. Do not press Enter after this entry. SharePlex recognizes the backslash (\) as an escape character to denote the underscore as a literal and not a wildcard. Do not press Enter after this entry. separating them with a dot (. type either an I. You can use an underscore (_) to denote a single-character wildcard.Type at least a space or tab to create a second col- umn.emp_cr Or.) but no spaces. 6 Type at least a space or tab to create a third column. type the string IUD.emp_cr The completed line should look like one of the following examples. you need not specify the backslash escape character when using table names containing underscores.

but with the understanding that it does not include logic that assigns priority. Do not list an owner name with this routine in the configuration file.table1 u owner.procedure_up_B owner.table1 during an UPDATE. These options can be used with basic and generic conflict resolution formats. If appropriate.table1 u !UpdateUsingKeyOnly The !UpdateUsingKeyOnly name is case sensitive. stop and re- start the Post process so that it updates the resolution cache. relying on !UpdateUsingKeyOnly as a final option if the custom routines fail. this routine can be used as the sole routine for UPDATEs. or instead of. It provides conflict resolution that relies solely on the key value of the changed row. Normally. thus assigning it last priority. custom logic must be used. Using prepared procedures for conflict resolution SharePlex provides the following optional prepared routines for use in conjunction with. !UpdateUsing- KeyOnly must be the last entry in the series of routines. custom routines. CHAPTER 5 235 Preparing for SharePlex Replication Changing the conflict resolution file You can change the conflict resolution file any time during replication to add and remove tables and procedures. There are no limitations on column types with the following pre- pared procedures. Quest recommends using !UpdateUsingKeyOnly in conjunction with specific custom routines. !UpdateUsingKeyOnly prepared routine SharePlex provides this prepared conflict resolution routine for UPDATE operations. To avoid out-of-sync errors.procedure_up_A owner. the WHERE clause uses both the key and the pre-image of the columns that changed to ensure synchroniza- tion. In the following example. assuming the keys match. SharePlex calls the two custom routines first (in order of priority) and then calls the !UpdateUsingKeyOnly routine. Example conflict resolution file using !UpdateUsingKeyOnly owner. when SharePlex builds a SQL statement to post data. with no spaces between words. After you change the conflict resolution file. For INSERT and DELETE operations. when there is a conflict for owner. It must be typed exactly as shown in these instructions. in case of multiple UPDATEs.table1 u owner. The !UpdateUsingKeyOnly routine directs SharePlex to post the data even though the pre-image values do not match. . such as system or time priority.

This is true regardless of the order in which the !DEFAULT-associated routine appears in the file. or instead of. . pre- pared routines.procedure_ins james.table1 i james. when SharePlex builds a SQL statement to post data. use the !DEFAULT parameter. The !DEFAULT parameter is case-sensitive.0 Updated 8/19/13 !MostRecentRecord(column_name) prepared routine SharePlex provides this prepared conflict resolution routine for UPDATE and DELETE operations.procedure_up_A owner.procedure_del In the example. Example conflict resolution file using !DEFAULT !DEFAULT u !ControlExtendedCharSet !DEFAULT d !ControlExtendedCharSet james. It provides conflict resolution based on the value of the "column_name" specified.236 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. Example conflict resolution file using !MostRecentRecord owner. It must be typed in all capital letters. This routine can be used in a time based replication to resolve conflicts.table1 u james. the !ControlExtendedCharSet proce- dure is used for UPDATEs and DELETEs for all tables. it will apply the changes.table1 u !MostRecentRecord(C2) C2 is the column_name which is a TIMESTAMP datatype !DEFAULT parameter for prepared routines To use the prepared routines or to use the prepared routines in combination with user defined routines for all tables in the replication configuration.table1 d james. The !MostRecentRecord routine directs SharePlex to post data even though the pre-image value doesn't match.table1 u owner.table1 u !UpdateUsingKeyOnly owner. For tables where there is a custom routine in addition to. If the value of the "column_name" sent over is greater than the target "column_name" value. including james. the custom routine takes priority over a prepared routine. It will make the change to the current row based on the comparison of the "column_name" specified. which uses conflict resolution.table1. the WHERE clause uses both the key and the pre-image of the columns that changed to ensure syn- chronization. Normally.procedure_upd !DEFAULT u !UpdateUsingKeyOnly james. A prepared routine is used only if the custom routine fails.

6 SharePlex Optional Setup This chapter guides you through additional implementation options for improving repli- cation performance and customizing SharePlex. This chapter is divided into parts relating to the different aspects of replication that you can customize. Contents Enhancing Post performance Using transformation with SharePlex Setting environment parameters Using security with SharePlex Other optional features .

See Chapter 6 of the SharePlex Reference Manual for more information about Share- Plex parameters. To enable the use of INDEX hints by SharePlex. You can increase or decrease this value with the SP_OPO_HINTS_LIMIT parameter. Oracle some- times does not pick the most efficient index for SharePlex. If the file contains entries. Use hints only for tables that need them.238 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. SharePlex enables you to make use of Oracle’s INDEX hints to enforce the correct index on target objects. This slows down posting. Changing this parameter requires stopping and starting Post.SID file that resides on the target system. . it reads the hints file.SID file on each system where you install SharePlex. Post reads the data into memory and then checks each UPDATE and DELETE statement that it processes. It is not necessary to include all replicating tables in the hints file. see the SharePlex Reference Manual. If Post is doing full-table scans on tables where there are defined indices.0 Updated 8/19/13 Part 1: Enhancing Post performance This section addresses optional features that you can enable to optimize the perfor- mance of the Post process. The default maximum number of hints (tablename/indexname pairs) is 100. use the hints. The ora_setup process installs a blank hints. Oracle generally uses the correct index. For additional tuning and troubleshooting information. Post sends the hints to Oracle. the Post process slows down when multiple UPDATEs and DELETEs are performed. where SID is the ORACLE_SID of the target instance. Without the right index. When Post applies a SQL statement.SID file. Using INDEX hints for faster posting When SharePlex performs UPDATEs and DELETEs on a target table. Use the hints. use hints for those tables. and including all of the tables in the file causes Post to reference the file for each operation. If any of those operations involve tables listed in the hints file.

How- ever. SharePlex uses it as a hint for the table. change directories to the data sub-directory of the SharePlex variable-data directory. 9 When you are finished. separating the two names with a dot (. sp_ctrl(sysB)> stop post 2 On the target system. Underscores (_) are permissible. sp_ctrl(sysB)> start post Problem-solving for the hints file If the hints file contains an invalid index. SharePlex generates the following . separat- ing the two names with a dot (. 10 On the target system. so there is no error. 4 Precede any comments with the pound (#) symbol to render them nonfunctional.source_table_name 6 Type at least a few spaces or a tab. source_owner.). save and close the file using :wq command in vi or Save on the File menu in WordPad. Oracle ignores invalid hints.target_table_index 7 Start a new line by pressing Enter.). Do not press Enter. 5 On a non-comment line. CHAPTER 6 239 SharePlex Optional Setup Configuring the hints file To configure the hints file. enter the owner and name of the first target table. stop the Post process. target_owner. you follow a process similar to creating a configuration. Leave no spaces between characters. Leave no spaces between characters. 3 Open the hints. start the Post process. 8 Repeat steps 5 through 7 for each target table. Underscores (_) are permissible. then enter the owner and name of the index to be used for the table.SID file in vi (UNIX) or WordPad (Windows). 1 On the target system.

0 Updated 8/19/13 errors in the event_Log when it encounters abnormal conditions relating to the use of hints. Substitute the full path name of the SharePlex variable-data directory for variable_data_dir. A set- . Enabling and configuring SQL Cache The SQL Cache feature is controlled by the following SharePlex parameters: SP_OPO_SQL_CACHE_DISABLE: This parameter enables or disables the SQL Cache feature. By default. Use the “hints. SQL Cache is enabled.SID” naming format. SQL Cache improves Post’s perfor- mance only if the same SQL statements are issued over and over again. You can tune this feature to maximize its advantages based on the amount of repetitive statements your application generates.240 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. and this parameter is set to 0. If a hints file does not exist. then SQL Cache adds unnecessary overhead to the Post process. If that is not true of your environment.SID command to cre- ate the file. you can issue a touch /variable_data_dir/data/hints. create one in the data sub-directory of the variable-data directory on the target system. whether or not it is populated. and you should disable it. When to use SQL Cache SharePlex is installed with SQL Cache enabled. so that SharePlex does not have to parse and bind them again when they recur. with no variation except the data values. and substitute the ORACLE_SID of the target instance for SID. Caching SQL statements for faster posting The SQL cache feature of SharePlex caches frequently-used parsed and binded SQL statements for reuse. On UNIX systems. 15050 – hint file not found 17000 – error opening hint file 15051 – missing column in the hint file (either table or index name) 15052 – syntax error for tablename 15053 – syntax error for indexname 15054 – source table’s object_id not found in object cache 15055 – more than 20 valid entries were entered into the hints file Important! SharePlex expects to find a hints file in the data sub-directory.

This parameter needs to be set high enough so that it cannot adversely affect Post’s performance. the Post process queries the OPEN_CURSORS value when it starts. query the database using the following SQL statement: SQL> select value from v$parameter where name = 'open_cursors'. Check 'OPEN_CURSORS' setting. If the value is not high enough.oracle-o. . estimate the peak number of concurrent transactions (sessions) that will be expected for the target instance. To avoid running out of cursors. Important! Read all of the following documentation before tuning SP_OPO_MAX_CDA. SP_OPO_MAX_CDA: This parameter determines the number of cursors to cache per session. CHAPTER 6 241 SharePlex Optional Setup ting of 1 disables SQL caching. The OPEN_CURSORS value can be modified or added if absent. Post opens 50 cursors per session by default. It is suggested that users consult the appropriate Oracle documentation prior to making changes to Oracle parameters. 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. When you disable SQL caching. Post writes the following warning to the event_log: Warning: (sp_opst_mt for o. You can increase or decrease this setting if needed. To view the OPEN_CURSORS value. Guidelines for setting OPEN_CURSORS To estimate a value for OPEN_CURSORS. Post opens a session on the target system for each one on the source system. SharePlex prints the following entry in the event_log: SQL Cache disabled.oracle queue oracle)Oracle parameter 'OPEN_CURSORS' is < number. The Number of Open Transactions field in the display shows the number of concurrent transactions (see Figure 21 on page 243). This is true whether or not SQL cach- ing is enabled. About open cursors The Oracle parameter OPEN_CURSORS defines the total maximum number of cursors that a process (such as Post) can open. To maintain the cache.

The formula is: 10 + (peak number of concurrent transactions x 7) = minimum open cursors needed How Post tracks open cursors Internally. If Post detects that it will exceed the maximum number of cursors. For the following example.oracle-o. OPEN_CURSORS is set to 512. it closes the least-recently used cursor in the least-recently used session. The for- mula is: 10 + (peak number of concurrent transactions x 2) = minimum open cursors needed With SQL Cache enabled With SQL Cache enabled.0 Updated 8/19/13 After you estimate the concurrent transactions to be expected.oracle queue oracle) Post will not open more than 502 cursors (OPEN_CURSORS – 10). Post establishes its maximum total number of open cursors from the value of OPEN_CURSORS. You view this value in the event_log. Post needs to reserve 10 cursors for routine calls that are closed once they finish. Notice: sp_opst_mt (for o. use the following formu- las to determine the correct setting for OPEN_CURSORS in the SharePlex replication environment. the Post process needs to reserve 10 cursors for routine calls that are closed once they finish. minus the 10 required for routine calls. plus a minimum of 2 cursors per transaction.242 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. With SQL Cache disabled With SQL Cache disabled. Post maintains a record of the number of cursors it has open. plus a minimum of 7 cursors per transaction (the base mini- mum of 2 plus an additional 5). .

This indicates that Post is using cached statements 36 percent of the time. If the hit ratio is under 50 percent. increase * A message typically is a SQL operation or an internal SharePlex operation. For more information about messages. see page 34. determine the hit ratio for cached statements by running sp_ctrl and issuing the show post detail command. CHAPTER 6 243 SharePlex Optional Setup Tuning SQL Cache To take full advantage of SQL Cache. update and delete operations. View the hit ratio after several days of typical replication activity to gauge the ideal set- ting for SP_OPO_MAX_CDA. the hit ratio is 36%. The SQL cache hit count field in the show post detail display shows the ratio of the total number of messages* that are executed without parsing and binding divided by the total number of insert. sp_ctrl> show post detail SQL Cache performance information FIGURE 21: SQL Cache hits are displayed in the Post statistics using the show post detail com- mand. . In the above example.

can trans- late into thousands or millions of individual UPDATE or DELETE statements for SharePlex. monitor the hit ratio over the next few days. The script will also have to be run on the target to bring the database back into sync. You can avoid this issue with the following implementation pro- cedure. Such transactions can cause posting to slow down significantly. but do so only in a small increment of about 5 cursors. create a table with the following description. For more information about the script and procedure. Making large transactions faster A single large SQL statement. the affected operations are not replicated.244 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. all needing to be applied by Post to the target database. 3 Edit your patch script to call SHAREPLEX_IGNORE_TRANS before update or delete. This script creates the SHAREPLEX_IGNORE_TRANS public procedure in the database. 2 On the source system. run the create_ignore. Grant SharePlex full DBA privileges to the table. Name it dml_statement. When executed at the start of the transaction. which increases the latency between the source and target data. see page 424. This allows SharePlex to ignore the transaction and not send it to the target. it means your applications are using all of the available cursors. the procedure directs the Capture process to ignore the DML operations that occur until the transaction is committed or rolled back. Thus. such as those applied by application patches. 1 In the source database. Continue increasing SP_OPO_MAX_CDA in small increments until the hit ratio remains constant.sql script from the util sub-directory in the SharePlex product directory.0 Updated 8/19/13 SP_OPO_MAX_CDA. Then. . which uses SharePlex optional features to bypass the Post process and apply the statement directly through Oracle. If the hit ratio increases.

• Create entries for those routines in the transformation. posting. • Create configuration entries for the source and target tables to be transformed. post to an alternate location. Considerations for using transformation Because transformation changes data and because SharePlex does not post the data. . Implementing transformation involves the following steps. if a source table and its target table are dissimilar in construction — like when a person’s 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. You can use them instead of database triggers to reduce I/O overhead. Configure them as you would any other table. When writing your routine. CHAPTER 6 245 SharePlex Optional Setup Part 2: Using transformation with SharePlex Transformation directs the Post process to call a PL/SQL procedure (defined as a trans- formation routine) instead of applying a SQL operation to the target database. units of measurement. For example. or character sets. is your responsi- bility to include in your procedure the necessary SQL operations for posting. Transfor- mation enables replicated data to be manipulated before. enabling you to control both the form and destination of the data with the procedure. Instead. see “SharePlex configuration construction” on page 132. There are no special configuration procedures for tables that use transformation. You can post to the target table. • Create transformation routine(s) using the instructions on page 249. Post takes no action on the replicated data. transformation changes the behavior of replication.SID file using the instructions on page 255. it passes data values to your transformation routine. When you specify transformation for a table. or both. Review the following consider- ations before implementing transformation. and for many other business requirements. or instead of. For more information about creating a configura- tion.

For peer-to-peer replication SharePlex must be able to detect and resolve conflicts when there are concurrent changes to the same record.emp_tr_delete . SharePlex allows this through the use of wildcards to specify the tables. Or.. When data is trans- formed. you can use one transformation routine for each SQL operation.. • You can create a procedure for each operation type.emp scott. UPDATE and DELETE operations.246 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. This provides the following choices: • You can create one procedure for all three operation types. This makes it practi- cal for reporting. Examples: TABLE PROCEDURE scott. SharePlex cannot compare before and after values to verify synchronization and detect conflicts. Transformation is not suitable for peer-to-peer or high-availability replication environ- ments..emp_tr_update scott.emp scott. And. Or.emp scott.emp_tr_insert scott. For more information about peer-to- peer replication. For each table. • You can use one procedure for all tables. data distribution. For more information about high-availability replication. High availability requires identical databases that are kept synchronized by repli- cation.. see “Establishing replication for high availability and data recovery” on page 190. • You can create different procedures for different tables. see “Establishing peer-to-peer replication” on page 211...0 Updated 8/19/13 Supported replication scenarios Transformation is a convenient way to use SharePlex to transfer data from one table to another without concern for maintaining identical structure or data. and data mart and warehousing applications. Supported operations Transformation supports only INSERT.

TABLE PROCEDURES All tables in the scott schema scott.tr_all scott. but scott. only scott.emp.tr_delete Or. Do not allow keys to be changed on the target system.emp scott.emp in the preceding example. such as for scott. or SharePlex will not be able to locate the row to pass values to your routine. and the table also is part of a group of tables for which another routine is specified. the scott. In the example.. .. For all other tables in the scott schema. TABLE PROCEDURE All tables in the scott schema scott.tr_insert is used for INSERTs on scott..tr_insert If a transformation routine is specified for an individual table. which enables it to return values to your transformation routine from the target table for UPDATE opera- tions.tr_update scott. SharePlex locates the target row for UPDATEs and DELETEs by using the key.tr_all Or.tr_insert scott. Privileges Any table that will be accessed through PL/SQL for transformation requires implicitly granted privileges from the owner of the object to SharePlex. only the table-specific routine is used for that table when the associated DML operation occurs... Keys A PRIMARY or UNIQUE key is required for all tables using transformation. CHAPTER 6 247 SharePlex Optional Setup Or.tr_all is used for UPDATEs and DELETEs to scott.emp..tr_all routine is used for all DML statements. TABLE PROCEDURE All tables in the scott schema scott.

Oracle has stated that the issue will not be fixed. • A known issue in PL/SQL prevents the SharePlex conflict resolution logic from call- ing a conflict resolution routine for tables whose names are the same as their owners. SharePlex uses the transformation routine. For those reasons. SharePlex cannot compare before and after values to verify synchronization. [repair] command with [key] option cannot be used to resynchronize data.0 Updated 8/19/13 Synchronization When data is transformed. Other considerations • Transformation does not support changes to LOB and LONG columns. combined with that of executing the procedure itself. It indicates whether or not there is a row on the target system with the same key as the source row. you can use generic conflict resolution and transformation for dif- ferent tables. degrades overall performance on the target system compared to normal replication and posting. because the target data was transformed. If transformation and conflict-resolution routines exist for the same table. see page 224.248 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. This method is not a complete confirmation of synchroniza- tion. Tables with default dates must use that format. use the following command to change the date format in SQL*Plus. SQL> ALTER SESSION SET nls_date_format = 'MMDDYYYYHH24MISS' Conflict resolution Transformation and conflict resolution cannot be used for the same table in a configura- tion. Dates The default date format for SharePlex transformation is MMDDYYYY HH24MISS. The only way to confirm synchronization is to use the compare com- mand with the [key] option. It does not (and cannot) indicate whether values in non-key columns are properly correlated to those in the source col- umns. • The processing overhead for passing data to your procedure. or transformation will return errors. Before creating a table with a default date.996 for . If appropriate. For more information about generic conflict resolution. so it only detects missing or extra rows. See Oracle TAR 2577886. You must devise your own resynchronization procedures based on your company’s business rules and the database environment.

Creating transformation routines Important! Test your transformation routines before you put them into production to make sure they work as intended. Transformation routines must be written with dynamic PL/SQL procedural language using parameters and record and table structures defined in a public package named sp_cr. and to make sure that one routine does not counteract another one. This package was installed during ora_setup in the SharePlex schema. This issue does not affect replication. SharePlex supports tables with identical owner and table names. . The package uses the following parameters. CHAPTER 6 249 SharePlex Optional Setup more information.

src_host This is the name of the source system (where the data was changed). this variable consists of the name of the post queue.reporting number direct its action.source_rowid varchar2(20) . Explanation of IN variables passed by SharePlex to your procedure For each change to a row that SharePlex replicates.src_ora_sid varchar2(32) passed to your procedure.column_name%type datatype that is . It is case-sensitive and is passed using the same case as on the source system.status number your procedure and . ).datatype%type used to popu- .current_value varchar2(32764) needed for your ).statement_type varchar2(6) . for example SysA. If there are named post queues in use on the target system.action number returned to SharePlex to .0 Updated 8/19/13 create package sp_cr as type row_typ is record (src_host varchar2(32) These are the IN variables .target_rowid varchar2(20) .target_table varchar2(78) These are the OUT vari- .old_value varchar2(32764) table capturing . .is_key boolean late the . type col_def_typ is record This is the (column_name user_tab_columns.datatype user_tab_columns. procedure. SharePlex passes this identifying information to your transformation routine.is_changed boolean col_def_tabtyp . . type col_def_tabtyp is table of col_def_typ index by binary_integer.250 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. for example postq1.new_value varchar2(32764) the information .oracle_err number ables that must be set in .

statement_type This is a letter. This variable is only used for conflict resolution. for example ‘123456’." oracle_err SharePlex passes a value of 0 for this variable. U or D. the value is NULL. source_rowid This is the row ID of the source row (the one whose data was replicated). It is passed as a literal within single quotes.table. expressed as owner. target_rowid This is the row ID of the corresponding row in the target data- base. either I. It is case-sen- sitive and is passed in the same case as in the oratab file. CHAPTER 6 251 SharePlex Optional Setup src_ora_sid This is the ORACLE_SID of the source database. target_table This is the owner and name of the target table. If the row cannot be found using the PRIMARY key. . UPDATE or DELETE statement. indicating whether the operation was an INSERT. SharePlex obtains the row ID by querying the data- base. It is passed as a literal within single quotes. for example ‘123456’. This value is case-sensitive and matches the way the table is named in the database."emp. for example "scott". Win- dows Registry or V$PARAMETER table. It is passed within double quotes.

status The status variable defines whether or not the transformation routine succeeded. Do not use them. You must specify a value for this parameter. It continues its processing by reading the next replicated operation in the post queue. action The action variable defines the action that SharePlex takes.252 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8.sql log.0 Updated 8/19/13 Explanation of OUT variables passed by your procedure to SharePlex These variables direct the action of SharePlex based on the outcome of the procedure (whether it succeeded or failed). . You must specify a value for this parame- ter. You must specify a value of 0 for this parameter. • A value of 1 implies unsuccessful execution. • A value of 3 directs SharePlex to write the failed SQL state- ment to the SID_errlog. • A value of 0 directs SharePlex NOT to report an error or write the failed SQL statement to the SID_errlog. • A value of 0 implies successful execution. • Values 1 and 2 are reserved for internal SharePlex use. Your transformation routine is responsible for posting the results of the transformation either to the target table or another table. SharePlex does not write any error messages to the Event Log when transforma- tion succeeds. • A value of 7 implies unsuccessful execution and instructs the Post process to stop.sql log and report an error to the Event Log. The outcome of this action depends on what you specify for the reporting variable reporting The reporting variable determines how SharePlex reports unsuc- cessful transformation results. which directs SharePlex NOT to post the SQL statement.

SharePlex will pass a value for a changed key column. and there will be out-of-sync errors. new_value This tells your procedure the new value of the replicated column. This value is not case-sensitive. If it is a key column. . SharePlex passes a value of TRUE. However. because keys typ- ically do not change. CHAPTER 6 253 SharePlex Optional Setup Explanation of col_def_typ datatype For each replicated column of a row. but if that key value also was changed on the target system. for example emp_last_name. If it is changed. For UPDATEs. SharePlex passes a value of FALSE. datatype This tells your procedure the datatype of the data in the repli- cated column. is_changed is TRUE for non-key columns. is_changed is FALSE. This column is NULL for INSERTs. as changed on the source system. If it is not changed. is_changed is TRUE for non-NULL values. because Share- Plex replicates only the key values for a DELETE statement. old_value This tells your procedure the old value of the replicated column. SharePlex passes a value of FALSE. This value is always in capital letters. for example VARCHAR2. column_name This tells your procedure the name of the column that was repli- cated from the source table. is_key This tells your procedure whether or not the column is a key col- umn. before it was changed on the source system. is_changed normally is FALSE. SharePlex passes a value of TRUE. For DELETEs. because the row did not exist in the target database. For INSERTs. SharePlex provides the following information in the col_def_tabtyp table. If it is not a key column. is_changed This tells your procedure whether or not the column value has changed. because none of the columns existed in the database. SharePlex cannot locate the correct row. If a NULL value is inserted. For key columns. is_changed is always FALSE.

although not all will have values if SharePlex cannot locate the row. the value is NULL. If it finds it.0 Updated 8/19/13 current_value This tells your procedure the current value of the column in the target table.254 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. . SharePlex cannot locate a row using the PRIMARY key and the pre-images. because the pre-images are different due to transformation. The following tables illustrate the possible outcomes of each type of operation. If SharePlex cannot locate the target row. SharePlex returns the current value for the key col- umn as well as the changed columns. As an alternative. For INSERT statements column_name is_changed old_value new_value current_value is_key C1 TRUE NULL bind NULL FALSE C2 TRUE NULL bind NULL TRUE C3 FALSE NULL NULL NULL TRUE | FALSE For UPDATE statements column_name is_changed old_value new_value current_value* is_key C1 TRUE bind bind NULL | target value FALSE C2 FALSE bind NULL NULL | target value TRUE C3 TRUE bind bind NULL | target value TRUE * For an UPDATE. Possible entries in the col_def_tabtyp table SharePlex creates a col_def_tabtyp PL/SQL table for each replicated operation. All fields are passed by SharePlex to your routine. it searches for the row using just the PRIMARY key. If it cannot locate the row using just the PRIMARY key. then current_value is NULL.

” Creating entries for the transformation.row_typ. use the transformation. This file normally is installed in the data sub-directory of the SharePlex variable-data directory. Refer to the following template as you follow the steps to create the file. CHAPTER 6 255 SharePlex Optional Setup For DELETE statements column_name is_changed old_value new_value current_value is_key C1 FALSE bind NULL NULL TRUE Creating the transformation procedure interface Your procedure must use the following interface. it cannot be orcl8 in the transformation file’s name.SID file per active configuration.SID file like:owner. Post reads this file to determine if there is a transfor- mation routine that it must call. Template 23: transformation entry in transformation.SID file.%\_string I | U | D | IUD owner. It must be named transformation.SID. Before executing a SQL operation.procedure_name .sp_cr.sp_cr.col_def_tabtyp) “splex.SID file To direct SharePlex to call transformation routines instead of posting SQL operations. where SID is the ORACLE_SID of the target database. create one line in the transformation file. Important! There can be only one transformation. you can create one in ASCII format in an ASCII text editor. If this file does not exist. Template 22: CREATE/REPLACE PROCEDURE parameter declarations Important! Substitute the (table_info in out splex. SharePlex Oracle user for col_values in splex. or SharePlex will not invoke the transfor- mation routines. For each transformation routine. if the SID is ORCL8 in the oratab file or Registry. The SID is case-sensi- tive and must match the case shown in those locations. Do not change the name of this file. For example. where SID is the ORACLE_SID of the target instance as shown in the oratab file or Windows Registry.

sep- arating them with a dot (. as shown in Template 23 and in the following examples. 7 Specify the Procedure.emp Note: If you are not using the LIKE operator.%\_corp\_emp scott. If the procedure is operation-specific. and end each one by pressing Enter.Type at least a space or tab to create a second col- umn. Example: scott.. Type the owner and name.) but no spaces. If the procedure is written for all types of SQL statements. enter either an I. enter the string IUD.SID file in either the vi text editor (UNIX) or WordPad (Windows).. a U. or a D. 2 Open the transformation.). You can use an underscore (_) to denote a single-character wildcard. You can use the LIKE operator and a SQL wildcard (%) to specify multiple tables using a search string.emp_tr . Or. 3 [OPTIONAL] You can enter comment lines to identify the file or convey other informa- tion. 6 Type at least a space or tab to create a third column. You can specify an individual target table for a routine. separating them with a dot (. Do not press Enter. SharePlex recognizes the backslash (\) as an escape character to denote the underscore as a literal and not a wildcard. 4 Specify the target table(s).0 Updated 8/19/13 1 Change directories to the data sub-directory of the SharePlex variable-data directory. Precede each comment line with a pound (#) symbol to indicate that it is non- functioning. Examples: like:scott.256 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. 5 Specify the Operation Type(s). For table names containing an underscore character (for example emp_sal). Do not press Enter after this entry. Allow no space between any items. you need not specify the backslash escape character when using table names containing underscores. Type the owner and name of the transformation routine.

scott. Changing the transformation file You can change the transformation file any time during replication to add and remove tables and procedures.. stop and re-start the Post process so that it updates the resolution cache. save and close it using the :wq command in vi or Save on the File menu in WordPad..emp_tr_u Or.emp_tr_u 8 Start a new line and repeat steps 4 through 7 for each additional transformation rou- tine. like:scott. CHAPTER 6 257 SharePlex Optional Setup The completed line should look like one of the following examples...%\_corp\_emp U scott. like:scott. . When you change the transformation file.emp U scott.%\_corp\_emp IUD scott.emp_tr Or. 9 When you are finished creating the conflict resolution file.

.258 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. which requires multiple variable-data directories. For example. the proddir/data/ defaults. it is used when a replication configuration uses multiple instances of sp_cop. When there is only one instance of SharePlex installed in the normal manner on a machine. For more information about installing SharePlex on clustered systems. It also is used when Share- Plex is installed within a high-availability cluster. To set the SP_SYS_VARDIR environment variable ksh shell: export SP_SYS_VARDIR= /full pathname of variable-data directory csh shell: setenv SP_SYS_VARDIR /full pathname of variable-data directory For more information about the SharePlex marker file. queues. Setting the SP_SYS_VARDIR environment variable The SP_SYS_VARDIR environment variable points to the SharePlex variable-data directory so that sp_cop can locate the configuration data.yaml file points sp_cop to the variable-data directory. On Windows systems. the variable-data directory is set in the SharePlex entry in the Registry. see “The SharePlex directories” on page 37. Set SP_SYS_VARDIR when directed to do so by a documented SharePlex procedure. On UNIX systems. logs and other infor- mation. this variable does not have to be set.0 Updated 8/19/13 Part 3: Setting environment parameters This section addresses environment-related aspects of customizing SharePlex. see the SharePlex Installation and Demonstration Guide.

you will be instructed to stop access to the source objects and shut down sp_cop. sp_cop on one system cannot connect to the sp_cop on another system to send or receive messages. 1 [IF YOU ARE USING MULTIPLE VARIABLE-DATA DIRECTORIES ONLY] Export the SP_SYS_VARDIR environment variable to point to the correct variable-data directory for the port you are setting. alternative port num- bers are used. To set the port number when you have an active configuration. • When an alternative port is required. If the ports are different.x. SharePlex permits a maximum of 64 port numbers (SharePlex instances) on one system. review the following points: • If you are using Oracle version 9. do not change the port. you need to change the SharePlex port number because Oracle uses port 2100 for an XML daemon. For more information about running multiple instances of sp_cop. the same number must be used for the TCP and UDP ports. CHAPTER 6 259 SharePlex Optional Setup Setting an alternative port for sp_cop The default TCP and UDP port numbers for SharePlex are both set to 2100 at the time of installation. • If you are running multiple instances of sp_cop on a system. ksh shell: $ export SP_COP_TPORT=portnumber $ export SP_COP_UPORT=portnumber where portnumber is the new port number . To set the SharePlex port on UNIX systems To set the port number. Each instance has a unique variable-data directory and port number. Unless you need to use a port number other than 2100. such as a command or exchange between the Export and Import processes. and it must be used for the TCP and UDP ports for the associated instances of sp_cop on all other machines involved in replication. • On the Windows platform. The sp_cop pro- cess listens on each system on TCP and UDP ports for communications from Share- Plex processes on other systems in the network. 2 Export the following environment variables on the source and target systems. a SharePlex Administrator must set both the TCP and UDP port parameters in the paramdb file.2. see page 64. Before selecting a port number. See page 258 for instructions.

followed by the ORACLE_SID of the source instance — for example o. the new port number takes effect. set the following parameters on the source and target sys- tems: sp_ctrl> set param SP_COP_TPORT portnumber sp_ctrl> set param SP_COP_UPORT portnumber 5 Do one of two things: • If there is not an active configuration. Proceed with the rest of the steps. For datasource in the following syntax. sp_ctrl> qstatus . start sp_cop with the -uportnumber option.260 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. You are finished setting the port number./sp_cop -uportnumber & $ . shut down sp_cop on the source and target systems./sp_ctrl 4 At the sp_ctrl prompt. then start sp_cop and sp_ctrl on the source and target systems. then issue the flush command in sp_ctrl on the source system to clear the queues. $ cd /SharePlex_product_dir/bin $ . sp_ctrl(sysA)> flush datasource 6 [ACTIVE CONFIGURATIONS ONLY] Issue the qstatus command on the source system to verify that all of the messages reached the target system.. If you are using multiple variable-data directories. Continue to issue the command until the export queue is empty. The next time you start sp_cop.0 Updated 8/19/13 csh shell: $ setenv SP_COP_TPORT portnumber $ setenv SP_COP_UPORT portnumber where portnumber is the new port number 3 Change directories to the SharePlex product directory. where portnumber is the port number you are setting. • If there is an active configuration. substitute o. stop access to the replicating objects on the source system.oraA. sp_ctrl> shutdown Or..

The new port takes effect. sp_ctrl> status 9 [ACTIVE CONFIGURATIONS ONLY] Shut down SharePlex on the source and target systems. sp_ctrl(sysB)> start post 12 [ACTIVE CONFIGURATIONS ONLY] Allow users to access the replicating objects. If it becomes necessary to change a port number. but there can be multiple port numbers if you installed SharePlex to create multiple services for certain replication configura- tions. consult your Systems Administrator for assistance. sp_ctrl> shutdown 10 [ACTIVE CONFIGURATIONS ONLY] Start sp_cop on the source and target systems. sp_ctrl> status To set the SharePlex port on Windows systems The default port number for SharePlex is 2100./sp_cop & 11 [ACTIVE CONFIGURATIONS ONLY] Start the Post process on the target system. this is the SharePlex entry location: \HKEY_LOCAL_MACHINE\Software\Wow6432node\Quest Soft- ware\SharePlex. CHAPTER 6 261 SharePlex Optional Setup 7 [ACTIVE CONFIGURATIONS ONLY] Issue the qstatus command on the target system to verify that all of the messages were posted to the database. sp_ctrl> qstatus 8 [ACTIVE CONFIGURATIONS ONLY] Issue the status command on the target system to verify that Post stopped. Errors when changing Registry settings can adversely affect the operation of the software or the system itself. If you are not familiar with the Registry. Continue to issue the command until the post queue is empty. $ cd /SharePlex_product_dir/bin $ . such as consolidated replication. SharePlex port numbers are stored in the Win- dows Registry. Warning! Do not add. 13 [ACTIVE CONFIGURATIONS ONLY] Verify that all SharePlex processes on the source and tar- get systems are running. change or remove Registry entries unless you are familiar with the functionality of the Registry and the Windows platform. .

2 Double-click the SpUtils desktop shortcut. 4 In the Port list box. click Stop. 3 Click the SharePlex Services tab. .262 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. Your user name must be assigned to the SharePlex Admin group. The SharePlex Utilities dialog box opens.0 Updated 8/19/13 To change the port number 1 Log onto Windows as a SharePlex Administrator using your system password and user name. select the port number for the instance of SharePlex whose port you want to change. 6 Click Close to close the SharePlex Utilities dialog box. 5 Under SharePlex Service Status.

10 Replace the highlighted port number with the new number. under \HKEY_LOCAL_MACHINE\Soft- ware\Wow6432node\Quest Software\SharePlex. then select Rename. 12 Under Name in the pane on the right. right-click the SP_SYS_VARDIR entry that is associated with the new port number. Click the Registry folder for the new port number to highlight it. select Run. CHAPTER 6 263 SharePlex Optional Setup 7 From the Start menu. right click the port’s folder name. and it must be changed to reflect the new number. 9 In the Registry Editor. This highlights the port number. the Registry entry for the variable-data directory includes the port num- ber. type regedit to open the Registry Editor. 8 In the Run dialog box. then select Modify. . 11 By default.

15 Go to the SharePlex product directory and rename the variable-data directory to reflect the new port number. 16 Double-click the SpUtils desktop shortcut to open the SharePlex Utilities dialog box again.264 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8.0 Updated 8/19/13 13 In the Edit String dialog box. then click OK to return to the Registry Editor. change the port number in the path to the new port number. 14 Exit the Registry Editor. .

Setting a default port for sp_ctrl On Windows systems. You can connect to the other SharePlex instances by using the port command after sp_ctrl starts. This is useful when you have multi- ple instances of SharePlex on the same system. select the port number that you created. click Install to establish the SharePlex service under that port 19 After the Current State text box displays a message that the service is installed. . 20 Click Close to close the SharePlex Utilities dialog box. click Start to start the service. you can set a default port number for the sp_ctrl process so that it automatically connects to that port when it starts. sp_ctrl connects to the SharePlex instance with the lowest port number. If you do not set a default port number. 18 Under SharePlex Service Status. CHAPTER 6 265 SharePlex Optional Setup 17 In the Port list box.

• On a UNIX system. the command runs the default text editor. 5 In the Name column in the right pane. even if you intend to save the file in text format. If you must change the editor. Configuration activation will fail. click Run. 4 Click the SharePlex node. enter the port number to be used as the default. 6 In the Value Data text box. It is recommended that you use the default editors. the text editor is set to vi because it is a universal ASCII editor. then click OK. SharePlex reads configuration files in ASCII format only. type regedit. and sp_ctrl is configured to work with those editors. right click DefaultPort.0 Updated 8/19/13 To set a default port for sp_ctrl 1 From the Start menu. During installation on UNIX systems. On Win- dows systems. then click OK to run the Registry Editor pro- gram. 7 Exit the Registry Editor. Do not use a word processing program such as Microsoft Word. and files created through sp_ctrl in WordPad are saved in ASCII text format. use the following guidelines. drill down to the SharePlex entry of \HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432node\Quest Software\Share- Plex. . then select Modify to open the Edit String dialog box. you can use NotePad instead of WordPad because it is an ASCII editor.266 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. 2 In the Run dialog box. the new editor must be an ASCII text editor. Defining an alternative editor When you issue the create config or edit config command to create or change a Share- Plex configuration. • On a Windows system. 3 Under My Computer. the text editor is set to WordPad.

• To set the EDITOR variable permanently. Instructions for changing Registry entries are on page 282. enter the appropriate command in the shell startup script on each machine. enter the appropriate com- mand at the UNIX prompt before starting sp_ctrl. define it with the EDITOR variable in one of two ways: • To set the EDITOR variable each time you run sp_ctrl. CHAPTER 6 267 SharePlex Optional Setup To change the editor on UNIX systems To set a different ASCII text editor as the default for SharePlex on a UNIX system. . Syntax for the ksh shell export EDITOR=name of new text editor Syntax for the csh shell setenv EDITOR name of new text editor To change the editor on Windows systems To change the text editor for SharePlex on a Windows system. change it through the Registry.

268 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. but if it exists on a system. If an auth_hosts file exists but contains no entries. you create an ASCII text file named auth_hosts in the data sub-directory of the SharePlex variable-data directory and then populate it with the names of systems being granted connection permission. Requirements for using the auth_hosts file • The file must be named auth_hosts and saved in the data sub-directory of the SharePlex variable-data directory for SharePlex to use it.0 Updated 8/19/13 Part 4: Using security with SharePlex This section includes ways to employ security measures with SharePlex. To implement host authorization. or WordPad (Win- dows) to open a blank file. NotePad (Windows). Enhancing security with host authorization SharePlex provides host authorization security that verifies whether or not SharePlex processes on other systems are authorized to connect to the local system for service and command requests. or host authorization will not function. 2 [UNIX ONLY] Press the i key to enter text-input mode in vi. . • The auth_hosts file is optional. change directories to the data sub-directory of the SharePlex variable-data directory before you run the editor. SharePlex accepts all requests from all systems that attempt to connect to sp_cop. To implement host authorization 1 Run an ASCII text editor such as vi (UNIX). it must contain valid entries. • The name of the local system must be listed in this file. Do not save it in the data sub-directory of the SharePlex product directory. SharePlex sends an error message similar to the following example to the Event Log: unauthorized connection attempt • If an auth_hosts file does not exist on a system. If you are using a UNIX text editor. or if it contains invalid entries.

then skip to step 9.com 9 When you are finished editing the file. End each line by pressing Enter.xyzcompany. enter the full machine name of the local system. all Or. CHAPTER 6 269 SharePlex Optional Setup 3 [OPTIONAL] Any number of lines can contain comments. LocalSys. 6 Do one of two things: To grant connection authorization on the local machine to all systems requesting it. End commented lines by pressing Enter.xyzcompany. Example of completed file: LocalSys. type the full host name of the first system to be granted connection.com system1. 8 For each additional system for which you are granting permission. . To grant connection permission on the local system to specific systems.com 5 Press Enter to start a new line. To save in a Windows text editor 1 Click the File menu.com system2. To save in vi 1 Press Esc to exit text-input mode. Precede a comment line with a pound symbol (#) to render it non-functional. save it in one of the following two ways. start a new line in the file and type its full name. 4 On the first non-commented line.com 7 Press Enter to start a new line. then press Enter.xyzcompany. 3 Type :q!.xyzcompany. 2 Type :w auth_hosts... then press Enter to return to the command-line. type the word all. then click Save. system1.xyzcompany.

set the following parameter as follows. 3 Click Save. Configuring SharePlex and SSH SharePlex can be configured to work with SSH (Secure Shell) software between a source system and one target system. Port forwarding allows you to establish a secure SSH session and then tunnel TCP con- nections through it. type the full path name of the data sub-directory of the SharePlex variable-data directory. Client-server applications using the tunnel provide their own authentication procedures the same way they would without the encrypted tunnel. . Note: SSH is not included with Shareplex and must be purchased separately. To use SharePlex with SSH. The following illustration shows how data from the source machine is replicated and sent via the encrypted tunnel to the target machine. Using SSH with SharePlex requires the use of local port forwarding (also known as tunneling) within the SSH configuration.0 Updated 8/19/13 2 In the Save in field. Data encryption and SharePlex SharePlex uses the SSH® Secure ShellTM utility to provide encryption for network ser- vices such as secure remote login and other services over an insecure network. or use standard Windows methods to navigate to that directory.270 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8.

If you do not use the -f option. Please refer to your SSH user documentation for syntax and exam- ples. which overrides the default SharePlex port. 4 In sp_ctrl. CHAPTER 6 271 SharePlex Optional Setup • SP_XPT_USE_LOCALHOST—The SharePlex Export process reads this parameter before making a TCP connection. To configure SharePlex to work with SSH port forwarding 1 On the source and target systems. instead of connecting directly to a target system. It can be the same port on both systems. • If there is only one target system. according to the following instructions. choose an available local port to be used as the tunnel port. 2 On the source and target systems. set the parameter on a global basis with the fol- lowing syntax. choose a different local port for each target sys- tem to which the source system will connect using SSH. simply specify more -L options in the SSH command. (SSH can not be started with the nohup option. which forces the SSH shell to run in the back- ground. $ ssh -L source_port:target_machine:target_port myuserid@target_machine -N -f Note: SSH must be run with the -f option. start sp_cop* and sp_ctrl. choose the same port for both systems.) You will be prompted for the password corresponding to myuserid@target_machine. 3 On the source system. If you need to connect to multiple machines. issue the SSH commands with the -L option to build the tunnel using the ports that you designated. sp_ctrl(sysA)> set param SP_XPT_USE_LOCALHOST 1 Or. . the terminal window from which SSH was launched must be kept open. • SP_XPT_PORT_OVERRIDE — This parameter sets the tunnel port number. start the SharePlex service from the Sp_Utils utility. One of those ports can be the same port as the one SharePlex uses on the source system. the Export process connects to the local host through a tunnel port number. • For uni-directional replication.. * On UNIX systems. • For peer-to-peer replication. run sp_cop from the bin sub-directory of the product directory. On Windows systems.. set the following parameter on the source system. If the parameter is enabled.

. Replication to the other target systems will connect directly in the normal fashion. sp_ctrl> shutdown $ /productdir/bin/sp_cop & Or. In that case. sp_ctrl(sysA)> set param SP_XPT_USE_LOCALHOST to hostname 1 5 Verify the parameter changeby issuing the list param modified command. • [IF A CONFIGURATION IS ACTIVE] Shut down and then restart sp_cop on the source system so that the parameter changes take effect.0 Updated 8/19/13 • If you have multiple replication routes. depending on whether or not there is an active configura- tion..272 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. • [TO ACTIVATE A CONFIGURATION] Activate the replication configuration. sp_ctrl(sysA)> list param modified 6 Do one of the following. you can use SSH only for one of them. sp_ctrl(sysA)> activate config filename . use a process-specific option to direct SharePlex to connect to the local host for the route using SSH.

operation type and the changed column values.table <target host>@c. SharePlex records the user id. To set up the change tracking functionality: • "Define the table(s) in the configuration file. making use of this functionality feasible. there is a need to keep track of changes made to a set of tables in the database." in the SID specification. transaction id. SharePlex records the after image of the columns changed. except for constraints (Post will fail if there is a NOT NULL constraint on any of the columns). etc: optdir/util/add_change_tracking_columns. key values. For update operations.sql The add_change_tracking_columns script will add the following columns to the target table: SHAREPLEX_SOURCE_TIME TIMESTAMP SHAREPLEX_SOURCE_USERID NUMBER SHAREPLEX_SOURCE_OPERATION VARCHAR2(20) SHAREPLEX_SOURCE_SCN NUMBER SHAREPLEX_SOURCE_ROWID ROWID SHAREPLEX_SOURCE_TRANS VARCHAR2(60) . CHAPTER 6 273 SharePlex Optional Setup Part 5: Turning on Change Tracking In some environments. For example. • Create the target table with the same name and the same structure as the source table. The cost of extracting changes from the source database using log mining is negligible. SCN. time. source row id. using the syntax for change tracking: owner." instead of "o. For every change to a row. timestamp. in certain circumstances it can be important to track every change made to a table to resolve customer disputes. Since the change data is stored in a different database. SharePlex now has the option to store the change data on a secondary server using log mining technology.<target sid> Note that a change tracker target is defined by prepending "!cdc:" to the target table name and by using "c.table !cdc:owner. • Run the following script to add columns to the target table for the userid. all change data inquires can be offloaded from the production database.

The SHAREPLEX_OPERATION_SEQ column will have an incrementing value for every operation with the same transaction id.updated INSERT X X UPDATE X X DELETE X If the parameter SP_OPO_TRACK_PREIMAGE is set. The actual table columns are divided logically into the key columns. For insert and update operations. The SHAREPLEX_SOURCE_OPERATION column will be updated with one of six possible values: INSERT UPDATE DELETE COMMIT TRUNCATE DROP COLUMN The SHAREPLEX_SOURCE_SCN column will have the source SCN at the time that the operation occurred. The SHAREPLEX_SOURCE_USERID column will have the user id from the source of the user that applied the change. When post inserts a row into the target table it may insert a value into one or more of the table columns as follows Operation Key Columns Non-key Columns .274 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. two rows will be inserted into the target table for every update. and the non-key columns. The SHAREPLEX_SOURCE_OPERATION column values for the two records will be: UPDATE BEFORE . The SHAREPLEX_SOURCE_TRANS column will have the transaction id with which the change is associated. The SHAREPLEX_SOURCE_ROWID column will have the rowid of the row changed. SharePlex replicates the key columns and the non-key columns that were changed by the original DML.0 Updated 8/19/13 SHAREPLEX_OPERATION_SEQ NUMBER The SHAREPLEX_SOURCE_TIME column will have the time that the operation was applied by Oracle on the source.

UK. "Alter table emp ADD SUPPLEMENTAL LOG DATA (ALL) COLUMNS. For example. perform the following on the source: 1 Turn on supplemental logging for all columns for each where this behavior is desired. updates or deletes. 2 Tell Shareplex to process these extra columns by turning on the SP_OCT_USE_SUPP_KEYS parameter: set param SP_OCT_USE_SUPP_KEYS 1 Note the following when using the change tracking feature: • The target table must not have PK. To track all columns of the row when an update occurs. not null. To configure post so that only the inserts and updates are tracked. the value stored for that column on the target will not be the complete LOB column . The COMMIT record will only be written to the target table if the parameter SP_OPO_TRACK_COMMITS parameter is set to 1. instead of just the changed columns.". CHAPTER 6 275 SharePlex Optional Setup UPDATE AFTER The SP_OPO_TRACK_OPERATIONS parameter can be used to disable tracking of inserts. The default value is "I/U/D". check. or default value constraints • Only ALTER TABLE ADD and ALTER TABLE MODIFY DDL will be applied to the target table • Changes made to UDT or VARRAY columns will not be recorded on the target • If a DBMS_LOB operation is used to change a part of the LOB column. change the parameter to "I/U". The parameter is set to 0 by default.

0 Updated 8/19/13 Part 6: Other optional features This section includes other features that allow you to customize SharePlex to your needs. You also can control the user account that is responsible for SharePlex startup through the Services Control Panel. click OK to complete the change and close the dialog box. or from man- ual to automatic by using the Services Control Panel in the Computer Management Administrative Tool (see page 277). Configuring SharePlex startup status on Windows systems You can change the startup status of SharePlex from automatic to manual. 3 In the Service dialog box. .276 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8.

CHAPTER 6 277 SharePlex Optional Setup To change SharePlex startup on Windows systems 1 From the Start menu. 3 Click the Services sub-node. . 2 In the Computer Management window. then scroll in the pane on the right to locate the Share- Plex service. then click Administrative Tools. then Com- puter Management. expand the Services and Applications node. select Programs.

then select Properties. From the SharePlex Properties dialog box.278 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. . Manual or Dis- abled. continue to the next step. you can specify a SharePlex Adminis- trator as the only user who can change startup status of SharePlex. instead of grant- ing anyone with System Account privileges that control. To change startup permission. select either Automatic. This opens a SharePlex Properties dialog box. To exit the SharePlex Properties dialog box without changing startup permission. click the General tab. 5 In the SharePlex Properties dialog box.0 Updated 8/19/13 4 Right-click the SharePlex service. 6 In the Startup Type drop-down list box. click OK.

click the Log On tab. 8 In the Log on as option box. . then click Browse to open the Select User dialog box. click This account. CHAPTER 6 279 SharePlex Optional Setup 7 In the Properties dialog box.

Instructions for running SpCli- ent are on page 454. These utilities enable you to limit the Task Manager view to the SharePlex processes. under Name. and instructions for using SpUtils are on page 451.0 Updated 8/19/13 9 In the Select User dialog box. 10 In the Password and Confirm fields. Setting SharePlex process priority on Windows systems To change process priority for SharePlex. double-click the SharePlex Administra- tor user. excluding all other processes running on the system. The Log On dialog box appears. . 11 Click OK to apply the change and exit the Properties dialog box. you must run the Windows Task Manager with special privileges because the MKS NuTCRACKER environment controls the SharePlex processes. enter and confirm the password for the Share- Plex Administrator account. Setting priority with a SharePlex utility The easiest and safest way to set process priority correctly is to set it from the Task Manager function within the SpUtils or SpClient utility. with the SharePlex Administrator displayed in the This account field. You can change SharePlex process priority in one of the following ways.280 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8.

CHAPTER 6 281 SharePlex Optional Setup Setting priority with a batch file You can set process priority by running a batch file named DTaskmgr using the follow- ing instructions. The Windows Task Manager opens with the special privileges. To change process priority with DTaskmgr 1 Log onto the system as the System Administrator account. 4 Right-click the SharePlex process that you want to prioritize. . then click Set Priority and select the desired priority level. and run it. 2 Navigate to DTaskmgr in the bin sub-directory of the SharePlex product directory. 3 Click the Processes tab to display all processes that are running.

Click either Yes to implement the change or No to cancel it. Changing SharePlex Registry entries on Windows systems SharePlex records and reads default directory locations and other environment informa- tion in the Windows Registry.282 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. The SharePlex Registry location is: \HKEY_LOCAL_MACHINE\Software\Wow6432node\Quest Software\SharePlex Each instance of SharePlex is recorded in the Registry as a port number.0 Updated 8/19/13 5 The system prompts for verification. make the change in the Registry with the regedit pro- . and each has its own set of environment variables. Whenever you must add. change or remove environ- ment variables for SharePlex. 6 Close the DTaskmgr dialog box.

Most of these are debugging parameters that you might be asked to set when you place a call to Quest Technical Support. EDITOR SP_DEBUG_OPC SP_SPIN_OPO HOST SP_DEBUG_OPP SP_SPIN_ORD LOGNAME SP_DEBUG_OPST SP_SPIN_XPT OL_DEBUG SP_DEBUG_OPST SP_SPOOL_OCT ORADUMP SP_DEBUG_OPST SP_SPOOL_OPO SIM_KERNEL SP_DEBUG_ORD SP_SPOOL_OPO SP_CNF_SKIP_ANALYZE SP_DEBUG_RMP SP_SPOOL_OPO SP_CONF_SPIN SP_DEBUG_ROM SP_SPOOL_ORD SP_COP_TPORT SP_DEBUG_SQL SP_STOP_GEN SP_DEBUG_BIO SP_DEBUG_SQL_LCACHE SP_STOP_OCAP SP_DEBUG_DDL SP_DEBUG_TRP SP_STOP_OPC SP_DEBUG_FIO SP_OBJECTID SP_STOP_OPP SP_DEBUG_GEN SP_OCAP_TEST_LOG1 SP_STOP_ROM SP_DEBUG_KCA SP_OPO_DISCARD_MSG SP_SYS_HOST_NAME SP_DEBUG_LCACHE SP_QUE_PAUSE SP_SYS_VARDIR SP_DEBUG_MSG SP_QUE_SIGBUS USERNAME SP_DEBUG_MSG SP_SPIN_CNC VERBOSE SP_DEBUG_OCAP SP_SPIN_IMP SP_DEBUG_OLOG SP_SPIN_OCT To add a Registry entry 1 Shut down the SharePlex service. using the following instructions. 3 In the Run dialog box. . Errors when changing Registry settings can adversely affect the operation of the software or the system itself. Any change to the environment requires restarting the SharePlex service to take effect. type regedit to run the Registry Editor. change or remove Registry entries unless you are familiar with the functionality of the Registry and the Windows platform. If you are not familiar with the Registry. The following are the environment variables that can be set for SharePlex in the Regis- try. 2 From the Start menu. Warning! Do not add. click Run. consult your Systems Administrator for assistance. CHAPTER 6 283 SharePlex Optional Setup gram.

5 In the Name column of the pane on the right. then select New>String Value. Replace this with the variable name.0 Updated 8/19/13 4 Under \HKEY_LOCAL_MACHINE\Software\Wow6432node\Quest Software\SharePlex in the Registry Editor. replace the highlighted new string with the SharePlex variable name.284 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. right click the SharePlex port number for the variable that you want to add. .

Its Registry entries are displayed in the pane on the right. type the variable’s character string. 7 In the Value data field of the Edit String dialog box. The Edit String dialog box appears. right-click the variable to be changed and select Modify. type regedit to run the Registry Editor. then close the Registry Editor. 4 Under \HKEY_LOCAL_MACHINE\Software\Wow6432node\Quest Software\SharePlex in the Registry Editor. 3 In the Run dialog box. . To change a Registry entry: 1 Shut down the SharePlex service. 9 Start the SharePlex service. 5 In the pane on the right. highlight the SharePlex port number for the variable that you want to change. then select Modify. CHAPTER 6 285 SharePlex Optional Setup 6 Right-click the new string. 2 From the Start menu. which now bears the variable’s name. 8 Click OK. click Run.

enter the new string.286 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. then close the Registry Editor. 8 Start the SharePlex service. .0 Updated 8/19/13 6 In the Value Data field of the Edit String dialog box. 7 Click OK.

Contents Synchronizing data for the first time Activating and deactivating configurations Changing Configurations . • Configured your database and system to implement your replication strategy. • Learned how to build a SharePlex configuration. This chapter assumes that you have: • Determined your replication strategy. 7 Starting SharePlex Replication The previous chapters provided you with the background to plan and establish your rep- lication environment. because it will help you choose an activation method. This chapter explains how to synchronize the source and target data and activate your configuration to begin SharePlex replication. The first part of this chapter contains procedures for synchronizing the data. The third part of the chapter explains how to make changes to configurations. Review the second part of the chapter before you synchronize the data. The second part reviews the configuration activation process.

review its description in the SharePlex Reference Manual and famil- iarize yourself with its syntax. but it does not perform initial synchronization. review “Activating and deactivating configurations” on page 308 to familiarize yourself with configuration activation options. you must synchronize the source and target data for that configuration. SharePlex maintains a synchronized environment through replication. Before you activate a configuration for the first time.288 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. This section explains how to synchronize your data with the following methods for copying data from a source system to a target system. . Before you exe- cute a command.0 Updated 8/19/13 Part 1: Synchronizing data for the first time Replication requires matching sets of data — source (original) data on the source sys- tem and target (copy) data on each target system. • Synchronizing data using an Oracle hot backup on an active database • Synchronizing data using an Oracle hot backup on a quiet database • Synchronizing data with export/import or store/restore from tape • Synchronizing data with FTP • Synchronizing data with transportable tablespaces The procedures in this chapter include certain SharePlex commands. In addition.

Warning! To establish consolidated replication. You need not populate the database. and then follow this procedure. a hot backup and the reconcile command. See “Establishing peer-to-peer replication” on page 211 for more information. Possible methods include export/import (see page 299). FTP (see page 302). the secondary system is referred to as the “target” system. You can use a hot backup of one of the source instances to establish the target instance. you cannot use a hot backup from all source systems. lets you perform initial synchronization to establish a target or secondary instance with- out quieting the source database.) . Only after this procedure has been performed on all of the secondary systems may users may resume activity on them. Do not use this procedure until you understand the implications of using peer-to-peer replication. have your configuration(s) ready to be acti- vated. and then use another method to copy the objects from the other instances. in conjunction with activation. (In this procedure. this procedure is necessary because the Registry entries are needed in order to perform the database recovery process. Important! Before beginning this procedure. you must quiet all of the secondary source sys- tems for the duration of this procedure. To establish peer-to-peer replication. such as a data warehouse. One backup would override the data from the previous one. the target system must have an instance already created containing an identical ORACLE_SID and directory structure created with the Oracle creation tools. and trans- portable tablespaces (see page 305). To use a hot backup between Windows systems. Move all users to the trusted source system. • High availability — replication from a primary system to one or more secondary sys- tems that are ready for failover. CHAPTER 7 289 Starting SharePlex Replication Synchronizing data using an Oracle hot backup on an active database SharePlex. Procedure for all replication strategies except cascading Use this procedure only for these replication scenarios: • Reporting and broadcast — replication from one source system directly to one or more target systems. Since Oracle runs as a service on Windows. since the hot backup will do this.

290 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. sp_ctrl(sysA)> show activate . issue the show activate command to view activation status. (There must be a valid SID in the oratab file or Windows Registry. and start sp_cop and sp_ctrl. but only run ora_setup on the source system. 4 On both systems.0 Updated 8/19/13 • Consolidated — replication of different data from two or more source systems to a central target system. stop the Post process.) See Chapter 11 for instructions on running ora_setup or use the instruc- tions in the SharePlex Installation and Demonstration Guide. use “Procedure for cascading replication” on page 292. sp_ctrl(sysA)> status sp_ctrl(sysB)> status 5 On the target system. activate the configuration on the source system. to a target system). 1 [UNIX 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 command retains control of sp_ctrl until activation is finished. from there. sp_ctrl(sysA)> activate config filename 8 On the source system. The SID must be the SID used in the routing map in the configuration you will be activating. verify that the SharePlex processes are started. 7 When the backup is finished. (In this procedure. 3 On the source and target systems.” For cascading replication (replicating to an intermediary system and. • Peer-to-peer — replication between two or more source systems. install SharePlex according to the instructions in the SharePlex Installation and Demonstration Guide. sp_ctrl(sysB)> stop post 6 On the source system. This allows replicated data to accumulate in the post queue until the database has been recovered and reconciled. the trusted source system is referred to as the “source” system. go to the bin sub-directory of the SharePlex prod- uct directory. 2 On the source and target systems. and the secondary system(s) is referred to as the “target system. run the Oracle hot backup. It cannot be run on the target system until that database has been recovered and opened.

make a note of the highest archive-log sequence number. 13 On the target system. A If recovering to a sequence number. issue the reconcile command. open the database with the RESETLOGS option. but do not create a new user. switch log files on the source system. and cancel the recovery after Oracle has applied the logs matching the SCN from step 9.” In this case. Issue the qstatus command if you are unsure of the queue name. B If recovering to a SCN. CHAPTER 7 291 Starting SharePlex Replication 9 When activation is complete. select one of the following options. recover the database from the hot backup using the UNTIL CANCEL option in the RECOVER clause. pick an SCN to recover to on the target database. Next. the syntax would be: sp_ctrl(sysB)> reconcile queue SysA for o. you need not shut down SharePlex when you run ora_setup. 12 On the target system. Choose the existing SharePlex user and password (copied in the backup) by choos- ing “n” when prompted “Would you like to create a new SharePlex user [y]. run ora_setup on the database. substitute the SCN that you noted in step 9. svrmgrl> alter system switch logfile. and cancel the recovery after Oracle has fully applied the log from step 9. 11 On the target system. recover the database from the hot backup using the UNTIL CHANGE <SCN> option in the RECOVER clause. substitute the sequence number of the log that you noted in step 9. 10 On the target system: A If recovering to a sequence number. sp_ctrl(sysB)> reconcile queue queuename for datasource-datadest seq sequence_number For example: if you are replicating from instance oraA on SysA to oraA on SysB.oraA seq 1234 B If recovering to a SCN.oraA-o. sp_ctrl(sysB)> reconcile queue queuename for datasource-datadest scn scn_number . A To recover the database to a sequence number. issue the command for each one. If you are using named post queues. B To recover the database to a Oracle System Change Number (SCN).

and scheduled jobs that perform DML. .292 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. and then the sp_ctrl prompt returns.sql utility script so that the triggers ignore the SharePlex user. stop Export. the syntax would be: sp_ctrl(sysB)> reconcile queue SysA for o. The two instances are now in synchroni- zation. sp_ctrl(sysB)> activate config filename 20 On the target system.0 Updated 8/19/13 For example: if you are replicating from instance oraA on SysA to oraA on SysB. check constraints. activate the configuration. delete the unneeded columns and rows from the target tables. disable cascading deletes. Procedure for cascading replication Use this procedure for cascading replication in which SharePlex posts to a database on an intermediary system and then replicates the posted data to a target system. start the Post process. 16 On the target system. or run the sp_add_trigger. disable triggers on the tables. and then to the target system (represented as “sysC”). 18 [HIGH AVAILABILITY ONLY] On the target (secondary) system. sp_ctrl(sysB)> start post 21 [OPTIONAL] If this was only a partial backup.sql script to truncate all of the SharePlex internal tables. drop the tablespaces that were not copied over during the hot backup. run the cleanup.oraA-o. Instructions for running this script are on page 435. 15 On the target system. 14 On the target system. and SharePlex will continue replicating to maintain synchronization.oraA scn 0123456789 The reconcile process retains control of sp_ctrl until it is finished. You will apply the backup to the intermediary system first (represented as “sysB”). sp_ctrl(sysB)> stop export 19 [HIGH AVAILABILITY AND PEER-TO-PEER ONLY] On the target (secondary) system. 17 [PARTITIONED REPLICATION ONLY] If you are using vertically partitioned or horizontally par- titioned replication for any tables.

switch log files on the source system and make a note of the highest archive-log sequence number. sp_ctrl(sysA)> show activate 9 After activation is complete. sp_ctrl(sysA)> status sp_ctrl(sysB)> status sp_ctrl(sysC)> status 5 On the intermediary and target systems. CHAPTER 7 293 Starting SharePlex Replication 1 [UNIX SYSTEMS] Verify that the ORACLE_SID and ORACLE_HOME in the oratab file are correct for the instances you will be establishing with the hot backup. run the Oracle hot backup. and cancel the recovery after . and start sp_cop and sp_ctrl. install SharePlex according to the instructions in the SharePlex Installation and Demonstration Guide. recover the database from the hot backup using the UNTIL CANCEL option in the RECOVER clause. 7 After the backup is finished. issue the show activate command to view activation status. activate the configuration on the source system. 10 On the intermediary system. 2 On all systems. The command retains control of sp_ctrl until activation is finished. go to the bin sub-directory of the SharePlex product directory. 3 On all systems. svrmgrl> alter system switch logfile. verify that the SharePlex processes are started. stop the Post process. The SID must be the SID used in the routing map in the configuration you will be activating. sp_ctrl(sysB)> stop post sp_ctrl(sysC)> stop post 6 On the source system. sp_ctrl(sysA)> activate config filename 8 On the source system. but only run ora_setup on the source system. (There must be a valid SID in the oratab file or Windows Registry. This allows replicated data to accumulate in the post queue until the databases have been recovered. It cannot be run on the other systems until their databases have been recovered and opened.) See Chapter 11 for instructions on running ora_setup or use the instructions in the SharePlex Installation and Demonstration Guide. 4 On all systems.

sql script to truncate all of the Share- Plex internal tables.294 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8.oraA-o. 16 On the intermediary system. disable triggers on the tables. check constraints.” In this case.0 Updated 8/19/13 Oracle has fully applied the log from step 9. disable cascading deletes. Instructions for running this script are on page 435. delete the unneeded columns and rows from those tables on the intermediary system. sp_ctrl(sysB)> reconcile queue queuename for datasource-datadest seq sequence_number For example: if you are reconciling from instance oraA on SysA to oraA on SysB. you need not shut down SharePlex when you run ora_setup. sp_ctrl(sysB)> set param SP_OCT_REPLICATE_POSTER 1 18 [PARTITIONED REPLICATION ONLY] If you are using vertically partitioned or horizontally par- titioned replication for any tables. the syntax would be: sp_ctrl(sysB)> reconcile queue SysA for o. or run the sp_add_trigger.oraA seq 1234 14 On the intermediary system. The reconcile process retains control of sp_ctrl until it is finished. 15 On the intermediary system. run the cleanup. issue the reconcile command. If you are using named post queues. run ora_setup on the database. 17 On the intermediary system. issue the command for each one. and sched- uled jobs that perform DML. set the SP_OCT_REPLICATE_POSTER parameter to 1. but do not create a new user. 11 On the intermediary system. 13 On the intermediary system. 12 On the intermediary system. Important! Do not start any Post processes yet! . This directs SharePlex to capture posted changes on that system and replicate them to the target system. and then the sp_ctrl prompt returns. Issue the qstatus command if you are unsure of the queue name. Choose the existing SharePlex user and password (copied in the backup) by choosing “n” when prompted “Would you like to create a new SharePlex user [y].sql utility script so that the triggers ignore the SharePlex user. open the database with the RESETLOGS option. Substitute the sequence number of the log that you noted in step 9.

Choose the existing SharePlex user and password (copied in the backup) by choos- ing “n” when prompted “Would you like to create a new SharePlex user [y]. All instances are now in synchronization. 24 On the target system. or run the sp_add_trigger. disable triggers on the tables. activate the configuration using default multi-threaded activation.sql utility script so that the triggers ignore the SharePlex user. sp_ctrl(sysB)> start post sp_ctrl(sysC)> start post 29 [OPTIONAL] If this was only a partial backup. run the cleanup. sp_ctrl(sysB)> activate config filename 27 On the intermediary system. Instructions for running this script are on page 435. drop the tablespaces that were not copied over during the hot backup. 22 On the target system. and cancel the recovery after Oracle has fully applied the log from step 9. and scheduled jobs that perform DML.” In this case. start the Post process on the intermediary and target systems. disable cascading deletes. CHAPTER 7 295 Starting SharePlex Replication 19 On the target system. open the database with the RESETLOGS option. delete the unneeded columns and rows from those tables on the target system. run ora_setup on the database. 21 On the target system. and SharePlex will continue replicating to maintain synchronization. 25 [PARTITIONED REPLICATION ONLY] If you are using vertically partitioned or horizontally par- titioned replication for any tables. but do not create a new user. sp_ctrl(sysB)> show activate 28 When activation of the intermediary configuration is complete.sql script to truncate all of the SharePlex internal tables. issue the show activate command to view activation status. you need not shut down SharePlex when you run ora_setup. 23 On the target system. . 26 On the intermediary system. The command retains control of sp_ctrl until activation is finished. recover the database from the hot backup using the UNTIL CANCEL option in the RECOVER clause. check constraints. 20 On the target system.

0 Updated 8/19/13 Synchronizing data using an Oracle hot backup on a quiet database You can use SharePlex and an Oracle hot backup on a quiet database to establish a target reporting instance. FTP (see page 302). Important! Before beginning this procedure. These instructions include references to an intermediary system. the target system must have an instance already created containing an identical ORACLE_SID and directory structure created with the Oracle creation tools. and then use another method to copy the objects from the other instances. 1 [UNIX SYSTEMS] Verify that the ORACLE_SID and ORACLE_HOME in the oratab file or Windows Registry are correct for the instance(s) you will be establishing with the hot backup. or to convert a hot standby database to a target reporting instance. install SharePlex and run ora_setup according to the instruc- tions in the SharePlex Installation and Demonstration Guide. You can use a hot backup of one of the source instances to establish the target instance. Warning! To establish consolidated replication. this procedure is necessary because the Registry entries are needed in order to perform the database recovery process. which is used in cas- cading replication where SharePlex posts to a database on one system and then repli- cates the posted data to another system. and trans- portable tablespaces (see page 305). One backup would override the data from the previous one. you cannot use a hot backup from all source systems. have your configuration(s) ready to be acti- vated. Possible methods include export/import (see page 299). The SID must be the SID used in the routing map in the configuration(s) you will be activating. To use a hot backup between Windows systems. Since Oracle runs as a service on Windows. such as a data warehouse. 2 On the source system. You need not populate the database. you can ignore all references to an intermediary system. since the hot backup will do this.296 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. If you are not using this replication strategy. . This procedure can be used for all replication configurations. It requires that users stop accessing the production database while the hot backup and configuration activation take place.

but do not create a new user. 7 On all systems. sp_ctrl(sysA)> activate config filename 11 On the source system. Do not cancel the recovery or allow a partial recovery. svrmgrl> alter system switch logfile. 13 List the archive logs on the intermediary and target systems. recover the database (or hot standby) to the log number that was recorded. 5 On the source system. and record the log number. sp_ctrl(sysB)> stop post 10 On the source system. 6 On the source system. issue the show activate command to view activation status. verify that sp_cop and sp_ctrl are started. install SharePlex. sp_ctrl(sysA)> status 9 On the intermediary and target systems. switch the redo logs. Delete any logs after the one whose number you recorded when you switched logs on the source system. sp_ctrl(sysA)> show activate 12 When the activation is finished. That log must be last. stop user access to the source database by shutting it down and opening it in restricted mode. activate the configuration using default multi-threaded activa- tion. 15 On the intermediary and target systems. 4 On the source system. The command retains control of sp_ctrl until activation is finished. 16 On the intermediary and target systems. complete the Oracle hot backup. because it is the log to which Oracle must recover. Choose the existing SharePlex user and password by selecting “n” . stop Post. open the database. but do not run ora_setup. run ora_setup on the instance. 8 On all systems. allow users to access the source database again. Stopping Post allows replicated data to accumulate in the post queue until the databases have been recovered. 14 On the intermediary and target systems. CHAPTER 7 297 Starting SharePlex Replication 3 On the intermediary and target systems. You will do this after the backup. start sp_cop and sp_ctrl from the bin sub-directory of the SharePlex product directory.

delete the unneeded columns and rows from those tables on the intermediary and target systems. disable triggers on the tables. drop the tablespaces that were not copied over during the hot backup. check constraints.sql script to truncate all of the SharePlex internal tables. sp_ctrl(sysB)> start post 24 [OPTIONAL] If this was only a partial backup. and SharePlex will continue replicating.298 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. sp_ctrl(sysB)> set param SP_OPO_REPLICATE_POSTER 1 22 On the intermediary and target systems. 21 [CASCADING REPLICATION ONLY] On the intermediary system. and scheduled jobs that perform DML. start the Post process on the intermediary and target systems. Tip: You need not create a new user because the existing user was copied with the backup. 18 On the intermediary and target systems. . The instances are now in synchronization. 19 On the intermediary and target systems. or run the sp_add_trigger. set the SP_OPO_REPLICATE_POSTER parameter to 1. disable cascading deletes.sql utility script so that the triggers ignore the SharePlex user. 20 [PARTITIONED REPLICATION ONLY] If you are using vertically partitioned or horizontally par- titioned replication for any tables. 17 On the intermediary and target systems. run the cleanup.0 Updated 8/19/13 when prompted “Would you like to create a new SharePlex user [y]. or use the instructions in the SharePlex Installation and Demonstration Guide.” See Chapter 11 for instructions on running ora_setup. activate the configuration. Instructions for running this script are on page 435. This directs SharePlex to capture posted changes on that system and replicate them to the target system. sp_ctrl(sysB)> activate config filename 23 After the activation of the configuration is complete.

CHAPTER 7 299 Starting SharePlex Replication Synchronizing data with export/import or store/restore from tape The procedures for synchronizing source and target data with import/export and store/ restore from tape are the same. first export the port and SP_SYS_VARDIR variables for the variable-data directory on this system. • For peer-to-peer replication. • For consolidated replication using separate instances of sp_cop. This allows the activation process to proceed while you are making the copy. or you can synchronize each source system one at a time using these instruc- tions. These instructions assume you already created the target instance. 3 Start sp_cop and sp_ctrl on the source system. . first export the port and SP_SYS_VARDIR variables for the variable-data directories. installed SharePlex on the source and target systems. activate the configuration on the trusted source system only. 4 Activate the configuration on the source system. stop access to all databases in the configuration. This procedure requires that users stop accessing the database while the copy and configuration activa- tion take place. you can stop access to all of the source systems at once and make the copies at the same time. including the “trusted source.” 2 Export or store the files from the source system (trusted source system in peer-to- peer replication). For consolidated replication using separate instances of sp_cop. • If you are replicating for centralized reporting (consolidated replication). sp_ctrl(sysA)> activate config filename 5 Start sp_cop and sp_ctrl on the target system(s) and the intermediary system. See page 310 for information about activating a configuration. and ran ora_setup on the source and target instances according to the instructions in the SharePlex Installation and Demonstration Guide. have your configuration(s) ready to be acti- vated. if using cascading replication. Important! Before beginning this procedure. For peer-to-peer replication. 1 Stop access to the objects to be replicated on the source system. Follow these steps in the order written.

• If this is a target system for consolidated replication running multiple instances of sp_cop. or the secondary sys- tem(s) for high availability and peer-to-peer replication.300 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. stop Post for each one. or run the sp_add_trigger. A For high availability replication: Run the sp_add_trigger. • For peer-to-peer replication. 8 Use the status command on the source system to make sure the SharePlex processes are running. if using cascading replication. and scheduled jobs that perform DML on the target tables (and the target tables on the intermediary system if using cascad- . start the sp_cop and sp_ctrl processes on the second- ary source systems — the ones to which you want to copy the trusted source sys- tem’s data.sql utility script (SharePlex product directory/util) so that triggers will ignore the SharePlex user. Stopping Post allows any data that gets replicated before the target data is established to collect in the post queue. all source systems in consolidated replica- tion).0 Updated 8/19/13 • For peer-to-peer replication.sql utility script (SharePlex product directory/util) on all tables to direct triggers to ignore the SharePlex Ora- cle user. B For peer-to-peer replication: Run the sp_add_trigger. 11 Disable check constraints. stop Post on all secondary source systems. C For all other replication scenarios: You can either disable triggers on the target tables and the target tables on the intermediary system if using cascading replica- tion. sp_ctrl(sysA)> status 9 Import or restore the data on the target system(s) and intermediary system if using cascading replication with an Oracle database on that system. cascading deletes. 6 Stop Post on the target system(s) and the intermediary system.sql utility script (SharePlex product directory/util) on the secondary tables to direct triggers to ignore the SharePlex Oracle user. 10 Follow the appropriate instructions for managing triggers. sp_ctrl(sysB)> stop post 7 Allow users to access the database on the source system again (only the trusted source system in peer-to-peer replication.

This directs SharePlex to capture posted changes on that system and replicate them to the target system. sp_ctrl(sysB)> activate config filename 15 [HIGH AVAILABILITY ONLY] Stop Export on the target system(s). SharePlex begins executing the SQL state- ments that have been collecting in the post queue. delete the unneeded columns and rows from those tables. For peer-to-peer replication. 12 [PARTITIONED REPLICATION ONLY] If you are using vertically partitioned or horizontally par- titioned replication for any tables. 13 [CASCADING REPLICATION ONLY] Set the SP_OPO_REPLICATE_POSTER parameter on the intermediary system to 1. keeping the source and target data in sync. start Post for each one. sp_ctrl(sysB)> activate config filename 17 Start Post on the target system(s). If this is a central target system running multiple sp_cop instances. CHAPTER 7 301 Starting SharePlex Replication ing replication). sp_ctrl(sysB)> set param SP_OPO_REPLICATE_POSTER 1 14 [CASCADING REPLICATION ONLY] Activate the configuration on the intermediary system. sp_ctrl(sysB)> stop export 16 [HIGH AVAILABILITY AND PEER-TO-PEER REPLICATION ONLY] Activate a configuration on the sec- ondary system (high availability) or all other source systems (peer-to-peer) that repli- cates to the source (or trusted source) system. . sp_ctrl(sysB)> start post 18 [PEER-TO-PEER REPLICATION ONLY] Allow users to access the databases on all systems. intermediary system (cascading replication) or all systems (peer-to-peer replication). all cascading delete functionality must be incorporated into triggers on all replication systems.

1 Shut down the source Oracle instance. and ran ora_setup on the source and target instances per the instructions in the SharePlex Installation and Demonstration Guide. first export the port and SP_SYS_VARDIR variables for the variable-data directory on this system. This allows the activation process to proceed while you are making the copy. • For peer-to-peer replication. Important! Before beginning this procedure.302 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. 3 Start sp_cop and sp_ctrl on the source system. first export the port and SP_SYS_VARDIR variables for the variable-data directories. installed SharePlex on the source and target systems. shut down all databases in the configuration.0 Updated 8/19/13 Synchronizing data with FTP Follow these steps in the order written. sp_ctrl(sysA)> activate config filename 6 Start sp_cop and sp_ctrl on the target system(s) and the intermediary system. FTP the files from the trusted source system to the other secondary source systems. These instructions assume you have already cre- ated the target instance. or you can synchronize each source instance one at a time using these instructions. includ- ing the “trusted source. 5 Activate the configuration on the source system. 4 Open the source Oracle instance but do not allow users to access it. have your configuration ready to be acti- vated on the source system. • If you are replicating for centralized reporting (consolidated replication). you can shut down all of the source instances at once and make the copies at the same time. . if using cascading replication. For peer-to-peer replication. For consolidated replication using separate instances of sp_cop. For peer-to-peer configurations.” 2 FTP the files from the source system to the target system(s). activate the configuration on the trusted source system only. See page 310 for information about activating a configuration. • For consolidated replication using separate instances of sp_cop. ensuring that you pre- serve file permissions and ownerships. This procedure requires that users stop accessing the database while the copy and configuration activation take place.

sp_ctrl(sysA)> status 10 Open the target instance(s) and the intermediary instance if using cascading replica- tion. Open all instances on all secondary source systems for peer-to-peer replication.sql utility script (SharePlex product directory/ util) so that triggers will ignore the SharePlex user. the intermediary system (cascading replication). • If this is a target system for consolidated replication running multiple instances of sp_cop. or run the sp_add_trigger. .sql utility script (SharePlex product directory/util) on the secondary tables to direct triggers to ignore the SharePlex Oracle user. CHAPTER 7 303 Starting SharePlex Replication • For peer-to-peer replication. start the sp_cop and sp_ctrl processes on the second- ary source systems — the ones to which you want to copy the trusted source sys- tem’s data. sp_ctrl(sysB)> stop post 8 Allow users to access the database on the source system again (only the trusted source system in peer-to-peer replication. if using cascading replication. A For high availability replication: Run the sp_add_trigger.sql utility script (SharePlex product directory/util) on all tables to direct triggers to ignore the SharePlex Ora- cle user. Stopping Post allows any data that gets replicated before the target data is established to collect in the post queue. stop Post on all secondary source systems. B For peer-to-peer replication: Run the sp_add_trigger. stop Post for each one. • For peer-to-peer replication. 11 Import or restore the data on the target system(s). or the secondary source systems (peer-to-peer replication). 7 Stop Post on the target system(s) and the intermediary system. 9 Use the status command on the source system to make sure the SharePlex processes are running. 12 Follow the appropriate instructions for managing triggers. C For all other replication scenarios: You can either disable triggers on the target tables (and the target tables on the intermediary system if using cascading repli- cation). all source systems in consolidated replica- tion).

start Post for each one. delete the unneeded columns and rows from those tables. . keeping the source and target data in sync. SharePlex begins executing the SQL statements that have been collecting in the post queue. sp_ctrl(sysB)> start post 20 [PEER-TO-PEER REPLICATION ONLY] Allow users to access the databases on all systems. sp_ctrl(sysB)> activate config filename 19 Start Post on the target system(s).0 Updated 8/19/13 13 Disable check constraints. For peer-to-peer replication. all cascading delete functionality must be incorporated into triggers on all replication systems. 15 [CASCADING REPLICATION ONLY] Set the SP_OPO_REPLICATE_POSTER parameter on the intermediary system to 1. sp_ctrl(sysB)> set param SP_OPO_REPLICATE_POSTER 1 16 [CASCADING REPLICATION ONLY] Activate the configuration on the intermediary system. sp_ctrl(sysB)> activate config filename 17 [HIGH AVAILABILITY ONLY] Stop Export on the target system(s). intermediary system (cascading replication) or all systems (peer-to-peer replication).304 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. This directs SharePlex to capture posted changes on that system and replicate them to the target system. 14 [PARTITIONED REPLICATION ONLY] If you are using vertically partitioned or horizontally par- titioned replication for any tables. If this is a central target running multiple sp_cop instances. sp_ctrl(sysB)> stop export 18 [HIGH AVAILABILITY AND PEER-TO-PEER REPLICATION ONLY] Activate a configuration on the sec- ondary system (high availability) or all other source systems (peer-to-peer) that repli- cates to the source (or trusted source) system. cascading deletes. and scheduled jobs that perform DML on the target tables and the target tables on the intermediary system if using cascad- ing replication.

These instructions assume familiarity with using the transportable tablespace feature and contain only the steps required for using this feature to synchronize data for replica- tion. It allows you to export just the metadata (data dictionary) and then copy the datafiles. first export the port and SP_SYS_VARDIR variables for the variable-data directories. For consolidated replication using separate sp_cop pro- cesses. if using cascading replication. See page 310 for information about activating a configuration. 2 Activate the configuration on the source system. stop Post for each one. 1 Set the source tablespace to READ ONLY (alter tablespace TRANS read only. Important! Before beginning this procedure. . This allows the activation process to proceed while you are making the copy.). eliminat- ing the need to rebuild them on the target system. 4 Stop Post on the target system(s) and the intermediary system. CHAPTER 7 305 Starting SharePlex Replication Synchronizing data with transportable tablespaces The transportable tablespace feature allows you to quickly synchronize and resynchro- nize numerous objects with minimal downtime. This method also moves indices. and you can move multiple tablespaces at one time. For peer-to-peer replication. activate the configuration on the trusted source system only. and ran ora_setup on the source and target instances per the instructions in the SharePlex Installation and Demonstration Guide. These instructions assume you already installed SharePlex on the source and target sys- tems. • For peer-to-peer replication. • If this is a target system for consolidated replication running multiple instances of sp_cop. sp_ctrl(sysA)> activate config filename 3 Start sp_cop and sp_ctrl on the target system(s) and the intermediary system. if using cascading replication. start the sp_cop and sp_ctrl processes on the secondary source systems — the ones to which you want to copy the trusted source system’s data. For peer-to-peer replication. stop Post on all secondary source systems. have your configuration(s) ready to be acti- vated.

0 Updated 8/19/13 Stopping Post allows any data that gets replicated before the target data is established to collect in the post queue.sql utility script (SharePlex product directory/ util) so that triggers will ignore the SharePlex user. and scheduled jobs that perform DML on the target tables and the target tables on the intermediary system if using cascad- .306 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8.sql utility script (SharePlex product directory/util) on the secondary tables to direct triggers to ignore the SharePlex Oracle user. C For all other replication scenarios: You can either disable triggers on the target tables (and the target tables on the intermediary system if using cascading repli- cation). B For peer-to-peer replication: Run the sp_add_trigger. 7 Set the source tablespace(s) back to read/write mode (alter Tablespace NAME read write. cascading deletes. This minimizes the impact on the source database of copying the files to the target system. use the Oracle import utility to import the metadata and the tablespace definitions.sql utility script (SharePlex product directory/util) on all tables to direct triggers to ignore the SharePlex Ora- cle user. interme- diary database (cascading replication). 12 Open all instances to which you copied the files. sp_ctrl(sysB)> stop post 5 Export the metadata to an export file according to Oracle’s instructions. 13 Follow the appropriate instructions for managing triggers. drop them so that the copied files can be applied. 11 Set the tablespace(s) on those systems to read/write mode. 6 When the export is finished. or run the sp_add_trigger. or secondary databases (high availability or peer-to-peer replication). copy the datafiles to another location on the source sys- tem (trusted source in peer-to-peer replication). 10 On the systems to which you copied the files.) 8 If any of the copied datafiles and tablespaces exist in the target database(s). A For high availability replication: Run the sp_add_trigger. 9 Copy the files from the new location on the source system to the target system(s) (or secondary systems) and intermediary system (cascading replication). 14 Disable check constraints.

. sp_ctrl(sysB)> set param SP_OPO_REPLICATE_POSTER 1 17 [CASCADING REPLICATION ONLY] Activate the configuration on the intermediary system. start Post for each one. sp_ctrl(sysB)> start post 21 [PEER-TO-PEER REPLICATION ONLY] Allow users to access the databases on all systems. CHAPTER 7 307 Starting SharePlex Replication ing replication. If this is a central target running multiple sp_cop instances. sp_ctrl(sysB)> activate config filename 20 Start Post on the target system(s). intermediary system (cascading replication) or all systems (peer-to-peer replication). SharePlex begins executing the SQL statements that have been collecting in the post queue. delete the unneeded columns and rows from those tables. sp_ctrl(sysB)> activate config filename 18 [HIGH AVAILABILITY ONLY] Stop Export on the target system(s). For peer-to-peer replication. 15 [PARTITIONED REPLICATION ONLY] If you are using vertically partitioned or horizontally par- titioned replication for any tables. all cascading delete functionality must be incorporated into triggers on all replication systems. This directs SharePlex to capture posted changes on that system and replicate them to the target system. keeping the source and target data in sync. 16 [CASCADING REPLICATION ONLY] Set the SP_OPO_REPLICATE_POSTER parameter on the intermediary system to 1. sp_ctrl(sysB)> stop export 19 [HIGH AVAILABILITY AND PEER-TO-PEER REPLICATION ONLY] Activate a configuration on the sec- ondary system (high availability) or all other source systems (peer-to-peer) that repli- cates to the source (or trusted source) system.

refer to the SharePlex Reference Manual.0 Updated 8/19/13 Part 2: Activating and deactivating configurations When you activate a configuration. About configuration activation To activate a configuration. the network. the amount of row chaining. and the type of activation you are using.308 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. The length of time that activation takes varies. depending on the size. . • it is automatically deactivated by the activation of another configuration replicating data from the same datasource (Oracle instance). A configuration ceases to be active when: • it is deactivated by an authorized SharePlex user with the deactivate config or abort config command. The configuration remains active when you shut down sp_cop and when a system.. For more information on this command. use the activate config command in sp_ctrl. the database containing the objects to be replicated must be mounted and open. To activate a configuration. and it resumes automatically when operations are restored. review that command and the other configuration commands in the SharePlex Reference Manual. Replication temporarily ceases.. Or. be sure to run the verify con- fig command. use the recommended command options. Important! Before you use the activate config command. Important! Before you use the activate config command. number and structure of the database objects. or with a SharePlex utility that includes deactivation. When you are following a documented SharePlex procedure. or an Oracle instance becomes unavailable. such as initial synchronization or resyn- chronization. replication begins.

The table is then unlocked. If another configuration is active for the same datasource. and whether a column is part of a key. Lock the tables. 3. Add a configuration change marker A configuration-change marker is placed in the data stream that tells sp_cop to gener- ate a new set of replication processes and queues. routing and other essential information. size. 2. but not the tables whose routes did not change. causing the removal of the old processes and queues after the data they contain is posted. the object cache includes the name. Create an object and partition cache An object cache is built to map the Oracle object ID of each table and sequence to the object’s name. SharePlex builds a partition cache that records the partition conditions. the marker deactivates it. SharePlex performs the following procedures. Tables are locked in the following ways: • All tables added to replication are locked. add the activation marker. • All tables removed replication are locked. NOT- NULL constraints. When the table is locked. 4. The tables are locked in a locking thread. Assign an activation ID An activation ID number is assigned that identifies the configuration activation and its associated replication processes and queues. • All tables in an active configuration where destination routes have changed are locked. 1. • For tables using horizontally partitioned replication. additional column information is included about the columns being replicated. an activation marker is placed in the data stream that tells the capture process to start (or stop) replicating that table. . This number is stored in the SHAREPLEX_ACTID internal table and is transparent to SharePlex users. unlock Configured tables are locked so that they can be activated. CHAPTER 7 309 Starting SharePlex Replication During activation. and type of columns. As many tables can be locked concurrently as there are threads. • For all tables. • For tables using vertically partitioned replication.

Consider using Oracle wildcards to simplify your config Use of Oracle wildcards in the configuration file make it possible for you to specify all the objects belonging to the same owner (or in the same schema) for replication using a single entry. You may also include. Before you activate a configuration The following guidelines help ensure that activation is successful. • If you are using Oracle wildcards insure that all the conditions and limitations are taken into account prior to activation. See page 137 for more information.0 Updated 8/19/13 5. You may also use wildcards to replicate a set of objects in a specific source schema to the same objects on the target. Partitioning a table while it is actively replicating causes SharePlex to lose the identifying information it has compiled. it can be automatically added to replication if it meets the wildcard criteria. in the single entry. exceptions using not notation. see page 379. To add an Oracle partition to a replicating table. If objects are listed in a configuration. but where the objects reside in under a different owner (or schema) name on the target. • Objects in the configuration must exist in the source instance before you activate. their activation fails. Other activation guidelines • Verify that the ORACLE_SID and ORACLE_HOME values are correct in the oratab file or Windows Registry. When a new table is created.310 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. and users can access the data once again. but are not created until after activation. . Unlock the tables The tables are unlocked when activation is complete. and DML from that table partition is not replicated. and that the SID matches the one specified as the datasource in the configuration. See page 137 for information on using Oracle wildcards. • Oracle partitions on tables must be created before activation.

its datasource. the date and time it was activated. the source and target data can go out of synchronization.. If there are two or more concurrent activations.. CHAPTER 7 311 Starting SharePlex Replication Viewing activation status Use the show activate command in sp_ctrl to view the status of all activation activity on a source system. • use the deactivate config or abort config command in sp_ctrl. sp_ctrl(sysA)> deactivate config filename Or… sp_ctrl(sysA)> abort config filename Warning! Deactivating or aborting a configuration stops replication. The syntax for the deactivate config and abort config commands is shown below. . the command dis- plays their status in the order in which they started. Deactivating a configuration To deactivate a configuration. Or. see the SharePlex Reference Manual. For more information about these and other SharePlex commands. and the number of objects that are configured. which will deactivate the orig- inal configuration. you can: • activate a new configuration for the same datasource. If users con- tinue making changes to the configured objects. Viewing configuration statistics Use the show config command in sp_ctrl to view statistics for active configurations. This command displays a configuration’s status. There are significant differences between the two commands.

only those objects are analyzed. you can control when the new configuration is activated. By contrast.312 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. SharePlex re-analyzes all the objects. then edit it with the edit config command.0 Updated 8/19/13 Part 3: Changing Configurations These instructions assume you are familiar with configuration construction. The new configuration activates before the existing one deactivates. . Copying a configuration before mak- ing changes preserves the original file in case it is needed again or a mistake is made during editing. And. For this reason. it is not necessary to add the object to the config file. SharePlex does not permit an active configuration to be edited directly. For more information about configuration construction. copy the configuration with the copy config com- mand. See page 137 for information on using Oracle wildcards. see Chapter 5. so SharePlex only analyzes added. so the activation is less time-consuming than a first-time activation. Tip: If you are using Oracle wildcards and the object that you are adding is covered by the Oracle wildcard specification in the configuration file. when you deactivate the original con- figuration and then activate a new one. Adding objects to an active configuration When objects are added to an active configuration. Any new objects that match the criteria are automatically added into replication. Unless you are adding numerous objects to a configuration or adding tables with exten- sive chaining. To change an active configuration. See Chapter 10 for procedures to follow when changing Oracle characteristics of repli- cating objects. changed or removed objects. activation of an edited configuration is less time-consuming than the orig- inal activation — if you do not deactivate the original configuration.

sp_ctrl(sysA)> activate config newname The old configuration automatically deactivates. Example owner.targetSID 5 Save the new configuration with either the :wq command if using vi or with Save on the File menu if using WordPad.target_table sysB@o. stop user access to the added tables. . sp_ctrl(sysA)> copy config filename to newname 3 Open the new configuration using the edit config command.table owner. issue the activate config command for the new configuration. 8 Restore user access to the tables. and the name of the new configuration for newname. Substitute the original configuration’s name for filename. 6 When you are ready to activate the new configuration. This opens the configu- ration file in the default text editor for SharePlex (vi for UNIX. sp_ctrl(sysA)> edit config newname 4 Add each new table’s source owner and name. and routing map to the new configuration. issue the copy config command. CHAPTER 7 313 Starting SharePlex Replication To add tables to an active configuration 1 Synchronize the new source and target tables according to the directions in “Syn- chronizing data for the first time” on page 288. 2 In sp_ctrl. Warning! SharePlex executes the command without requiring confirmation. target owner and name. This creates an exact copy of the configuration and returns you to the sp_ctrl prompt. 7 In sp_ctrl. WordPad for Win- dows). Do not deactivate the existing config- uration.

depending on whether or not the sequences are used to populate a column in a table. which follows this procedure. and the routing map to the new configuration. 1 Stop user activity on the source system.target_sequence sysB@o. sp_ctrl(sysA)> edit config newname 4 Add the owner and name of each new source sequence. WordPad for Win- dows). To ensure uniqueness on the target system. 6 Create the target sequence on the target system.0 Updated 8/19/13 Adding sequences to an active configuration Use one of the following sets of instructions to add sequences to an active configuration. and the name of the new configuration for newname. the start value of the target sequence must be larger than the start value of the source sequence. Example owner. To add a sequence that does not populate a column The following procedure can be used whether or not a sequence populates a column in a table. use the “To add a sequence that populates a column” procedure. sp_ctrl(sysA)> copy config filename to newname 3 Open the new configuration using the edit config command. sp_ctrl(sysA)> activate config newname .sequence owner.targetSID 5 Save the new configuration with either the :wq command if using vi or with Save on the File menu if using WordPad. This procedure involves stopping user access to the objects. This creates an exact copy of the configuration and returns you to the sp_ctrl prompt. Use the following formula to determine the target START_WITH value: {source_INCREMENT_BY_value} x {source_CACHE_value} = START_WITH_value 7 In sp_ctrl. Substitute the original configuration’s name for filename. issue the activate config command for the new configuration. 2 In sp_ctrl.314 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. This opens the configu- ration file in the default text editor for SharePlex (vi for UNIX. If a sequence popu- lates a column in a table and you cannot stop user access. issue the copy config command. the owner and name of each target sequence.

target_sequence sysB@o. Example owner. 8 Restore user activity on the source system. This opens the configu- ration file in the default text editor for SharePlex (vi for UNIX. CHAPTER 7 315 Starting SharePlex Replication The old configuration automatically deactivates. sp_ctrl(sysA)> copy config filename to newname 2 Open the new configuration using the edit config command. To add a sequence that populates a column Use this procedure to add a sequence to an active configuration if the sequence popu- lates a column in a table and you cannot stop user access to the objects. issue the activate config command for the new configuration. This command stops Post and places a marker in the data stream that establishes a syn- chronization point between source and target data. and the routing map to the new configuration. Warning! SharePlex executes the command without requiring confirmation. Substitute the original configuration’s name for filename. flush the data from source system to the target system. WordPad for Win- dows). sp_ctrl(sysA)> edit config newname 3 Add the owner and name of each new source sequence. 5 In sp_ctrl. This creates an exact copy of the configuration and returns you to the sp_ctrl prompt. 1 In sp_ctrl. and the name of the new configuration for newname. issue the copy config command. Warning! SharePlex executes the command without requiring confirmation.sequence owner. the owner and name of each target sequence. sp_ctrl(sysA)> activate config newname The old configuration automatically deactivates.targetSID 4 Save the new configuration with either the :wq command if using vi or with Save on the File menu if using WordPad. For datasource in the following . 6 On the source system.

Example: INCREMENT_BY = 2 CACHE = 10 select max(column_name) = 24 Next highest multiple of (2 x 10) after 24 = 40. 11 Create the target sequence with the START WITH value that you determined. {source_INCREMENT_BY_value} x {source_CACHE_value} For example.oraA. add another multiple of {source_INCREMENT_BY_value x source_CACHE_value}. the value would be 20. 9 Starting with the value obtained by the select max (column_name) command in step 7. 12 Start the Post process.316 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. The result determines the START WITH value of the target sequence. if the source sequence is incremented by 2 and the cache size is 10. determine the next highest multiple of {source_INCREMENT_BY_value x source_CACHE_value}. sp_ctrl(sysB)> start post SharePlex will continue replicating.0 Updated 8/19/13 syntax. while keeping the target sequence at least one mul- tiple of {source_INCREMENT_BY_value x source_CACHE_value} ahead of the source sequence. followed by the ORACLE_SID of the source instance — for example o. substitute o. the START WITH value would be: 40 + (2 x 10) = 60. sp_ctrl(sysA)> flush datasource 7 After Post stops. 10 To the value obtained in step 9. . Continuing with the example. select max(column_name) = last known value 8 Determine the value of the following equation. issue the following Oracle command on the target system to find the last known value of the sequence.

. repeat the preceding procedure to re-establish the sequence relationships. If a source table using a replicated sequence has many rollback operations. it causes sequence values to increase without actually being used in columns in the table. As a result. the sequence value on the target system could be less than the value in the replicated row. when the next valid operation is replicated. If the current value of the target sequence is less than the maximum value in the table. view the target table regularly to ensure that the current value of the target sequence remains greater than the maximum value in the table. When there are numerous roll- backs. CHAPTER 7 317 Starting SharePlex Replication IMPORTANT! Sequences continue to be incremented even when a transaction is rolled back.

sp_ctrl(sysA)> activate config newname The original configuration automatically deactivates. To remove objects 1 In sp_ctrl. See page 137 for information on using Oracle wildcards. Substitute the original configuration’s name for filename. delete the entry for each object to be removed from replica- tion.). there is data corruption or some other reason for not wanting DML or DDL operations on the table to be applied to the target table. see the SharePlex Reference Manual. For more information about this parameter. This creates an exact copy of the configuration and returns you to the sp_ctrl prompt. This opens the configu- ration file in the default text editor for SharePlex (vi for UNIX. enter the copy config command. Tip: You can prevent posting for a table without removing it from the configuration file if. Do not deactivate the original configuration. sp_ctrl(sysA)> edit config newname 3 In the new configuration. (Or if the object you are removing from replication is covered by an entry that employs Oracle wildcards. for example. so the activation is less time-consuming that the orig- inal activation. activate the new configuration when you are ready. The objects being removed are locked when the new configuration is activated. or with Save on the File menu if using WordPad.318 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. use not notation to exclude the object from replication. 6 In sp_ctrl. and the name of the new configuration for newname. 5 Stop user access to the removed objects. 4 Save the new configuration with either the :wq command if using vi. use the SP_OPO_DISABLE_OBJECT_NUM parameter. WordPad for Win- dows). but only those objects are locked. To prevent posting for a table. . sp_ctrl(sysA)> copy config filename to newname 2 Open the new configuration using the edit config command.0 Updated 8/19/13 Removing objects from an active configuration Removing objects from an active configuration involves a similar procedure to adding objects.

remove the entry for that scheme from the configuration file. . then make the required changes to the column partition in the new configuration. If the change involves renaming the partition scheme itself. if necessary. add a routing map for it in the configu- ration. insert the scheme information and column conditions into the SHAREPLEX_PARTITION table. do one of the following. for exam- ple: ! sysD@o. Begin the line with an exception marker (!) and one or more spaces. referring to the preceding instructions in this chapter for changing config- urations and the instructions in “Configuration for vertically partitioned replication” on page 172. if necessary. depending on the change required. referring to the preceding instructions in this chapter for changing configura- tions. • To remove a partition scheme from replication.oraD To change vertically partitioned replication To change replication for a table that uses vertically partitioned replication. Stop user access to the affected table. you might need to change the SHAREPLEX_PARTITION table as well as the configu- ration. restore user access to the objects. edit the configuration entry accordingly. For horizontally partitioned replication. • To add a new target system to a partition scheme when that system is not also in a routing map somewhere in the configuration. update or delete the rows in the SHAREPLEX_PARTITION table that relate to that scheme. Changing partitioned replication You can change replication for a table that uses vertically or horizontally partitioned replication while the configuration is active. but are not required to. • To add a partition scheme. copy the active configuration. CHAPTER 7 319 Starting SharePlex Replication 7 After activation. and in “Configuration for horizontally partitioned replication” on page 160. • To change a partition scheme. then activate the new con- figuration. and add a configuration line for the source and target objects that will use that scheme. remove the partition scheme information from the SHAREPLEX_PARTITION table. To change horizontally partitioned replication To change replication for a table using horizontally partitioned replication. You can.

320 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8.0 Updated 8/19/13 .

where primary (source) and secondary (target) databases are mirrors of each other. The procedures in this chapter assume true high availability. Contents Failing over to a secondary system after an unplanned system failure Failing back to the primary system after an unplanned system failure Restoring replication when the secondary instance fails Planned failover and failback . 8 Using SharePlex in a High- Availability Environment This chapter shows you how to maintain replication in a high-availability UNIX envi- ronment after a system or database failure. see “Establishing replication for high availability and data recovery” on page 190 for instructions for establishing SharePlex replication in a high-availability environment. or for planned failover for maintenance or other operations. including the owners and table names. Important! Before you use the procedures in this chapter.

so that archives are available for restoration. which synchronizes the results of the backup or copy with ongoing replicated user changes after the copied instance is recovered. A commit releases them from the queue. • You activated a reverse configuration on the secondary system that is ready to repli- cate users’ changes from that system to the primary system.0 Updated 8/19/13 Failing over to a secondary system after an unplanned system failure In an unplanned failure of the primary (source) machine. • You have current backups of the UNIX files containing SharePlex environment information as recommended in “Regular SharePlex backups” on page 129.” sp_ctrl(sysB)> qstatus Note: Do not wait for the number of messages to be 0. SharePlex posts transactions as they are received. you use activation and the reconcile command. Instructions for switching users back to the primary system begin on page 324. you can move users to the secondary (target) machine and then back again with minimal downtime using SharePlex and a hot backup of the secondary instance. but also retains them in the post queue in case of data recovery.322 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. To fail over to the secondary system 1 Verify that Export is stopped on the secondary system. Use the qstatus command to check the posting process until the number of backlogged messages is “0. In a high-availability replication environ- ment. If the primary system failed before the commit . sp_ctrl(sysB)> stop export 2 Allow all of the transactions in the post queue on the secondary system to post to the secondary instance. replicated data remaining in the SharePlex queues on that system will be unrecoverable as a result of buffering and the likelihood that the queues are corrupted. This procedure assumes that: • You established a replication environment for high availability according to the instructions in “Establishing replication for high availability and data recovery” on page 190. For this procedure. This procedure addresses the SharePlex requirements for the failover.

UPDATE and DELETE access to all users on the secondary system. including starting the applications. 6 Move users to the secondary system and let them resume working. these partial transactions remain in the queue indefinitely.* Their transactions will now be accumulating in the export queue awaiting restoration of the source database. . but do not start Export. wasting system resources. * If started. 4 Run the script that enables triggers and constraints on the secondary system when users begin using this system. Export will repeatedly try to connect to the primary system. 3 Run the script that grants INSERT. CHAPTER 8 323 Using SharePlex in a High-Availability Environment was received. 5 Implement the failover procedure for relocating users to the secondary system. This is addressed later in these procedures.

Read. Export. use the syntax provided in the following examples to issue the delete queue command to delete the following queues: Note: The delete queue command will fail if there are messages in backlog. start sp_ctrl.324 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. 4 On the primary system. 2 On the primary system. deactivate the configuration. system files and Oracle files from the archives.0 Updated 8/19/13 Failing back to the primary system after an unplanned system failure Follow these steps to move users back to the primary machine after it has been recov- ered. $ /productdir/bin/sp_cop -s & 3 On the primary system.oraA:C B Delete the export queue on the primary system sp_ctrl(sysA)> delete queue queuename:X Example: sp_ctrl(sysA)> delete queue sysA:X . recover the SharePlex directories. A Delete the capture queue on the primary system sp_ctrl(sysA)> delete queue datasource:C Example: sp_ctrl(sysA)> delete queue o. sp_ctrl(sysA)> deactivate config filename Phase 2: Purge the queues 5 Run sp_ctrl on both systems. 6 On both systems. Phase 1: Restore the replication environment on the primary system 1 On the primary system. Post) from starting. you copied the configura- tion that was active before the system failed. This procedure is divided into phases to make it easier to understand and follow. When you copied the archived SharePlex variable-data directory to the primary system. start sp_cop using the [-s] option to prevent the SharePlex processes (Capture. Import. This causes the Capture process to set the transaction number to “1” when replication from the primary system resumes.

oraA-o. For more information about the delete queue command.oraB Note: You are issuing the delete queue command on the primary system because you restored the old SharePlex queues when you restored the archived SharePlex directo- ries (capture and export from the primary configuration). see the SharePlex Reference Manual. and cancel the recovery after Oracle has fully applied the log whose number you recorded. sp_ctrl(sysB)> start export Phase 4: Synchronize the data 10 Do a hot backup on the secondary system using an Oracle hot backup. Phase 3: Start replication from secondary to primary system 7 Issue the status command on the primary system to verify that all SharePlex pro- cesses are stopped. Recover the primary database from the hot backup using the UNTIL CANCEL option in the RECOVER clause. . You are issuing the delete queue command on the secondary system because data remaining in the post queue cannot be posted. This establishes communication between the primary and secondary systems. switch log files on the secondary system and make a note of the highest archive-log sequence number. • When the hot backup is finished. sp_ctrl(sysA)> status 8 Stop the Post process on the primary system sp_ctrl(sysA)> stop post 9 Start the Export process on the secondary system. Open the database with the RESETLOGS option. SharePlex will rebuild the queues when you reactivate the configu- ration and the two systems are reconciled. CHAPTER 8 325 Using SharePlex in a High-Availability Environment C Delete the post queue on the secondary system sp_ctrl(sysB)> delete queue queuename:P for datasource-datadest Example: sp_ctrl(sysA)> delete queue sysA:P for o. the primary system failed before Post received a COMMIT.

sp_ctrl(sysA)> activate config filename .326 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. and run the cleanup. the syntax would be: sp_ctrl(sysA)> reconcile queue SysA for o. This truncates the SharePlex tables and updates the SHAREPLEX_ACTID table. and then the sp_ctrl prompt returns.) The reconcile process retains control of sp_ctrl until it is fin- ished. 11 On the primary system. substituting the sequence number of the log that you recorded in step 10. if you are replicating from instance oraA on SysA to oraA on SysB.0 Updated 8/19/13 Note: This resets the sequences on the primary system to the top of the cache upon startup. sp_ctrl(sysA)> reconcile queue queuename for datasource-datadest seq sequence_number For example. If you are using named post queues. and therefore that information is obsolete.sql 14 Truncate the SHAREPLEX_TRANS table on the secondary system.oraA-o. activate the configuration on the primary system using default multi- threaded activation. (Issue the qstatus command if you do not know the queue name. issue the command for each one. Use this command. • triggers • foreign key constraints • cascading delete constraints • check constraints • scheduled jobs that perform DML 13 Log onto SQL*Plus on the primary system as the SharePlex Oracle user.oraA [seq 1234] 12 Disable or modify the following on the primary system. issue the reconcile command. Truncating the table restores transaction consistency between the two systems. This table con- tains transaction information that the Post process was using before the primary sys- tem failed. SQL> @/productdir/bin/cleanup.sql utility from the bin sub-directory of the SharePlex product directory. Phase 5: Activate replication on the primary system 15 In sp_ctrl.

such as the number . 20 Shut down SharePlex on the secondary system. 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. This is the object-cache file that the Post process needs. If you are using named post queues. sp_ctrl(sysA)> start post Phase 6: Restoring the object cache 17 Issue the status command on the primary system. This will flush Capture’s object cache to disk so that the file can be copied to the primary system. for example: splex_vardir/state/0x0a0100c5+PP+sys4+sp_opst_mt+o.quest-o.” Look for a Post error message referring to a file with a name similar to the example below. such as .18. change directories to the state sub-directory of the Share- Plex variable-data directory and locate the Capture object-cache file.18 in the example. . The path will be the state directory in the SharePlex variable-data directory. CHAPTER 8 327 Using SharePlex in a High-Availability Environment 16 Start Post on the primary system. The following steps guide you in restoring the object-cache file.ov-objcache_sp_opst_mt. This file will have a name similar to the one in the following example. The error is due to a missing object cache. containing the string “objcache_sp_opst_mt.18 19 Make a note of the full pathname of the Post object-cache file(s) referenced in the error message. You will see that Post has stopped due to an error.18 in the example.” fol- lowed by a number. there will be more than one error message. sp_ctrl(sysB)> shutdown 21 On the secondary system. each refer- ring to a different object-cache file but ending with the same number.quest-o.ov- objcache_sp_opst_mt. sp_ctrl(sysA)> status 18 Issue the show log command for the Event Log on the primary system. If there are more than one of these files. sp_ctrl(sysA)> show log filter=objcache Example Post object-cache file: 0x0a0100c5+PP+sys4+sp_opst_mt+o. and filter for the keyword “objcache.

sp_ctrl(sysA)> start post Phase 7: Switch users back to the primary system 24 Stop user access on the secondary system. 32 Disable or modify the following on the secondary system according to your replica- tion strategy.18 22 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 in step 19. • triggers • foreign key constraints . Continue to view it until the number of messages is 0. 23 Start Post on the primary system. 28 Enable all database objects that were disabled on the primary system in preparation for users to access them. svrmgrl> startup Note: This resets the sequence on the secondary system to the top of the cache to syn- chronize with the primary system.quest-objcache_sp_ocap. in preparation for the database to become the failover database again. svrmgrl> shutdown 27 Start up the secondary instance using the following Oracle command. 25 View the post queue on the primary system using the qstatus command. 30 Stop Post on the secondary system. 29 Start SharePlex on the secondary system.328 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8.0 Updated 8/19/13 Example Capture object-cache file: o. sp_ctrl(sysB)> stop post 31 Move users back to the primary system. sp_ctrl(sysA)> qstatus 26 Shut down the secondary instance using the following Oracle command.

switch users back to the primary system. disabled or modified triggers. disabled constraints and scheduled jobs. CHAPTER 8 329 Using SharePlex in a High-Availability Environment • cascading delete constraints • check constraints • scheduled jobs that perform DML 33 Start Post on the secondary system. sp_ctrl(sysA)> qstatus 35 When the number of messages is 0. sp_ctrl(sysB)> stop export Note: The secondary system is now in a failover-ready state again. and a stopped Export process . 36 Stop Export on the secondary system to prevent accidental changes made on that system from being replicated to the primary system. an active configuration. Keep checking until the number of messages is 0. with no users. sp_ctrl(sysB)> start post 34 Use the qstatus command on the primary system to view the number of messages in the post queue.

You may ignore it and continue with the procedure.oraB . This eliminates the need to reactivate the configuration on the primary system after the secondary instance is recovered. This procedure is divided into phases to make it easier to understand and follow. Phase 1: Purge the queues 1 Stop the Post process and deactivate the configuration on the secondary system. so that archives are available for restoration. Note: The delete queue command will fail if there are messages in backlog. use the syntax provided in the following example to issue the delete queue command to delete the post queue. 3 On the primary system. 2 Run sp_ctrl on the primary system. This procedure assumes that: • you have established a replication environment for high availability according to the instructions in the SharePlex Implementation Guide • you have an active reverse configuration on the secondary system that is ready to replicate users’ changes back to the primary system. sp_ctrl(sysB)> stop post sp_ctrl(sysB)> deactivate config filename Note: The deactivation causes an error: “Error in sp_cnc.0 Updated 8/19/13 Restoring replication when the secondary instance fails You can use a hot backup and SharePlex to recover the secondary instance if it fails.” in the Event Log. • you made regular backups of the UNIX files containing SharePlex environment information as recommended in “Regular SharePlex backups” on page 129.330 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. sp_ctrl(sysB)> delete queue queuename:P for datasource-datadest Example: sp_ctrl(sysA)> delete queue sysA:P for o.oraA-o.

CHAPTER 8 331 Using SharePlex in a High-Availability Environment Note: You are issuing the delete queue command on the primary system because there could be messages remaining from uncommitted transactions sent from the secondary instance before it failed. This table contains transaction information that the Post process on that system was using before the secondary instance failed. and therefore the existing transaction records must be purged. Phase 2: Synchronize the data Begin a hot backup on the primary system using an Oracle hot backup. 5 Run sp_ctrl on the secondary system. and therefore the information is obsolete. Trun- cating the tables restores transaction consistency. 8 Recover the secondary database from the hot backup using the UNTIL CANCEL option in the RECOVER clause. and cancel the recovery after Oracle has fully . 7 Switch log files on the primary system and make a note of the highest archive-log sequence number. use the syntax provided in the following examples to issue the delete queue command to delete the following queues: Note: The delete queue command will fail if there are messages in backlog. svrmgrl> alter system switch logfile. 4 Truncate the SHAREPLEX_TRANS internal table on the primary machine. A Delete the capture queue on the secondary system sp_ctrl(sysA)> delete queue datasource:C Example: sp_ctrl(sysA)> delete queue o.oraA:C B Delete the export queue on the secondary system sp_ctrl(sysA)> delete queue queuename:X Example: sp_ctrl(sysA)> delete queue sysA:X Note: You are issuing the delete queue command on the secondary system because the capture and export queues on that system still retain a record of the transactions that have already been processed. 6 On the secondary system. The goal of this procedure is to re-initialize replication by resynchronizing the data.

) The reconcile process retains control of sp_ctrl until it is finished. sp_ctrl(sysB)> reconcile queue queuename for datasource-datadest seq sequence_number For example. the syntax would be: sp_ctrl(sysA)> reconcile queue SysA for o. if you are replicating from instance oraA on SysA to oraA on SysB. Use the following command.sql script from the bin sub-directory of the SharePlex product directory. (Issue the qstatus command if you do not know the queue name. If you are using named post queues. 10 Log onto SQL*Plus as the SharePlex Oracle user on the secondary system. 9 Open the database with the RESETLOGS option.0 Updated 8/19/13 applied the log from step 7. issue the command for each one.oraA [seq 1234] 12 Disable or modify the following on the secondary system. substituting the sequence number of the log that you recorded earlier. This script truncates the SharePlex tables and updates the SHAREPLEX_ACTID table. and run the cleanup.oraA-o.sql 11 On the secondary system.332 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. stop the Export process on the secondary system so that nothing accidentally gets replicated to the primary system when the configu- ration is re-activated. Note: This resets the sequence on the secondary system to the top of the cache upon startup. sp_ctrl(sysB)> stop export . SQL> @/productdir/bin/cleanup. issue the reconcile command. • triggers • foreign key constraints • cascading delete constraints • check constraints • scheduled jobs that perform DML 13 When the sp_ctrl prompt returns. and then the sp_ctrl prompt returns.

CHAPTER 8 333 Using SharePlex in a High-Availability Environment Phase 3: Start the replication processes on the secondary system 14 Activate the configuration on the secondary system using default multi-threaded activation. sp_ctrl(sysB)> activate config filename 15 Start the Post process on the secondary system to start posting replicated data from the primary system. sp_ctrl(sysB)> start service The secondary instance is now ready for future failover. sp_ctrl(sysB)> start post 16 Start any other SharePlex processes on the secondary system that were “stopped due to error” when the secondary instance failed. .

(Keep issuing the command until it shows that Post has stopped due to the flush.334 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. and none in the post queue on the secondary system. followed by the ORACLE_SID of the primary instance. • there is enough disk space on the drive where the SharePlex queues are located on the secondary system to hold accumulated messages while users work there. This procedure assumes that: • you have established a replication environment for high availability according to the instructions in “Establishing replication for high availability and data recovery” on page 190. In the syntax below. stop user access to the objects. • you have an active reverse configuration on the secondary system that is ready to replicate users’ changes back to the primary system. sp_ctrl(sysA)> flush datasource 3 Verify that the Post process has stopped on the secondary system. . The “Number of Mes- sages” and the “Backlog (messages)” fields must be 0. 2 On the primary system. sp_ctrl(sysA)> qstatus sp_ctrl(sysB)> qstatus 5 Shut down SharePlex on the primary system (if needed).0 Updated 8/19/13 Planned failover and failback When you maintain a secondary instance with SharePlex in a high-availability environ- ment. establishing a synchronization point between the primary and secondary data. you can switch users to that system when maintenance or other operations must be performed on the primary system. substitute o. To switch users to the secondary system 1 On the primary system. This command stops the Post process on the secondary system and places a marker in the data stream. issue the flush command to flush the data to the secondary system.) sp_ctrl(sysB)> status 4 Verify that there are no messages in the capture and export queues on the primary system.

but do not start Export. Note: The sequence on the primary system is now at the top of the cache. not the immediate option. UPDATE and DELETE access to all users on the secondary system. 10 Implement the failover procedure for relocating users to the secondary system. including starting the applications and starting jobs that were running on the primary system. svrmgrl> shutdown abort Note: This resets the sequence on the primary system to the top of the cache upon startup. for this procedure. 9 Run the script that enables triggers and constraints on the secondary system when users begin using this system. CHAPTER 8 335 Using SharePlex in a High-Availability Environment 6 Shut down the instance on the primary system using the following Oracle com- mand. This prevents users’ changes from being replicated to the primary system until it is ready. 2 Disable or modify the following on the primary system: • triggers • foreign-key constraints • cascading delete constraints . follow these steps to switch them back to that system. 1 Open the primary instance. To switch users back to the primary system (planned failback) When the primary system is ready to be used again. 7 Verify that Export is stopped on the secondary system. The messages will accu- mulate in the export queue. You must use the abort option. 11 Move users to the secondary system and let them resume working. svrmgrl> stop export 8 Run the script that grants INSERT.

stop user access to the objects after Post has regained its processing pace. 4 Start Export on the secondary system so that SharePlex sends the accumulated mes- sages to the primary system.0 Updated 8/19/13 • check constraints • scheduled jobs that perform DML 3 Start SharePlex on the primary system (if needed). sp_ctrl(sysB)> start export Note: SharePlex passes any sequence updates from the secondary system back to the primary system when Export starts. and none in the post queue on the primary system. sp_ctrl(sysA)> status 10 Verify that there are no messages in the capture and export queues on the secondary system. 12 Shut down the instance on the secondary system using the following Oracle com- mand. sp_ctrl(sysA)> stop export 6 Wait until Post on the primary system has processed the messages that accumulated on the secondary system before proceeding to the next step. Keep issuing the status command until it shows that Post has stopped. 8 On the secondary system. for this procedure. The “Number of Mes- sages” and the “Backlog (messages)” fields must be 0. svrmgrl> shutdown abort . 7 On the secondary system. not the immediate option. 5 Stop Export on the primary system. flush the data to the primary system. You must use the abort option. sp_ctrl(sysA)> qstatus sp_ctrl(sysB)> qstatus 11 Shut down SharePlex on the secondary system. sp_ctrl(sysB)> flush datasource 9 Verify that the Post process has stopped on the primary system by issuing the status command.336 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8.

Use the following command to stop Export if it is running. 16 Implement the failover procedure for relocating users back to the primary system. This prevents users’ changes from being replicated to the secondary system until that machine is ready to received replicated data. including starting the applications and starting jobs that were running on the second- ary system. 20 Stop Export on the secondary system. UPDATE and DELETE access to all users on the primary system. but do not start Export. This prevents accidental DML that might occur on that system from replicating to the primary system. When the next value is selected on the primary system. svrmgrl> startup Note: The sequence on the secondary system is now at the top of the cache. and the sec- ondary system is at the top of a cache. sp_ctrl(sysB)> stop export . Now. a new cache is acquired and is replicated to the secondary system. the primary system is at the start of a cache. CHAPTER 8 337 Using SharePlex in a High-Availability Environment 13 Start the instance on the secondary system using the following Oracle command. 14 Run the script that grants INSERT. The messages will accumulate in the export queue. 17 Switch users to the primary system and let them resume working. 15 Run the script that enables triggers and constraints on the primary system when users begin using this system. sp_ctrl(sysA)> stop export 18 Disable or modify the following on the secondary system: • triggers • foreign-key constraints • cascading delete constraints • check constraints • scheduled jobs that perform DML 19 Start SharePlex on the secondary system.

where the secondary system is maintained by replication as a standby for the primary system.338 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. sp_ctrl(sysB)> start post . The regular high-availability environment is restored.0 Updated 8/19/13 21 Start Export on the primary system. sp_ctrl(sysA)> start export 22 Start Post on the secondary system so that replicated changes from the primary sys- tem begin posting to the secondary database.

Contents Monitoring SharePlex on UNIX systems Monitoring SharePlex on Windows systems Using SNMP with SharePlex . This chapter provides instructions for using these features. SharePlex provides monitoring scripts and SNMP traps for unat- tended monitoring of replication and remote notification of problems. 9 Unattended SharePlex Monitoring In addition to the interactive monitoring that you can do with the information com- mands in sp_ctrl.

one or more Share- Plex processes could stop as the result of a user command or an error.0 Updated 8/19/13 Part 1: Monitoring SharePlex on UNIX systems SharePlex is designed to run reliably in the background without supervision. For example. This section explains how to use the SharePlex monitoring scripts to notify you of key replication events. • Flexibility to run independently at regular intervals or as a scheduled crontab job. sp_logmon alerts you before the logs wrap so that you can take corrective action. If Capture loses pace by a specified number of logs. Or. The monitoring scripts provide the following benefits: • Less need for frequent status checks with sp_ctrl status commands. sp_qstatmon monitors the status of the SharePlex queues and sends a warning if the backlog exceeds a threshold (limit) that you define.340 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. but unfore- seen situations can occur in any replication environment. a system or the network could fail and cause data to accumulate in the queues. . This enables you to take corrective action before the queues exceed available disk space and replication is adversely affected. sp_eventmon monitors the SharePlex Event Log and reports errors that you specify in a special file. sp_logmon monitors how well Capture is keeping pace with the changes entering the redo logs. 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. Overview of the SharePlex Monitoring Utilities SharePlex provides the following scripts for monitoring replication. • Custom configuration capabilities. • Regular output to a log file on the system being monitored.

Suggestions are: --the SharePlex port number --the ORACLE_SID of the instance for which replication is being monitored --the SharePlex Administrator’s name See “Starting sp_cop with the -u option on UNIX systems” on page 63 for instruc- tions and syntax. where name can be an identifier of your choice. • The monitoring utility scripts must remain together in the installed directory (/SharePlex_product_directory/util). because that makes it difficult to maintain patches to sp_ctrl. and the contents provide the full message generated by the script. • Users of the monitoring utilities must have the following rights: . • To use the monitoring utilities. Location of the monitoring utilities The SharePlex monitoring utilities are located in the util sub-directory of the SharePlex product directory on UNIX systems. • SharePlex must be running prior to executing a monitoring script. • Platform independence. Before you use the scripts. CHAPTER 9 341 Unattended SharePlex Monitoring • E-mail and/or paging notification of conditions requiring immediate attention. start sp_cop with the -uname option. such as the type of e- mail or paging available. Do not move these scripts to a different direc- tory. make a link in the util sub-directory to the sp_ctrl binary in the bin sub-directory of the SharePlex product directory. modify it in the following location: <optdir>/. All scripts are UNIX shell scripts. The subject field of the e-mail contains a brief notation of the problem. Run the scripts from this location: <optdir>/util If you need to modify a script. Do not copy the binary itself. • The monitoring scripts make use of sp_ctrl commands.app-modules Requirements for using the monitoring utilities • The scripts must be customized to reflect your environment.

Upgrade instructions The monitoring scripts are overwritten with new scripts during patches and upgrades of SharePlex. --Korn (ksh) shell access and ps permission from the UNIX command line. use the kill -9 command. • The monitoring utilities use the mailx program to send e-mail notifications. • To kill any of the processes generated by these scripts.0 Updated 8/19/13 --local access to sp_ctrl and permission to run the script on the system on which the sp_cop to be monitored is running. • The permission on the iwgrep utility must be 755. After applying the patches. • Paging requires that your service provider supports receiving e-mails on your paging device. The kill command alone does not kill all of the processes. Do not rename the existing scripts to replace the updated scripts. . or you could lose important improvements or fixes. --read. update the new scripts with your customizing. make sure mailx is configured to send e-mail on all systems where the monitoring scripts will be deployed.342 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. Before using a script. write and execute permissions to the directory where the scripts reside. • Verify the ORACLE_HOME (the path to the ORACLE_HOME directory) for each Oracle instance being monitored. rename your existing scripts so that your customizing is retained. Before you install the patch or upgrade.

Actions taken by sp_eventmon The sp_eventmon script takes the following actions after each scan of the Event Log: • When sp_eventmon detects an error that you defined. These three components must be kept in the same directory as the script. You can define the scan inter- val and the error messages you want the script to detect. if that option is enabled. • If the e-mail option is enabled. the subject text is: Errors found in SharePlex log! Requirements for running sp_eventmon • Before you use the sp_eventmon utility. Each scan starts where the pre- vious one stopped to keep the impact on the system minimal and prevent duplicate warnings. • The sp_eventmon utility relies on the iwgrep program (see page 341).splex log file and an e-mail message. This file prevents duplicate warning messages from being sent to the log and your e-mail or pager.mrk (where user- name is derived from the string that you enter with the -s argument when you run sp_eventmon). When you run sp_eventmon. and the time and date of the error’s occurrence. if you are . or it will not function. but sp_eventmon will start scanning the Event Log from the beginning every time it starts. For example. each *.mrk file. CHAPTER 9 343 Unattended SharePlex Monitoring Monitoring the Event Log with sp_eventmon The sp_eventmon monitoring utility monitors the SharePlex Event Log (event_log) at set intervals for entries relating to key replication events. the script still will function. and a marker file named username. THE FOLLOWING ERRORS WERE FOUND IN THE SHAREPLEX EVENT LOG FOR INSTANCE:SID It also logs each error. it prints a notification to the error. the error_list file (described in this section).mrk file will have a different name. see “Requirements for using the monitor- ing utilities” on page 341. This causes warnings that were previously generated to be sent again. it creates the username. each instance must be run under the name of a different UNIX user. Note that if you are running multiple instances of sp_eventmon. the error’s Event Log line number. Thus. the sp_cop instance name (typically the port number). If you delete this file.

Poster failure. located in the util sub-directory of the SharePlex product directory.See the SharePlex Reference Manual for more infor- mation about the truncate log command. This file is in the util sub-directory of the SharePlex product directory. Out of sync. Bob. System call error. and Charlie.mrk. Note that when you issue the truncate log com- mand you must remove the username. The following are the default errors for which sp_eventmon monitors: Default errors monitored by sp_eventmon SharePlex was shutdown.mrk file. where sp_cop_name is the value used in the -s argument when the script was run. Important! When there is an existing Event Log with errors in it and the sp_eventmon monitoring script is running. If the log grows too large. The next time you run sp_eventmon it will create a new *. . Internal error. the iwgrep pro- gram cannot grep from it properly. Deactivate config.344 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. Open the file and place each error string on a separate line. Host is down.0 Updated 8/19/13 running three instances of sp_eventmon under the UNIX names of Adam. Parameter was changed. and Charlie. issue the truncate log command and then delete the sp_cop_name.mrk. Bad config file.mrk files named Adam. Child process failed. you will have three *. Error. Queue partition is full.mrk.mrk file. Defining the error messages for notification The sp_eventmon script scans for events listed in the error_list file.mrk file. You can add custom error strings to the error_list by editing the file in any ASCII text editor. • Use the truncate log command in sp_ctrl to truncate the Event Log frequently when you are running the sp_eventmon script. Activate config. sp_cop was shutdown. Bob.

Syntax for sp_eventmon nohup sp_eventmon -s 'sp_copname' -t interval -p path [-n name] [-m] /dev/null & Required components COMPONENT DESCRIPTION nohup sp_eventmon The nohup command tells sp_eventmon to continue running in the background if the user logs out. 4 Enable e-mail notification by including the -m option in the script syntax. 2 Add the address strings after the MailUserName= variable. This ensures continuous monitoring. Use the full e-mail and/or pager address. you first must define the e-mail address(es) within the script. The sp_eventmon component runs the script. Defining the e-mail addresses To execute sp_eventmon with the -m option (for e-mail notification). IW_HOME=/export/home/jdadd/monscripts 3 Save and close the script file. If you move iwgrep. You can specify as many addresses as you want. . CHAPTER 9 345 Unattended SharePlex Monitoring Setting IW_HOME The IW_HOME variable must be customized for each machine because it points to the directory in which the scripts and iwgrep reside. The script exports the IW_HOME variable when it runs.com 3 Save and close the file. as shown in the following example. you must re-set this variable to the new path.com. 12345678910@pageservice. 1 Open the sp_eventmon script in any ASCII text editor. scott@company. Separate multiple entries with a comma. 2 Type the correct path on the line where the IW_HOME variable appears. 1 Open the sp_eventmon script in any ASCII text editor. as shown in the following example.

. The value can be any positive integer. -p path This variable sets the path to the SharePlex variable-data directory. sp_eventmon assumes the default path. The sp_eventmon script sends notification messages to all addresses coded in the script.” -m This enables the e-mail/paging option. -t interval This sets the time interval between scans in seconds. /dev/null This 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. You can use this parameter more than once to moni- tor multiple sp_cop instances on a system. & This runs the script in the background. but only logs errors to the log file. Without this parameter. sp_eventmon will not start.346 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. With- out this parameter. sp_eventmon does not send an e-mail.0 Updated 8/19/13 Required components (continued) COMPONENT DESCRIPTION (continued) -s 'sp_copname' This sets the name of sp_cop that was used when you started sp_cop with the -u option. The name of sp_cop must be enclosed within sin- gle quote marks. Without this variable. omit this argument. To have the output appear on screen. Optional variables VARIABLE DESCRIPTION -n name This sets the name of the Event Log if it is something other than the default name “event_log.

Actions taken by sp_logmon The sp_logmon script takes the following actions after each analysis of the redo logs and the Capture process: • If Capture falls a specified number of logs behind Oracle. which exceeds the threshold (of 2 files).log file and an e-mail message. Corrective action is needed before the log wrap. sp_logmon generates a warning in the logmon. If Capture loses pace by a specified number of logs. This gives you time to correct the cause of the delay and restore the archive logs. the subject text is: SharePlex (port n) may encounter a log wrap! Requirements for running sp_logmon • Before you use the sp_logmon utility. It moni- tors the redo log group that Oracle currently is writing to and determines which log SharePlex is reading. sp_logmon notifies you. CHAPTER 9 347 Unattended SharePlex Monitoring Monitoring the Capture process with sp_logmon The sp_logmon monitoring utility helps prevent situations where you must resynchro- nize because the redo logs wrapped before Capture was finished reading them. if necessary. . You can run this script for multiple SharePlex instances by using a different port number for the -p argument in the syntax. or resynchronization will be necessary. • If the e-mail option is enabled. see “Requirements for using the monitoring utilities” on page 341. if that option is enabled: The SharePlex (port n) Capture process has fallen behind in capturing information from the redo log by 10 files. at Fri Oct 5 16:52:55 PDT 2001.

-p port_number This sets the port number for the instance of sp_cop that you are moni- toring. The sp_logmon component runs the script.com 3 Save and close the file. -t interval This sets the time interval between scans in seconds. /dev/null This redirects the notification output to the /dev/null device on the local system so that the monitoring process continues to run in the back- ground and generate output. 4 Enable e-mail notification by including the -m option in the script syntax. you first must define the e-mail address(es) within the script. & This runs the script in the background.0 Updated 8/19/13 Defining the e-mail addresses To execute sp_logmon with the -m option (e-mail notification).com. You can monitor different SharePlex instances by running sp_logmon for each one.348 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. Separate multiple entries with a comma. 2 Add the address strings after the MailUserName= variable. as shown in the following example. You can specify as many addresses as you want. scott@company. 12345678910@pageservice. This ensures continuous monitoring. To have the output appear on screen. Important! If the person modifying the script is someone other than a SharePlex user. . Use the full e-mail and/or pager address. he or she needs to have these Oracle privileges: CONNECT privileges SELECT privileges for the V$LOG table SELECT privileges for the SharePlex internal tables 1 Open the sp_logmon script in any ASCII text editor. omit this argument. Syntax for sp_logmon nohup sp_logmon -p port_number -t interval -l integer [-m] /dev/null & Required components COMPONENT DESCRIPTION nohup sp_logmon The nohup command tells sp_logmon to continue running in the back- ground if the user logs out. The value can be any positive integer. using different values for this argument.

This value triggers the warning generated by sp_logmon. CHAPTER 9 349 Unattended SharePlex Monitoring Required components (continued) COMPONENT DESCRIPTION (continued) -l integer This sets a threshold value (limit) for the permissible number of redo logs between where Capture is reading and where Oracle is writing. but only logs errors to the log file. . Valid values are positive integers from 1 to the number of redo logs in the group. The sp_logmon script sends notification messages to all addresses coded in the script. Optional variables VARIABLE DESCRIPTION -m This enables the e-mail/paging option. sp_logmon does not send an e-mail. Without this parameter.

see “Requirements for using the monitoring utili- ties” on page 341. including child pro- cesses. Actions taken by sp_ps After each scan of the processes. 2 Change the interval= line to the scan interval that you want. . To specify a different scan interval. 1 Open the sp_ps file in any ASCII text editor. a value of “0” is not valid. The [Capture | Reader | Export | Import | Post] process for [sp_cop_name] Shareplex instance is down! • If the e-mail option is enabled. The default is 2. sp_ps gener- ates a notification message to one or more log files. it prints the appropriate version of the following message. sp_ps takes the following actions: • When it finds an abnormal condition that requires immediate attention. Setting the scan interval This variable specifies how long the sp_ps program waits between monitor checks. 3 Save the changes and close the file.000 seconds. Depending on whether you spec- ify the sp_cop on a source system. follow these steps. or for peer-to-peer replication. target system.350 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. associated with a specified sp_cop instance at regular intervals and reports abnormal conditions.0 Updated 8/19/13 Monitoring the SharePlex processes with sp_ps The sp_ps monitoring utility monitors all SharePlex processes. This script can monitor multiple installations of SharePlex on one or more systems. for example: interval=1500 You may enter any positive integer. and it accommodates uni-directional and bi-directional (peer-to-peer) configurations. the subject text is: Urgent! A SharePlex process is down! Requirements for running sp_ps • Before you use the sp_ps utility.

sp_ps assumes you want to monitor the sp_cop that uses the default SharePlex port of 2100. 1 Open the sp_ps script in any ASCII text editor. as shown in the following example.You can specify as many addresses as you want. as shown in the following exam- ple. CHAPTER 9 351 Unattended SharePlex Monitoring Setting the e-mail option The e-mail/paging option is enabled by default. You can use this parameter more than once to monitor multiple sp_cop processes. 2 Set the MAILOPTION variable line to TRUE or FALSE. notifications are sent to all addresses.com. • define the e-mail address(es) where sp_ps will send notifications. Follow these directions to: • disable or enable the e-mail option.com 4 Save and close the file. scott@company. Use the full e-mail and/or pager address. MAILOPTION=TRUE enables the e-mail feature (this is the default). 12345678910@pageservice. MAILOPTION=FALSE disables the e-mail feature. This ensures continuous monitoring. When this argument is used alone without the -uname option. The sp_ps component runs the script. 3 To add e-mail and/or pager address strings. . 'sp_cop -uname ' This is a required part of the syntax and must be enclosed within single quote marks as shown. Syntax for sp_ps nohup sp_ps 'sp_cop -uname' CONFIGURATION > /dev/null & Required components COMPONENT DESCRIPTION nohup sp_ps The nohup command tells sp_ps to continue running in the back- ground if the user logs out. When the script executes with e-mail enabled. Separate multiple entries with a comma. The -uname option must reflect exactly the same name that was used when sp_cop was started with the -u option. type them after the MailUserName= vari- able.

the target system. there will be no Import or Export processes. TARGET — monitors the Import and Post processes on the target system. or is part of peer-to-peer replication. Import and Post processes on each system.352 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. omit this argument & This runs the script in the background. For peer-to-peer replication: MULTI-SOURCE — tells the script to monitor the Capture.) Note: If you are running peer-to-peer replication on the same sys- tem. Export. the configuration on each system generates an Import and Post process on the other system. This value must be entered in CAPITAL letters.0 Updated 8/19/13 Required components (continued) COMPONENT DESCRIPTION (continued) CONFIGURATION This variable refers to the replication configuration of the SharePlex instance being monitored — whether it is on the source system. Read and Export processes on the source system. . To have the output appear on screen. Valid values for “CONFIGURATION” For uni-directional replication: SOURCE — monitors the Capture. (In peer-to-peer replication. Read. /dev/null This 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.

For more information about messages. see page 34. The backlog of messages in the [capture/post] queue is currently value.log (for the capture queue) or post- stat. • If the e-mail option is enabled. sys- tem or network problem. indicating that there is a potential data. if that option is enabled. This exceeds the threshold of [-c | -d value]. Actions taken by sp_qstatmon The sp_qstatmon script takes the following actions after each analysis of the queues: • The following notice is printed in the capstat. . This gives you time to correct the problem before the queues exceed their allocated space on the filesystem. Please assign write permission to that directory for sp_qstatmon. * A message typically is a SQL operation or an internal SharePlex operation. Please consult the release notes for future releases of SharePlex to determine if this capability has been added. see “Requirements for using the monitoring utilities” on page 341. • The sp_qstatmon utility creates some temp files in the directory where it resides. CHAPTER 9 353 Unattended SharePlex Monitoring Monitoring the queues with sp_qstatmon The sp_qstatmon utility monitors the status of the capture and post queues for mes- sage* backlogs. Requirements for running sp_qstatmon • Before you use the sp_qstatmon utility.log (for the post queue) and in the e-mail message. You can configure the script to alert you if the number of messages in a queue exceeds a defined threshold (limit). Defining the e-mail addresses 1 Open the sp_qstatmon script using any ASCII text editor. the subject text is: SharePlex [capture/post] queue backlog threshold exceeded! Note: The sp_qstatmon script does not support monitoring multiple (named) post queues. Please take cor- rective action.

omit this argument. . Without this variable. /dev/null This 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. -p port_number This sets the port number for the sp_cop you want to monitor. using different values for this argument. Without this parameter. & This runs the script in the background. 3 Save and close the file. Optional variables OPTIONAL VARIABLES DESCRIPTION . To have the output appear on screen. This value can be any positive integer. 12345678910@pageservice. as shown in the following example.com. sp_qstatmon defaults to 100 messages. You can monitor multiple instances of SharePlex by running the script for each one. -t n This sets the time interval between scans in seconds.com. This value can be any positive integer.0 Updated 8/19/13 2 Add the address strings after the MailUserName= variable. The sp_qstatmon component runs the script.c integer This sets the threshold value (limit) for the number of messages in the capture queue. -v path This sets the path to the SharePlex variable data directory for the instance of sp_cop that you want to monitor. Syntax for sp_qstatmon nohup sp_qstatmon -v path -t n -p port_number [-c integer] [-d integer] [-m] > /dev/null & Required components COMPONENT DESCRIPTION nohup sp_qstatmon The nohup command tells sp_qstatmon to continue running in the background if the user logs out.. sp_qstatmon fails and prints the following error message: Error. Separate multiple entries with a comma. 4 Enable e-mail notification by including the -m option in the script syntax..please enter a valid variable data directory path.354 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. This ensures continuous monitor- ing. You can specify as many addresses as you want. Use the full e-mail and/or pager address. scott@company.

sp_qstatmon does not send an e-mail. . CHAPTER 9 355 Unattended SharePlex Monitoring Optional variables (continued) OPTIONAL VARIABLES DESCRIPTION (continued) . Without this parame- ter. but only logs errors to the log file. -m This variable enables the e-mail/paging option. With- out this parameter.d integer This sets the threshold value (limit) for the messages in the post queue. The sp_qstatmon script sends notifications to all addresses coded in the script. This value can be any positive integer. sp_qstatmon defaults to 100 messages.

This section explains how to use the Sp_Nt_Mon utility to send e-mail notifications of key replication events.exe pro- cesses. • The volume of the capture and post queues. one or more SharePlex processes could stop as the result of a user command or an error. • The following messages in the Event Log: SharePlex was shutdown Activate config System call error Deactivate config Queue partition is full Bad config file Host is down sp_cop was shutdown Internal error Child process failed Out of sync Error Poster failure ORA-(error number) Parameter was changed . It sends alerts to one or more designated e-mail addresses to notify you of the following: • The status of the Capture. For example. Read. a system or the network could fail and cause data to accumulate in the queues.0 Updated 8/19/13 Part 2: Monitoring SharePlex on Windows systems SharePlex is designed to run reliably without supervision. but unforeseen situations can occur in any replication environment. • Latency between redo logs being processed by Oracle and by SharePlex. Post. Overview of Sp_Nt_Mon Sp_Nt_Mon runs in the background.356 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. Export. Import. and Sp_Copsrv. Or.

edit this file. select Programs. The sp_nt_mon. select the port number of the instance of SharePlex that you want to monitor.txt file is displayed in the default text editor (NotePad by default). then select SpClient from the SharePlex pro- grams group.txt file. CHAPTER 9 357 Unattended SharePlex Monitoring Configuring Sp_Nt_Mon Sp_Nt_Mon reads its input from the sp_nt_mon. To configure monitoring. click the SpMonitor button. . which resides in the data sub- directory of the SharePlex variable-data directory. 2 On the SpClient toolbar. SpMoni- tor 3 In the Port list box in the SharePlex Monitor dialog box.txt file 1 From the Start menu. then click Configure Monitor. To open the sp_nt_mon.

enter one or more e-mail addresses. # The name of the SMTP Server. Send Email alert: 1 4 On the SMTP Server Name line. if necessary. Export. separated by spaces.com OtherName@YourCompany. # Add the list of email addresses you wish to send alert messages to. Allow the line to wrap.358 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. The value of the Send Email alert line must be set to 1. Capture. enter the name of the SMTP server for the e-mail account. The entry name is HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432node\Quest Soft- ware\SharePlex Remote. making certain to precede all comment lines with a pound symbol (#) and end each one by pressing Enter. # Time interval for Sp_NT_Mon to check . separating each address with a space. SMTP Server Name: smtpserver. 1 = send email alerts.default = 60 seconds. Time Interval: 60 3 An e-mail address is required for Sp_Nt_Mon. If a process stops .0 = send no alerts via email. # Send email alerts . The default is every 60 seconds. Disabling e-mail notification with a value of 0 disables the script’s functionality.yourcompany.com 5 On the Email Address line.0 Updated 8/19/13 Tip: You can change the default text editor for SpClient in the Windows Registry. # Email Address: YourName@YourCompany. set the value to 1 to have Sp_Nt_Mon monitor the process. To change the default. set the value on the Time Interval line to the desired poll interval. Import. 2 Sp_Nt_Mon polls SharePlex at specified intervals. The only output is through e-mail. Post).com 6 For each line for the replication processes (Cop. To configure Sp_Nt_Mon 1 You can add comments to the file. Read.

This gives you enough time to add disk space or resolve any problems that are causing the backlog. # Processes to monitor . use the default of 0. Set this value to a number well below that which would result in a queue’s exceeding its disk space. 1 = monitor this process. Sp_Nt_Mon issues an alert. enter the number of messages* that you consider an alert threshold for backlogged mes- sages. 1 = Monitor Log Redo Log Monitor: 1 * A message typically is a SQL operation or an internal SharePlex operation.0 (zero) do not monitor. . To disable monitoring of a queue. This enables moni- toring of all supported Event Log messages. 1 = Monitor Event Log Monitor Event Log: 1 9 To monitor the latency between the redo log that Oracle is writing to. To disable Event Log monitoring. set the Redo Log Monitor field to 1. Post Threshold). # Monitor the Event Log . set the Monitor Event Log field to 1. # Queue Thresholds # # A threshold of 0 (Zero) means do not monitor this queue. If a queue’s backlog volume reaches this threshold.0 (zero) do not monitor. To disable monitoring of a process. use the default of 0. Cop: 1 Capture: 1 Read: 1 Export: 1 Import: 1 Post: 1 7 For each line for the replication queues (Capture Threshold. To disable redo log monitoring. Capture Threshold: 100000 Post Threshold: 100000 8 To monitor the Event Log. see page 34. and the log that SharePlex is processing. Sp_Nt_Mon issues an alert. use the default value of 0.0 = do not monitor. CHAPTER 9 359 Unattended SharePlex Monitoring for any reason. For more information about messages. use the default of 0. # Monitor Redo Logs .

# This parameter is optional. Sp_Nt_Mon continuously monitors SharePlex until it is shut down from SpCli- ent. Running Sp_Nt_Mon After you configure Sp_Nt_Mon. When Sp_Nt_Mon starts. specify a threshold value for the per- missible number of redo logs for Oracle to be ahead of SharePlex. Click here to configure the monitor parameters. To shut down Sp_Nt_Mon. or the Sp_Nt_Mon utility will exit with an error. use the Redo Threshold field to set the maximum permissible number of logs for Oracle to be ahead of SharePlex in processing. Redo Threshold: 3 11 From the File menu. .360 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. run it from the SpClient interface by selecting the port number of the instance of SharePlex that you want to monitor and then clicking Start. the Start button becomes a Stop button. The default is 2 logs.0 Updated 8/19/13 10 If you enabled redo log monitoring. # If Redo Log Monitor enabled. but you can set a value from 1 to the number of redo logs. click Stop. will default to 2 if not specified. 12 Keep the SharePlex Monitor dialog box open Important! Do not rename this file. click Save to save and close the file. FIGURE 22: The Sp_Nt_Mon Share- Plex Monitor: Click here to start or stop Sp_Nt_Mon.

Do not run this program. SharePlex does not provide an SNMP signal daemon (SNMP manager) to intercept the traps. Overview of the SharePlex SNMP agent SharePlex provides only agent support for SNMP. CHAPTER 9 361 Unattended SharePlex Monitoring Part 3: Using SNMP with SharePlex SharePlex provides agent support for Simple Network Management Protocol on all UNIX and Windows platforms supported by SharePlex replication. Note: The SNMP agent is named iwsnmptrap and is installed with SharePlex in the bin sub-directory of the SharePlex product directory. It only sends SNMP traps. Use the SharePlex SNMP feature only if you have a Network Management Station (NMS) to manage SNMP signals. . You can configure the SharePlex SNMP agent to send SNMP traps for any or all of the following SharePlex events: • SharePlex logic errors and errors that cause replication processes to stop • System-related errors encountered by SharePlex • Other SharePlex errors • Out-of-sync conditions • SharePlex startup • SharePlex shutdown • When a replication process starts • When a replication process stops The error text for the event is included in the trap and is the same error that appears in the Event Log.

Parameter Name Event Monitored SP_SLG_SNMP_INT_ERROR SharePlex logic errors and errors that cause processes to exit .362 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. Some are required and others are optional. Parameter Name Set value to SP_SLG_SNMP_HOST The name of the system (host) to which the traps will be sent SP_SLG_SNMP_COMMUNITY The community to which the traps will be sent 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 Configuring the traps The following parameters encompass all of the replication events for which you can configure SharePlex to send SNMP traps. All changes take effect after you re-start sp_cop.0 Updated 8/19/13 Configuring SNMP monitoring To enable SNMP support for SharePlex. By default. the parameter is set to 0. set the following required parameters. You can enable any or all trap parame- ters. set this parameter to 1. To enable SNMP support. Configuring the agent To configure the agent to communicate with the NMS. They all are flags. set the following parameters. Enabling SNMP monitoring SNMP monitoring of SharePlex replication is controlled by the SP_SLG_SNMP_ACTIVE parameter. A setting of 1 enables it (SharePlex sends a trap). Each parameter must have a value if the SP_SLG_SNMP_ACTIVE param- eter is enabled. A setting of 0 disables the parameter’s functionality (meaning that SharePlex does not send a trap for the event). which dis- ables SNMP support.

CHAPTER 9 363
Unattended SharePlex Monitoring

Parameter Name Event Monitored
SP_SLG_SNMP_SYS_ERROR System-related errors encountered by Share-
Plex
SP_SLG_SNMP_ERROR Other SharePlex errors
SP_SLG_SNMP_OUT_OF_SYNC When replication is out of synchronization
SP_SLG_SNMP_STARTUP When SharePlex starts up
SP_SLG_SNMP_SHUTDOWN When SharePlex shuts down
SP_SLG_SNMP_LAUNCH When a SharePlex process starts
SP_SLG_SNMP_EXIT When a SharePlex process stops

To set the parameters
1 From the bin sub-directory of the SharePlex product directory, run sp_ctrl.

2 In sp_ctrl, use the following syntax to set each parameter.
sp_ctrl> set param [paramname] [value]

3 Re-start the sp_cop process.

364 SHAREPLEX® FOR ORACLE
Administrator’s Guide Version 8.0 Updated 8/19/13

10
Changing Oracle Characteristics Of
Replicated Objects

To change Oracle characteristics of objects in an active configuration, there are special
procedures to follow in view of the fact that SharePlex is continuously replicating data
that you want to keep synchronized. This chapter provides guidelines for performing
those operations.

Important! These procedures must be performed by an experienced SharePlex user
who is familiar with the software’s functionality and commands.

Contents

Performing DDL changes to replicating objects
Making other Oracle changes

366 SHAREPLEX® FOR ORACLE
Administrator’s Guide Version 8.0 Updated 8/19/13

Part 1: Performing DDL changes to replicating
objects

SharePlex replicates some, but not all, DDL operations. For a list of DDL operations
that SharePlex does and does not support, plus exclusions and restrictions, see “What
SharePlex replicates” on page 76.
Supported DDL operations can be made without reactivating the configuration or stop-
ping user access to objects, and without repeating the changes on the target system.
SharePlex performs the replicated DDL on the target system, and no special procedures
are required.
This part of the chapter contains procedures for making DDL changes that are not sup-
ported by SharePlex replication. Follow these procedures to prevent errors that can
cause data to go out of synchronization. For some procedures, you will need to reacti-
vate the configuration. The procedures are organized in alphabetical order according to
the Oracle commands to which they apply. For all other DDL commands, see the
generic procedure “Making other non-replicated DDL changes” on page 367.

Important! TRUNCATE is supported by SharePlex replication. To prevent errors, disable
foreign key constraints in other tables that relate to the table being truncated before issu-
ing the TRUNCATE statement. SharePlex references the foreign keys on those tables
and returns an error message if it cannot find them.

CREATE TABLE
If you are using Oracle wildcards and the table that you are adding is covered by the Oracle wild-
card specification in the configuration file, it is not necessary to add the table to the config file as
described below. When the config file is reactivated, any new objects that match the criteria are
added into replication. See page 137 for information on using Oracle wildcards.
Requires configuration reactivation
To add a table to the database and include it in an active configuration, follow these
steps.
1 Add the table to the source and target databases, and ensure that the data is synchro-
nized if the tables are populated. If you prefer, you can add the table to the configura-

CHAPTER 10 367
Changing Oracle Characteristics Of Replicated Objects

tion before you add it to the database, as instructed in the following steps, but the
table must exist in the database prior to activating the new configuration.

2 [PARTITIONED REPLICATION ONLY] If you are using vertically partitioned or horizontally par-
titioned replication for this table, delete unneeded columns and rows from the target
table as needed.

3 Run sp_ctrl.

4 Copy the active configuration, but do not deactivate it. Use the show config or list
config command if you are unsure of the name.
sp_ctrl(sysA)> copy config filename to newname

5 Edit the new configuration to add the new table’s owner and name, target table and
routing information.
sp_ctrl(sysA)> edit config newname

6 Save the new configuration file with the :wq command if using vi, or with Save on
the File menu if using WordPad.

7 Use default multi-threaded activation to activate the new configuration. You are
warned that this configuration deactivates the one that is active. Proceed with the
activation. The only table requiring analysis is the new one.
sp_ctrl(sysA)> activate config newname

Making other non-replicated DDL changes
Requires configuration reactivation
Perform all other non-replicated DDL changes manually on the source and target sys-
tems according to the following steps.
1 Stop access to the source Oracle instance (and all instances if using peer-to-peer rep-
lication).

2 On the source system, use the command below to flush the data from source to target
systems. For datasource, substitute o. followed by the source database’s
ORACLE_SID — for example o.oraA. This command stops the Post process and

368 SHAREPLEX® FOR ORACLE
Administrator’s Guide Version 8.0 Updated 8/19/13

places a marker in the data stream that establishes a synchronization point between
the source and target data.
sp_ctrl(sysA)> flush datasource

3 Using the lstatus command in sp_ctrl on the target system(s), verify that the post
queue for that datasource is empty on each system, and that the Post process has
stopped. The number of messages in the post queue should be 0.
sp_ctrl(sysB)> lstatus

4 When all of the data is posted and Post is stopped, make the DDL changes on the
source system.

5 Reactivate the configuration on the source system using default multi-threaded acti-
vation. This instructs SharePlex to rebuild its internal tables to incorporate the DDL
changes.
sp_ctrl(sysA)> activate config filename

6 Resume user activity on the source system. The replicated data accumulates in the
Post queues until Post is restarted.

7 While Post is stopped, make the same DDL changes on the target systems.

8 [HIGH AVAILABILITY AND PEER-TO-PEER REPLICATION ONLY] If you are using replication for high
availability or peer-to-peer replication, reactivate the configurations on all of the sec-
ondary systems.
sp_ctrl(sysA)> activate config filename

9 Start Post on all target systems. SharePlex resumes replication from where it
stopped, and the data remains synchronized.
sp_ctrl(sysB)> start post

CHAPTER 10 369
Changing Oracle Characteristics Of Replicated Objects

Part 2: Making other Oracle changes

This part of the chapter provides procedures for making other, non-DDL changes to the
database while replication is active.

Moving the location of ORACLE_HOME on UNIX systems
Changing the location of ORACLE_HOME requires re-linking SharePlex to the Oracle
libraries. Follow these steps.
1 Shut down SharePlex.
sp_ctrl> shutdown

2 Move the ORACLE_HOME.

3 Update the oratab file to the path for the new ORACLE_HOME.

4 Update the defaults.yaml file in the [proddir]/data directory with the path for the new
ORACLE _HOME.

5 Re-start SharePlex.

370 SHAREPLEX® FOR ORACLE
Administrator’s Guide Version 8.0 Updated 8/19/13

Changing the target ORACLE_SID
Changing the name of the target database (which changes the ORACLE_SID) requires a
configuration reactivation. Follow these steps.
1 Run sp_ctrl on the source system.

2 Copy the active configuration on the source system, but do not deactivate it. Use the
show config or list config command if you are unsure of the name.
sp_ctrl(sysA)> copy config filename to newname

3 Open the new configuration and change all routing maps for this target system to the
new ORACLE_SID. The routing map is the entry in the third column of each line
that looks like this: targetsystem@o.targetSID.
sp_ctrl(sysA)> edit config newname

4 Save the configuration (use :wq in vi or Save on the File menu in WordPad), but do
not reactivate it yet.

5 Stop user activity on the source tables involved in replication.

6 On the source system, use the following command to flush the data remaining in the
queues to the target database. For datasource, substitute o. followed by the source
database’s ORACLE_SID — for example o.oraA. This command stops the Post pro-
cess and establishes a synchronization point between the source and target databases.
sp_ctrl(sysA)> flush datasource

7 Activate the new configuration on the source system. You are warned that this con-
figuration deactivates the one that is active. Proceed with the activation. Because
SharePlex does not need to analyze the tables, the activation will be brief.
sp_ctrl(sysA)> activate config newname

8 Allow users to resume work on the source database.

9 On the target system, issue the status command to verify that Post stopped. If Post
still is running, continue to issue the status command until Post is stopped.
sp_ctrl(sysB)> status

10 After Post stops, shut down the target database and rename the ORACLE_SID.

CHAPTER 10 371
Changing Oracle Characteristics Of Replicated Objects

11 Start the Post process on the target system.
sp_ctrl(sysB)> start post

372 SHAREPLEX® FOR ORACLE
Administrator’s Guide Version 8.0 Updated 8/19/13

CHAPTER 10 373
Changing Oracle Characteristics Of Replicated Objects

374 SHAREPLEX® FOR ORACLE
Administrator’s Guide Version 8.0 Updated 8/19/13

CHAPTER 10 375
Changing Oracle Characteristics Of Replicated Objects

376 SHAREPLEX® FOR ORACLE
Administrator’s Guide Version 8.0 Updated 8/19/13

CHAPTER 10 377
Changing Oracle Characteristics Of Replicated Objects

378 SHAREPLEX® FOR ORACLE
Administrator’s Guide Version 8.0 Updated 8/19/13

11
Performing Administrative
Operations

Performing system and software maintenance on machines running SharePlex requires
special procedures in view of the fact that SharePlex is replicating data that you want to
keep synchronized. This chapter provides guidelines for performing those operations.

Important! These procedures must be performed by an experienced SharePlex user
who is familiar with the software’s functionality and commands.

Contents

Installing patches and upgrades
Migrating your Oracle database
Administering the SharePlex Oracle account
Changing the SharePlex user (or user and password) on UNIX systems
Running ora_setup on UNIX systems
Running OraSetup on Windows systems
Performing other administrative operations
Removing SharePlex from a UNIX system
Removing SharePlex from a Windows system

380 SHAREPLEX® FOR ORACLE
Administrator’s Guide Version 8.0 Updated 8/19/13

Part 1: Installing patches and upgrades

This part of the chapter contains instructions for the following:
• Installing application patches and upgrades on systems running SharePlex
• Installing OS and Oracle patches on systems running SharePlex
• Installing SharePlex upgrades
• Installing SharePlex patches
• Migrating your Oracle database

Installing application patches and upgrades on systems
running SharePlex
The content of an application patch or upgrade and its relationship to your replication
environment both determine how (or if) it needs to be applied on the target system, and
what you need to do afterward. Before you select a procedure to follow in this section,
review “Determining how to apply a patch or upgrade” and “Applying patches or
upgrades when using partitioned replication” on page 382 before you select a procedure
to follow.

Determining how to apply a patch or upgrade
There are different procedures for applying a patch or upgrade while replication is in
process. Which one to choose depends on whether or not your patch or upgrade includes
DML and/or DDL that affects the replicating objects. Refer to the following table to
determine which procedure to use.

. Makes DDL changes to tables using No action needed. Apply the patch/upgrade and dis- straints such as cascading deletes straints will be replicated by Share. stored procedures No action needed. 2 If you plan to use the target system for high availability.the tables on the target if you want figuration. then activate the edited con. able the triggers and constraints on Plex. Optional. because SharePlex does not use the object ID on the target. The changes are replicated. the configuration per procedure get to apply the DDL. The changes are replicated. because their actions will system. activate the configuration on the target system. No action needed on source the target. target.. to replicate to them.. Reactivate the configuration per Applying the patch/upgrade to the cess) which uses a temporary table procedure instructions so that target is optional.2 cated by SharePlex1 instructions so that SharePlex can analyze the changes. SharePlex1 1 For a list of DDL that SharePlex replicates.2 Creates or modifies triggers or con.2 Adds new tables Edit the configuration to add the Perform the patch/upgrade to add tables. too. Changes users and security on No action needed. USE PROCEDURE C Source System Target System if patch/upgrade does any of Instructions Instructions these things ONLY. Does a table reorg (or other pro. position in the database object ID(s). Optional. You can apply the patch/ and/or packages to source system upgrade if desired for high avail- ability. These changes Do not apply patch/upgrade on the are replicated to the target system.. already have been replicated by SharePlex. You can apply the patch/ source system upgrade if desired for high avail- ability. CHAPTER 11 381 Performing Administrative Operations Patch and upgrade procedure chart USE PROCEDURE A or B Source System Target System if patch/upgrade does ANY of Instructions Instructions these. Makes DDL changes to tables other Edit (if necessary) and reactivate Apply the patch/upgrade to the tar- than with DDL commands repli. target. see the Release Notes that correspond to your version of SharePlex.The effects of the triggers or con. Reorgs on target that is renamed into a permanent SharePlex can obtain the new tables do not affect replication. Makes DML changes to tables No action needed. Adds indices.. These changes Do not apply patch/upgrade on the DDL commands replicated by are replicated to the target system.

add those columns to the source and target column lists in the configuration file. add a column condi- tion for them in the SHAREPLEX_PARTITION table.) are changed. or will be. take into account the following as you follow the procedure you have selected based on the “Patch and upgrade procedure chart” on page 381. remove those columns from the source and target column lists in the configuration file. and they will be part of a column partition. . Horizontally partitioned replication • If rows are added. and those columns are part of a column partition. Vertically partitioned replication • If columns are added. but they are part of a column partition. • If column characteristics (name. See “Changing partitioned replication” on page 319 for more information. then stop user access to the table and reactivate the configuration. etc. size. update the source and target column lists (if names changed) in the configuration file and reactivate the configuration. • If columns are added. involved in partitioned replication. but they will not be part of a column partition. remove their column con- dition from the partition scheme in the SHAREPLEX_PARTITION table. if needed. • If columns are deleted. datatype.382 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. • If rows are deleted. then stop user access to the table and reactivate the configuration.0 Updated 8/19/13 Applying patches or upgrades when using partitioned replication If a table affected by a patch/upgrade is. and they are part of a partition scheme. then reactivate the con- figuration. then reactivate the configuration. and they will be part of a partition scheme. See “Changing partitioned replication” on page 319 for more information. drop those col- umns from the target table after the patch/upgrade is applied.

1 Stop access to the Oracle instance on all systems (source and target). sp_ctrl(sysA)> flush datasource 3 Deactivate the configuration on the source system. sp_ctrl(sysA)> deactivate config filename 4 You can follow either set of steps in the following table for the rest of the procedure. This command stops Post and places a marker in the data stream that estab- lishes a synchronization point between source and target data. . When you reactivate the configuration. 2 On the source system. You will deactivate the configuration so that SharePlex can rebuild its object information to incorporate the changes. The steps in the second column minimize production downtime. SharePlex will re-analyze all of the objects again. substitute o. For datasource in the following syntax. issue the flush command to flush the data to all target sys- tems. To avoid a deactivation. CHAPTER 11 383 Performing Administrative Operations Procedure A — deactivation and reactivation (requires quiet system) This procedure is the basic way to install an application patch or upgrade if it includes changes to the database that are not replicated by SharePlex.oraA. followed by the ORACLE_SID of the source instance — for example o. use Procedure B.

sql on the target systems or disable the triggers. For sp_ctrl(sysA)> activate config filename more information. see page 106. more information. tem.384 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. For 6 Start Post on the target systems.sql on the system. 3 If the patch/upgrade created or modified 3 Activate the configuration on the source triggers. 8 Start Post on the target systems. re-run sp_add_trigger. 4 Grant users access to the source instance. 2 [PARTITIONED REPLICATION ONLY] Make any 2 [PARTITIONED REPLICATION ONLY] Make any required configuration changes and delete required configuration changes as recom- columns and/or rows as recommended in mended in “Applying patches or upgrades “Applying patches or upgrades when using when using partitioned replication” on partitioned replication” on page 382. triggers. see page 106. 5 Apply the patch/upgrade on the target sys- sp_ctrl(sysA)> activate config filename tems. re-run sp_add_trigger. page 382. 4 Activate the configuration on the source system.0 Updated 8/19/13 Basic process Process that minimizes downtime 1 Apply the patch/upgrade on the source and 1 Apply the patch/upgrade on the source sys- target systems. sp_ctrl(sysB)> start post . sp_ctrl(sysB)> start post 7 [PARTITIONED REPLICATION ONLY] Perform all appropriate operations as recommended in “Applying patches or upgrades when using partitioned replication” on page 382. target systems or disable the triggers. 5 Grant users access to the source and target 6 If the patch/upgrade created or modified instances.

For datasource in the follow- ing syntax. 5 Allow users to resume activity on the source system. Note: It could be less time-consuming to apply a patch or upgrade manually to the target system. and run sp_ctrl. instead of using a hot backup. CHAPTER 11 385 Performing Administrative Operations Procedure B — Patches and upgrades with an Oracle hot backup (maintain an active database) You can use an Oracle hot backup to copy patches or upgrades from the source system to the target system without having to deactivate the configuration on the source system or stop user access. but do not shut down SharePlex. 2 Change to the bin sub-directory of the SharePlex product directory on the source system. but not all. This command stops Post and places a marker in the data stream that establishes a synchronization point between source and target data. .oraA. (SharePlex replicates some. issue the flush command to flush the data to the target sys- tem. You use the reconcile command to identify and eliminate the fol- lowing: • duplicate DML from the operation that was replicated but was also applied by the backup. substitute o. Examples of such situations are when the opera- tion only adds an index or stored procedures. followed by the ORACLE_SID of the source instance — for example o. DDL. Using this procedure instead of applying the Oracle operations directly on the target system is useful if the patch or upgrade makes extensive changes that are of the type(s) not supported by SharePlex replication. • duplicate DDL from those operations that was replicated but also applied by the backup. or when it only changes security. To prepare for the copy 1 Stop user access to the instances involved in replication on the source and target systems. sp_ctrl(sysA)> flush datasource 4 Apply the patch or upgrade on the source system. or if you are unsure of what it does. 3 On the source system.) • User (OLTP) transactions that were replicated but also applied by the backup.

using partitioned replication” on page 382 for more information. 1 Switch log files on the source system and make a note of the highest archive-log sequence number. Or... sp_ctrl(sysA)> activate config file- name Affected objects for which you are See “Applying patches or upgrades when using partitioned replication. vate the configuration that is active... do any of the following that applies to the results of the patch or upgrade: If the patch did this. 4 Activate the new configuration. sp_ctrl(sysA)> activate config file- Used a temporary table that was name renamed to a table in the database. To make the copy To make the copy on the source system.. Do not deacti- (unless supported DDL was used). Do the following. Changed the structure of a table Reactivate the configuration. cated.0 Updated 8/19/13 6 On the source system. 1 Copy the configuration. such as a reorganization. .. Added objects that must be repli. which changes the object ID. use an Oracle hot backup. sp_ctrl(sysA)> edit config newname 3 Save the configuration by using :wq if using vi or by selecting Save from the File menu if using WordPad. svrmgrl> alter system switch logfile. sp_ctrl(sysA)> copy config filename to newname 2 Edit the new configuration to add the objects.386 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8.

but do not create a new user. 6 Disable or modify the following on the target system according to your replication strategy: • triggers • foreign key constraints • cascading delete constraints • check constraints • scheduled jobs that perform DML 7 [PARTITIONED REPLICATION ONLY] If you are using horizontally partitioned or vertically par- titioned replication. datasource- datadest is o. 5 On the target system. and sequence_number is the sequence number of the log after which you cancelled the recovery of the target database. you can leave SharePlex running when you run ora_setup. delete unneeded columns and rows from the target tables as necessary. CHAPTER 11 387 Performing Administrative Operations 2 Recover the target database from the hot backup using the UNTIL CANCEL option in the RECOVER clause. using one of the following options where queuename is the name of the post queue. the reconcile syntax would be: sp_ctrl(sysB)> reconcile queue SysA for o. . Choose the existing SharePlex user and password (copied in the backup) by choosing n when prompted Would you like to create a new SharePlex user. issue the reconcile command for each post queue.oraA-o. sp_ctrl(sysB)> reconcile queue queuename for datasource-datadest seq sequence_number For example. For this procedure.sourceSID-o. and cancel the recovery after Oracle has fully applied the log that you recorded in the previous step. and then the sp_ctrl prompt returns.targetSID. 3 Open the database with the RESETLOGS option. To prepare the target instance 4 Run ora_setup on the target instance. if you are replicating from instance oraA on SysA to oraA on SysB. Issue the qsta- tus command if you are unsure of the queue name.oraA [seq 1234] The reconcile process retains control of sp_ctrl until it is finished. See page 407 for instruc- tions for running ora_setup.

sp_ctrl(sysB)> start post 7 Allow users to access the target instance. For more information. 2 On the source system.0 Updated 8/19/13 8 Start the Post process on the target system. 1 Stop access to the Oracle instances on all systems (source and target). followed by the ORACLE_SID of the source instance — for example o. see page 106. For datasource in the following syntax. • DDL changes replicated by SharePlex. For a list of DDL that SharePlex does and does not replicate. re-run sp_add_trigger. issue the flush command to flush the data to the target sys- tems. substitute o. 6 Start Post on each target system.oraA. because they will be replicated to the target table.sql on the target system or disable the triggers. Such patches or upgrades need only be applied to the source table.388 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. . Supported operations are the following: • DML changes. 5 If the patch or upgrade created or modified triggers. see the Release Notes that correspond to your version of Share- Plex. and SharePlex resumes replication. The changes are replicated to the target system. The two instances are now in synchroni- zation. 4 Allow users access to the source instance again. sp_ctrl(sysB)> start post Procedure C Use this procedure only if all of the operations applied by a patch or upgrade are sup- ported by SharePlex (replicated). This command stops Post and places a marker in the data stream that estab- lishes a synchronization point between source and target data. as required for your replication strategy. sp_ctrl(sysA)> flush datasource 3 Apply the patch or upgrade on the source system.

For more information. Downloading SharePlex . . After applying an Oracle patch. run sp_add_trigger. upgrades. Installing OS and Oracle patches on systems running SharePlex Before installing an operating system patch or an Oracle DBMS patch. Installing SharePlex patches Quest is committed to maintaining the SharePlex software to ensure peak performance and reliability. as appropriate for your replication strategy.tpm files that either can be downloaded from Support Link or installed using the product CD-ROM (patches are only available from Support Link).tpm files for installs. contact Quest Technical Support to determine if your version of SharePlex supports the new version of the operating system or Oracle database. If you do not have the Upgrade Guide. SharePlex is continually tested by the SharePlex Quality Assurance team and the development team. You will be provided with download instructions. contact Quest Technical Support. follow the upgrade instructions in the Upgrade Guide for the new version. and patches The installation files are self-extracting . Patches are issued when necessary in response to issues uncovered during internal testing or as a result of customer support calls. You might need to upgrade Oracle if your current version is not supported by the new version. if needed. An Oracle patch could create or modify triggers. To determine if there are any patches for your version of SharePlex. see page 106. CHAPTER 11 389 Performing Administrative Operations Installing SharePlex upgrades To upgrade SharePlex to a more recent version.sql on the target system or disable the triggers. contact Quest Technical Support.

• Migrating from Oracle 8i/9i to 10g/11g between different operating systems using Oracle export/import • Migrating from Oracle 8i/9i to 10g/11g between different operating systems using Oracle hot backup and activation • Migrating from Oracle 8i/9i to 10g/11g using Oracle export/import • Migrating from Oracle 8i/9i to 10g/11g using Oracle hot backup . as in Sun Solaris 2.6 to Solaris 2. • from one operating system to another. as in HP-UX to AIX. • from a lower version of an operating system to a higher version.390 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. The following migration procedures use either the Oracle hot backup procedure or the Oracle export/import utilities. as in moving from Oracle 8i to 10g/11g. The database can be moved • from a lower version of Oracle to a higher version.0 Updated 8/19/13 Migrating your Oracle database Migration refers to the act of moving your Oracle database from one location to another.9. either virtually or physically.

Refer to the SharePlex Installation and Demonstration Guide for instructions. 3 Install Shareplex. On TARGET machine 1 Install Oracle 10g/11g and create a 10g/11g database. while the next migration procedure use the Oracle hot backup procedure. following the instructions in the SharePlex Installation and Dem- onstration Guide. 8 Run ora_setup. 5 Stop Post. before return- ing to the target system to complete the procedure. Refer to your Oracle documen- tation for instructions. CHAPTER 11 391 Performing Administrative Operations Migrating from Oracle 9i to 10g/11g between different operating systems using Oracle export/import The following procedure can be used when you are migrating your Oracle database from one Oracle version to another between machines that are running different operat- ing systems. again following the procedure in the SharePlex Installation and Demonstration Guide. sp_ctrl(sysB)> shutdown On SOURCE machine 7 Install Shareplex on the source machine if it is not already installed. The procedure begins with a list of steps that you perform first on the target system. . Note that this procedure uses the Oracle export and import utilities. sp_ctrl(sysB)> stop post 6 In sp_ctrl on the target system. 2 Start the database. issue the shutdown command to shut down Share- Plex. Important! Do not run ora_setup now! 4 Start sp_cop and log on to sp_ctrl. you might have Sun Solaris as the source and AIX as the tar- get. followed by another list of steps that you perform on the source system. For example.

15 Start SharePlex.0 Updated 8/19/13 9 Stop user access to the source database by shutting it down and opening it in restricted mode. you need not shut down SharePlex when you run ora_setup. 17 Disable triggers on the tables. 19 Stop Export." In this case. sp_ctrl(sysA)> activate config filename 12 When activation is complete. and scheduled jobs that perform DML. sp_ctrl(sysB)> activate config filename 21 Start the Post process. 10 Start the Oracle export utility using option CONSISTENT=Y.392 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. or run the sp_add_trigger. On TARGET machine 13 Import the data using the export file from the source system.sql script to truncate all of the SharePlex internal tables. 16 Run the cleanup. The two instances are now in synchronization. 14 Run ora_setup on the database.sql utility script (found on page 427) so that the triggers ignore the SharePlex user. sp_ctrl(sysB)> stop export 20 Activate the configuration to ensure you can failover. 18 Disable cascading deletes. allow users to access the source database again. but do not create a new user. and SharePlex will continue replicating to maintain synchronization. Instruc- tions for running this script are on page 435. Choose the existing SharePlex user and password (copied in the backup) by choosing "n" when prompted "Would you like to create a new SharePlex user [y]. check constraints. 11 Activate a configuration using default multi-threaded activation. sp_ctrl(sysB)> Start post .

following the procedure in the SharePlex Installation Guide. On TARGET machine 1 Install Oracle 10g/11g and create a 10g/11g database. following the instructions in the SharePlex Installation and Dem- onstration Guide. 3 Install Shareplex. CHAPTER 11 393 Performing Administrative Operations Migrating from Oracle 9i to 10g/11g between different operating systems The following procedure should be used when you are migrating your Oracle database from one Oracle version to another between machines that are running different operat- ing systems. sp_ctrl(sysB)> stop post 6 In sp_ctrl on the target system issue the shutdown command to shut down Share- Plex. sp_ctrl(sysA)> activate config filename 10 Run the Oracle hot backup procedure on the source system. The intermediary server used during the migration should be running the same operating system as the source machine. 9 Activate a configuration on the source system. sp_ctrl(sysB)> shutdown On SOURCE machine 7 Install Shareplex on the source if it is not already installed. Refer to your Oracle documen- tation for instructions. you might have Sun Solaris as the source and AIX as the tar- get. 5 Stop Post. 2 Start the database. For example. Refer to the SharePlex Installation Guide for instructions. . 8 Run ora_setup. Important! Do not run ora_setup now! 4 Start sp_cop and log on to sp_ctrl.

issue the com- mand for each one.394 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. The reconcile process retains control of sp_ctrl until it is finished. or run the sp_add_trigger. If you are using named post queues. Choose the existing SharePlex user and password (copied in the backup) by choosing "n" when prompted "Would you like to create a new SharePlex user [y]. Issue the qstatus command if you are unsure of the queue name. but do not create a new user. and then the sp_ctrl prompt returns. and scheduled jobs that perform DML. 17 Run ora_setup on the database. Continue with step 12. check constraints. Instruc- tions for running this script are on page 435. and cancel the recovery after Oracle has fully applied the log. On an INTERMEDIARY server (should be same OS as source) 12 Install Oracle 9i. 14 Open the database with the RESETLOGS option. On TARGET machine 16 Import the data using the export file from the intermediary server. Substitute the sequence number of the log that you noted in step 18 (for Intermediary server). sp_ctrl(sysB)> reconcile queue queuename for datasource-datadest seq sequence_number 20 Run the cleanup.0 Updated 8/19/13 11 Switch log files on the source system and note the number of the new archive-log file.sql utility script (found on page 427) so that the triggers ignore the SharePlex user. 15 Run the Oracle export utility on the database. 22 Disable cascading deletes. 13 Recover the database from the hot backup using the UNTIL CANCEL option in the RECOVER clause. . 19 Issue the reconcile command." In this case. create the database. 21 Disable triggers on the tables. you need not shut down SharePlex when you run ora_setup.sql script to truncate all of the SharePlex internal tables. svrmgrl> alter system switch logfile. 18 Start SharePlex. and start it.

sp_ctrl(sysB)> stop export 24 Activate the configuration. CHAPTER 11 395 Performing Administrative Operations 23 Stop Export. and SharePlex will continue replicating to maintain synchronization. sp_ctrl(sysB)> activate config filename 25 Start the Post process. sp_ctrl(sysB)> Start post . The two instances are now in synchronization.

sp_ctrl(sysA)> activate config filename 12 Start the Oracle export utility using option CONSISTENT=Y. 13 Issue the flush command. following the procedure in the SharePlex Installation and Demon- stration Guide. 11 Activate a configuration using default multi-threaded activation. 10 Stop user access to the source database by shutting it down and opening it in restricted mode. sp_ctrl(sysB)> stop post 6 Stop Shareplex. 3 Install SharePlex.for example. 4 Start Shareplex. sp_ctrl(sysB)> flush o. Refer to your Oracle documentation for instructions. substitute o. For datasource in the following syntax. On SOURCE machine 7 Install Shareplex on the source system if it is not already installed.0 Updated 8/19/13 Migrating from Oracle 9i to 10g/11g using Oracle export/import This procedure can be used On TARGET machine 1 Install Oracle 9i (if not already installed). following the instructions in the SharePlex Installation and Dem- onstration Guide. 2 Install Oracle 10g/11g. followed by the ORACLE_SID of the primary instance . o. and then start it.396 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. 8 Run ora_setup. create the database. <datasource> .oraA. This command stops Post and places a marker in the data stream that establishes a synchronization point between source and target data. 9 Start sp_cop. Refer to the SharePlex Installation and Demonstration Guide for instructions. 5 Stop Post.

22 Disable cascading deletes. On TARGET machine 15 Import the data using the export file from the source system. or run the sp_add_trigger. sp_ctrl(sysB)> stop export 24 Activate the configuration to ensure you can failover. 16 Upgrade the Oracle 9i instance to 10g/11g. 19 Issue the reconcile command. 17 Run ora_setup on the database. Substitute the sequence number of the log that you noted in step 15. sp_ctrl(sysB)> reconcile queue queuename for datasource-datadest seq sequence_number 20 Run the cleanup. sp_ctrl(sysB)> activate config filename 25 Start the Post process. and then the sp_ctrl prompt returns. 21 Disable triggers on the tables. Choose the existing SharePlex user and password (copied in the backup) by choosing "n" when prompted "Would you like to create a new SharePlex user [y].sql utility script (found on page 427) so that the triggers ignore the SharePlex user. and SharePlex will continue replicating to maintain synchronization. check constraints. If you are using named post queues. 23 Stop Export. and scheduled jobs that perform DML. issue the com- mand for each one. CHAPTER 11 397 Performing Administrative Operations 14 When the flush process is complete. but do not create a new user. Issue the qstatus command if you are unsure of the queue name. The two instances are now in synchronization. 18 Start SharePlex. allow users to access the source database again. you need not shut down SharePlex when you run ora_setup." In this case. Use the upgrade procedure provided in your Oracle documentation. sp_ctrl(sysB)> start post . The reconcile process retains control of sp_ctrl until it is finished. Instruc- tions for running this script are on page 435.sql script to truncate all of the SharePlex internal tables.

0 Updated 8/19/13 .398 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8.

and a database backup taken on the source server is recovered on the target server. following the instructions in the SharePlex Installation and Dem- onstration Guide. sp_ctrl(sysA)> stop export 11 Activate a configuration on the source systemn. issue the shutdown command to shut down Share- Plex. 3 Install SharePlex. 8 Run ora_setup. sp_ctrl(sysA)> activate config filename . 10 Stop Export. again following the procedure in the SharePlex Installation and Demonstration Guide. Important! Do not run ora_setup now! 4 Start sp_cop and log on to sp_ctrl. On TARGET machine 1 Install Oracle 9i. sp_ctrl(sysB)> stop post 6 In sp_ctrl on the target system. 2 Install Oracle 10g/11g. Refer to the SharePlex Installation and Demonstration Guide for instructions. 9 Start sp_cop. CHAPTER 11 399 Performing Administrative Operations Migrating from Oracle 9i to 10g/11g using Oracle hot backup This procedure is used when operating systems and their versions remain the same on the source and target machines. sp_ctrl(sysB)> shutdown On SOURCE machine 7 Install Shareplex on the source system if it is not already installed. 5 Stop Post.

22 Disable cascading deletes. 19 Issue the reconcile command. Use the upgrade procedure pro- vided in your Oracle documentation. issue the com- mand for each one. On TARGET machine 14 Recover the database from the hot backup using the UNTIL CANCEL option in the RECOVER clause. but do not create a new user. and cancel the recovery after Oracle has fully applied the log. Issue the qstatus command if you are unsure of the queue name. or run the sp_add_trigger. svrmgrl> alter system switch logfile.400 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. you need not shut down SharePlex when you run ora_setup. sp_ctrl(sysB)> reconcile queue queuename for datasource-datadest seq sequence_number 20 Run the cleanup. Continue with step 14. sp_ctrl(sysB)> stop export . 17 Run ora_setup on the database.sql utility script (found on page 427) so that the triggers ignore the SharePlex user.0 Updated 8/19/13 12 Run the Oracle hot backup procedure on the source system. If you are using named post queues. 16 Upgrade the Oracle 9i instance to Oracle 10g/11g. Substitute the sequence number of the log that you noted in either step 7 or 11. respectively. Choose the existing SharePlex user and password (copied in the backup) by choosing "n" when prompted "Would you like to create a new SharePlex user [y]. and then the sp_ctrl prompt returns. and scheduled jobs that perform DML. 23 Stop Export. The reconcile process retains control of sp_ctrl until it is finished. 13 Switch log files on the source system and note the number of the new archive log file. Instruc- tions for running this script are on page 435. 21 Disable triggers on the tables. check constraints.sql script to truncate all of the SharePlex internal tables. 15 Open the database with the RESETLOGS option. 18 Start SharePlex." In this case.

which ensures that users can failover. The two instances are now in synchronization. and SharePlex will continue replicating to maintain synchronization. sp_ctrl(sysB)> activate config filename 25 Start the Post process. CHAPTER 11 401 Performing Administrative Operations 24 Activate the configuration. sp_ctrl(sysB)> start post .

use the following procedure to run the ora_chpwd utility. . SharePlex must be installed on the system and there must be an existing SharePlex user in the data- base. To change the SharePlex user (or user and password together) run ora_setup as instructed in “Changing the SharePlex user (or user and password) on UNIX systems” on page 406. To use ora_chpwd. Changing the password with ora_chpwd requires a non-root. Run ora_chpwd for each Oracle instance where you want to change the SharePlex pass- word. DBA privileged user. This utility changes the password of the SharePlex user account in Oracle and in the SharePlex paramdb file.0 Updated 8/19/13 Part 2: Administering the SharePlex Oracle account This part of the chapter contains instructions for the following: • Changing the SharePlex password on UNIX systems • Changing the SharePlex user (or user and password) on UNIX systems • Running ora_setup on UNIX systems • Running OraSetup on Windows systems Changing the SharePlex password on UNIX systems To change the password for the SharePlex Oracle user. Warning! The ora_chpwd utility changes only the Oracle password for SharePlex. All existing SharePlex objects in the instance remain intact and unchanged. Do not use it to create a new SharePlex user.402 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8.

If so. ORACLE_HOME directory. On HP-UX and IBM AIX machines On Sun Solaris machines $ cd /etc On the Solaris platform. a reply must be entered. a carriage return will choose the default given in brackets. In response to prompts. or press Enter to use the default of “Man- ager. or type the correct ORACLE_SID. If there is no default. Enter a valid password for the SYSTEM account. Please enter the SID where SharePlex is installed [np73]: 5 You are prompted for a password to connect to the database as SYSTEM. Ensure that a valid ORACLE_SID exists in the oratab file. we must connect to the database as SYSTEM. which will not echo [MANAGER]: connecting--This may take a few seconds. 3 Run ora_chpwd from its location in the bin sub-directory of the SharePlex product directory. the oratab $ more oratab file should be located in the var/ opt/oracle directory. Enter password for the SYSTEM account. This causes ora_setup to fail. . qa81 is the ORACLE_SID cate or remove any oratab file in and /qa/oracle/ora10/product is the the /etc directory. Press Enter to accept the default. 2 Shut down sp_cop on the source and target systems.” The password is not echoed. SharePlex reads the current SharePlex user’s envi- ronment and displays that user’s ORACLE_SID as the default. This program allows you to change the password of the SharePlex user account needed to run Oracle replication. CHAPTER 11 403 Performing Administrative Operations To run ora_chpwd 1 Verify the Oracle_SID by viewing the oratab file. $ /product_dir/bin/ora_chpwd 4 You are prompted for the ORACLE_SID of the instance for which you want to change the SharePlex password. Warning! Sometimes oratab files have an asterisk (*) symbol instead of an entry for the ORACLE_SID. In order to change the password for the SharePlex user account. but some- You will see a display similar to this: times there is an oratab file in the qa81:/qa/oracle/ora10/product /etc directory as well. relo- In this example.

You must enter the name of the existing SharePlex user. There is no default for this step. Warning: Password changed for SharePlex in Oracle Database. which must have a valid Oracle password format.. The utility displays the status of the change and then notifies you when the password has been successfully changed in Oracle and in the SharePlex paramdb file. ora_chpwd exits and displays the SQL statement it used and the Oracle error code. Re-type it exactly as you typed it before. Changing SharePlex parameter database. Re-enter password for SharePlex user: Note: Ora_chpwd permits five attempts to enter and confirm the new password. either because an incorrect Ora- cle format was used or for some other reason. The password is not echoed. You are returned to the UNIX prompt. Error making change in SharePlex parameter database. 6 You are prompted for the name of the existing SharePlex user. SharePlex reads the paramdb file to ensure that the name is valid. it prompts you to try again or quit the utility. the utility aborts. it exits and displays the following message. . 7 You are prompted for the new password. After five invalid attempts. SharePlex password change completed successfully chicago:judy: $ Problem solving tips for ora_chpwd • If SharePlex cannot change the password in Oracle.0 Updated 8/19/13 Note: You are allowed five attempts to enter a valid password. Enter new password for SharePlex user: 8 You are prompted to enter the new password again to confirm it. Enter the current username for SharePlex user: Note: Ora_chpwd permits five attempts to enter a valid user name. After five invalid names.. • If ora_chpwd successfully changes the password in Oracle but cannot change it in the paramdb. Type y at the prompt to keep trying or type n to quit. After five invalid pass- words.404 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. the utility aborts.

find out if the paramdb has been corrupted. The passwords in Oracle and the paramdb must be identical for replication to pro- ceed. CHAPTER 11 405 Performing Administrative Operations Verify that nobody deleted or moved the paramdb from the data sub-directory of the SharePlex variable-data directory or changed permissions for it. . And.

you will be instructed to shut down sp_cop. 2 After you run ora_setup. . start sp_cop as soon as you are finished running ora_setup. but before you start sp_cop again. To change the SharePlex user name in Oracle. To change the user when a configuration is not active If there is not an active configuration. SharePlex will resume replication when you start sp_cop again. Instructions for running ora_setup are on page 407. follow the procedure “Changing the SharePlex password on UNIX systems” on page 402. run ora_setup to create a new SharePlex user. copy the existing SharePlex database objects from the previous user’s schema into the new one. see page 36. To change the user when a configuration is active 1 During ora_setup. 3 To minimize the time that data capture is stopped while users are making transac- tions. follow the instructions for running ora_setup as though you were doing an initial Oracle setup for SharePlex.0 Updated 8/19/13 Changing the SharePlex user (or user and password) on UNIX systems Note: To change only the password for the SharePlex Oracle user.406 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. For a list of the SharePlex internal tables. Before you run ora_setup. read the following directions. Copy- ing the objects provides the new SharePlex user with the configuration data and other information needed to continue replication under the current configuration(s).

ksh shell: export ORACLE_SID=OracleSID of this instance csh shell: setenv ORACLE_SID OracleSID of this instance 5 [FOR CONFIGURATIONS USING MULTIPLE VARIABLE-DATA DIRECTORIES] Export the environment vari- able that points to the variable-data directory for the SharePlex instance for which you are running ora_setup. The oratab file is typically located in the /etc directory. You will need it for the setup process. export it by typing one of the following commands.) Warning! Sometimes oratab files have an asterisk (*) symbol instead of an entry for the ORACLE_SID. If there are multiple oratab files they should be identical or have different file names. however. 2 Log onto UNIX as a non-root user with DBA privileges. Ensure that the oratab file contains a valid ORACLE_SID. 4 Make a note of the ORACLE_SID. CHAPTER 11 407 Performing Administrative Operations Running ora_setup on UNIX systems To run ora_setup 1 Start the Oracle database instance. To set the ORACLE_SID as the default. as is the case for Sun Solaris platforms. and that can cause ora_setup to fail. 3 View the oratab file. If the oratab file is located in the var/opt/oracle directory ensure that no other version of this file exists in the /etc directory. and make certain that the values for ORACLE_SID and ORACLE_HOME directory paths are valid. if it is not already. ksh shell: export SP_SYS_VARDIR=/full pathname of variable-data directory csh shell: . it may be located in the var/opt/oracle directory. (The ora_setup process first looks in the /etc directory and then the var/opt/oracle directory.

run sp_ctrl and shut down sp_cop with the following com- mand. $ cd /product_dir/bin 7 If sp_cop is running. where alias_name is the TNS alias. you are also returned to the Create New User prompt. If this is not the first time that ora_setup is being run you may use the existing SharePlex Admin user or you may elect to use another existing SharePlex user. Note: You are allowed five attempts to enter a valid password for an existing user. for example manager@oraB. create a new SharePlex user. You will need the following information to complete the process: • ORACLE_SID • SYSTEM account password • SharePlex User name and password If this is the first time ora_setup is being run. If you quit. run the ora_setup program./ora_setup 9 Follow the prompts through the ora_setup process.0 Updated 8/19/13 setenv SP_SYS_VARDIR /full pathname of variable-data directory 6 Change directories to the bin sub-directory of the SharePlex product directory. After five invalid passwords. $ . $ . SharePlex will not be established as an Ora- cle user.408 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8./sp_ctrl sp_ctrl> shutdown 8 From the bin sub-directory of the SharePlex product directory. Enter y to create a new user or n to quit ora_setup. Default options are shown in brackets [ ]. . At any point. To choose the default. • DEFAULT tablespace for use by SharePlex • TEMPORARY tablespace for use by SharePlex • INDEX tablespace(s) for use by SharePlex • If you are running ASM. press Enter. SharePlex cannot be running when you run ora_setup. Note: Enter the SYSTEM account password appended with @alias_name. you can press Enter to return to the Create New User prompt.

to preserve the current replication environment copy the SharePlex objects from the existing SharePlex user’s schema to the new SharePlex user’s schema.sql script is documented on page 426. 10 When the ora_setup program completes the Oracle setup process it will exit with confirmation of a successful setup: Setup completed successfully The sp_change_trigger. When prompted for the SharePlex Oracle user specify the changed SharePlex Oracle user. . CHAPTER 11 409 Performing Administrative Operations Note: If you have an active configuration and you would like to change the SharePlex Oracle user.

run OraSetup for each variable-data directory.410 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. To run OraSetup 1 Start the Oracle database instance. If you have questions or concerns about these objects. • DEFAULT tablespace for use by SharePlex • TEMPORARY tablespace for use by SharePlex • INDEX tablespace(s) for use by SharePlex .0 Updated 8/19/13 Running OraSetup on Windows systems Requirements for OraSetup • Run OraSetup for each Oracle instance involved in SharePlex replication on all source and target systems. You will need the following information to complete the process: • SharePlex port number • ORACLE_SID • SYSTEM account password • SharePlex User name and password Note: If this is the first time OraSetup is being run. If this is not the first time that OraSetup is being run you may use the existing SharePlex user or you may elect to use another existing SharePlex user.2 or higher client must be installed on the system where you are running OraSetup. contact Quest Technical Support. • Do not alter the SharePlex internal objects.2. • Within a cluster.0. create a new SharePlex user. 2 Launch the SpUtils from the shortcut on the Windows desktop and select the Ora- Setup tab from the SharePlex Utilities dialog box. if it is not already. You do not need to run it on the other cluster nodes. run it on the primary node (the one to which the shared disk con- taining the variable-data directory is mounted) so that the SharePlex user and pass- word are registered in the SharePlex paramdb file. • For centralized reporting (consolidated replication) using separate variable-data directories. • The Oracle 9. 3 Follow the prompts through the OraSetup process.

After five invalid passwords. 4 When the OraSetup program completes the Oracle setup process it will display a confirmation of a successful setup: OraSetup Finished Successfully 5 Click OK to close the SharePlex Utilities dialog box. CHAPTER 11 411 Performing Administrative Operations • If you are running ASM on an ASM supported platform. you are also returned to the Create New User prompt. Note: If you have an active configuration and you would like to change the SharePlex Oracle user. At any point. to preserve the current replication environment copy the SharePlex objects from the existing SharePlex user’s schema to the new SharePlex user’s schema.sql script is documented on page 426. The sp_change_trigger. . Enter y to create a new user or n to quit OraSetup. SharePlex will not be established as an Ora- cle user. Note: You are allowed five attempts to enter a valid password for an existing user. When prompted for the SharePlex Oracle user specify the changed SharePlex Oracle user. If you quit. you can press Enter to return to the Create New User prompt.

copying the same data as you would on the source system. To perform a partial backup on the target system. sp_ctrl(sysB)> start post . substitute o. Post resumes posting data. to extract data or populate a data warehouse) while data is being replicated. you can perform the partial backup on the target system instead. This command stops the Post process and places a marker in the data stream that establishes a synchroniza- tion point between source and target data. flush the data to the target system. 4 Start the Post process on the target system. followed by the ORACLE_SID of the source Oracle instance. sp_ctrl(sysA)> flush datasource 3 Back up the data on the target system (which now matches the source data at the flush marker). follow these instructions. 1 Start sp_ctrl.0 Updated 8/19/13 Part 3: Performing other administrative operations This part of the chapter contains instructions for the following: • Performing system backups on systems running SharePlex • Removing SharePlex from a UNIX system • Removing SharePlex from a Windows system Performing system backups on systems running SharePlex Performing a partial backup of the source system To perform a partial back up of a source system (for example. 2 On the source system. For datasource in the following syntax.412 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8.

and to start it again after the backup. 9 Start sp_ctrl on the source system. 2 Start sp_ctrl on the source system. substitute o. you must shut down Share- Plex replication on that system. flush the data to the target system. followed by the ORACLE_SID of the source Oracle instance. To stop replication properly. sp_ctrl(sysA)> shutdown 5 Shut down the network and the Oracle instance on the source system. 1 Stop all system activity on the source system. This com- mand shuts down SharePlex on UNIX and Windows systems. For datasource in the following syntax. 10 Allow users to access the Oracle instance on the source system. This command stops the Post process and places a marker in the data stream that establishes a synchroniza- tion point between source and target data. sp_ctrl(sysA)> flush datasource 4 Shut down SharePlex on the source system using the following command. 11 Start Post on the target system. including SharePlex. 3 On the source system. which enables SharePlex to stop its replication processes in a normal manner. follow these instructions. 6 Perform the backup on the source system. sp_ctrl(sysB)> start post . CHAPTER 11 413 Performing Administrative Operations Performing a full backup on the source system To back up the entire source system. 8 Start sp_cop (UNIX) or the SharePlex service (Windows) on the source system. 7 Start the network and the Oracle instance on the source system.

or other Share- Plex database objects. This script does not remove the SharePlex internal tables. . 3 Use the following command to make certain that no other users are running Share- Plex and that there are no SharePlex processes running.0 Updated 8/19/13 Removing SharePlex from a UNIX system To remove SharePlex from a UNIX source or target system. use the following proce- dure. those files should be backed up. sp_ctrl(system:port)> shutdown When you have finished with this step. including user-created files such as configuration files. Installing a SharePlex upgrade or reinstalling the software without un-installing it pre- serves existing data files. see the Release Notes for the version you are installing to familiarize yourself with any special upgrade or installation requirements. shut them down or use the UNIX kill com- mand to terminate them. exit out of sp_ctrl. If there are any files you would like to keep. Use standard Oracle methods to remove those objects. including sp_cop.) 2 Shut down SharePlex using sp_ctrl.414 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. Use this procedure only if a system no longer will be used for replication or if you are directed to use it by Quest Technical Support or another documented procedure. their indices. conflict-resolution files. copied. Before you upgrade or re-install SharePlex. and hints files. # ps -ef | grep sp_ 4 If any SharePlex processes are running. Permissions errors may occur and the splex_remove script will not be able to find installation details if another user attempts to remove SharePlex using the splex_remove script. (The splex_remove script should be run by the user who installed SharePlex. or archived before starting the procedure. To run splex_remove 1 Log on as the user that installed SharePlex. Removing SharePlex This procedure removes the SharePlex product and variable-data directories.

. (The splex_remove script must be run from outside of the installation directories to pre- vent removal errors caused by trying to delete the current working directory. # /product_dir/install/splex_remove When the splex_remove process has is complete. the script will print the location of the removal log file to the screen. CHAPTER 11 415 Performing Administrative Operations 5 Run the splex_remove script from outside the SharePlex installation directory.

it reads install. The following components are removed by the automatic uninstall option of the unin- stall program for all instances of SharePlex (all SharePlex services on all ports). When you run the uninstall program to remove SharePlex. • The SharePlex product directory. . a file named install. • The SharePlex Registry entries. Files not removed by the uninstall program The uninstall program does not remove the following components. • Removing the SharePlex software and system files.416 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. This file contains a record of all files created on the system by the installation program. • Files that already existed on the system when the current version of SharePlex was installed.0 Updated 8/19/13 Removing SharePlex from a Windows system Overview of the removal process Removing SharePlex from a Windows system involves the following procedures. • Removing the MKS Toolkit (formerly known as NuTCRACKER) operating envi- ronment. • The SharePlex desktop icons. • The SharePlex menu items (except for the top-level Program Manager Group folder). Files removed by the uninstall program When SharePlex was installed.log was installed in the SharePlex product directory. The uninstall program also contains a custom uninstall option that enables you to selec- tively remove files. • Shutting down the SharePlex service. • Manually removing files that are not removed by the uninstaller. • Manually removing the SharePlex user and database objects.log to determine which files to remove.

2 In the Port list box. To remove the SharePlex software and system files 1 From Start menu. Such files can be removed manually after SharePlex is removed. 5 [FOR MULTIPLE SHAREPLEX SERVICES] While in the SharePlex Services dialog box. repeat steps 6 and 7 for all SharePlex services to remove their Registry keys. 1 Click the SharePlex Services tab. 9 Click Close to close the SharePlex Service dialog box. 7 Click Apply to remove the service’s key from the Registry.. The uninstall program does not remove this directory because there could be user-created files. 1 Double-click the SpUtils desktop icon. This is standard procedure for most Windows applications. The Current State field displays the status. that you want to keep for a future installation of SharePlex. click Stop.. To remove the SharePlex service Before you remove the SharePlex software from the system. 6 After the SharePlex service stops. select the port number for the SharePlex instance that you want to remove. repeat the preceding steps to stop each SharePlex service. • The SharePlex variable-data directory. click Programs. click Remove. 8 [FOR MULTIPLE SHAREPLEX SERVICES] While in the SharePlex Services dialog box. such as configuration files and custom parameter settings. delete it through the operating system. To remove this directory. 4 Click Apply to stop the service. . Or. then navigate to the SharePlex program folder and click Uninstall. follow these steps to stop and remove each SharePlex service on the system. CHAPTER 11 417 Performing Administrative Operations • Files created by SharePlex or a user in the product or variable-data directory after the current version of SharePlex was installed. 3 Under SharePlex Service Status.

Or.. select an uninstall option.. Use this option only if you must retain some files while deleting others. Or. 3 Click Next to continue.0 Updated 8/19/13 Use the Add/Remove Programs tool in the Windows Control Panel. Follow the remaining steps for the option that you selected. or Repair. . • Select Custom to selectively remove files... • Select Automatic to remove everything listed in “Files removed by the uninstall program” on page 416. This option might require the original SharePlex installation CD if the installation files are not avail- able. • Select Repair to re-install files or update Registry entries. You are prompted based on the uninstall option that you selected.418 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. either Auto- matic uninstall. Custom uninstall. 2 In the Select Uninstall Method dialog box. This is the recommended procedure because it is the clean- est way to remove SharePlex from the system.

CHAPTER 11 419 Performing Administrative Operations Automatic uninstall In the Perform Uninstall dialog box. or click Back to perform a custom uninstall. click Finish to complete the uninstall. The automatic uninstall finishes and exits. .

Remaining component types for which you can make selec- tions are: • Directories. • Select all of the files by clicking the Select All button. • INI files to remove..420 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. click Select None. 4 Click Next to continue. • To clear your selections and start selecting files over again. click it again. select the files that you want to remove by clicking them. • Registry keys to edit back to the way they were before SharePlex was installed. This has the same effect as if you had selected the Automatic uninstall option.. use the same procedure as before to select com- ponents to be removed. • Registry keys to remove. • Registry trees to remove. To deselect a file. Or. 5 For the next series of dialog boxes. • INI files to edit back to the way they were before SharePlex was installed.0 Updated 8/19/13 Custom uninstall • In the Select Private Files to Remove dialog box. .

or click Back to change any of your selections. then click Control Panel. click Settings. Repair In the Perform Repair dialog box. 5 Search the Registry to ensure that any “Mortice Kern Systems. The removal process finishes and exits. The repair function detects items need- ing repair and performs the repair automatically.” “MKS” and “Data Focus” entries from HKEY_LOCAL_MACHINE\Software are removed. highlight MKS Platform Components. 4 Click Change/Remove. To remove the MKS Toolkit operating environment 1 From the Start menu. 3 In the Add/Remove Programs dialog box. double-click Add/Remove Programs. click Finish. 2 In the Control Panel dialog box. 6 In the Perform Uninstall dialog box. click Finish to begin the uninstall process. CHAPTER 11 421 Performing Administrative Operations • Sub-systems to remove. remove them. If you locate any such entries. .

422 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. If you are not familiar with the Registry. . it will not reinstall unless these Registry entries are removed. Warning! Do not add. consult your System Administrator for assistance. change or remove Registry entries unless you are familiar with the functionality of the Registry and the Windows platform.0 Updated 8/19/13 Important! If you intend to reinstall SharePlex or MKS Toolkit. Errors when changing Registry settings can adversely affect the operation of the software or the system itself. use stan- dard Oracle methods for removing users and objects. See Oracle’s documentation for instructions if needed. To remove the SharePlex user and database objects To remove the SharePlex user and database objects from the Oracle instance.

Note: You might see programs in the SharePlex directories that appear to be utilities. Contents Preventing DML transactions from replicating with create_ignore. Use only the util- ities documented in this chapter.sql Debugging networking and/or firewall issues using the socket_test utility Restoring replication to an initial state with ora_cleansp Using the SharePlex license key utilities Using the SpUtils utility Using the SpClient remote-access utility . They are for use by Quest Technical Support and the develop- ment team. Do not run these programs. and others are only available on UNIX systems. 12 SharePlex Utilities This chapter explains how to use the SharePlex utilities.sql Using the SharePlex trigger scripts Viewing and manipulating queue files with qview Purging the variable-data directory with clean_vardir.sh Truncating the SharePlex tables with cleanup. Some utilities are available for both UNIX and Windows platforms. and they can adversely affect replication if used improperly.

including TRUNCATE. / GRANT EXECUTE ON SHAREPLEX_IGNORE_TRANS TO PUBLIC. run the create_ignore. To prevent DML from replicating.0).sql Supported platforms: UNIX and Windows Some SharePlex procedures for making DDL changes during active replication require preventing certain DML operations. QUE_SEQ_NO_2. The script executes the following PL/SQL: CREATE OR REPLACE PROCEDURE SHAREPLEX_IGNORE_TRANS AS TNUM NUMBER.0. You might encounter other reasons to prevent DML operations from being posted to a target database. generally internal Oracle operations.0. BEGIN INSERT INTO SHAREPLEX_TRANS (TRANS_NUM. When executed at the start of a transaction. so they render the procedure invalid. QUE_SEQ_NO_1. Thus.0 Updated 8/19/13 Preventing DML transactions from replicating with create_ignore.'DUMMY'. DELETE FROM SHAREPLEX_TRANS WHERE TRANS_NUM=-999 AND COMBO='DUMMY' AND OP_TYPE=0.424 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. the affected operations are not replicated. It does not cause SharePlex to skip DDL operations. OP_TYPE) VALUES (-999. the procedure makes the Capture process ignore DML operations that occur from the point of execution until the transac- tion is either committed or rolled back. To run create_ignore. which cre- ates a public procedure named SHAREPLEX_IGNORE_TRANS in the source data- base. from being replicated to the target system.sql utility script. • Only DML operations are affected by the SHAREPLEX_IGNORE_TRANS proce- dure.sql • Run the create_ignore. / . COMBO. • Run it as the SharePlex Oracle user so that procedure is created in the SharePlex schema.sql script from the util sub-directory in the SharePlex prod- uct directory. DDL operations are implicitly committed by Oracle. END.

replication of subsequent transactions resumes normally. If it is called in the middle of a transac- tion. 1 Log onto SQL*Plus as the SharePlex user. The Read process will retain unwanted cache information on those records indefinitely. CHAPTER 12 425 SharePlex Utilities To execute SHAREPLEX_IGNORE_TRANS Call SHAREPLEX_IGNORE_TRANS only at the beginning of a transaction contain- ing operations that you do not want replicated. $ sqlplus name/password 2 Execute the SHAREPLEX_IGNORE_TRANS procedure at the beginning of the transaction that you want to skip. They will be ignored by Capture. replicated operations preceding the start of the procedure will remain in the post queue indefinitely awaiting a COMMIT. make the changes to the database that you do not want replicated. The COMMIT will not arrive because Capture ignores all operations in the transaction after the procedure is called. . 3 In one transaction. SQL> execute SharePlex_schema. 4 After the COMMIT or ROLLBACK.SHAREPLEX_IGNORE_TRANS. because SharePlex does not release messages without one.

please be aware that the triggers will not fire when you execute DML as the shareplex user on source. If your applications use other triggers. If the trigger is employed on the target. They cannot be modified to support any other type of trigger. modify them for the SharePlex user separately. A SharePlex user created by ora_setup has this access. you must have access to both the SYS and DBA objects. In this configuration. If a trigger on the target object initiates those same DML changes. • The scripts operate on all objects in the Oracle instance. SharePlex will replicate the trigger action. • The scripts support row-level triggers only. essentially performing the same task as SharePlex rep- lication. • The scripts must be run for target objects. • The scripts reside in the util sub-directory of the SharePlex product directory. whether or not they are part of replication. Review the following points before you run the scripts. SharePlex will flag these rows as out of sync. If the change of data occurs on a table in replication. Note: If you choose to run this script on source objects.426 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. • The scripts should not be used if source and target objects are both on the same machine. For more information about the effects of triggers on replication. Triggers are used as part of the application to make changes to data. and therefore are replicated and posted to the target database by SharePlex. the user can disable triggers on target objects. it will cause out-of-sync errors. SharePlex provides three interactive scripts that you can run in SQL*Plus to manage triggers so that they do not interfere with replication.0 Updated 8/19/13 Using the SharePlex trigger scripts Supported platforms: UNIX and Windows DML changes caused by a trigger on a source object enter the redo log. . Do not run them on the source objects unless you are using peer-to-peer replication. Important! To run the scripts. see “Triggers” on page 106.

sql sp_change_trigger. It prompts for the current SharePlex user name and for the new user name. and SCOTT. such as for peer-to-peer and high-availability configurations.sql Use sp_remove_trigger. If you continue to use SharePlex to replicate to those tables without disabling the triggers. and then it modifies the triggers. It does not modify triggers belonging to SYS. CHAPTER 12 427 SharePlex Utilities sp_add_trigger.sql Use sp_add_trigger. when user != ‘SharePlex_username’ begin The script prompts for the SharePlex user name.sql. Syntax SQL> @absolute_pathname/sp_add_trigger. This script changes the triggers so that they ignore the SharePlex Oracle user associated with the Post process. Syntax SQL> @absolute_pathname/sp_change_trigger. SYSTEM. the triggers will fire when SharePlex posts data. Change the SharePlex user in Oracle before you run this script. but fire for all other users. see page 406. For instructions for changing the SharePlex user. It inserts the following WHEN clause into each trigger in the database.sql sp_remove_trigger.sql Use sp_change_trigger. and SharePlex will generate out-of-sync errors. Use this script if you no longer will be replicating to those tables.sql. It prompts for the SharePlex user name and then automatically removes the WHEN clause from all of the triggers.sql .sql to replace the name of the SharePlex user in the WHEN clause that was created with sp_add_trigger. Syntax SQL> @absolute_pathname/sp_remove_trigger.sql when you cannot disable triggers on target objects.sql to remove the WHEN clause created with sp_add_trigger.

.428 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. The qview utility is located in the bin sub-directory of the SharePlex product directory. for the capture queue. it can damage the replication environment and require resynchronization and reactivation. and the replica- tion process that reads it. there is only one Administrator user. The qview tools described here do not deactivate the configuration. it lists the Capture process and the Read process. On Windows. If this utility is not used properly. It is run from the UNIX or Windows command line. Other users with Administrator privileges can run qview if the SharePlex service is shut down. Other users. Using the list command in qview Use the list command to list all queues for all active configurations on a system.0 Updated 8/19/13 Viewing and manipulating queue files with qview Supported platforms: UNIX and Windows Through the qview utility. the replication process that writes to it. Use the following syntax on the command line: UNIX syntax qview list Windows syntax qview -rportnumber list The command lists each queue. whether or not they have Administrator privileges (members of Administrators group). cannot run qview. you can view queue names and remove old queue files. Running qview on Windows systems To run qview on the Windows platform while the SharePlex service is running. log onto the system as the Administrator user. Warning! Do not use qview for the first time without the assistance of Quest Technical Support. For example.

while preserving the ones containing data not yet committed to .ora920+sp_ordr+o.ora920 subqueues range from 2 to 6 WRITER +PI+elliot+sp_mport+0x0a01014e (10. suppose the datafiles were only partially full when the activity level dropped—half full. The following is an example of the qview list output.ora920 Read process READER +PX+elliot+sp_xport+0x0a01014e (10. The following queues exist: capture queue o. creating 100 subqueues in the post queue on the target system.ora920-o. SharePlex routinely writes replicated data from the subqueues to associated datafiles on disk as part of its checkpoint recovery system. The size in megabytes (MB) for the post queue in a qstatus display is the actual disk space that the datafiles occupy.1. • An export queue is designated with a +X. CHAPTER 12 429 SharePlex Utilities • A capture queue is designated with a +C. each approxi- mately corresponding to a user session on the source system. suppose there were 100 concurrent sessions on the source system.1. the higher the activity level on the source system. for example. each with a default size of 8 MB. The number of subqueues that exist at a given time on a target system reflects the peak activity on the source sys- tem since replication started.ora920 Capture process READER +PR+o. you can routinely eliminate obsolete subqueue files that were read-released.ora920+sp_ocap+o. • A post queue is designated with a +P.ora920 Post process Using the trim command in qview The SharePlex post queue actually consists of a number of subqueues. Consequently.78) Import process READER +PP+elliot+sp_opst_mt+o.ora920+C WRITER +PA+o.ora920-o.1.1. the more datafiles on disk. a datafile remains on the system even though the data was posted and read/released. Using the trim command in qview.ora920 Read process export queue elliot+X WRITER +PR+o.78) Export process post queue elliot+P+o. Each subqueue can have one or more datafiles associated with it. If the entire 8 MB file size is not consumed.ora920+sp_ordr+o. or 4 MB of 8 MB used—and thus were not deleted. And. For example. totalling 400 MB of disk space. The Post process uses the subqueues to establish Oracle sessions for the target instance. The post queue on that system would consist of 100 datafiles at 4 MB each.

ora920-o.ora920-o. To run the trim command SharePlex can remain running when the trim command is issued. as shown in the following example.ora920 (y/n) <n>? y . use the qview com- mand trimall described in the subsection that follows. The trim function affects the post queue. • If there are more than one post queue (named queues or replication from more than one source machine). 2 Change directories to the bin sub-directory on the target system. Stopping Import and Post prevents them from accessing the queues while the trim command is running. qview returns this error message: que_INUSE: Que is already open.ora920 (y/n) <n>? n Queue elliot+P+o. The trim command does not eliminate queue files for subqueues 0 or 1.0 Updated 8/19/13 the target database. because those are the most heavily used subqueues. 1 To ensure the integrity of the queues. Note: Run the trim command in qview on the target system only. 3 Enter the following command at the command prompt.430 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. UNIX syntax qview trim Windows syntax qview -rportnumber trim • If you are using basic replication with one post queue (no named queues or repli- cation from more than one source machine). Queue zac+P+o. the command executes and returns the command prompt. stop the Import and Post processes on the tar- get system. sp_ctrl(sysB)> stop import sp_ctrl(sysB)> stop post Note: If one or both of those processes is not stopped. qview prompts you to select the one you want the command to affect. You can only trim one queue at a time. To trim a large number of queues with one command.

752562-3(139) --. The qview utility prints the transaction id. Creating a full rollback message Users can create a full rollback message using the fullrb command in qview.ora920+sp_ocap+o. sp_ctrl(sysA)> stop capture 2 Launch the qview utility and execute the otrans command. qview will open the Capture queue.752700-2(14162) --.ora920+C user +PA+o. Using the transaction id from the otrans command. the DML type operation (if there is only one) and the object id modified (if there is only one). The following example describes how to execute a full rollback using the otrans cand fullrb ommands in qview: 1 Stop the Capture process.ora920 Full rollback record written to capture queue at 378744.752562-3(139) The resulting qview information should look similar to the following: Current queue o. id 1102 odr_magic 0x4f445235 . including the number of messages: vqiew> otrans 500000 The resulting qview information should look similar to the followig: Full rollback 8(7). qview returns this error message: que_NOEXIST: Queue does not exist.99999 Update operations on object id 466857 Open transaction 8(23).2001 Update operations (1000 backward operations) on object id 466857 3 Execute the fullrb command using the the transaction id from the otrans information above: vqiew> fullrb 8(7). write an out-of-band full rollback message to the Capture queue and then write commit. the num- ber of operations (records). and scans for the number of messages specified. CHAPTER 12 431 SharePlex Utilities Note: If you do not select a queue. Using the otrans command This command scans the Capture queue starting at the read release point.

432 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. sp_ctrl(sysA)> start capture . restart the Capture process.752562-3(139) odr_time 01/01/88 00:00:00 (0) 4 Using sp_ctrl.0 Updated 8/19/13 odr_op ODR_FULL_ROLLBACK (50) odr_trans 8(7).

• the contents of the dump and state sub-directories. 1 Shut down sp_cop. hint files. The clean_vardir. and using it improperly can result in replication problems and the need to resynchronize the data. the paramdb. It is an alternative to using ora_cleansp in situations where you do not want to truncate the SharePlex internal tables.sh script deactivates configurations.sql script (see page 435). • the log files in the log sub-directory.sh script removes the following: • the queue files in the rim sub-directory. Usually. and the oramsglist file.sh uses the vardir listed . To completely restore SharePlex to an initial state by removing the SharePlex files and truncating the SharePlex tables.sh procedure. use the cleanup. It deactivates the configuration. there is another alternative.sh script preserves user-created files such as configuration files. Tip: To truncate only the SharePlex tables without removing the files in the variable-data directory. To start replication after running clean_vardir. contact Quest Technical Support before running it for the first time.sh Run this script on UNIX systems only. CHAPTER 12 433 SharePlex Utilities Purging the variable-data directory with clean_vardir. The clean_vardir.sh Supported platforms: UNIX only The clean_vardir.sh. clean_vardir. • the contents of the statusdb file in the data sub-directory. If SP_SYS_VARDIR is not set. 2 Set the SP_SYS_VARDIR environment variable to point to the SharePlex variable- data directory. The clean_vardir. use ora_cleansp (see page 439). The Event log retains one entry reflecting the clean_vardir. you must activate a configuration. con- flict-resolution files. Unless a documented SharePlex procedure requires running this script. This utility rarely is appropriate in a production environment.sh script restores the variable-data directory to an initial state. To run clean_vardir.

Use the following syntax. 10gor 11g.0 Updated 8/19/13 in the proddir/data/defaults.sh cannot remove the . where Oracle_version is either 9i. . .434 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. Note: The utility might generate an error message stating that clean_vardir.yaml file. Run it as a SharePlex Administrator./save_SharePlex_version directory. You may manually remove this direc- tory./clean_vardir.sh from the bin sub-directory of the SharePlex product directory..sh Oracle_version 4 When the script is finished running.. To set the SP_SYS_VARDIR environment variable ksh shell: export SP_SYS_VARDIR= /full pathname of variable-data directory csh shell: setenv SP_SYS_VARDIR /full pathname of variable-data directory 3 Run clean_vardir. you are returned to the UNIX prompt. where the proddir is where the script was invoked from.

2 Run the cleanup. use the following command: $ cat SharePlex_variable_data_directory/data/paramdb | grep SP_ORD_OWNER. SQL> @absolute_pathname/cleanup.sh script (see page 433). CHAPTER 12 435 SharePlex Utilities Truncating the SharePlex tables with cleanup. password. Tip: To find out the name of the SharePlex account. there is another alternative.sql script is an alternative to using ora_cleansp when you want to retain replication data in the SharePlex variable-data directory. . which contains partition schemes that might be needed again.sql utility is a SQL script that truncates all of the SharePlex internal tables except the SHAREPLEX_PARTITION table.sql script in SQL*Plus. The first component is the ORACLE_SID (oraA in the example). It prompts you for the SharePlex user name and password. This utility rarely is appropriate in a production environment. or demonstration objects from the database. To run cleanup.sql Supported platforms: UNIX and Windows The cleanup.sql The script logs into SQL*Plus and truncates the SharePlex tables. The SharePlex tables belong to the SharePlex user. contact Quest Technical Support before running it for the first time. The cleanup. use ora_cleansp (see page 439). You will see a display similar to this: SP_ORD_OWNER_O. The second component is the Oracle account name (jdadd in the example). Usually. It does not remove the SharePlex Oracle user. there is a SharePlex Oracle user for each one. Make certain to run this script as the correct one. Tip: To remove only the SharePlex files in the variable-data directory. Using it improperly can result in replication problems and the need to resynchronize the data. Unless a documented SharePlex procedure requires running this script.oraA jdadd. To completely restore SharePlex to an initial state by removing the SharePlex files and truncating the SharePlex tables. If you are running multiple instances of sp_cop with multiple variable-data directories.sql 1 Log into Oracle as the SharePlex user. use the clean_vardir.

11 U 9000/800 1141089608 unlimited-user license Program executing as server. on the source machine. a pri- vate LAN and the public Internet..436 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8.11. Using the socket_test utility in a NAT configured environment Network Address Translation (NAT) enables a local-area network (LAN) to use one set of IP addresses for private internal traffic and another set of addresses for public exter- nal traffic. using the same host name. Running the socket_test utility The socket_test is designed to simulate the behavior of the Compare Server and the Compare Client.1... 1 Execute the socket_test utility. NAT acts as a bridge and an interpreter between the two networks. using the server option. and Compare/Repair. in the example that follows. from the source and target machines. The server will remain in a waiting state until the socket_test client connects to it. If the socket_test utility is successful there are no network or firewall issues to prevent the source and target from communicating. The user can also specify a specify port number in the command line..0 Updated 8/19/13 Debugging networking and/or firewall issues using the socket_test utility The socket_test utility was designed to debug networking and/or firewall issues for Import.0. e.version: 1. 10.146 and 57370 respectively.2 HP-UX irvqasuf B. socket_test . or a secure network and an insecure network.g. Determining if your system is using NAT Execute nslookup. Export. If the results reflect different values it is likely that the systems are working in a NAT con- figured environment. irvqasuf > socket_test server The socket_test server will display the host IP address and the port number. The socket_test utility is located in the utility sub-directory of the SharePlex product directory on UNIX and Linux systems. Thu Mar 9 19:58:22 2006 . This section explains how to use this utility in an environment configured with Network Address Translation.

totalRBytes=512.-x..1.1. SUCCESSFULLY read/write messages from server CE:ReadWriteCnt = 1. writeCnt=0. Server Host: 10.Sun-Fire-880 Program executing as client.. totalWBytes=0 -m.0.146 Server Port: 57370 rb(512):ReadWriteCnt = 0. readCnt=1. server host name: irvqasuf server IP: 10. readCnt=1.. writeCnt=0. readBytes=0.2 SunOS irvlabu01 5.0..0..Sun-Fire-880 Program executing as client.version: 1.version: 1..0.0. client host name: irvlabu01 client IP: 10..0.1.146 57370 If the socket test is successful the socket_test client will display the following mes- sage: socket_test . writeCnt=0. CHAPTER 12 437 SharePlex Utilities SP_SYS_HOST_NAME was not set.9 Generic_112233-12 sun4u sparc SUNW. readCnt=0. The user will need to provide the socket_test server network IP address (or if you are working in a NAT configured environment you will need to provide the NAT IP address of the source machine) and the port number issued by the socket_test server.10000000.-r..9 Generic_112233-12 sun4u sparc SUNW. Thu Mar 9 19:52:40 2006 SP_SYS_HOST_NAME was not set.0. Thu Mar 9 20:02:26 2006 SP_SYS_HOST_NAME was not set.0.. totalWBytes=0 Client completed successfully..0.0.2 SunOS irvlabu01 5..0.1.0.-s. If the you specified the port number use that port number instead. client host name: irvlabu01 client IP: 10.-l.-t.0. Thu Mar 9 19:52:40 2006 If the socket test is not successful the socket_test client will display the following: socket_test . using the client option.0.. irvlabu01 > socket_test client 10.0.... on the target machine. writeBytes=0re:ReadWriteCnt = 1.36 Client is try to connect to. totalRBytes=512..0. .36 Client is try to connect to.146 Port Number: 57370 2 Execute the socket_test utility. Thu Mar 9 19:52:40 2006 Program exiting.1..-o.0.

readCnt=0. totalWBytes=512 Server completed successfully. totalWBytes=512 SE:ReadWriteCnt = 1.438 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. totalRBytes=0. totalRBytes=0. totalRBytes=0.. writeCnt=1. In the event of an unsuccessful socket test or if an error occurs execute Ctrl-C on the source machine to exit out of the socket_test server.1. readCnt=0. Thu Mar 9 20:00:07 2006 Program exiting. writeCnt=0. Thu Mar 9 20:02:26 2006 3 If the socket test is successful the socket_test server on the source machine will append the following text to the text displayed in step 1 above: Connected to client WB(512):ReadWriteCnt = 0.146 Server Port: 57370 Error calling connect in connect_to_server Error 146: Connection refused Error 146 calling connect_to_server CE:ReadWriteCnt = 0. readCnt=0.0. writeCnt=1. readBytes=0.. writeCnt=0. . totalWBytes=0 Error in client. writeBytes=0 WE:ReadWriteCnt = 1. readCnt=0.0 Updated 8/19/13 Server Host: 10.. Thu Mar 9 20:00:07 2006 If the socket test is not successful the socket_test server will remain in a waiting state until the socket_test client connects to it.

• the contents of the statusdb file in the data sub-directory. . transformation files. you might be able to use the abort config or purge config command in sp_ctrl. This can be acceptable in a test or demonstration environ- ment. It does not remove the SharePlex Oracle user. ora_cleansp deactivates configurations. and the oramsglist file. Other alternatives to ora_cleansp • To stop activity for a configuration without truncating the SharePlex tables and restoring replication to an initial state. There are other alternatives to running ora_cleansp. the paramdb. conflict-resolution files. • the log files in the log sub-directory. ora_cleansp removes the following components from the SharePlex variable-data directory: • the queue files in the rim sub-directory. or demonstration objects. The Event log retains one entry reflecting the outcome of the ora_cleansp procedure. as follows: ora_cleansp first truncates all of the SharePlex internal tables. How ora_cleansp works ora_cleansp works in two stages to restore replication to an initial state. Unless a documented procedure or demonstration requires running ora_cleansp (OraCleanSp on Win- dows systems). After the tables are truncated. which contains partition schemes that might be needed again. but it rarely is appropriate in a production environment. CHAPTER 12 439 SharePlex Utilities Restoring replication to an initial state with ora_cleansp Supported platforms: UNIX and Windows The ora_cleansp utility removes the current replication state on a system. For more information about these commands. • the contents of the dump and state sub-directories. contact Quest Technical Support for assistance before running this utility for the first time. ora_cleansp preserves user-created files such as configuration files. including deactivating configurations. you must activate a configuration. hint files. password. To start replication after running ora_cleansp. except for the SHAREPLEX_PARTITION table.

Important! ora_cleansp must be run on all source and target systems to restore replica- tion to an initial state. sp_ctrl> shutdown 8 Verify that all SharePlex processes are stopped by using either the ps -ef | grep sp_ command on UNIX systems or Taskmgr from the SpUtil program on Windows sys- tems. . you can purge the files in the variable-data directory without truncating the SharePlex tables by running the clean_vardir. 5 [UNIX ONLY] Set the SP_SYS_VARDIR environment variable to point to the SharePlex variable-data directory.sql script (from the bin sub-directory of the product direc- tory on UNIX systems or the util sub-directory of the product directory on Windows systems). set SP_SYS_VARDIR for the variable-data directory that you want to restore. To verify if and when ora_cleansp was run on a system. you can run the cleanup. • On UNIX systems. • To truncate the SharePlex tables without purging files in the variable-data directory. 7 Shut down sp_cop.sh script from the bin sub-directory of the SharePlex product directory. ksh shell: $ export SP_SYS_VARDIR=/SharePlex_vardir_absolute_path csh shell: $ setenv SP_SYS_VARDIR /SharePlex_vardir_absolute_path 6 Run sp_ctrl from the bin sub-directory of the SharePlex product directory. Before running ora_cleansp 4 Log on as a SharePlex Administrator.440 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8.0 Updated 8/19/13 see the SharePlex Reference Manual. view the Event Log on that system. If you are running multiple instances of sp_cop using multi- ple variable-data directories.

2 View the Event Log after you run the utility to confirm its results. view the oratab file to determine the val- ues for ORACLE_HOME and ORACLE_SID for the instance./ora_cleansp SharePlex_username/SharePlex_password Tip: To find out the name of the SharePlex account. ksh shell: $ export ORACLE_HOME=[value from oratab file] $ export ORACLE_SID=[value from oratab file] csh shell: $ setenv ORACLE_HOME [value from oratab file] $ setenv ORACLE_SID [value from oratab file] 12 Run ora_cleansp using one of the following methods.bat program on Windows systems. 10 [UNIX ONLY] If you have not done so already. $ . You will see a display similar to this: SP_ORD_OWNER_O. Running ora_cleansp on a UNIX system 1 Change directories to the bin sub-directory of the SharePlex product directory (this must be the current working directory). and run ora_cleansp with the SharePlex Oracle user account and password. CHAPTER 12 441 SharePlex Utilities 9 Kill all orphan SharePlex processes by using either the kill -9 command on UNIX systems or the KillSharePlex. $ cd /etc $ more oratab 11 [UNIX ONLY] Set the ORACLE_HOME and ORACLE_SID environment variables. use the following command: $ cat SharePlex_variable_data_directory/data/paramdb | grep SP_ORD_OWNER. The first component after the dot is the ORACLE_SID (oraA in the example). The second component is the Oracle account name (jdadd in the example). When run as a different user. .oraA jdadd. ora_cleansp does not truncate the SharePlex tables. depending on the platform.

You can remove this directory. then double- click the SpUtils program icon... Running OraCleanSp on a Windows system 1 Double-click the SpUtils desktop shortcut. Navigate to the bin sub-directory of the SharePlex product directory./ save_SharePlex_version directory.. ..0 Updated 8/19/13 Note: The utility might generate an error message stating that it cannot remove the .442 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. Or.

type the name of the SharePlex Oracle user for the designated instance of SharePlex. 5 Click Clean to execute OraCleanSp. type the password for the SharePlex user. • In the User text box. • In the Password text box. enter the following information. CHAPTER 12 443 SharePlex Utilities 2 In the SharePlex Utilities dialog box. 3 In the Port list box. click the OraCleanSp tab. OraCleanSp must run as the SharePlex Oracle user. type the ORACLE_SID of the Oracle instance for which you are running OraCleanSp. 4 Under SharePlex User Info. Processing progress is displayed in the text box at the bottom of the dialog box. select the port number for the instance of SharePlex for which you are running OraCleanSp. . 6 Click Close to close the dialog box. • In the Oracle SID text box.

separate utilities are used for: • Adding a license key to a UNIX or Linux system. Each license pro- vided is specific for a particular host. UNIX and Linux systems On UNIX and Linux systems. Linux.x. . one utility handles all of the licensing functions for SharePlex. See page 447. • Generating a license key on a UNIX or Linux system • Viewing a license key on a UNIX or Linux system. SharePlex provides a utility named splex_add_key for adding license keys to existing SharePlex installations — such as when you are convert- ing from a demo license to a permanent one. but you cannot add licenses for non-clustered machines from one machine. Adding a license key to a UNIX or Linux system On UNIX and Linux systems.444 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. and Windows SharePlex licenses are issued for a machine ID number (CPU ID). The license utility must be run on each non-clustered replication system so that the license information is installed in the paramdb in the variable-data directory on each system. operating system. Existing customers will need to get a new license key before upgrading to SharePlex version 5. Important! You can use a SharePlex license utility on the primary node of a cluster to install licenses for all secondary nodes in the cluster because they all share one variable- data directory.0 Updated 8/19/13 Using the SharePlex license key utilities Supported platforms: UNIX. Overview of the license utilities SharePlex provides utilities for viewing and adding license keys and viewing a machine ID. and number of CPUs. Windows systems On Windows systems. There are different license utilities on UNIX and Windows platforms.

To run splex_add_key 1 In sp_ctrl. SharePlex License Utility 1) Read license key from file 2) Enter license key manually 3) Add license key for alternate host q) Quit License Utility Enter option: 3 Choose the appropriate option. paying attention to spaces and capitalization if you are entering it manually.4 for each machine. 5 Select the q option to exit the script. The splex_uname utility is located in the install sub-directory of the SharePlex product directory on UNIX and Linux systems. and press Enter. 2 for enter- ing it manually or 3 for adding a license key for an alternate host. the splex_uname utility collects the local machine infor- mation in order for Quest to generate a license key. Repeat steps 3 . Note: When adding a license key with splex_add_key. 6 Start SharePlex to begin or resume replication. and run the splex_add_key script. CHAPTER 12 445 SharePlex Utilities You can use splex_add_key to license one system. the string needs to contain the following before the actual license key: “SPLEXKEY=”. Generating a license key on a UNIX or Linux system On UNIX and Linux systems. the . you are asked to Enter Machine ID as many times as you like. Note: If you choose option 3. It displays the hostname of the local system. until you enter q to quit. 1 for reading the license key from a file. or you can use it to license multiple systems in a cluster. 4 Enter the license key. sp_ctrl> shutdown 2 Change directories to the install sub-directory of the SharePlex product directory. shut down SharePlex. The following choices are displayed.

the splex_get_key utility provides a convenient way to determine if a machine has a valid SharePlex license (such as if you are using a demo license and do not know its expiration date). It displays the customer name. and the number of CPUs on the local system. the operating system. To run splex_get_key To view a license number.UltraAX-i2 CPU Type = sparc9 CPU Speed = 500 Number of CPUs = 1 Viewing a license key on a UNIX or Linux system On UNIX and Linux systems. run splex_uname and a display similar to fol- lowing is shown: $ /splex/proddir/install/splex_uname Local system info: Host Name = irvspxu09 Host ID = 2198894273 (831076C1 HEX) Operating System = SunOS Machine model = SUNW. The splex_get_key utility is located in the install sub-directory of the SharePlex prod- uct directory on UNIX and Linux systems. CPU type. the product name.0 Updated 8/19/13 host ID. A display similar to following results: $ /splex/proddir/install/splex_get_key Customer Name = quest License Key = EANLCF3P56F8M1JB1K6RBJCBB6TBEP0 Product Name = SharePlex Oracle License type = demo key Expired on = 01/01/2008 12:00 AM . or to find out the actual license number itself.446 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. machine model. To run splex_uname To collect the local machine information. and. if the license is a demo license. run splex_get_key. the expiration date of the license. the license number for the local machine. CPU speed.

double-click the SpUtils shortcut. all licensing functions are performed through the SpUtils util- ity. then click Programs and navigate to SpUtils in the SharePlex programs group. click the SharePlex Services tab.. Click the Start button on the Windows taskbar. including viewing the machine ID for a system. Your user name must be assigned to the SharePlex Admin group. .. To run SpUtils 1 Log onto Windows as a SharePlex Administrator using your system password and user name. CHAPTER 12 447 SharePlex Utilities Licensing SharePlex on a Windows system On Windows platforms. 2 On the Windows desktop. 3 In the SharePlex Utilities dialog box. Or.

5 Under SharePlex Service Status.0 Updated 8/19/13 4 In the Port list box under SharePlex Services. click Stop.448 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. select the port number for the instance of SharePlex that you are licensing. then wait for the Current State field to display a message stating that the service stopped. .

and the Status text box at the bottom of the dialog box. Repeat this step for all secondary nodes in the cluster. 11 In the SharePlex Utilities dialog box. . either copy it from a file and use the Con- trol+v keys to paste it into the License Key text box. The key is case-sensitive. or enter it manually. CHAPTER 12 449 SharePlex Utilities 6 In the SharePlex Utilities dialog box. including spaces. select the correct port number. select the Add Alternate Host Id check box. click Start when you are ready to start SharePlex. 9 Information about the license is displayed in two places: the License Info box. 12 Under SharePlex Service Status. which tells you if the license key is a permanent key or a temporary one (expiration date is given) 10 [CLUSTERS ONLY—MUST BE PERFORMED ON THE PRIMARY NODE] To add a license for a secondary node of a cluster. which lists the information about the host machine. click the SharePlex Services tab. 7 If the port for the instance of SharePlex for which you are adding or viewing the license key is not displayed in the Port list box. click the License Key tab. To add a license key. 8 Click Add License. Click Ok. then select the machine ID from the CPU ID list box.

0 Updated 8/19/13 13 Click Close to close the SpUtils utility.450 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. .

Viewing the installation information from SpUtils Click the Information tab to view information about the system where SharePlex is installed and about the SharePlex version and environment. Or. then select Programs and navigate to SpUtils in the SharePlex programs group... The SharePlex Utilities dialog box appears. which enables you to start SharePlex and run select management utilities from one interface. To run SpUtils. . CHAPTER 12 451 SharePlex Utilities Using the SpUtils utility Supported platforms: Windows only On Windows systems. Click the Start button on the Windows taskbar. SharePlex provides the SpUtils utility. double-click the SpUtils shortcut on the Windows desktop.

Managing license keys from SpUtils Click the License Key tab to view. For more information about running OraCleanSp. add. You cannot terminate Share- Plex processes or set process priority through the regular Windows Task Manager because the NuTCRACKER environment controls the SharePlex processes. Terminating a process or setting priority from SpUtils Click the TaskMgr tab to run the Windows Task Manager with special privileges so that you can terminate SharePlex processes or set their priority. Running OraSetup from SpUtils Click the OraSetup tab to run the OraSetup utility. see page 444. or remove a SharePlex service (instance of SharePlex). see page 410. see the SharePlex Installation and Demonstration Guide. For more information about managing license keys. . see page 439. For more informa- tion about running OraSetup. which establishes an Oracle account for SharePlex and installs database objects necessary for replication. or change the SharePlex license key for an instance of SharePlex. see Chapter 3. and to view the machine ID number associated with the license key. stop. For more information about running SharePlex.452 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8.0 Updated 8/19/13 Controlling the SharePlex service from SpUtils Click the SharePlex Services tab to install. For more information about installing and removing the SharePlex service. start. which removes the current replication environment. Running OraCleanSp from SpUtils Click the OraCleanSp tab to run the OraCleanSp utility.

filtering out other processes on the system. CHAPTER 12 453 SharePlex Utilities The dialog box displays only the SharePlex processes. To terminate a process or set its priority. then select either End Process or Set Priority (shown below). right-click the process name in the dialog box. .

0 Updated 8/19/13 Using the SpClient remote-access utility Supported platforms: Windows only On Windows systems. . or you can install it as a stand-alone program on a machine that is not used for replication.454 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. SpClient runs on any Windows machine. It starts when the system starts. • The sp_client process is the user interface. which you can run from any machine whether or not SharePlex is installed there. SpClient has two components: • The sp_remote agent runs in the background as a service on machines where you are running SharePlex. you can use the SpClient utility instead of other remote-access programs (such as Terminal Server) to log onto any replication system from one central machine and perform the following SharePlex functions: • Control the SharePlex service • Run OraCleanSp • Run OraSetup • Run SplexAddKey • Run a special Task Manager with the correct privileges to kill SharePlex processes and change priority • Activate and configure the Sp_Nt_Mon monitoring utility SpClient is installed automatically when you install SharePlex.

start. SpOraSetup — to create or change the SharePlex Oracle user and set up the instance for SharePlex replication. For more infor- mation about using Sp_Nt_Mon to monitor replication. SpAddKey — to add a SharePlex license key to a machine and to find out the machine ID number. For more information about running OraCleanSp. SpMonitor — to configure and run the Sp_Nt_Mon monitoring script. FIGURE 23: The SpClient interface The SpClient buttons are. see “Monitoring SharePlex on . or stop the SharePlex service. OraCleanSp — to run OraCleanSp to restore replication to an initial state. These buttons are inactive until you log onto a system. CHAPTER 12 455 SharePlex Utilities The SpClient toolbar Figure 23 illustrates the SharePlex tool bar buttons. The other buttons are standard Windows buttons. see page 439. from left to right in Figure 23: Remote logon — to connect to a remote replication machine Local logon — to connect to the local machine Logoff — to end the current session of SpClient SpServices — to install. For more information about running OraSetup. see Chapter 3. SpTaskMngr — to open a SharePlex-filtered version of the Windows Task Manager to terminate SharePlex processes and set process priority. see the instructions on page 459. For more informa- tion about controlling the SharePlex service. remove. For more information. see page 410.

navigate to the SpClient shortcut in the SharePlex Programs folder. SpClient output window SpClient prints to screen every action it executes. Or. To save a session’s records. SpClient output does not enter the Event Log. • From the Start menu.. In addition. • Use Windows Explorer to navigate to the bin sub-directory of the SharePlex product directory.456 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. Running SpClient Use any standard Windows method to launch SpClient. the Access and Select menus let you perform the same tasks as the toolbar buttons. you can print the output or save it to a text file using standard Windows Print and Save commands from the File menu.. as shown in the following example.0 Updated 8/19/13 Windows systems” on page 356. SpClient menus SpClient includes standard Windows File. View and Help menus. . Edit. Whether to use the menu or the toolbar is a matter of personal preference. Double-click the SpClient program.

It uses the logon that you supplied when you logged onto Windows. depending on the location of the SharePlex instance you want to affect. When logon is verified. It verifies the logon in the output window. log onto either a remote sys- tem or the local system. Local Logon button SpClient does not request logon information for the local machine. CHAPTER 12 457 SharePlex Utilities Connecting with SpClient When you run SpClient. click the Local Logon button. To log onto a remote system 1 On the toolbar. click the Remote Logon button. it opens a blank client window containing a display area and a Windows menu bar and toolbar. To log onto the local system 1 On the toolbar. the other SpClient buttons on the toolbar become active (displayed in color instead of gray). To begin using SpClient. Remot e Logon .

enter the port number for SpClient on that machine. .You can either accept the default port number for SpClient (2101) or enter a different port number where SpClient was installed on that machine. enter the password for that user.458 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. • In the Port Number field. The sp_remote client must be installed on that system for the connection to succeed. Do not enter the port number for SharePlex. • In the Machine Name field. 2 In the Remote Access dialog box. enter the name of the replication system to which you want to connect. This user must be a member of the SharePlex Admin group on the remote machine. enter a valid Windows logon name. • In the Password field.0 Updated 8/19/13 The Remote Access dialog box appears. This is true for the system Administrator. as well as all other users. enter the following: • In the User Name field.

4 Click Done to close the dialog box. The other SpClient buttons on the toolbar are now active (displayed in color instead of gray). Logoff button Running the SpClient Task Manager The SpClient Task Manager provides a filtered view of the Windows Task Manager that displays only the SharePlex processes on the machine to which you connected. SpClient terminates the connection. click Connect. Logging off To log off from the local system or a remote system. The dis- play is continuously updated. . CHAPTER 12 459 SharePlex Utilities 3 To initiate the connection. but the SpClient interface remains active to enable logon to a different system. click the Logoff button on the tool- bar. SpClient displays the connection status at the bottom of the Remote Access dialog box.

SpTaskMngr button The SpClient Task Manager window appears. To display processes for other SharePlex port numbers. showing all SharePlex processes for the port number displayed in the list box. select the port number from the list box. . click the SpTaskMngr button.460 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8.0 Updated 8/19/13 1 On the toolbar.

right-click the process name. 3 [OPTIONAL] To change the priority of a SharePlex process. then click Set Priority and select a priority setting. right click the process name. 4 Click Exit to close the Task Manager and return to the SpClient interface. . then select End Process. CHAPTER 12 461 SharePlex Utilities 2 [OPTIONAL] To kill a SharePlex process.

462 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8.0 Updated 8/19/13 .

. Residing on the source system. cascading delete A constraint set on data that. when a DELETE operation is performed on a primary key column. replication ALTER TABLE A DDL command that changes a table’s structure. target system or target instance is down. capture queue A temporary data repository for raw Oracle data that SharePlex copies from the Oracle redo logs for replication. it copies the source data from the Oracle redo logs and places it into the cap- ture queue. used in disaster recovery and peer- to-peer replication. and other files stored in proprietary format. automatically initiates a DELETE operation on the row containing the related foreign key in a dependent table. it allows activity to continue on the source and lets transactions queue if the network. Instead. storage characteristics or other parameters. video clips.Glossary active-active See peer-to-peer replication. asynchronous Replication that does not require the source and target instances and network replication to be accessible at all times. Some examples of BLOBs are photographs. bi-directional Replication that goes in both directions: from the source to the target. This is a built-in Oracle datatype con- sisting of unstructured (not recognized by the database) binary data of up to 4 GB in length that is stored in the database. sound files. archive log A permanent record of all the transactions made against an Oracle instance. Some ALTER TABLE commands are replicated by Share- Plex. and replication then from the target back to the source. Capture process One of the major SharePlex processes. BLOB An acronym for Binary Large Object.

conflict resolution User-defined instructions that tell the Post process what action should be taken when the pre-image of data from the source system does not match the local data on the target system. This is a built-in Oracle datatype consisting of fixed or variable-width character data of up to 4 GB in length that is stored in the database. cold backup A physical backup of the database made after the database has been shut down. COMMIT An Oracle SQL command that makes a series of changes permanent. limiting its (integrity value or use. constraint) database A collection of datafiles and the software that manipulates it. column A field in a database record. This enables SharePlex to identify missing elements and request re-trans- mission. asynchronous transport of recovery system data by acknowledging the receipt of packets and monitoring their sequence. chained row A row in a table that is stored in more than one database block and therefore has several row pieces. An example of a CLOB is an unstructured XML document or an ASCII text file. CLOB An acronym for Character Large Object.0 Updated 8/19/13 cascading A multi-tiered replication strategy that uses an intermediary target system to replication pass replicated data on to remote target system(s) that are not networked to the source system. checkpoint A process used by SharePlex to facilitate safe. consolidated Replication of different data from different machines to a single machine to replication provide a centralized reporting instance.464 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. configuration A file containing the specifications that tell SharePlex which objects to repli- cate. constraint A restriction imposed on a piece of data in an Oracle database. such as being greater than or equal to 0. . and to which target systems the replicated data should be sent. check constraint A constraint the ensures that the value of a piece of data meets a certain con- dition. These have a negative impact on the performance of the system and on the replication speed of SharePlex. Conflicts often occur in peer-to-peer envi- ronments where it is possible for different users to change the same data on different systems.

GLOSSARY 465 datasource The SharePlex term for the Oracle instance containing the objects being rep- licated by SharePlex for Oracle. The data dictionary is stored in the SYSTEM tablespace. destination Sometimes used synonymously with target system. data definition This is the SQL language used to define data in a database. such as dates. datatype One of the several kinds of data that can be stored and manipulated by Ora- cle. permissions. data manipulation This is the SQL language used to insert. update or delete data in a database. The data dictionary is central to database operations because it contains informa- tion about schemas. numbers or characters. column defaults. data warehousing Enterprise-wide data storage that encompasses current and archived data. and other information. language SharePlex replicates all DML. user information. This is the copy of the source data that SharePlex maintains in the target instance on the target sys- tem. SharePlex replicates some DDL. direct-path load Data loaded directly into a database in pre-formatted blocks instead of using INSERT statements. . This is also the term for the source UNIX filesystem in SharePlex FS software from Quest. data dictionary A read-only set of tables that provides information about the database. destination data Sometimes used synonymously with target data. disaster recovery The ability to continue computer operations after the primary computers and related hardware/software are disabled by unplanned outages such as a fire or earthquake. DDL See data definition language. downtime Planned or unplanned time when a computer is unavailable. data mart An alternative to data warehousing that stores only a subset of an organiza- tion’s data intended for use by an individual department or group of users. This is the system or sys- system tems containing the objects to which the replicated data is written by Share- Plex. storage. DML See data manipulation language. data distribution The process of sending data to remote offices. integrity constraints. such as when language creating and altering tables.

466 SHAREPLEX® FOR ORACLE
Administrator’s Guide Version 8.0 Updated 8/19/13

ERP Enterprise Resource Planning software. A group of business applications
such as Oracle Applications that work in concert with each other to manage
data consistently throughout an organization.

event A single incident in the SharePlex process, such as the startup of a process,
the execution of a command, or the establishment of a connection.

Event Log A log maintained by SharePlex that records all replication events, such as
the activation of a process or the issuing of a command, used primarily for
problem solving.

export/import The process used by Oracle to copy data between tables.

export queue A temporary data repository created by SharePlex which holds data that is
ready to be transported from a source system to the target system.

Export process One of the major SharePlex processes. Residing on the source system, it
sends replicated data from the source system to the target system over the
TCP/IP network.

fault tolerance The ability of a process to handle interruptions without adversely affecting
data or processing integrity.

file transfer A method of copying/moving data from one system to another.
protocol

foreign key The primary key of one table that is stored in another referenced table. It
establishes a relationship between the tables and allows users to access the
information in both tables quickly and efficiently.

FTP See file transfer protocol.

high availability The ability to continue normal operations despite the requirements to be
“down” for planned computer maintenance.

host Another term for an individual computer system.

horizontally Also known as selective row replication, this feature of SharePlex allows
partitioned you to replicate selected rows of a table, based on column conditions that
replication you define before configuration activation.

hot backup A physical backup of the database while the database is open and in
ARCHIVELOG mode.

hot standby An alternate online database that, when opened, is ready to take over for the
production database in the event of an emergency or planned downtime.

GLOSSARY 467

Import process One of the major SharePlex processes. Residing on the target system, it
receives the replicated data from the source system and places it in a post
queue for subsequent writing to disk.

index Created for a table to allow faster access to the table data by organizing and
referencing each row’s key; without an index, the entire table must be
scanned by Oracle and SharePlex. Adding an index greatly speeds replica-
tion processing.

instance A single manifestation of an Oracle database complete with datafiles, con-
nectivity information, shared area memory and its own name, number, and
parameters. Multiple instances can run on one computer using one installa-
tion of Oracle.

key definition SharePlex allows you to specify one or more columns to be used as a key
when a table does not have a unique or primary key. The key definition is
specified in the configuration file.

latency The difference in time between when the source data is changed and when
the target data reflects that change. SharePlex minimizes latency because it
replicates changes continuously, instead of waiting for a commit to be
issued.

load balancing The distribution of processing among multiple computers.

LOB Oracle acronym for Large Object. A LOB can be large graphics files, for-
matted text files, audio, video and other unstructured data of up to four GB
in size that is stored in a database. SharePlex replicates BLOB and CLOB
large objects. (See BLOB and CLOB.)

log-based The type of replication used by SharePlex that reads the online redo logs
replication instead of triggers.

log wrap The overwriting of the first Oracle redo log after the last one allocated to the
instance has filled up. This has important implications for SharePlex replica-
tion.

LONG columns A column in a table reserved for large chunks of data. LONG columns are
replicated by SharePlex, but tables containing LONG columns should have a
primary key for faster processing.

master database A database that contains a complete copy of the objects and is independent
of any other database in the replication hierarchy. This also is known as a
“production” or “source” database.

468 SHAREPLEX® FOR ORACLE
Administrator’s Guide Version 8.0 Updated 8/19/13

message A message is a packet of information that is sent from Capture to the other
replication processes in sequence. A message can reflect a SQL operation or
an internal SharePlex operation, but most of the time it is an INSERT,
UPDATE, DELETE, COMMIT, TRUNCATE or a supported DDL opera-
tion. Large operations like those on LONG or LOB columns can be spread
among more than one message because a message has a size limitation.
Other operations, such as array inserts of small records, have the inverse
effect: There could be one record for numerous operations. In general, unless
you are replicating numerous changes to LONGs and BLOBs, you can
assume that the number of messages that you see in a process or queue status
display approximately corresponds to the same number of SQL operations.

named queue A SharePlex queue other than the default queue created by SharePlex; a
named queue is created when a user defines it within the configuration file.

object A table, sequence or other entity within an Oracle database.

object cache An internal table maintained by SharePlex that maps an object ID to the
object name, creating a snapshot of all the objects that contains the name,
size and type of columns in each one, along with any constraints.

OLTP Online transaction processing, generally a high-intensity data processing
environment.

ORACLE_SID The system (server) identification name or number of the Oracle instance.

ORACLE_HOME The environment in which the Oracle software runs, including the location
of the software files.

ora_setup A program provided with SharePlex that sets up SharePlex as an Oracle user
during installation.

partitioned Selective replication of rows and/or columns; see horizontally partitioned
replication replication and vertically partitioned replication.

peer-to-peer Replication strategy where users on the source and one or more target sys-
replication tems all make changes concurrently to the same data while SharePlex repli-
cates it, using conflict resolution routines to determine how to handle
duplicity. This strategy is also known as “active-active,” “master-to-master”
or “multi-master” replication.

posting A SharePlex term for the process of writing replicated data to disk on the tar-
get system.

GLOSSARY 469

post queue A temporary data repository that receives replicated data from the Import
process on a target system and holds it until the Post process writes it to disk.

Post process One of the major SharePlex processes. Residing on the target system, it is
responsible for making sure source and target data match and writing
changes to the target instance.

pre-image A snapshot of the most recent source data values before the current block of
changes was made. Before applying those changes to the target instance, the
Post process compares the pre-image with the target data to ensure that the
values are the same. If the values are different, the data is out of sync.

primary key/ A column or set of columns containing unique identifying values for each
unique key row in a table, such as a customer ID number. Using a primary key on tables
increases the speed of SharePlex replication.

ps -ef | grep A UNIX command used for culling out selected information from the UNIX
filesystem.

query A request for information from a database.

queue An interim data repository created by SharePlex to store replicated data as it
is passed along its route from the source to the target system. There are three
queues: the capture and export queues on the source system, and the post
queue on the target system.

raw device A storage unit on a system that is devoid of operating system or application
software or formatting, used only for storing raw data.

Read process One of the major SharePlex processes. Residing on the source system, it
takes replicated raw data from the capture queue and prepares it for export to
the target system.

redo logs Temporary log files maintained by Oracle that record every user transaction
for recovery purposes and, if specified, are periodically written to permanent
archive logs. SharePlex reads the redo logs in order to replicate the data
specified in a configuration.

referential A property that guarantees that values in one column depend on values in
integrity another column.

replication The process of copying data from a source machine to a target machine for
backup, reporting or other purposes. SharePlex is a type of replication soft-
ware.

470 SHAREPLEX® FOR ORACLE
Administrator’s Guide Version 8.0 Updated 8/19/13

ROLLBACK The SQL statement that undoes all changes made to a database since the last
COMMIT statement.

rollback segments Internal Oracle safety devices that are used to reconstruct lost information in
the data recovery process. SharePlex uses the rollback segment to maintain a
snapshot of all current transactions.

routing map The information in a configuration that tells SharePlex where to send the
replicated data. The basic components of a routing map are the target
machine’s name and the ORACLE_SID of the target instance.

row All fields in one database record.

Row ID map An internal table that SharePlex maintains to keep track of chained rows in a
table.

SELECT An Oracle SQL command that retrieves information from a database.

sequence An Oracle function that provides a list of numbers in order.

SharePlex FS Software from Quest that replicates UNIX filesystems, allowing replication
of files outside of the Oracle instance for use in disaster recovery strategies.

source data The original, or master, data that is being replicated.

source system The machine on which the original (source) data to be replicated resides.

sp_cnc The SharePlex “command and control” program. This is the process that car-
ries out user commands.

sp_cop The SharePlex master control program. It runs in the background on both
source and target machines to establish and coordinate replication processes.

sp_ctrl The SharePlex command-line interface program through which users issue
commands to monitor and control replication.

SQL Structured Query Language, the standard for data access in most database
environments, and the language used by SharePlex in the replication pro-
cess.

SQL*Net A type of communications software that connects systems in a network to an
Oracle database.

SQL statement One or more SQL commands and qualifying clauses that tell Oracle exactly
what the user wants to do.

GLOSSARY 471

Status Database A record provided by SharePlex of key replication events, used primarily for
monitoring and problem solving purposes.

stored procedure Established rules and application logic for manipulating data which are
maintained as a group of SQL and PS/SQL code that resides within the data-
base instead of within the application on the client machine. This speeds up
Oracle processing and also allows repeat use of the code by other users and
applications.

synchronization The process of making target data identical to source data. SharePlex repli-
cation maintains synchronization between the source and all target systems
to provide an alternate instance for backup, recovery, reporting and other
purposes.

table A way of structuring data using sets of rows and columns.

tablespace The storage space allocated to a defined group of tables in the Oracle data-
base.

target data The copy of the source data that SharePlex maintains in the target instance
on the target system.

target system A system to which the original (source) data is replicated for reporting,
recovery or other purposes.

TCP/IP A network communication protocol used by SharePlex.

text editor A program that handles the input of programming statements or text entries
in files.

transformation This SharePlex feature allows you to manipulate replicated data instead of
posting it, using custom PL/SQL procedures. The procedure manipulates the
data and controls where the resultant data is posted.

trigger A program within the Oracle instance that initiates an action when an event
such as updating a record occurs.

TRUNCATE A SQL command that erases all the data from a table.

uni-directional Replication that goes in one direction only: from source to target system.
replication

vertically Also known as selective column replication, this feature of SharePlex allows
partitioned you to replicate selected columns of a table, as specified in the configuration
replication file.

472 SHAREPLEX® FOR ORACLE
Administrator’s Guide Version 8.0 Updated 8/19/13

views A representation of an existing table that can be used in the same manner as
a table but does not actually exist as an object with physical storage space. It
is a way for controlling the way a table can be seen by different users.

WHERE clause A clause within a SQL statement that refines the way a SQL command
affects data.

Appendix A
Third Party Licensing

SharePlex for Oracle contains the following third party components with copyright
acknowledgements and licensing statement requirements.

Copyright Acknowledgements
libstdc++
Licensed under the GNU General Public License with runtime exception version 2.0.
Copyright 1989, 1991 Free Software Foundation, Inc.
Source was not modified. A copy of the source can be found at http://rc.quest.com.
The original distribution license can be found via the libstdc++ home page at http://
www.quest.com/legal/third-party-licenses.aspx or by contacting Quest Software.

Ruby
Licensed under the Ruby License.
Copyright 2007 Yukihiro Matsumoto
Source was not modified. The original distribution can be found via the Ruby home
page at http://www.ruby-lang.org/en/ or contact Quest Software.

STEMKIT-CPP
Licensed under the MIT License.
http://sourceforge.net/projects/stemkit

Tecla
http://www.astro.caltech.edu/~mcs/tecla/
Copyright 2000 by Martin C. Shepherd.
All rights reserved.

474 SHAREPLEX® FOR ORACLE
Administrator’s Guide Version 8.0 Updated 8/19/13

Permission is hereby granted, free of charge, to any person obtaining a copy of this soft-
ware and associated documentation files (the "Software"), to deal in the Software with-
out restriction, including without limitation the rights to use, copy, modify, merge,
publish, distribute, and/or sell copies of the Software, and to permit persons to whom
the Software is furnished to do so, provided that the above copyright notice(s) and this
permission notice appear in all copies of the Software and that both the above copyright
notice(s) and this permission notice appear in supporting documentation.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WAR-
RANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE
AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN NO EVENT SHALL
THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS NOTICE BE
LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUEN-
TIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CON-
NECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
Except as contained in this notice, the name of a copyright holder shall not be used in
advertising or otherwise to promote the sale, use or other dealings in this Software with-
out prior written authorization of the copyright holder.

TSC-TPM
Licensed under the BSD License.
http://sourceforge.net/projects/tsc-tpm/

License Statements
GNU General Public License with runtime exception
http://gcc.gnu.org/onlinedocs/libstdc++/17_intro/COPYING
Version 2, June 1991
Copyright 1989, 1991 Free Software Foundation, Inc.
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies of this license document,
but changing it is not allowed.
Preamble

APPENDIX A 475
Third Party Licensing

The licenses for most software are designed to take away your freedom to share and
change it. By contrast, the GNU General Public License is intended to guarantee your
freedom to share and change free software--to make sure the software is free for all its
users. This General Public License applies to most of the Free Software Foundation's
software and to any other program whose authors commit to using it. (Some other Free
Software Foundation software is covered by the GNU Library General Public License
instead.) You can apply it to your programs, too.
When we speak of free software, we are referring to freedom, not price. Our General
Public Licenses are designed to make sure that you have the freedom to distribute cop-
ies of free software (and charge for this service if you wish), that you receive source
code or can get it if you want it, that you can change the software or use pieces of it in
new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid anyone to deny you these
rights or to ask you to surrender the rights. These restrictions translate to certain respon-
sibilities for you if you distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether gratis or for a fee, you
must give the recipients all the rights that you have. You must make sure that they, too,
receive or can get the source code. And you must show them these terms so they know
their rights.
We protect your rights with two steps: (1) copyright the software, and (2) offer you this
license which gives you legal permission to copy, distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain that everyone
understands that there is no warranty for this free software. If the software is modified
by someone else and passed on, we want its recipients to know that what they have is
not the original, so that any problems introduced by others will not reflect on the origi-
nal authors' reputations.
Finally, any free program is threatened constantly by software patents. We wish to avoid
the danger that redistributors of a free program will individually obtain patent licenses,
in effect making the program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and modification follow.

GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION
AND MODIFICATION
This License applies to any program or other work which contains a notice placed by
the copyright holder saying it may be distributed under the terms of this General Public
License. The “Program”, below, refers to any such program or work, and a “work based

your work based on the Program is not required to print an announcement. 1 You may copy and distribute verbatim copies of the Program's source code as you receive it. and give any other recipients of the Program a copy of this License along with the Pro- gram. in any medium. that in whole or in part contains or is derived from the Program or any part thereof.) Each licensee is addressed as “you”. If identifiable sections of that work are not derived from the Program. when started running for such interactive use in the most ordinary way. (Hereinafter. provided that you also meet all of these conditions: a You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. keep intact all the notices that refer to this License and to the absence of any warranty. 2 You may modify your copy or copies of the Program or any portion of it. they are outside its scope. either verbatim or with modifications and/or translated into another language. translation is included without limitation in the term “modification”. The act of running the Program is not restricted. thus form- ing a work based on the Program. and you may at your option offer warranty protection in exchange for a fee. Activities other than copying.476 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. and telling the user how to view a copy of this License.) These requirements apply to the modified work as a whole. Whether that is true depends on what the Program does. a work containing the Program or a portion of it. provided that you conspicuously and appropriately pub- lish on each copy an appropriate copyright notice and disclaimer of warranty. and can be reasonably considered inde- . (Exception: if the Pro- gram itself is interactive but does not normally print such an announcement. to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else. distribution and modification are not covered by this License. You may charge a fee for the physical act of transferring a copy. saying that you provide a warranty) and that users may redistribute the program under these conditions. you must cause it. c If the modified program normally reads commands interactively when run.0 Updated 8/19/13 on the Program” means either the Program or any derivative work under copyright law: that is to say. and copy and distribute such modifications or work under the terms of Section 1 above. and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). b You must cause any work that you distribute or publish. to be licensed as a whole at no charge to all third parties under the terms of this License.

then this License. 3 You may copy and distribute the Program (or a work based on it. it is not the intent of this section to claim rights or contest your rights to work written entirely by you. mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribu- tion medium does not bring the other work under the scope of this License. But when you distribute the same sections as part of a whole which is a work based on the Program. to give any third party. under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a Accompany it with the complete corresponding machine-readable source code. or.) The source code for a work means the preferred form of the work for making modifi- cations to it. do not apply to those sections when you distribute them as separate works. b Accompany it with a written offer. the intent is to exercise the right to control the distri- bution of derivative or collective works based on the Program. the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler. then offering equivalent access to copy the source code from the . In addition. complete source code means all the source code for all modules it contains. for a charge no more than your cost of physically performing source distri- bution. valid for at least three years. For an executable work. as a special exception. to be distributed under the terms of Sections 1 and 2 above on a medium customar- ily used for software interchange. c Accompany it with the information you received as to the offer to distribute cor- responding source code. the distribution of the whole must be on the terms of this License. and thus to each and every part regard- less of who wrote it. which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. However. rather. unless that component itself accompanies the executable. Thus. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer. plus the scripts used to control compilation and installation of the executable. a complete machine-readable copy of the corresponding source code. APPENDIX A 477 Third Party Licensing pendent and separate works in themselves. or. whose permissions for other licensees extend to the entire whole. and its terms. kernel. and so on) of the operating system on which the executable runs. plus any associated interface definition files. in accord with Subsection b above. If distribution of executable or object code is made by offering access to copy from a designated place.

If you can- not distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations. parties who have received copies. if a patent license would not permit royalty-free redis- tribution of the Program by all those who receive copies directly or indirectly through you. 5 You are not required to accept this License. and will automatically terminate your rights under this License. even though third parties are not compelled to copy the source along with the object code. and all its terms and conditions for copying. you indicate your acceptance of this License to do so. Therefore. the recipient automatically receives a license from the original licensor to copy. modify. Any attempt otherwise to copy. nothing else grants you permission to modify or distribute the Program or its deriva- tive works.478 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. agreement or otherwise) that contradict the conditions of this License. For example. conditions are imposed on you (whether by court order. You are not responsible for enforcing compliance by third parties to this License. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims. You may not impose any further restrictions on the recipients' exercise of the rights granted herein.0 Updated 8/19/13 same place counts as distribution of the source code. they do not excuse you from the conditions of this License. the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues). Many people have made generous . by modifying or distributing the Program (or any work based on the Pro- gram). 7 If. However. These actions are prohibited by law if you do not accept this License. since you have not signed it. 4 You may not copy. sublicense. which is implemented by public license practices. If any portion of this section is held invalid or unenforceable under any particular circumstance. or distribute the Program except as expressly provided under this License. or rights. sublicense or distribute the Program is void. distributing or modifying the Program or works based on it. then as a consequence you may not distribute the Program at all. then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. However. modify. this section has the sole purpose of protecting the integrity of the free software distribution system. distrib- ute or modify the Program subject to these terms and conditions. 6 Each time you redistribute the Program (or any work based on the Program). from you under this License will not have their licenses terminated so long as such parties remain in full compliance.

it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. so that distribution is permitted only in or among coun- tries not thus excluded. write to the Free Software Foundation. you may choose any version ever published by the Free Software Foundation. this License incorporates the limitation as if written in the body of this License. 10 If you wish to incorporate parts of the Program into other free programs whose dis- tribution conditions are different. APPENDIX A 479 Third Party Licensing contributions to the wide range of software distributed through that system in reli- ance on consistent application of that system. TO THE EXTENT PERMITTED BY APPLICABLE LAW. If the Program specifies a version number of this License which applies to it and “any later version”. If the Program does not specify a version number of this License. we sometimes make exceptions for this. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PRO- GRAM “AS IS” WITHOUT WARRANTY OF ANY KIND. NO WARRANTY 11 BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE. the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries. Such new versions will be similar in spirit to the present version. Each version is given a distinguishing version number. For soft- ware which is copyrighted by the Free Software Foundation. 8 If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces. 9 The Free Software Foundation may publish revised and/or new versions of the Gen- eral Public License from time to time. THERE IS NO WARRANTY FOR THE PROGRAM. THE IMPLIED WARRAN- TIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PUR- POSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF . This section is intended to make thoroughly clear what is believed to be a conse- quence of the rest of this License. you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. but may differ in detail to address new problems or concerns. BUT NOT LIMITED TO. INCLUDING. write to the author to ask for permission. EITHER EXPRESSED OR IMPLIED. In such case.

merge.org/licenses/mit-license. if other files instantiate templates or use macros or inline func- tions from this file. you may use this file as part of a free software library without restriction. . to any person obtaining a copy of this soft- ware and associated documentation files (the "Software"). BE LIABLE TO YOU FOR DAMAGES. Specifically. 12 IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER. and to permit persons to whom the Software is furnished to do so. and/or sell copies of the Software. INCLUDING BUT NOT LIMITED TO THE WAR- RANTIES OF MERCHANTABILITY. publish. YOU ASSUME THE COST OF ALL NECESSARY SERVICING. SHOULD THE PROGRAM PROVE DEFEC- TIVE. THE SOFTWARE IS PROVIDED "AS IS". As a special exception. REPAIR OR CORRECTION. distribute. to deal in the Software with- out restriction. sublicense. INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INAC- CURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAIL- URE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS). subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or sub- stantial portions of the Software.0 Updated 8/19/13 THE PROGRAM IS WITH YOU. This exception does not however invalidate any other reasons why the executable file might be covered by the GNU General Public License. WITHOUT WARRANTY OF ANY KIND. INCLUDING ANY GEN- ERAL. free of charge. EXPRESS OR IMPLIED. WHETHER IN AN ACTION OF CONTRACT. including without limitation the rights to use. SPECIAL. copy. EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. or you compile this file and link it with other files to produce an exe- cutable.php Permission is hereby granted. OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMIT- TED ABOVE. END OF TERMS AND CONDITIONS MIT License http://www. IN NO EVENT SHALL THE AUTHORS OR COPY- RIGHT HOLDERS BE LIABLE FOR ANY CLAIM. this file does not by itself cause the resulting executable to be covered by the GNU General Public License.opensource. modify. FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. TORT OR OTHERWISE. DAMAGES OR OTHER LIA- BILITY.480 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8.

this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.txt/ Ruby is copyrighted free software by Yukihiro Matsumoto <matz@netlab. BSD License http://opensource. OR CONSEQUENTIAL DAMAGES (INCLUDING. Redistributions in binary form must reproduce the above copyright notice.org/licenses/bsd-license. LOSS OF USE. BUT NOT LIMITED TO. OR BUSI- NESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY. THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FIT- NESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. You can redistribute it and/or modify it under either the terms of the GPL (see COPYING. INCIDENTAL. or the conditions below: .ruby-lang. with or without modification. SPECIAL. Redistribution and use in source and binary forms.org/en/about/license. are permitted provided that the following conditions are met: Redistributions of source code must retain the above copyright notice.php All rights reserved. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT.co. OR PROFITS. EXEMPLARY. OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE. Ruby License http://www. PROCUREMENT OF SUBSTI- TUTE GOODS OR SERVICES. DATA. INDIRECT.jp>. EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. INCLUDING. APPENDIX A 481 Third Party Licensing ARISING FROM. BUT NOT LIMITED TO. Neither the name of the organization nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES. WHETHER IN CONTRACT. this list of condi- tions and the following disclaimer.txt file). OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. STRICT LIABILITY.

INCLUDING. d d make other distribution arrangements with the author. and may be sold commercially. . provided that you do at least ONE of the following: a distribute the executables and library files of the software. which must also be provided. such as by posting said modifications to Usenet or an equivalent medium. st. utils. 4 You may modify and include the part of the software into any other software (possi- bly commercial). b use the modified software only within your corporation or organization. provided that you duplicate all of the original copyright notices and associated disclaimers. d make other distribution arrangements with the author. and may be aggregated with this software. 90 SharePlex Manager SharePlex Manager User Guide 5 The scripts and library files supplied as input to or produced as output from the soft- ware do not automatically fall under the copyright of the software. with instructions on where to get the original software distribution.482 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. c give non-standard executables non-standard names. so that they are not under this terms. 2 You may modify your copy of the software in any way. But some files in the distribution are not written by the author.c(partly).[ch].0 Updated 8/19/13 1 You may make and give away verbatim copies of the source form of the software without restriction. 3 You may distribute the software in object code or executable form. 6 THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES. WITHOUT LIMITATION. regex.[ch] and some files under the . together with instruc- tions (in the manual page or equivalent) on where to get the original distribution./ missing directory. See each file for the copying condition. c rename any non-standard executables so the names do not conflict with standard executables.c(partly). THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. but belong to whomever generated them. They are gc. b accompany the distribution with the machine-readable source of the software. provided that you do at least ONE of the following: a place your modifications in the Public Domain or otherwise make them Freely Available. or by allowing the author to include your modifications in the software.

66 Numerics 508 compliance xv A abort config command 311 abstract datatypes in partitioned replication 160 planning for 108 Access menu in SpClient 456 accessibility xv account for starting SharePlex (Windows) 278 in Oracle UNIX 407 Windows 410 activate config command 308 activation process description 308 guidelines 310 troubleshooting. see SharePlex Reference Manual viewing status and statistics 311 . Index 483 Index Symbols /etc/group file 49 /etc/services file 129 & argument 49.

considerations for replication 114 ASM 114 asynchronous transport 30 auth_hosts file 268 authorization level SharePlex commands 55 starting SharePlex 48 .484 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8.0 (document revision 2) adding named queues export 150 post 155 partition schemes and conditions 319 primary key 101 sequences to replication 314 SharePlex license key 444 table to replication 312 to the database 366 unique index 101 Administrator. SharePlex authority to create configurations 132 set port number 259 start SharePlex 48 specifying startup authority on Windows systems 278 alerts monitoring scripts (UNIX) 340 monitoring utility (Windows) 356 ALTER TABLE command RENAME TO 111 application patches and upgrades 380 app-modules directory UNIX systems 38 archive logging.

sql script 179 C caching SQL statements 240 capstat. Index 485 B backups full system 413 Oracle hot backup on active source database 289 on quiet database 296 partial system 412 SharePlex 129 bandwidth for SharePlex 128 batch loads 113 bi-directional replication description 83 establishing for high availability 190 peer-to-peer replication 211 bin directory UNIX systems 37 bin sub-directory 456 Windows systems 39 binaries location 33 running 44 broadcast replication establishing 194–203 using for distributing data 84 distributing processing and balancing loads 85 buffer size 119 build_config.log 353 Capture process DDL logging 112 description 32 stopping 114 .

0 (document revision 2) capture queue description 30 monitoring 353. considerations for replication 104 cascading replication description 86 establishing 197 case-sensitivity. 356 cascading deletes.sh script 433 clusters routing maps for 142 setting SP_SYS_VARDIR for 258 .486 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8.sql script 435 clean_vardir. performance issues 105 checkpoint in redo logs 36 recovery system 30 cleanup. how applied by SharePlex 34 changing configurations 312 data instead of posting 245 key values 101 location of ORACLE_HOME 369 OPEN_CURSORS 117 process priority on Windows systems 280 replicating objects 366 SharePlex password on UNIX systems 402 SharePlex Registry entries 282 SharePlex startup on Windows systems 276 SharePlex text editor 266 SharePlex user in trigger WHEN clause 427 SharePlex user name 406 target objects 99 target ORACLE_SID 370 transformation file 257 character sets establishing 119 supported by SharePlex 119 check constraints. in configuration 136–139 centralized reporting description 87 establishing 204–210 changes.

175 column-level replication changing 319 configuring 172 description 132 columns in horizontally partitioned replication 166 requirements for replication 97 selective replication of 172 . Index 487 collectors in partitioned replication 160 planning for replication 108 column conditions changing 319 creating 163 description 161 supported datatypes and syntax 166 viewing 171 column partition excluded column partition 174.

interactively 56 UNIX command line 55 maximum string length 55 to use for activating configurations 308 connecting to alternate sp_cop 56 copying configurations 312 creating configurations 135 deactivating replication 311 defining default system 57 editing a configuration 179 shutting down replication 53 stopping a replication process 52 viewing activation status 311 viewing configuration statistics 311 viewing queue status 154 viewing replication processes 154 see also SharePlex Reference Manual COMMIT statement and Post read/release 119 and replication 35 and tuning log buffer size 119 comparing tables for synchronization 99 compression of archive logs 114 condition.0 (document revision 2) commands. column changing 319 creating 163 description 161 supported datatypes and syntax 166 viewing 171 config directory UNIX systems 38 config sql script 183 config sub-directory description 28 Windows systems 40 .488 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. SharePlex authorization levels 55 getting scroll bar for output 56 issuing from remote system 56 sp_ctrl.

see SharePlex Administrator’s Guide configuring database for replication 95 objects for replication 132 system for replication 122 using Oracle wildcards 137 conflict resolution description 211 . Index 489 configurations activation description 308 statistics for 311 adding objects sequences 314 tables 312 change marker for 309 changing 312 components of 135 creating for data distribution 194 distributed processing 194 faster posting 155 high availability and data recovery 190 multiple targets 148 peer-to-peer replication 222 replication through intermediary system 197 reporting 186 selective column replication 172 selective row replication 160 deactivating 311 description 28 in cluster environments 142 information in internal tables 36 methods for creating basic 145 multiple targets 148 quick-build for entire database 183 quick-build for multiple tables in a schema 179 separating data with named export queues 150 removing configured objects 318 reverse configuration 192 troubleshooting.

266 CREATE TABLE command 366 create_ignore.sql utility 424 creating column partitions 174 configurations 132 using Oracle wildcards 137 multiple variable-data directories 64 named queues export 150 post 155 partition schemes and conditions 161 SharePlex Oracle user on UNIX 407 on Windows systems 410 simulated key 134. 140 transformation components 249 unique index in absence of primary keys 101 See also defining crontab 340 cursors. integrity 104 converting data during replication 245 CPU requirements for replication 123 create config command 145.0 (document revision 2) connection security with auth_hosts file 268 terminating from remote system 459 to sp_cop 54 consolidated replication description 87 establishing 204–210 constraints. setting 117 .490 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8.

Index 491 D data changing what is replicated 312 configuring for replication 132 converting during replication 245 directory in product directory Windows 39 directory in variable-data directory Windows 40 distribution description 84 establishing replication for 194 guidelines for replication 90 integrity assurance 90 preventing from replicating 424 recovery description 83 establishing replication for 190 planned failover procedures 334 unplanned failover procedures 322 strategies for replication 80 warehousing/mart description 87 establishing replication for 204–210 data directory UNIX systems 37. 38 Data Focus 42 database changing during replication 365 SharePlex password 402 SharePlex user (UNIX) 406 configuring for replication 95 creating SharePlex account UNIX 407 Windows 410 Oracle supplemental logging 95 patches and upgrades application 380 Oracle 389 .

98 large. separating 150 datatypes abstract guidelines for replicating 108 converting through transformation 245 in SHAREPLEX_PARTITION table 164 in source and target columns 90.0 (document revision 2) datafiles location of 123 on raw devices 114 datasource description 135 multiple replicating.492 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. replicating 121 db directory UNIX systems 38 db sub-directory Windows systems 40 DDL changes to target objects 99 logging DDL 112 performing on replicating objects 366 renaming tables 111 replication of 110 supported and non-supported 76 deactivate config command 311. in named queues 134 LOB. replication requirements 108 object-relational 108 supported for horizontal partitioning 166 user-defined guidelines for replicating 108 dates. 383 .

Index 493 default behavior for DDL error on target 112 direct-load replication 113 SQL Cache 240 startup on Windows systems 42 configuration directory 135 errors monitored by sp_eventmon 344 export queue 30 number of hints 238 NuTCRACKER folder 42 parameter settings. 140 See also creating definitions. of terms 463 delete queue command 330 DELETE statement disabling cascading on target 104 out-of-sync conditions for 91 replicating 34 . file containing 37 post queue 31 SharePlex environment for Windows 41 SharePlex port number 259 overriding 271 size of queue file 429 system for sp_ctrl 57 text editor 266 values in extra target columns 97 DEFAULT conflict resolution parameter 236 defining character sets 119 column partitions 174 data to be replicated 132 default system for sp_ctrl 57 partition schemes and conditions 161 simulated key 134.

splex log 343 error_list file 344 .494 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8.bat 281 dump directory UNIX systems 38 dump sub-directory Windows systems 40 E edit config command 266 editor. 330 through qview 428 through sp_ctrl. default and alternative 266 e-mail alerts monitoring scripts (UNIX) 340 monitoring utility (Windows) 356 environment variables. SharePlex 41.sql 36 error. see SharePlex Reference Manual DEMO_DEST table 37 DEMO_SRC table 37 desktop shortcut for SharePlex 50 direct-path loads. Oracle JDBC version 121 dropping partition schemes and conditions 319 DTaskmgr.0 (document revision 2) deleting dependent rows (ON DELETE CASCADE) 104 entries from conflict resolution file 224 entries from transformation file 257 objects from configuration 318 queues during failover procedure 324. conditions for replicating 113 disabling cascading deletes 104 distributed processing description 85 establishing replication for 194 DML changes to target objects 99 locks 116 DML_LOCKS parameter 116 driver. 282 errlog.

replication monitoring 343 viewing 35 exception marker 170 Export process creating multiple 150 description 32 export queue description 30 named 150 export/import (Oracle) description 26 using to synchronize data 299 F failover and failback planned 334 preparing backups 129 unplanned 322 foreign keys replication considerations 104 FTP. Index 495 errors. replication impact 101 G Generating a license key on a UNIX or Linux system 445 glossary of terms 463 H handshaking process 30 high availability backup recommendations 129 description 83 establishing replication for 190 procedures for failover and failback 321 . using to synchronize data 302 full table scans. viewing 35 Event Log monitoring with sp_eventmon 343 events.

496 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. SharePlex creating UNIX systems 407 Windows systems 410 descriptions 36 truncating 435 . description 32 index-organized tables 104 indices location of SharePlex indices 123 need for in replication 102 using INDEX hints for posting 238 init. 296 how SharePlex replicates 46 I I/O intensive operations 123 icons for SpClient 455 Import process.ora file DML_LOCKS parameter 116 LOG_PARALLELISM parameter 118 PROCESSES parameter 117 INSERT statement how SharePlex replicates 34 in horizontally partitioned replication 160 out-of-sync conditions for 90 install directory UNIX systems 38 integrity constraints in replication 104 intermediary system description 86 establishing replication with 197 internal tables.0 (document revision 2) hints. using to expedite Post process 238 horizontally partitioned replication changing 319 configuring 160 description 132 hot backup with Oracle for synchronization 289.

Index 497 iwgrep utility setting IW_HOME variable 345 used in monitoring 343 IW_HOME variable 345 iwsnmptrap for SNMP 361 J Java. Oracle 122 LAN. in high availability configuration 83 language. 113 how SharePlex minimizes 35 monitoring for 347. JDBC driver version 121 JDBC driver version 121 K keys on tables changing values 101 foreign 104 in peer-to-peer replication 216 need for 100 simulating 134. setting for SharePlex 119 large objects. considerations for replication 108 latency causes of 101. 140 kill command 342 L Label Security. 359 lib directory UNIX systems 38 license key adding 444 viewing 446 list command in qview 428 load balancing description 85 establishing replication for 194 .

log 347 LOG_PARALLELISM parameter 118 logs archive 114 for sp_ps 350 out-of-sync SQL 36 redo 114 sp_eventmon 343 sp_logmon 347 sp_qstatmon 353 LONG datatype considerations for replication 110 M -m argument 345 MailUserName 348 MailUserName variable 345 mailx program 342 memory for LOB replication 109 requirements for SharePlex processes 125 used by queues 124 menus for SpClient 456 message 34 .498 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. DML 116 log buffer size 119 log directory UNIX systems 38 log sub-directory Windows systems 40 logging off with SpClient 459 login security features 268 logmon.0 (document revision 2) LOB datatypes in selective row replication 160 isolating in separate queues 108 Local Logon button 457 local system. logging on with SpClient 457 locally-managed tablespaces and index-organized tables 104 locks.

67 objects with same names 139 port numbers 259 Post processes 33 source systems centralized reporting 87. 207 peer-to-peer replication 88. Index 499 meta-inf directory UNIX systems 38 MKS Platform Components 42 MKS Toolkit description 42 monitoring utilities for UNIX systems 340 utility for Windows systems 356 with SNMP traps 361 Mortice Kern Systems 42 moving location of ORACLE_HOME 369 multiple configurations on a system 28 databases on same system 150 instances of SharePlex on same system 64. 211 target systems configuration for 148 description 84–86 UPDATES and DELETES. and indices 238 variable-data directories 64 versions SharePlex 70 N named queues export and LOBs 108 creating 150 post 155 .

maximum 238 of indices on a table 104 of messages for Post read/release 119 of OPEN_CURSORS 117 of SQL Cache cursors 241 of sub-queue files 109 of target routes.500 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8.0 (document revision 2) names of configurations 135 of monitoring scripts 340 of replication strategies 80 of SharePlex directories 37 of SharePlex logs of SharePlex processes 32 of SharePlex programs 44 of SharePlex queues 30 of source and target columns 97 of source and target tables 98 NAT 436 network controlling when SharePlex sends data 35 how SharePlex uses 35 recovery from failures 35 requirements 128 security features 268 Network Address Translation 436 Network Management Station (NMS) 361 NLS_LANG environment variable 119 NULLs in keys. considerations for replication 100 number activation ID number 309 for PROCESSES parameter 118 of columns in tables 97 of database writers 119 of DML locks for SharePlex 116 of hints. maximum 142 SharePlex port 259 NuTCRACKER and changing process priority 280 .

to synchronize data active source database 289 quiet source database 296 JDBC driver version 121 Label Security 122 patches and upgrades 389 supported and non-supported features 76 Oracle wildcards in configuration files 137 ora_cleansp how to use 439 running remotely with SpClient 455 OraCleanSp. 309 ID 36 types replicating 108 object-relational structures 108 ON DELETE CASCADE. Index 501 O object cache 130. see ora_cleansp ORACLE_HOME changing location of 369 determining 136 ORACLE_SID changing target 370 determining 136 . considerations for replicating 104 online transaction processing (OLTP) 88 OPEN_CURSORS parameter setting for replication 117 setting for SQL Cache 241 ora_chpwd utility 402 Oracle 9i DDL Logging 112 error handling 112 renaming tables 111 buffer size 119 configuring for replication 95 DDL replication 110 hot backup.

0 (document revision 2) ora_setup running on UNIX systems 407 running on Windows systems (OraSetup) 410 running remotely with SpClient 455 OraSetup. 114 prevention planning 95 viewing statements for 36 P parameter for keys that permit NULLs 100 number of DML locks 116 hints 238 open cursors 117 processes in Oracle 117 read/release interval 119 replication of DDL 110 direct loads 113 posted data 200 shared memory for queues 109 SharePlex port number 260 SharePlex text editor SharePlex variable-data directory 258 SNMP traps 362 SQL Cache 240. 241 SSH 271 using prepared conflict resolution for all tables 236 partition schemes and conditions adding and changing 319 creating 163 description 161 supported datatypes and syntax 166 viewing 171 .502 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. see ora_setup oratab file 129. 136. 407 out-of-sync tables causes of 90.

Index 503 partitioned replication and application patches or upgrades 382 changing 319 description 96. 132 of columns (vertical) 172 of rows (horizontal) 160 partitioned tables and replication 310 partitions for selective column replication 174 for selective row replication 161 pass-through system 86 password for SharePlex. 218 target table access during 100 updating inventory/account balances 219 . changing UNIX systems 402 Windows systems 410 patches application 380 applying with Oracle hot backup or DBCopy 385 OS and Oracle 389 SharePlex 389 peer-to-peer replication assigning transaction priority 221 description 88 establishing 211 requirements for archive logging 115 cascading deletes 105. 218 LOB replication 109 primary keys 101. 216 sequences 108. 217 triggers 106.

log 353 pre-image 91 . 108. 118.0 (document revision 2) performance. improving changing log buffer size 119 Post read/release 119 process priority 127 disabling check constraints 105 tuning Post process ??–245 using indices 102 keys 100 permissions for monitoring utilities 342 for starting SharePlex 48 see also privileges per-process memory requirements 125 placeholder for routing map 170 port number multiple SharePlex instances UNIX systems 64 Windows systems 67 multiple SharePlex versions 70 setting UNIX systems 259 Windows systems 261 Post process configuring for faster posting with INDEX hints 238 with named post queues 155 with SQL caching 240 DDL logging 112 description 33 ensuring data integrity 90 monitoring 350 things that reduce performance 101. 356 named 155 poststat. 119 post queue deleting sub-queues 429 description 30 monitoring 353. 103.504 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8.

Index 505 preventing cascading deletes from firing 104 character set errors 119 contention on SHAREPLEX_TRANS table 122 DML transactions from replicating 424 drive-related I/O contention 123 excessive Post I/O for small transactions 119 failures to connect to Oracle 117 full table scans during posting 102 key changes in peer-to-peer replication 216 log wrap-related problems 114 loss of SharePlex environment 129 OPEN_CURSORS errors 117 open-files limitation during posting 126 process priority-related slowdowns 127 queue space problems 124 referential integrity corruption on target 104 SharePlex from running out of DML locks 116 SharePlex process failure 126 target table access 99 triggers from firing on target 106 unauthorized connections to sp_cop 268 users from entering duplicate data 102 primary key in peer-to-peer replication 216 replication considerations 100 simulating a key 134. 140 priority. setting for SharePlex UNIX systems 128 Windows systems 280 .

0 (document revision 2) privileges granting for DML on target system 100. 192 SharePlex as Oracle user 407. see SharePlex Reference Manual . 410 SharePlex for conflict resolution 225 SharePlex for transformation 247 SharePlex startup on Windows systems 278 required for changing SharePlex Oracle password 402 changing SharePlex process priority 280. 452 modifying monitoring scripts 348 running qview on Windows systems 428 problem-solving.506 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8.

Index 507 procedure for activating and deactivating configurations 308 adding license key 444 applying patches application 380 OS and Oracle 389 SharePlex 389 configuring data for replication 132 SharePlex for SSH port forwarding 271 high availability failing back to primary system 324 failing over to secondary system after system failure 322 planned failover and failback 334 restoring replication after secondary instance failure 330 Oracle Setup UNIX 407 Windows 410 performing DDL on replicating objects 366 system backups 412 upgrades. normal manner 48 transforming data 245 truncating SharePlex tables 435 . SharePlex 389 preventing DML from replicating 424 triggers firing for SharePlex 426 removing current replication state 439 data from variable-data directory 433 old queues 428 SharePlex 414. 416 running different versions of SharePlex 70 multiple instances of SharePlex 64 setting environment parameters 258 shutting down SharePlex 52 starting replication systems 47 SharePlex without replication processes 59 SharePlex.

setting for replication 117 product directory. stored for transforming data instead of posting 245 process ID 49 processes location of 33 monitoring UNIX systems 350 Windows systems 356 multiple sp_cop 64 priority.0 (document revision 2) See also changing procedures. 155 monitoring UNIX systems 353 Windows systems 356 named export 150 post 155 removing old queue files 429 viewing and removing with qview 428 qview utility 428 R RAID devices 125 . setting for SharePlex UNIX systems 128 Windows systems 280 remote viewing and termination (Windows) 459 SharePlex.508 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. description 32 starting SharePlex without 59 tab in Task Manager 281 PROCESSES parameter. description 37 Program Files folder 456 Q qstatus command 322 queues description 30 location and optimization 125 maximum number on a system 151.

description 32 read/release by Post process 429 by Post upon COMMIT 119 during SharePlex shutdown 53 parameter for Post 119 read-consistency marker 36 Reconcile to a SCN 291 to a sequence number 291 reconcile command in failback 326 in failover 322 in initial synchronization with hot backup on active database 291. replication strategy for description 83 establishing 190 redo logs archiving option 116 ASM 114 considerations for replication 113 on raw devices 114 operations that bypass 116 optimal location 123 referential integrity constraints considerations for replication 104 . Index 509 raw devices redo logs on 114 SharePlex on 123 Read process. 324 checkpoint explanation 30 Post checkpoint 119 data. 294 when secondary instance fails 332 with hot copy to apply patches 387 recovery after secondary instance failure 330 after system failure 322.

changing SharePlex environment 282 SharePlex port number 261 SharePlex text editor 266 Remote Access window for SpClient 459 Remote Logon button 457 remote system controlling access from 268 issuing sp_ctrl commands for 56 running utilities for 454 selective replication to 132 strategy for replicating to 84.510 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. 85.0 (document revision 2) Registry. 197 removing data from SharePlex tables 435 entries from configuration 318 conflict resolution file 224 transformation file 257 Windows Registry 282 old queue files 429 partition schemes and conditions 319 SharePlex from UNIX systems 414 from Windows systems 416 SharePlex directories 37 table from replication 318 renaming tables 111 replicating cascading deletes 104 DDL 110 direct-path loads 113 DML from triggers 106 entire tables 97 LOBs 108 LONGs 110 object-relational structures 108 operations that bypass redo logs 116 selected columns 172 selected rows 160 sequences 106 .

186 for centralized reporting description 87 establishing 204–210 for data distribution description 84 establishing 194 for data warehousing/mart description 87 establishing 204–210 for distributed processing description 85 establishing 194 for distribution through intermediary system description 86 establishing 197 for high availability and data recovery description 83 establishing 190 for load balancing description 85 establishing 194 for multiple peers description 88 establishing 211 for reporting 81 description 81 establishing 186 how SharePlex replicates 32 messages. Index 511 replication between tables on same system 81. definition 34 monitoring on Windows with Sp_NT_Mon 356 with SNMP 361 with UNIX scripts 340 planning and requirements 75 preventing for specific transactions 424 restoring to initial state 439 starting and stopping 48–52 supported and non-supported Oracle components 76 .

0 (document revision 2) reporting replication for data warehousing/mart description 87 establishing 204–210 replication to maintain a reporting instance description 81 establishing 186 rim directory UNIX systems 38 rim sub-directory 124. 125 Windows systems 40 rollback segment optimal location 123 routing map description 141 for multiple target systems 133 for selective row replication 165 limitations 142 placeholder in configuration file 170 row-level replication changing 319 configuring 160 description 132 rows Oracle Label Security 122 selective replication of 160 S -s option when starting sp_cop 59 same-system replication (UNIX only) description 81 establishing 187 save directory UNIX systems 38 save sub-directory Windows systems 40 saving files for backup 129 SpClient output 456 state of replication when shutting down 53 .512 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8.

sql 183 disabling of cascading deletes 104 purging of variable-data directory 433 replication monitoring on Windows systems 356 sp_eventmon 343 sp_logmon 347 sp_ps 350 sp_qstatmon 353 truncating of SharePlex tables 435 scroll bar. and replication 122 Select menu in SpClient 456 selective replication description 96. SharePlex (Windows systems) starting 50 starting remotely 455 setting.sql 179 config. 132 of columns 172 of rows 160 sequence number 291 sequences guidelines for replicating 106 in peer-to-peer replication 217 service. see changing . in sp_ctrl for Windows 56 security controlling remote connections 268 for starting and stopping SharePlex 48 row-level. Index 513 scheme. partition adding and changing 319 creating 163 description 161 viewing 171 SCN 291 scripting alteration of triggers to ignore SharePlex 427 configurations build_config.

location 33 changing environment parameters 258 password 402 port number 259 user name/password 406 commands.514 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8.0 (document revision 2) SharePlex architecture diagram 29 backing up 129 binaries (processes). see SharePlex Reference Manual configurations activating 308 creating 132 description 28 using Oracle wildcards 137 desktop shortcut 50 in high availability environment 321 internal tables creating on UNIX systems 407 creating on Windows systems 410 list of 36 monitoring 339 Oracle account Windows systems 410 overview 25–41 patches 389 process priority UNIX systems 128 Windows systems 280 processes description 32 location of 123 monitoring 350. 356 product directory 37 queues description 30 location and sizing 124 viewing and removing 428 remote connection and control 454 removing UNIX systems 414 .

Index 515 Windows systems 416 replication options 96 replication strategies 80–89 requirements for replication database 95 system 122 resources consumed 124 routing limitations 142 running multiple sp_cop sessions 64. 67 multiple versions on same system 70 with SharePlex FS 62 security features 268 service controlling with SpClient 455 removing 416 services (see SharePlex processes) starting basic startup procedure 48 with -u option 63 without replication processes (-s option) 59 startup on Windows systems 276 supported and non-supported Oracle features 76 upgrading 389 utilities 423 variable-data directory UNIX systems 38 Windows systems 40 SharePlex FS. running with SharePlex for Oracle 62 SHAREPLEX_ACTID table 36 SHAREPLEX_COMMAND table 36 SHAREPLEX_CONFIG table 36 SHAREPLEX_DATAEQUATOR table 36 SHAREPLEX_IGNORE_TRANS procedure 424 SHAREPLEX_LOBMAP table 36 SHAREPLEX_MARKER table 36 SHAREPLEX_OBJMAP table 36 SHAREPLEX_PARTITION table 37. 164 SHAREPLEX_TRANS table 37 preventing contention on 122 show activate command 311 .

0 (document revision 2) show config command 311 SID_errlog. using with SharePlex 361 socket_test 436 source meaning of 27 objects configuring for replication 132 description 137. 427 sp_change_trigger.sql 36 snapshots 26 SNMP.sql utility 384.exe 46 SP_COP_TPORT parameter 260 SP_COP_UPORT parameter 260 .sql utility 427 sp_client process 454 SpClient utility 454 sp_cop connections security for 268 with sp_ctrl 54 description 44 differences between UNIX and Windows systems 46 running multiple sessions on same UNIX system 64 on Windows systems 67 setting alternative port for 259 shutting down 52 starting basic startup procedure 48 with -s option 59 with -u option 63 without SharePlex services (processes) 59 SP_COP_IDLETIME parameter 115 sp_copsrv. 139 planning for replication 95 system configuring for replication 122 multiple 211 trusted 221 table names 98 sp_add_trigger.516 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8.

46 SP_OCT_CHECKPOINT_FREQ parameter 115 SP_OCT_REPLICATE_DLOAD parameter 113 SP_OCT_REPLICATE_POSTER parameter 200 SP_OPO_HINTS_LIMIT parameter 238 SP_OPO_MAX_CDA parameter 241 SP_OPO_READRELEASE_INTERVAL parameter 119 SP_OPO_SQL_CACHE_DISABLE parameter 240 SP_OPO_STOP_ON_DDL9I_ERR parameter 112 sp_opst 46 SP_ORD_CDA_LIMIT parameter 115 SP_ORD_DELAY_RECORDS parameter 115 SP_ORD_LDA_ARRAY_SIZE parameter 115 sp_ordr 32. 46 SP_ORD_RMSG_LIMIT parameter 115 Spotlight on Oracle 108 sp_ps monitoring utility 350 sp_qstatmon monitoring utility 353 SP_QUE_SHMSIZE parameter 109 .exe. See sp_ctrl spelling case.txt file 357 sp_ocap 32. in configuration 136–139 sp_eventmon monitoring utility 343 SP_IMP_WCMT_MSGCNT parameter 115 splex_add_key utility running locally (UNIX) 444 running remotely through SpClient 455 splex_get_key utility 446 splex_uname utility 445 sp_logmon monitoring utility 347 sp_mport 32. 46 Sp_Nt_Mon monitoring script 356 sp_nt_mon. Index 517 sp_ctrl connecting to alternate port 56 defining default system 57 description 44 maximum number of characters 55 running for one command 55 running interactively for multiple commands 56 starting 54 stopping 57 sp_ctrl.

518 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. 46 SP_XPT_PORT_OVERRIDE parameter 271 SP_XPT_USE_LOCALHOST parameter 271 SQL Cache and OPEN_CURSORS 117 running 240 tuning 243 SQL statement and index hints 238 caching for faster posting 240 definition of out-of-sync 90 how SharePlex constructs 34 use of system-defined name for abstract datatype 108 viewing for out-of-sync tables 36 SQL*Loader 113 SSH port forwarding 271 SSH Secure Shell parameters for 270 .0 (document revision 2) sp_remote 454 sp_remove_trigger. setting 258 SpUtils utility 451 sp_xport 32. 386 SP_SLG_SNMP_LAUNCH parameter 363 SP_SLG_SNMP_MJR_ERRNUM parameter 362 SP_SLG_SNMP_MNR_ERRNUM parameter 362 SP_SLG_SNMP_OUT_OF_SYNC parameter 363 SP_SLG_SNMP_SHUTDOWN parameter 363 SP_SLG_SNMP_STARTUP parameter 363 SP_SLG_SNMP_SYS_ERROR parameter 363 SP_SYS_IN_SYNC parameter 100 SP_SYS_VARDIR.sql utility 427 SP_SLG_SNMP_ACTIVE parameter 362 SP_SLG_SNMP_COMMUNITY parameter 362 SP_SLG_SNMP_ERROR parameter 363 SP_SLG_SNMP_EXIT parameter 363 SP_SLG_SNMP_HOST parameter 362 SP_SLG_SNMP_INT_ERROR parameter 362.

Index 519 starting replication 308 replication servers 47 SharePlex 48 controlling startup mode 276 SpClient 456 sp_ctrl 54 state directory UNIX systems 38 state sub-directory 130 Windows systems 40 Status Database 35 stopping Capture process 114 for DDL errors (9i) 112 replication 311 replication processes 52 SharePlex 52 sp_ctrl 57 store/restore to synchronize data 299 striped devices and SharePlex 125 synchronization causes of out-of-sync conditions 90. 99 explanation of 27. 90 verifying 99 with FTP 302 with import/export 299 with Oracle hot backup active database 289 quiet database 296 with transportable tablespaces 305 .

0 (document revision 2) system backup on replication machine 412 configuring for replication 122 failover/failback procedures 322. 183 dropping from configuration 318 for selective row replication 164 instance-specific 98 key requirements 100 foreign keys 104 name of source and target 98 not replicated 99 partitioned 310 SharePlex internal tables 36 structure requirements 97 to exclude from replication 98 .520 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. 324 licensing for SharePlex 444 remote accessing in Windows 454 connecting with sp_ctrl 56 secure connections 268 removing SharePlex from UNIX procedure 414 Windows procedure 416 tablespace in Oracle 123 System Change Number 291 T tables accessing on target 99 adding to the database 366 configuration script for multiple 179.

0. using for synchronization 305 traps. 204–210 replicating to multiple 84–86. 459 TCP/IP how SharePlex uses 35 security for 268 setting SharePlex port for 259 SharePlex bandwidth requirements for 128 temp directory UNIX systems 38 temp files generated by sp_qstatmon 353 terms. glossary of 463 testing new version of SharePlex 70 text editor. Index 521 target meaning of 27 objects commands to verify synchronization 99 description 140 planning for replication 95–?? ORACLE_SID. defining 266 timestamp priority in conflict resolution 221 Title page version Version 6. changing 370 system configuring for replication 122 how SharePlex applies changes to 34 maximum number of 142 replicating to central 87. 194–202 row IDs on 100 verifying synchronization on 90 Task Manager changing process priority 280. 148. 452 identifying processes 47 running remotely with SpClient 455. SNMP for SharePlex 361 triggers requirements for SharePlex 106 utilities for changing 426 .0 Release i toolbar for SpClient 455 transformation of data 245 transformation.SID file 255 transportable tablespaces.

ensuring for rows 100 UPDATE statement how SharePlex replicates 34 in selective row replication 160 out-of-sync conditions for 91 upgrades application 380 applying with Oracle hot backup or DBCopy 385 OS and Oracle 389 SharePlex 389 . SharePlex xi the Post process 238–244 types.522 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. user-defined replication requirements 108 U -u option when starting sp_cop 63 uni-directional replication description 81 establishing 186 uninstalling SharePlex from UNIX systems 414 from Windows systems 416 unique key on tables description 100 simulating a key 134.0 (document revision 2) trim command in qview 429 troubleshooting replication. see SharePlex Reference Manual truncate log command 344 TRUNCATE PARTITION command in selective row replication 160 trusted source priority in conflict resolution 221 tuning parameters. 140 uniqueness.

QSA_KTFBUE view 104 user-defined types in partitioned replication 160 planning for 108 util directory UNIX systems 38 Windows systems 39 utilities debugging network issues 436 managing SharePlex 451 monitoring replication 340 remote access 454 V V$LOG table 348 variable-data directory description 37 when running multiple sp_cop processes 64 variables. running different 70 . Index 523 user access on target system 99 command levels for sp_ctrl 55 command-line interface 36. 50 SharePlex changing on UNIX systems 402 disabling triggers for 106 privilege for SYS. environment UNIX systems 258 Windows systems varrying array (VARRAY) collectors in partitioned replication 160 planning for 108 verifying synchronization 99 that SharePlex processes are running 47 Veritas Quick I/O and replication 128 versions Oracle JDBC driver 121 SharePlex. 44 file for groups 129 group for starting SharePlex 49.

524 SHAREPLEX® FOR ORACLE Administrator’s Guide Version 8. 101 . in triggers 427 WHERE clause exclusion of LONGs 110 in SharePlex statements 91.0 (document revision 2) vertically partitioned replication changing 319 configuring 172 description 132 rules for use 98 using when column names are different 97 with horizontally partitioned replication 160 viewing activation status 311 configuration statistics 311 number of concurrent sessions 241 out-of-sync SQL 36 partition schemes 171 queues names of 428 status and disk space 429 SharePlex processes on Windows systems 47 SQL Cache hit count 243 W WAN in high availability configuration 83 security features 268 SharePlex support for 35 web browser 88 WHEN clause.

Index 525 Windows adding SharePlex license key 444 changing SharePlex Registry entries 282 configuring SharePlex startup 276 determining ORACLE_SID 136 differences from UNIX systems 46 displaying scroll bar in sp_ctrl 56 identifying SharePlex processes on 47 Registry environment for SharePlex 41 removing SharePlex 416 running different SharePlex versions 74 multiple instances of SharePlex 64 OraSetup 410 sp_ctrl 56 setting alternative editor 266 process priority 280 SharePlex port 261 SharePlex control utility 451 SharePlex directories 39 starting SharePlex 50 SharePlex without replication processes 60 work tables 98 .