Download - Quest® SharePlex™ 8.6support-public.cfm.quest.com/39476_SharePlex_8_6_6_Admin_Guide.pdf · Use compression 69 Enable capture on Exadata machines 69 Configure support of Data Pump

Transcript
  •  

    Quest® SharePlex™ 8.6.6

    Administrator Guide

  • Copyright 2017 Quest Software Inc.

    ALL RIGHTS RESERVED.This guide contains proprietary information protected by copyright.   The software described in this guide is furnished under a software license or nondisclosure agreement.   This software may be used or copied only in accordance with the terms of the applicable agreement.  No part of this guide may be reproduced or transmitted in any form or by any means, electronic or mechanical, including photocopying and recording for any purpose other than the purchaser’s personal use without the written permission of Quest Software Inc.

    The information in this document is provided in connection with Quest Software products. No license, express or implied, by estoppel or otherwise, to any intellectual property right is granted by this document or in connection with the sale of Quest Software products. EXCEPT AS SET FORTH IN THE TERMS AND CONDITIONS AS SPECIFIED IN THE LICENSE AGREEMENT FOR THIS PRODUCT, QUEST SOFTWARE ASSUMES NO LIABILITY WHATSOEVER AND DISCLAIMS ANY EXPRESS, IMPLIED OR STATUTORY WARRANTY RELATING TO ITS PRODUCTS INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. IN NO EVENT SHALL QUEST SOFTWARE 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 SOFTWARE HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. Quest Software makes no representations or warranties with respect to the accuracy or completeness of the contents of this document and reserves the right to make changes to specifications and product descriptions at any time without notice. Quest Software does not make any commitment to update the information contained in this document.

    If you have any questions regarding your potential use of this material, contact:

    Quest Software Inc.

    Attn: LEGAL Dept

    4 Polaris Way

    Aliso Viejo, CA 92656

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

    PatentsQuest Software is proud of our advanced technology.  Patents and pending patents may apply to this product.   For the most current information about applicable patents for this product, please visit our website at www.quest.com/legal.

    TrademarksQuest, and the Quest logo are trademarks and registered trademarks of Quest Software Inc. in the U.S.A. and other countries. For a complete list of Quest Software trademarks, please visit our website at www.quest.com/legal.    All other trademarks, servicemarks, registered trademarks, and registered servicemarks are the property of their respective owners.

    Legend

    WARNING: A WARNING icon indicates a potential for property damage, personal injury, or death.

    CAUTION: A CAUTION icon indicates potential damage to hardware or loss of data if instructions are not followed.

    IMPORTANT, NOTE, TIP, MOBILE, or VIDEO: An information icon indicates supporting information.

     

    SharePlex Administrator GuideUpdated - 4/3/2017Version -  8.6.6

    SharePlex 8.6.6 Administrator Guide 2

    http://www.quest.com/legal

  • Contents

    About this Guide 17Other SharePlex documentation 17

    Conventions used in this guide 18

    About us 19Contacting Quest 19Technical support resources 19

    Overview of SharePlex 21The advantages of SharePlex 21About source and target data 23About the SharePlex architecture 24SharePlex queues 24SharePlex processes 25How SharePlex replicates data 26

    About sp_cop 27About sp_ctrl 27Understand the concept of synchronization 28Characteristics of synchronized tables 28Hidden out-of-sync conditions 29

    Strategies for information availability 29Reporting instances 29Broadcast and cascade 30Data warehousing 30High availability and disaster recovery 30

    Test before you deploy 31

    Run SharePlex 33Run SharePlex on Unix and Linux 33Startup sequence on Unix and Linux 34Start SharePlex on Unix and Linux 34Identify SharePlex processes on Unix and Linux 35Stop SharePlex on Unix and Linux 36Shutdown Considerations on Unix and Linux 36

    Run SharePlex on Windows 36Startup Sequence on Windows 36Start and stop SharePlex on Windows 37Set SharePlex startup status on Windows 37Set SharePlex process priority on Windows 38Identify SharePlex processes on Windows 38Shutdown Considerations on Windows 39

    SharePlex 8.6.6 Administrator Guide 3

  • Run multiple instances of SharePlex 40Run multiple instances of SharePlex from separate installations 40Run multiple instances of SharePlex from one installation 41

    How to run multiple sp_cop instances on Unix and Linux 41How to run multiple sp_cop instances on Windows 44

    Execute commands in sp_ctrl 45How to run sp_ctrl 45Start sp_ctrl 45sp_ctrl prompt 46Exit sp_ctrl 46

    Define a default port for sp_ctrl 46Define a default host for sp_ctrl 47Set a default editor for sp_ctrl 47Change the editor on Unix or Linux 47Change the editor on Windows 47

    Command guidelines 48Issue Commands on a remote system 48Issue commands for clustered systems 49Add a scroll bar to output on Windows 49

    SharePlex parameters 51View and set  parameters 51View parameters 51Set parameters 52Set SharePlex parameters through sp_ctrl 52Set SharePlex parameters as environment variables 52

    Where parameter information is stored 52

    Prepare an Oracle environment for replication 54Set up Oracle redo logging to support SharePlex 54Set the appropriate logging level 54Ensure that the correct key is logged 55Configure the archive logs 55

    Set up Oracle database objects for replication 57Ensure row uniqueness 57The role of keys 57Tables without a key or unique index 57Keys with nulls 58Changes to key values 58Indexes 59Bitmap indexes 59

    Prevent triggers from firing on the target 60Configure integrity constraints 60Foreign key constraints 61ON DELETE CASCADE constraints 61

    SharePlex 8.6.6 Administrator Guide 4

  • Check constraints 61Prevent access to target objects 61Configure sequences 61

    Set up an Oracle database to support SharePlex 63Adjust OPEN_CURSORS to support Post cursors 63Adjust the PROCESSES parameter to support connections 63Adjust the log buffer size to improve posting 64Adjust the SharePlex transaction table based on user volume 64Control conversion of character sets 64Replication between an Oracle source and Oracle targets 65Replication between an Oracle source and non-Oracle targets 65

    Set up SharePlex to support Oracle data 66LOBs, LONGs, VARRAYs, and XML 66Tune SharePlex based on Oracle data volume 67Set system process priority 68Enable Oracle direct path loads 68Use compression 69Enable capture on Exadata machines 69Configure support of Data Pump exports 69

    Set up TDE Support 69Required privilege to capture TDE-protected data 70Configure SharePlex to capture TDE-protected data 70

    Create configuration files 72Ensure compatible source-target mapping 72How to create a configuration file 73Create a configuration file 73Structure of a configuration file 74Additional configuration options 76

    Database specifications in a configuration file 76Target specifications in a configuration file 77Routing specifications in a configuration file 78Replicate to one target 78Replicate to multiple targets 79Replicate between objects on the same system 79Routing Limitations 80

    Replicate to or from a PDB 80Capture from a PDB 80Replicate to a PDB 81Examples 81

    Configuration examples by datasource and target 81Replicate from a regular Oracle instance to a regular Oracle instance 81Replicate from a regular Oracle instance to an Open Target database 82Replicate from a regular Oracle instance to a file in XML or SQL format 82Replicate from a regular Oracle instance to a JMS queue or topic 82

    SharePlex 8.6.6 Administrator Guide 5

  • Replicate from a regular Oracle instance to a Kafka topic 83Replicate from and to an Oracle pluggable database (PDB) in a container database (CDB)* 83Replicate to maintain a change history target 83

    Use a script to build a configuration file 84Configure Replication to Oracle on Amazon RDS 84Use Wildcards to specify multiple objects 85Requirements and limitations of wildcard support 85Supported wildcard syntax 86Specify wildcarded names in the configuration file 86Validate a wildcard specification 87Examples 87

    Define a unique key 88Syntax for key definition 89Example 89

    Filter DML operations 89Filter out a DML type 89Configure a DML filter 89Examples 90View current DML filters 90Restrictions 90

    Filter DML related to specific Oracle objects from replication 90Map source and target columns 91Guidelines for using column mapping 91Configure column mapping 91Configuration example 92

    Build a configuration file using a script 92Supported databases 92Use config.sql 92Use build_config.sql 94

    Configure replication to Open Target targets 96Configure replication to a Microsoft SQL Server target 97Overview 97Configure SharePlex on the source 97Enable  Oracle keys 97Configure replication 97

    Configure SharePlex on the target 98Configure replication to a PostgreSQL target 100Overview 100Configure SharePlex on the source 100Enable supplemental logging 100Set SP_OCT_USE_SUPP_KEYS parameter 100Configure replication 100

    Configure SharePlex on the target 101Configure replication to an SAP ASE target 102

    SharePlex 8.6.6 Administrator Guide 6

  • Overview 102Configure SharePlex on the source 102Enable supplemental logging 102Set SP_OCT_USE_SUPP_KEYS parameter 102Configure replication 102

    Configure SharePlex on the target 103Install the ODBC driver 103Set up ODBC 103Set connection information with the connection command 104

    Configure replication to a HANA target 107Overview 107Configure SharePlex on the source 107Enable supplemental logging 107Set SP_OCT_USE_SUPP_KEYS parameter 107Configure replication 107

    Configure SharePlex on the target 108Configure replication to a Teradata target 109Overview 109Configure SharePlex on the source 109Enable supplemental logging 109Set SP_OCT_USE_SUPP_KEYS parameter 109Configure replication to Teradata 109

    Configure SharePlex on the target 110Configure replication to other Open Target databases 111Overview 111Configure SharePlex on the source 111Enable supplemental logging 111Set SP_OCT_USE_SUPP_KEYS parameter 111Configure replication 111

    Configure SharePlex on the target 112Install the ODBC driver 112Set up ODBC 112Set connection information with the connection command 113Map datatypes 115

    Configure Replication to a JMS target 116Overview 116Configure SharePlex on the source 116Enable supplemental logging 116Set SP_OCT_USE_SUPP_KEYS parameter 116Configure replication 116

    Configure SharePlex on the target 117Configure  SharePlex on an Active MQ target 117Configure SharePlex on an IBM MQ target 119

    View and change JMS settings 120Set recovery options 122

    SharePlex 8.6.6 Administrator Guide 7

  • Control memory settings 123Configure debugging 123About the XML 124Schema record template 124Operation record template 125

    Configure Replication to a Kafka target 129Overview 129Guidelines for posting to Kafka 129Configure SharePlex on the source 129Enable supplemental logging 129Set SP_OCT_USE_SUPP_KEYS parameter 129Configure replication 130

    Configure SharePlex on the target 130View and change Kafka settings 131Set recovery options 132About the XML 133Schema record template 133Operation record template 135

    Configure Replication to a SQL or XML file target 139Overview 139Configure SharePlex on the source 139Configure SharePlex on the target 140View and change target settings 140

    About the SQL 140About the XML 141Schema record template 141Operation record template 142

    File storage and aging 146

    Configure a replication strategy 148Configure replication to share or distribute data 148Supported targets 149Capabilities 149Requirements 149Conventions used in the syntax 149Replicate  within the local system 150Replicate to a remote target system 151Replicate to multiple target systems 151

    Confgure replication to maintain a central data store 152Supported targets 152Capabilities 152Requirements 152Deployment options 153Deploy with one instance of SharePlex on the target system 153Deploy with multiple instances of SharePlex on the target system 154Configuration 155

    SharePlex 8.6.6 Administrator Guide 8

  • Recommended target configuration 156Configure replication to maintain multiple peer databases 157Supported targets 157Capabilities 157Requirements 158Overview 158Deployment 160Evaluate the data 160Configure replication 164Develop conflict resolution routines 165How to write a routine using the SharePlex generic interface 166How to use the SharePlex prepared routines 171

    List the routines in conflict_resolution.SID 172Where to find the conflict resolution file 172How to make entries in the conflict resolution file 172

    Log information about resolved conflicts 174Configure replication through an intermediary system 176Supported targets 176Capabilities 176Requirements 176Conventions used in the syntax 177Deployment options 177Cascade with posting on intermediate system 178Cascade with pass-through on intermediary system 179

    Configure replication to maintain high availability 180Supported targets 181Capabilities 181Requirements 181Conventions used in the syntax 181Configuration 182Make the system ready for failover 182Perform recovery procedures 183

    Configure partitioned replication 184Configure horizontally partitioned replication 184Guidelines for using horizontally partitioned replication 184How it works 185Define partitions and schemes 187How to create a column condition 190

    Specify partition schemes in the configuration file 193Change the hash algorithm 194

    Configure vertically partitioned replication 195Supported targets 195Guidelines for using vertically partitioned replication 195Configure vertically partitioned replication 196

    SharePlex 8.6.6 Administrator Guide 9

  • Configure named queues 199Configure named export queues 199Supported targets 200Benefits of named export queues 200Considerations when using named export queues 201Configure a named export queue 201How to identify named export queues 202

    Configure named post queues 203Supported targets 203Benefits of named post queues 203Considerations when using named post queues 204Configure a named post queue 205How to identify a named post queue 206

    Configure replication to maintain a change history target 207Overview of the change-history target 207Capabilities 207Supported targets 208Operations supported 208Operations not supported 208How SharePlex maintains change history 208

    Configure change history 209Create a change-history configuration file 209Additional change history configuration options 210Customize column names 210Add the before image to each change row 210Include all columns of an operation in the history 210Disable change history of an operation type 210Set rules and filters 211Include COMMITs 211

    Set up Oracle DDL Replication 212DDL that SharePlex supports 212Control Oracle DDL replication 213Default support for Oracle DDL 213Optional DDL on objects in replication 214Optional Auto-Add support for Oracle DDL 214Expanded DDL support for objects outside replication 214

    Filter DDL Replication 215Best practices for ALTER TABLE DDL 218Tables with VARRAY or ABSTRACT types 218Tables with system-specific metadata 218Tables that are renamed 218Tables with system-generated interval partitions/subpartitions 219ALTER TABLE...MOVE 219

    DDL logging and error handling 219

    SharePlex 8.6.6 Administrator Guide 10

  • Set up error handling 221Continue to post when there is a DML error 221Continue posting on Oracle and SharePlex errors 221Continue posting on ODBC errors 222

    Continue to Post when there is a DDL error 224Increase the number of retries on error 224Handle transactions that contain out-of-sync operations 224Default Post handling of out-of-sync errors 224Stop on out-of-sync errors 225Roll back the transaction if it generates out-of-sync errors 225

    Transform data 226Overview of transformation 226Supported databases 226Supported replication strategies 227Supported operations 227

    Considerations when using transformation 227Deploy transformation 228Create transformation routines 228Complete the transformation file 233

    Configure SharePlex security features 235Secure connections to SharePlex 235Requirements 235

    Secure data with SSH 236Requirements 236

    Encrypt data across the network 238Encryption guidelines 238Enable encryption on the source system 238Set the key size on the source system 239Create an encryption key on the source system 239Set the key on the source and target 239Example 239View and reset encryption 240

    Assign SharePlex users to security groups 240Overview of SharePlex security groups 240Description of the SharePlex security groups 240

    Create and populate SharePlex groups on Unix and Linux 241Create and populate SharePlex groups on Windows 242

    Activate replication in your production environment 243What is activation? 243Activation commands 244Requirements for activating a configuration 245Required authorization level 246Required setup 246

    SharePlex 8.6.6 Administrator Guide 11

  • Prerequisites 246Test the configuration before activation 247Frequently Asked Questions about activation 247How to activate multiple configuration files 248Activate replication with an Oracle hot backup on an active database 249Preliminary considerations 249Procedures 250Activation with hot backup: all strategies except cascading 250Activation with hot backup: cascading replication 252

    Activate replication with an Oracle hot backup on a quiet database 254Preliminary considerations 254Procedure 255

    Activate replication with Oracle transportable tablespaces 256Preliminary considerations 257Procedure 258

    Activate replication with cold copy/transfer methods 259Preliminary considerations 259Procedure 260

    Activate replication from Oracle to Open Target 261Preliminary considerations 261Procedure 262

    Monitor SharePlex 265View and terminate SharePlex processes 265View and terminate processes on Unix and Linux 265View and terminate SharePlex processes on Windows 266View SharePlex processes on Windows 266Terminate SharePlex processes on Windows 267

    View events and errors 267Monitor with sp_ctrl commands 269Run monitor scripts on Unix 271Requirements for using the monitoring scripts 271Monitor Oracle capture with sp_logmon 272Prepare to run sp_logmon 272Run sp_logmon 273

    Monitor events with sp_eventmon 273Prepare to run sp_eventmon 274Run sp_eventmon 275

    Monitor processes with sp_ps 276Prepare to run sp_ps 276Run sp_ps 277

    Monitor  queues with sp_qstatmon 277Prepare to run sp_qstatmon 278Run sp_qstatmon 278

    Run a monitor script on Windows 279

    SharePlex 8.6.6 Administrator Guide 12

  • Monitor replication with SNMP 281Enable SNMP 281Configure the SNMP agent 282Custom MIB parameters 282Configure the SNMP traps 282

    Prevent and solve replication problems 283Find the solution in the SharePlex Knowledge Base 283Solve database setup problems 284Oracle setup issues 284SQL Server setup issues 285

    Solve configuration file problems 286A configuration file was accidentally deleted 286Solve configuration file errors 286

    Solve activation problems 287SharePlex cannot locate the configuration file 287Some objects failed to activate 288Activation failed completely 288Activation takes too long 289The reconcile command is slow to complete 289Common activation errors 289

    Solve replication problems 290General issues 291Oracle Capture-related issues 291Oracle Post-related issues 292Commit reduction issues 295Post stopped 295Other problems and solutions 297Common replication errors 297

    Solve Oracle DDL replication problems 302DDL is not replicating 302Replicated DDL is not completely displayed in the Event Log 303

    Solve queue problems 303SharePlex is running out of disk space 303There is a “failure to write and open queue” error 305The queues are corrupted 305The post queue seems too large 305

    Solve synchronization problems 305How SharePlex reports out-of-sync conditions 306Detect false out-of-sync conditions 306Common out-of-sync conditions and solutions 307Oracle-related out-of-sync conditions and solutions 310Correct the problem first 312Resynchronize data 313

    Solve compare command errors 313

    SharePlex 8.6.6 Administrator Guide 13

  • Kill compare processes 314Solve other replication problems 315SharePlex does not run on a Windows system 315A “Can’t unlink file” error occurs on Windows systems 316Common connection errors 316Common command errors 317

    How to resynchronize source and target tables 318How to restore Oracle archive logs 322How to release semaphores after process failure 323How to resolve disk space shortage 325How to conserve disk space on the target 325How to restore disk space 325

    How to find the ORACLE_SID and ORACLE_HOME 326

    Repair out-of-sync Data 328Overview of Compare and Repair 328Supported targets 328Overview of the server and client processes 329How locks are managed 329

    Before you use Compare and Repair 329How to use the repair and compare commands 330When to run a repair 331How to run the compare and repair commands 331

    Procedures to Maintain Oracle High Availability 332Recover replication if the primary system fails 332Supported databases 332Requirements 333Procedure 1: Move replication to the secondary system 333Procedure 2: Move replication to the restored primary system 333

    Recover replication if the secondary Oracle instance fails 337Supported databases 337Requirements 337Procedure 338

    Move replication during planned failover and failback 339Supported databases 340Requirements 340Procedure 340

    Make changes to an active replication environment 343Change an active configuration file 343Add or change table specifications in an active configuration 344Supported databases 344Procedure 344

    Change Partitioned Replication 344Supported databases 345

    SharePlex 8.6.6 Administrator Guide 14

  • Add Oracle sequences to an active replication configuration 346Supported databases 346Enable auto-add of sequences 346Add sequences if auto-add is not enabled 346Add a sequence if the sequence does not populate a column 346Add a sequence if the sequence populates a column 347

    Remove source objects from replication 348Supported databases 348Procedure 348

    Make DDL changes in an active replication configuration 349Supported databases 349Requirements 349Procedure 349

    Make Oracle changes that affect replication 350Supported databases 350Move the location of ORACLE_HOME 350Change the target ORACLE_SID 350

    Change the SharePlex database account 351Supported databases 351Procedure 351

    Change the name or IP address of a replication host 353Set the SharePlex port number 353Supported databases 353Set the SharePlex port on Unix and Linux systems 353Set the SharePlex port on Windows systems 355

    Apply an Oracle application patch or upgrade 357Before you  patch or upgrade an application 357Which procedure to use? 357The effect of patches and upgrades on partitioned replication 358Naming conventions used 359

    Apply patch/upgrade to source then copy it to target 359Supported databases 359When to use this procedure 359Overview of the procedure 360Apply the patch/upgrade 360

    Apply patch/upgrade to source and target 361Supported databases 361When to use this procedure 361Overview of the procedure 362Apply the patch/upgrade 362

    Apply patch to source and replicate it to the target 363Supported databases 363When to use this procedure 363Apply the patch/upgrade 363

    SharePlex 8.6.6 Administrator Guide 15

  • Back up Oracle data on the source or target 364Perform a partial backup of the source system 364Perform a full backup on the source system 365

    Tune the Capture process 366Disable LOB Mapping 366Tune Capture on Exadata 367Tune checkpointing 367

    Tune the Post process 368Use Oracle INDEX hints 368Tune SQL Caching 369Supported targets 369Enable or disable SQL Cache 370Oracle 370Open Target 370

    Tune SQL Cache for best performance 370Adjust open cursors 371Skip large maintenance transactions 372Make small transactions faster 372Increase the level of concurrency 373Reduce the number of commits 373

    Split a large transaction into a smaller one 373Tune queue performance 374Reduce queue contention 374Tune subqueue indexing 374

    Tune hash-based horizontally partitioned replication 374

    Appendix A: Peer-To-Peer Diagram 376

    Appendix B: SharePlex variables 378

    SharePlex 8.6.6 Administrator Guide 16

  • About this GuideThis manual provides instructions for:

     l Operating SharePlex

     l Planning your replication strategy

     l Preparing the environment for replication

     l Configuring replication

     l Starting replication

     l Monitoring, tuning, and troubleshooting replication

     l Failover/failback in a high-availability environment

     l Performing administrative operations on replication systems

    Other SharePlex documentationFor the complete SharePlex documentation set, go to:

    http://documents.quest.com

     l See the SharePlex Reference Guide for reference information that you will need from time to time. It includes detailed information about:

     l sp_ctrl commands that administer, monitor and control replication

     l SharePlex tuning parameters

     l SharePlex utilities

     l SharePlex error messages

     l See the SharePlex Preinstallation Checklist  for  tasks that must be finished before  installing or running SharePlex.

     l See the SharePlex Installation Guide for instructions for installing SharePlex and performing initial setup.

     l See the SharePlex Upgrade Guide for instructions for upgrading a current installation of SharePlex to this version.

     l See the  SharePlex Release Notes for information about new features, enhancements, bug fixes and known issues in this release.

    SharePlex 8.6.6 Administrator GuideAbout this Guide

    17

    http://documents.quest.com/

  • Conventions used in this guideConventions used in this manual

    The following typographic conventions are used in this guide.

     l Bold represents required components of a command or option that must be typed as shown.

     l Italics represent variables defined, named or entered by the user.

     l {Braces} enclose required arguments.

     l [Brackets] represent optional command components and may also be used in example command strings to emphasize required user defined variables in long strings.

    Example:

    reconcile queue {queuename} for {datasource-datadest} [on host]

     l A vertical bar, or “pipe” character, ( | ) within brackets or braces indicates that you can use only one of the enclosed components.

    Example:

    abort service {service | all}

    Names of commands, programs, directories and files are expressed in Bold.Other names are expressed in capital letters using the default font.

    Examples:

    The sp_ctrl program is located in the bin directory.Open the oramsglst file.Find the value for ORACLE_HOME.

    Click Apply.System displays, such as prompts and command output, are expressed in a monofaced (fixed-space) font.

    Examples:sp_ctrl(sysA)>

    User is a viewer (level=3)

    Windows menu items, dialog boxes, and options within dialog boxes are expressed in Bold.Example:

    From the File menu, select Print.System names are expressed generically or fictitiously. When necessary, the source system (or primary system) is referred to as SysA. Target systems (or secondary systems) are referred to as SysB, SysC, SysD, and so forth.

    SharePlex 8.6.6 Administrator GuideConventions used in this guide

    18

  • About us

    We are more than just a nameWe are on a quest to make your information technology work harder for you. That is why we build community-driven software solutions that help you spend less time on IT administration and more time on business innovation. We help you modernize your data center, get you to the cloud quicker and provide the expertise, security and accessibility you need to grow your data-driven business. Combined with Quest’s invitation to the global community to be a part of its innovation, and our firm commitment to ensuring customer satisfaction, we continue to deliver solutions that have a real impact on our customers today and leave a legacy we are proud of. We are challenging the status quo by transforming into a new software company. And as your partner, we work tirelessly to make sure your information technology is designed for you and by you. This is our mission, and we are in this together. Welcome to a new Quest. You are invited to Join the Innovation.

    Our brand, our vision. Together.Our logo reflects our story: innovation, community and support. An important part of this story begins with the letter Q. It is a perfect circle, representing our commitment to technological precision and strength. The space in the Q itself symbolizes our need to add the missing piece — you — to the community, to the new Quest.

    Contacting QuestFor sales or other inquiries, visit www.quest.com/company/contact-us.aspx or call +1 949 754-8000.

    Technical support resourcesTechnical support is available to Quest customers with a valid maintenance contract and customers who have trial versions. You can access the Quest Support Portal at https://support.quest.com.

    The Support Portal provides self-help tools you can use to solve problems quickly and independently, 24 hours a day, 365 days a year. The Support Portal enables you to:

     l Submit and manage a Service Request

     l View Knowledge Base articles

     l Sign up for product notifications

     l Download software and technical documentation

     l View how-to-videos

    SharePlex 8.6.6 Administrator GuideAbout us

    19

    http://www.quest.com/company/contact-us.aspxhttps://support.quest.com/

  •  l Engage in community discussions

     l Chat with support engineers online

     l View services to assist you with your product

    SharePlex 8.6.6 Administrator GuideAbout us

    20

  • 1

    Overview of SharePlexSharePlex provides high-speed, log-based replication that supports a variety of topology configurations in heterogeneous database environments. This chapter provides an overview of how SharePlex replication works. It explains concepts surrounding SharePlex replication and provides an overview of SharePlex capabilities.

    ContentsThe advantages of SharePlexAbout source and target dataAbout the SharePlex architectureSharePlex queuesSharePlex processesHow SharePlex replicates data

    About sp_copAbout sp_ctrlUnderstand the concept of synchronizationCharacteristics of synchronized tablesHidden out-of-sync conditions

    Strategies for information availabilityTest before you deploy

    The advantages of SharePlexSharePlex provides high-speed, log-based replication with support for many different configurations to meet your unique data availability needs. Major Unix, Linux, and Windows platforms are supported.

    Support a variety of targets

    SharePlex provides high-speed, log-based replication between Oracle instances on Sun Solaris, IBM-AIX, HP-UX, Linux, and Windows platforms. The SharePlex product line also provides the ability to replicate data from an Oracle source to Microsoft SQL Server, SAP Adaptive Server Enterprise (ASE),  SAP HANA, PostgreSQL, Teradata, Files (SQL and XML format), JMS, and Apache Kafka. 

    SharePlex 8.6.6 Administrator GuideOverview of SharePlex

    21

  • You can also configure SharePlex to maintain a change history database. Rather than overlaying current target data with the data that changed on the source (as in a regular replication configuration) SharePlex inserts a new row for every change to provide a step-by-step history of every change made to the source database. Optionally, you can include metadata columns in each row to include context information about the change that was made.

    Maintain up-to-date, accessible target instances

    A major benefit of SharePlex replication is that users can access a target database while SharePlex updates it. SharePlex targets are continuously updated, providing a reliable copy of the production database that can be used for reporting, queries, extracts, backups, and high availability. Removing that processing from the production server improves the performance of the production database while enabling the secondary database to be optimized for the needs of its users. In addition, SharePlex delivers a logical replica that helps protect against accidental DDL or DML changes and database corruption.

    Compare source and target data and repair inconsistencies

    To verify the consistency of source and target data, SharePlex enables you to detect and correct hidden out-of-sync conditions in target tables before they become large problems that require the tables to be resynchronized. SharePlex detects extra or missing rows and rows whose values do not match. You can customize these comparisons, for example to filter the rows that are compared.

    Support high-intensity OLTP and ERP environments

    SharePlex is designed for business volumes of data. It is capable of replicating millions of transactions a day for thousands of tables. It supports business varieties of data, including data types such as LONG columns and sequences, which are found in ERP applications, as well as BLOB and CLOB datatypes.

    Conserve system resources

    SharePlex accomplishes its replication without significantly impacting the source database, the source system, or the network. Its log-based design allows it to replicate with very low overhead. Because SharePlex replicates changes as they occur, rather than on a commit or refresh schedule, it reduces the impact of replication on the network and does not cause spikes in network performance. This design also minimizes latency between source and target systems.

    Replicate with both speed and accuracy

    SharePlex is fast, minimizing the latency between source and target databases by capturing modifications to selected objects from the redo logs continuously and starting replication before transactions are committed. If a transaction is canceled, SharePlex replicates the rollback so that the target is an accurate representation of the source. SharePlex strictly adheres to the Oracle Read Consistency model, maintaining operation order and session context all the way to the target, where SharePlex uses standard SQL to apply the replicated changes.

    Maintain fault tolerance

    Another significant advantage of SharePlex is its tolerance for outages. If the target database is unavailable, SharePlex queues data on the target system, allowing transactions to accumulate until a target connection can be re-established. If the target system is down, or if there are network problems, SharePlex stores the transactions on the source system until operations are restored.

    Maintain a high level of user control

    With this design, you have additional options. You can control when SharePlex sends the data over the network. By default, SharePlex replicates as quickly as it can, sending a steady stream of data to the target systems, but 

    SharePlex 8.6.6 Administrator GuideOverview of SharePlex

    22

  • you can delay transmission by stopping the Export process. To control when the transactions are applied to a target system, you can stop the Post process. When you are ready for the transactions to be applied, you simply start the posting process again. As an alternative, you can force the Post process to delay transactions based on a time factor, using one of the SharePlex tuning parameters.

    Benefit from a high level of flexibility

    SharePlex enables you to customize replication to specific needs. For example, you can replicate an entire table, or you can replicate a subset of its data (columns) beyond a firewall while protecting other, more sensitive data. You can replicate different records to different locations. And, you can configure SharePlex to interact with PL/SQL procedures that transform data before, or instead of, posting it to a target database.

    SharePlex provides several other ways to configure replication routes, as well.

    Install quickly and easily

    SharePlex is relatively simple to install. The average installation takes about an hour for source and target systems. Configuration of replication scenarios may require more time if they are especially complex or if there are special circumstances.

    Maintain a high availability environment

    SharePlex provides significant advantages for high-availability and other mission-critical operations where perpetual data access is essential and downtime means lost business opportunities. Using WAN connections, SharePlex replication can be used to maintain a duplicate database in a different location that is ready for fast, seamless failover and failback in planned or unplanned mode.

    When the primary system fails, user activity moves to the secondary system and continues while the secondary instance is copied and applied to the primary system during recovery. SharePlex reconciles the copy provided by the backup with the ongoing, replicated user transactions, discarding operations already applied by the backup. With synchronization between the two databases restored, users move back to the primary system and continue to work.

    Simplify routine maintenance

    SharePlex simplifies the maintenance of Oracle instances involved in replication by facilitating data re-synchronization with minimal interruption to user activity. Application and Oracle patches, upgrades, and DDL changes can be performed on the source machine and applied to the target machine with a hot backup instead of manually, while SharePlex replicates online transactions. SharePlex synchronizes the replicated changes with the backup, and replication resumes in a seamless manner.

    Reduce downtime and risk from migrations

    Hardware migrations usually require a significant amount of downtime, whether you need to change hardware platforms, move a data center, or consolidate servers to reduce costs. By maintaining a near-realtime copy of the database, SharePlex can help you minimize migration downtime by enabling the original system to function normally until the migration is complete.

    About source and target dataSharePlex replication uses the concepts of source and target.

    SharePlex 8.6.6 Administrator GuideOverview of SharePlex

    23

  •  l The source data is the primary data that is to be replicated. This data resides on the source system.

     l The target data is a full or subset copy of the primary data.This data resides on the target system. The object of replication is to keep the source and target data synchronized, or in-sync. This means that the state of the source data is reflected accurately by the target data, adjusting for any transformation that is performed and for any time lag in the replication stream. 

    As changes are made to source data, SharePlex continuously replicates them to the target system. The target data can take the form of any of the SharePlex-supported target types: tables in a database, messages in a JMS queue or Kafka topic, or XML or SQL records in a file that can be consumed by other software programs.

    You can replicate data from one source to many targets in a direct or cascading configuration, and you can replicate from many sources to one target.

    About the SharePlex architectureThis topic explains the basic components of SharePlex replication. 

    NOTE:  This topic explains the default configuration of SharePlex. You can customize the SharePlex configuration to add additional queues and processes for the purpose of isolating data streams or improving performance.

    SharePlex queuesQueues store the replicated data as it is transported from the source system to the target system. Queues are part of a checkpoint recovery system that facilitates safe, asynchronous transport of data. Data travels through the queues in the sequence in which it was generated.

    Data is not read-released (deleted) from one queue until it is written to the next one. Data accumulates in the queues on the source and target systems if the network, system, or database slows down or fails, or when a replication process stops. When the problem or outage is resolved, SharePlex resumes processing from the point where it stopped.

    SharePlex replication uses the following queues:

     l Capture Queue: The capture queue resides on the source system and stores captured data for further processing by SharePlex. There is one capture queue for each data source that is being replicated. A capture queue is identified by the datasource, for example o.oraA. 

     l Export Queue: The export queue resides on the source system.  It holds data  that has been processed by SharePlex and  is ready for  transport  to  the target system. By default,  there  is one export queue on a source system regardless of  the number of active configurations or  target systems.  A default export queue  is  identified by the name of  the source system on which  it  resides, for example, SysA. You can  instruct SharePlex to create additional named export queues  for more complex replication strategies. See .

     l Post Queue: The post queue resides on the target system. It holds data that is ready for writing to the target. On each target system, there is one post queue for the replication stream between a datasource and its target. For example, if OraA and OraB are both replicating to OraC, there are two post queues. A default post queue is identified by the name of the source system plus the datasource and the target, for example SysA (o.oraA-o.oraB). You can instruct SharePlex to create additional named post queues for more complex replication strategies. See .

    NOTE: All SharePlex queue files are created and maintained in the rim sub-directory of the SharePlex variable-data directory.

    SharePlex 8.6.6 Administrator GuideOverview of SharePlex

    24

  • SharePlex processesSharePlex replicates data through a series of replication processes that are started by the main SharePlex process, sp_cop.

     l The Capture process: The Capture process reads the transaction logs or archive logs on the source system for changes to objects that are configured for replication by SharePlex. The Capture process writes the data to the capture queue, where it accumulates until the Read process is ready for it. There is a separate Capture process for each datasource being replicated, each functioning concurrently and independently. The Capture process is named sp_ocap (Oracle Capture).

     l The Read process: The Read process operates on the source system to read data from the capture queue and add routing information to the data. After processing the data, the Read process sends it to the Export queue. The Read process is named sp_ordr (Oracle Reader).

     l The Export process: The Export process operates on the source system to read data from the export queue and send it across the network to the target system. By default, a source system has one Export process for each of its target systems. For example, if there are two target systems, there are two Export processes. Each Export process controls transmission of all data that is being replicated from a source system to a target system. The Export process is the first part of the Export/Import transport pair, which moves data between systems over a TCP/IP network. The Export process is named sp_xport.

     l The Import process: The Import process is the second half of the Export/Import transport pair. It operates on the target system to receive data and build a post queue. There is one Import process for each Export process. For example, if there are two source systems (each with an Export process) replicating data to a target system, there are two Import processes on the target. The Import process is named sp_mport.

    NOTE: It is possible to replicate data between Oracle instances on the same system. In this case the Export and Import processes are not created. The Read process places data directly into a post queue on that system.

     l The Post process: The Post process operates on the target system to read the post queue and apply the replicated operations to the target. There is a Post process for each post queue on a target system. Multiple Post processes can operate simultaneously on a system. The Post process is sp_opst_mt when configured to post to an Oracle database and sp_xpst when configured to post to an Open Target target.

    SharePlex 8.6.6 Administrator GuideOverview of SharePlex

    25

  • All communication and movement of data by SharePlex is handled by an internal messaging and transport system, using an asynchronous stream protocol with TCP/IP connections that is very efficient for large data transfers. This method ensures optimal performance, reliability and restart capabilities, while conserving communication bandwidth. SharePlex can replicate over any TCP/IP network, including WAN environments.

    SharePlex processes recover from network failures. When the network is unavailable, data is queued on the source system. SharePlex detects when the network is available again and resumes transmission.

    How SharePlex replicates dataSharePlex reads the blocks of the redo logs and replicates transactional changes that are made to objects that are specified in a configuration file. In the configuration file, you specify which data to replicate and the target to which it is applied. When a configuration is activated. SharePlex replicates only the changes made to the source data, providing a fast and reliable replication solution. For more information about configuration files, see 

    From the information that it has about an operation, SharePlex creates one or more messages that are sent from the Capture process to the Read process, and from the Read process to all of the other replication processes in the replication stream. 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 operation.

    Large operations like those on LONG or LOB columns can require 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. For example, an array insert of 70,000 rows might be accommodated with only 700 messages, depending on the data.

    In general, unless you are replicating numerous changes to LONGs and BLOBs, you can assume that the number of messages shown in the status output for a process or queue approximately corresponds to the same number of SQL operations.

    The Post process reads messages from the post queue and applies the replicated data changes to the target. In the case of a database target, Post constructs SQL statement to apply the data. In the case of non-database targets, Post outputs data records in the format required by the target, for example a JMS queue.

    SharePlex 8.6.6 Administrator GuideOverview of SharePlex

    26

  • The following explains the default ways that SharePlex builds SQL statements on the target system.

     l If the change is an INSERT, SharePlex uses all of the columns in the row to build an INSERT statement.

     l If the change is a DELETE, SharePlex uses only the key to build a WHERE clause to locate the correct row. If a table lacks a key, SharePlex simulates one by using the values of all of the columns, except LONG and LOB columns. You can specify columns to use as a key when you create the configuration file.

     l If the change is an UPDATE, SharePlex uses the key plus the values of the changed columns to build a WHERE clause to locate the correct row. Before applying changes to the database, the Post process compares a pre-image of the values of the source columns to the existing values of the target columns. The pre-image (also known as the before image) is the value of each changed column before the UPDATE. If the pre-image and the existing target values match, confirming a synchronized state, Post applies the changes. If not, then Post logs the operation to an error file and SharePlex returns an “out-of-sync” error.

     l If the change is an UPDATE or DELETE statement that affects multiple rows on the source machine, SharePlex issues multiple statements on the target to complete the task. For example, an UPDATE tableA set name = ‘Lisa’ where rownum < 101 statement actually sends 100 UPDATE statements to the target, even though only one statement was issued on the source.

    About sp_copThe sp_cop program coordinates the SharePlex replication processes: (Capture, Read, Export, Import, Post) and the SharePlex queues, and it initiates all of the other background processes that perform specific tasks. It also maintains communication with other systems in the replication network. In general, most SharePlex users have little interaction with sp_cop other than to start and stop it. Once started, sp_cop runs in the background.

     l Only a SharePlex Administrator (member of the SharePlex admin group) can start or stop sp_cop.

     l sp_cop must be started on all source and target systems involved in replication.

     l Start sp_cop as soon as (or before) users access the data on the source system, so that all SharePlex processes are ready to start processing transactions. That way, Capture can keep pace with the changes that are made to the source data.

     l If Capture loses pace with the rate at which source transactions are generated, the redo logs could wrap before Capture is finished reading them. Log wrap is when the online Oracle redo logs reach their maximum size and number and Oracle starts writing new logs over the existing ones. If SharePlex has not captured all of the changes before the logs wrap, it reads the archive logs, but by then there could be unacceptable latency between source and target data. In that case, it might be more practical to resynchronize the data.

    For more information about the replication processes, see About the SharePlex architecture.

    About sp_ctrlUse sp_ctrl to issue the commands that start, stop, configure, direct and monitor SharePlex activities. The sp_ctrl program interacts internally with the sp_cnc (command and control) process, which is the child process of sp_cop that executes the commands. Users do not interact with sp_cnc itself. 

    SharePlex 8.6.6 Administrator GuideOverview of SharePlex

    27

  • Understand the concept of synchronizationThe concept of synchronization applies mainly to table-to-table replication, where Post performs integrity checks to make certain that only one row in the target matches the row change that is being replicated.  It does not apply to file, JMS, Kafka, and change-history targets, which contain a record of every operation replicated by Post, some of which may be identical over time. The Post process does not perform integrity checks on those targets.

    Characteristics of synchronized tablesThe basic characteristics of synchronized source and target tables are as follows (unless the transformation feature is used).

     l If a row exists in the source database, it exists in the target.

     l Corresponding columns in source and target tables have the same structure and datatypes.

     l Data values in corresponding rows are identical, including the values of the key.

    Ensuring data integrity is the responsibility of the Post process. Post applies a WHERE clause to compare the key values and the before values of the SQL operations that it processes. Post uses the following logic to validate synchronization between source and target tables:

     l Post applies a replicated INSERT but a row with the same key already exists in the target. Post applies the following logic:

     o If all of the current values in the target row are the same as the INSERT values, Post considers the rows to be in-sync and discards the operation. 

     o If  any of  the  values are different  from  those of  the  INSERT, Post  considers  this  an out-of-sync  condition.

    NOTE: You can configure Post so that it does not consider non-key values when posting an INSERT. See the SP_OPO_SUPPRESSED_OOS parameter in the  SharePlex Reference Guide.

     l Post applies a replicated UPDATE but either cannot find a row in the target with the same key value as the one in the UPDATE or Post finds the correct row but the row values  do not match the before values in the UPDATE. Post applies the following logic:

     o If the current values in the target row match the after values  of the UPDATE, Post considers the rows to be in-sync and discards the operation. 

     o If the values in the target row do not match the before or after values of the UPDATE, Post considers this an out-of-sync condition.

    NOTE: You can configure Post so that it returns an out-of-sync message if the current values in the target row match the after values of the UPDATE.  See the SP_OPO_SUPPRESSED_OOS parameter in the  SharePlex Reference Guide.

     l A DELETE is performed on the source data, but Post cannot locate the target row by using the key. When Post constructs its DELETE statement, it includes only the key value in its WHERE clause. If the row does not exist in the target, Post discards the operation.

    SharePlex 8.6.6 Administrator GuideOverview of SharePlex

    28

    http://documents.quest.com/http://documents.quest.com/

  • Hidden out-of-sync conditionsPost only verifies the integrity of the rows that are being changed by its current SQL  operation. It does not verify whether other rows in that table, or other tables, are out of synchronization in the target database. Hidden out-of-sync conditions may not show up until much later, when a change is eventually made by SharePlex to that data or a discrepancy is detected in the course of using that data.

    Example of a detectable out-of-sync conditionSomeone logs into the target and updates the COLOR column in the target table from “blue” to “red” in Row1. Then, an application user on the source system makes the same change to the source table, and SharePlex replicates it to the target. In the WHERE clause used by Post, the pre-image for the target table is “blue,” but the current value in the target row is “red.” Post generates an out-of-sync error alerting you to the out-of-sync condition.

    Example of a hidden out-of-sync conditionSomeone logs into the target and updates  the COLOR column in the target table from “blue” to “red” in Row2, but the change is not made to the source table and is not replicated. The two tables are now out-of-sync, but there is no error message as in the previous example, because there is no Post involvement. No matter how many subsequent updates are made to other columns in the row (SIZE, WEIGHT), 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. When that change is replicated, Post compares the pre-images, and only then is there an error message.

    The majority of time, the cause of out-of-sync data is not anything done wrong by replication, but rather DML applied on the target, an incomplete backup restore, or some other hidden out-of-sync condition that can go undetected a long time until an operation applied by Post finally affects that data and an error is returned. Solving out-of-sync conditions can be time-consuming and disruptive to user activity. Once replication is started, it is recommended that you:

     l Prevent write access to the target tables, so that DML and DDL cannot be applied to them.

     l Use the compare command to compare source and target data regularly to verify synchronization and detect hidden out-of-sync conditions.

    Strategies for information availabilityBecause SharePlex replicates over LAN and WAN connections, you can put a replica database to work as a reliable, continuously updated alternate database that can be used in many different ways. The following strategies enable you to get the right data to the people who need it, when they need it.

    Reporting instancesTargets maintained by SharePlex are ideal for offloading report and query processing because they are accessible while being kept up-to-date, and they can be optimized with keys and indexes designed for optimal query performance. You can run reports all day long, without complaints about performance from your OLTP users. Even during busy reporting times such as the end of the month or quarter, application response time will be unaffected by heavy reporting. And, your organization’s decision-makers will appreciate the accuracy of the data reflected in the reports.

    SharePlex 8.6.6 Administrator GuideOverview of SharePlex

    29

  • Broadcast and cascadeWhen many remote users access or use data stored in a primary database, you can move their processing to one or more secondary databases that are kept current through SharePlex replication. That way, you can keep the primary database and system optimized for transactions. SharePlex also can cascade ndata through an intermediary system to remote systems, providing access for remote users who have no direct network connection to the primary database.

    Data warehousingSharePlex can replicate from numerous source systems to one target system. It is ideal for consolidating data in a data warehouse or a data mart so that information is available enterprise-wide for queries and reports. A high degree of granularity in the data that you replicate and the option to transform replicated data to conform to a different target structure are unique SharePlex features that enable you to populate your data warehouse with the specific, timely information that users need to make good decisions.

    High availability and disaster recoverySharePlex can be used to maintain duplicate databases over local or wide-area networks. Production can move to the alternate sites in an emergency or in a planned manner when routine maintenance is performed on the primary server. SharePlex replication enables the secondary database to be used for queries and reporting.

    SharePlex 8.6.6 Administrator GuideOverview of SharePlex

    30

  • Figure 1: SharePlex replication strategies at a glance

    Test before you deployBefore you implement SharePlex on production systems, Quest recommends performing tests in a mirror of the production environment to ensure that you configured SharePlex properly to support your requirements. Testing can uncover issues such as configuration errors and unexpected environmental issues, for example network or resource issues that affect replication performance or availability. 

    Additionally, it is assumed that your organization has in place an infrastructure that supports the use of enterprise applications such as SharePlex. These include, but are not limited to, the following:

    SharePlex 8.6.6 Administrator GuideOverview of SharePlex

    31

  •  l Availability and use of the database and SharePlex documentation

     l Training programs for users

     l Rollout and upgrade plans  that ensure minimal interruption to business. When SharePlex is implemented as part of an application’s infrastructure, it is strongly recommended to test new application functionality in conjunction with SharePlex in a non-production environment.

     l Database or system maintenance procedures that consider SharePlex dependencies, such as the proper shutdown of SharePlex processes and the preservation of unprocessed redo to accommodate system or database maintenance.

     l Sufficient security that prevent unauthorized persons from accessing SharePlex data records or making configuration changes.

    The SharePlex Professional Services team can help you prepare for, install, and deploy SharePlex in your environment. 

    SharePlex 8.6.6 Administrator GuideOverview of SharePlex

    32

  • 2

    Run SharePlexThis chapter contains instructions for running SharePlex on UNIX, Linux, and Windows

    ContentsRun SharePlex on Unix and LinuxStartup sequence on Unix and LinuxStart SharePlex on Unix and LinuxIdentify SharePlex processes on Unix and LinuxStop SharePlex on Unix and LinuxShutdown Considerations on Unix and Linux

    Run SharePlex on WindowsStartup Sequence on WindowsStart and stop SharePlex on WindowsSet SharePlex startup status on WindowsSet SharePlex process priority on WindowsIdentify SharePlex processes on WindowsShutdown Considerations on Windows

    Run SharePlex on Unix and LinuxOn Unix and Linux systems, you start SharePlex by running the sp_cop program. After you activate a configuration, sp_cop spawns the necessary child replication processes on the same system. Each instance of sp_cop that you start is a parent to its own set of child replication processes. The sp_cop process must be started on each system that is part of the replication configuration.

    You can start sp_cop in one of two ways: 

     l From the operating system command line.

     l At system startup as part of the startup file. 

    IMPORTANT:   Run SharePlex from either the korn (ksh) or C shell (csh) shell.

    SharePlex 8.6.6 Administrator GuideRun SharePlex

    33

  •  l Do not use the Bourne shell (sh), because the way it handles background processes is not compatible with SharePlex. If you must use the Bourne shell, switch shells to ksh or csh to run SharePlex, then exit the shell and return to the Bourne shell. 

     l If using an Exceed X window emulator, switch from the default shell of POSIX to the ksh shell, then run sp_cop from the ksh shell only.

    Startup sequence on Unix and LinuxWhen you start systems that are involved in replication, start the components in this order:

     1.  Start the system.

     2.  Start the source  and target databases.

     3.  Start SharePlex.

     4.  Start sp_ctrl.

     5.  Verify that the SharePlex processes are started by issuing the lstatus command in sp_ctrl.sp_ctrl>  lstatus

     6.  Allow users on the system.

    Start SharePlex on Unix and LinuxTo start SharePlex, you must log onto the system as a SharePlex Administrator. Your user name must be assigned to the SharePlex admin group in the /etc/group file. For more information about user groups, see Assign SharePlex users to security groups.

    Table 1: SharePlex startup syntax

    Method Startup syntax

    From root, with full path $ /productdir/bin/sp_cop [-uidentifier] [-s] &

    CD to the product directory $ cd /productdir/bin $ ./sp_cop [-uidentifier] [-s]  &

    From a startup script #!/bin/ksh cd productdir\bin nohup sp_cop [-uidentifier] [-s]  &

    Table 2: Description of SharePlex startup syntax

    Argument Description

    & Causes SharePlex to run in the background.

    nohup Directs the startup of SharePlex to continue in the background after the current user logs out.

    SharePlex 8.6.6 Administrator GuideRun SharePlex

    34

  • Argument Description

    -s   Starts sp_cop without starting the SharePlex replication processes (Capture, Read, Export, Import, Post). Without -s, the replication processes start automatically if there is an active configuration. 

      To start the replication processes after you start sp_cop with the -s option, use the startup command. The startup command starts all processes at once. Processes cannot be started individually after starting sp_cop with -s. Use the stop command if you must stop individual processes. See the SharePlex Reference Guide for more information about these commands.

    -uidentifier Starts sp_cop with a unique identifier. Use this option when there are multiple instances of sp_cop running on a system, which is required for some SharePlex configurations. For more information, see Run multiple instances of SharePlex on page 40.

    Some suggestions for identifier are: 

     l the SharePlex port number (such as -u2100) 

     l the identifier of the database for which replication is running (such as -uora12c) 

     l any descriptive identifier (such as -utest)

    Identify SharePlex processes on Unix and LinuxEvery session of sp_cop has a process ID number. The ID is returned after startup and then the command prompt reappears. If a configuration was activated during a former session of sp_cop, replication begins immediately. Without an active configuration, sp_cop runs passively in the background.On Unix and Linux systems, you can use the ps -ef | grep sp_ command to view the SharePlex processes that are running.

     l The sp_cop process is the root process.

     l The following child processes are spawned by sp_cop on a source system:

     o Command and Control process (sp_cnc)

     o Capture (sp_ocap)

     o Read (sp_ordr)

     o Export (sp_xport)

     l The following child processes are spawned by sp_cop on a target system:

     1.  Command and Control process (sp_cnc)

     2.  Import (sp_mport)

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

    Each child process has the same -uidentifier as its parent sp_cop process. This makes it easier to identify related processes when multiple session of sp_cop are running.

    SharePlex 8.6.6 Administrator GuideRun SharePlex

    35

    http://documents.quest.com/http://documents.quest.com/

  • Stop SharePlex on Unix and LinuxTo stop SharePlex, issue the shutdown command in sp_ctrl. This is a graceful shutdown that saves the state of each process, performs a checkpoint to disk, read/releases buffered data, and removes child processes. Data in the queues remains safely in place, ready for processing when sp_cop starts again. The shutdown process can take some time if SharePlex is processing large operations.

    You can use the force option with the shutdown command to forcefully shut down replication if necessary. It terminates sp_cop immediately, bypassing normal shutdown procedures. See the SharePlex Reference Guide for more information about this command.

    Shutdown Considerations on Unix and LinuxYou can safely shut down SharePlex for a short time while there is still transactional activity. The next time you start SharePlex, replication resumes at the correct place in the redo  logs or the archive logs, if needed. However, the best practice is to leave SharePlex running while there is transactional activity. Otherwise, SharePlex may need to process a large volume of redo backlog when you start it again, and there will be latency between the source and target data.

    If the redo logs wrap and the archive logs cannot be accessed, resynchronization of the source and target data may be the only option. Take this possibility into account whenever you stop SharePlex while redo is still being generated.

    NOTE: If you want to shut down both SharePlex and the database,  shut down SharePlex first. Otherwise, SharePlex will interpret that the database is failing and generate a warning message.

    As an alternative to stopping SharePlex, you can use the stop command in sp_ctrl to stop individual SharePlex replication processes as needed. See the SharePlex Reference Guide for more information about this command.

    Run SharePlex on WindowsOn Windows, SharePlex runs as a service named SharePlex port#, where port# is the port number that is used by a particular instance of SharePlex. The service can be installed during the installation of SharePlex or at a later time by running the SharePlex SpUtils progam. See the SharePlex Reference Guide for more information about SpUtils.

    NOTE: When directed in the documentation or other instructions to start or stop sp_cop on the Windows platform, it means to start or stop the SharePlex service.

    Startup Sequence on WindowsWhen you start systems that are involved in replication, start the components in this order:

     1.  Start the system.

     2.  Start the source and target databases.

     3.  Start the NuTCRACKER service in the Windows Administrative Tools control panel. This starts the MKS Toolkit® operating environment, which must be running in order to run SharePlex. See the SharePlex Installation Guide for more information about the MKS Toolkit.

    SharePlex 8.6.6 Administrator GuideRun SharePlex

    36

    http://documents.quest.com/http://documents.quest.com/http://documents.quest.com/http://documents.quest.com/

  •  4.  Start  the SharePlex  port#  service.  For  more  information,  see  Start  and  stop  SharePlex  on Windows  on  page  37.

     5.  Start sp_ctrl from the bin sub-directory of the SharePlex product directory.

     6.  Verify that the SharePlex processes are started by issuing the lstatus command in sp_ctrl.sp_ctrl>  lstatus

    Start and stop SharePlex on WindowsOn Windows, the only way to start or stop SharePlex is by starting or stopping the SharePlex service. To control the service, you can use the SpUtils utility or the Windows Administrative Tools control panel.

    NOTE: Starting the SharePlex service automatically starts the SharePlex replication processes  (Capture, Read, Export, Import and Post). If you do not want those processes to start when the service starts, they must be stopped with the stop command in sp_ctrl before you shut down the SharePlex service. They will remain stopped until you issue the start command for each process that you want to start.

    To control the SharePlex service with SpUtilsYou can use SpUtils to install, start, stop, and check the status of the SharePlex service.

     1.  Log onto Windows as a SharePlex Administrator. Your user name must be assigned to the SharePlex admin group. For more information, see Assign SharePlex users to security groups on page 240.

     2.  View the Windows services to make certain the NuTCRACKER service is running. Start it, if needed.

     3.  Run the SpUtils utility from the desktop shortcut or  the Programs menu.

     4.  Click the SharePlex Services tab of the utility.

     5.  Select the port number of the SharePlex instance that you want to control.

     6.  Do one of the following:

     l Click Install to install the service. If Install is not shown, the service exists.

     l Click Start to start the service. When Current State shows that the service is running, you can close the utility. If Start is not shown, the service is either running already or not installed.

     l Click Stop  to stop the service.  If Stop  is not shown,  the service  is either stopped already or not  installed.

    NOTE: You can also use the shutdown command in sp_ctrl to stop the SharePlex service.

    To control the SharePlex service from WindowsThe SharePlex service appears as an entry named SharePlex port# in the Services console of the Administrative Tools control panel. Right-click the service name to start or stop the service.

    Set SharePlex startup status on WindowsYou can change the timing of SharePlex startup. By default, it is Automatic, meaning the service starts when the system starts. You may need to contact a System Administrator to perform this task.

     1.  Open the Services console of the Administrative Tools control panel. 

     2.  Right-click the SharePlex service name, then click Properties.

    SharePlex 8.6.6 Administrator GuideRun SharePlex

    37

  •  3.  From  the  Startup  type  list,  select  the  desired  startup  option.  For  assistance,  click  the  Help  link in  the  dialog.

    Set SharePlex process priority on WindowsIMPORTANT! Do not use the standard Windows Task Manager to set process priority for SharePlex.On Windows systems, the NuTCRACKER operating environment controls the SharePlex processes. The SpUtils utility has an option that enables you to run the Windows Task Manager with the required elevated privileges to set the process priority. This procedure must be performed by a SharePlex Administrator. Consult with the System Administrator to select an appropriate value based on the requirements of all software running on the system.

    To set SharePlex priority

     1.  Run SpUtils.

     2.  Select the TaskMgr tab.

     3.  Right click the SharePlex instance that you want to prioritize.

     4.  Select Set Priority, then select the desired priority level.

    Identify SharePlex processes on WindowsIn the Windows Task Manager, SharePlex appears as Sp_Copsrv.exe, representing the SharePlex sp_cop process. The operating system controls the parent Sp_Copsrv.exe service. The parent Sp_Copsrv.exe process spawns child Sp_Copsrv.exe processes — one for each replication process (Capture, Read, Export, Import, Post, sp_ctrl, and so forth.).

    For a standard uni-directional configuration replicating through default queues to one target system, there are following processes on a Windows system:

    On the source system:

     l One parent Sp_Copsrv.exe process.

     l One Sp_Ocap  (Capture) process plus one child Sp_Copsrv.exe process.

     l One Sp_Ordr (Read) process plus one child Sp_Copsrv.exe process.

     l One Sp_Xport (Export) process plus one child Sp_Copsrv.exe process.

     l If there are any additional SharePlex processes running, such as sp_ctrl, there is an additional Sp_Copsrv.exe process for each one.

    On the target system:

     l One parent Sp_Copsrv.exe process.

     l One Sp_Mport (Import) process plus one child Sp_Copsrv.exe process.

     l One Sp_Opst_Mt (Oracle Post) or Sp_Xpst (Open Target Post) process plus one child Sp_Copsrv.exe process.

     l If there are any additional SharePlex processes running, such as sp_ctrl, there is an additional Sp_Copsrv.exe process for each one.

    SharePlex 8.6.6 Administrator GuideRun SharePlex

    38

  • If there are no active replication configurations, the SharePlex processes do not start when you start the service, and just the parent Sp_Copsrv.exe will be running.To  identify  the parent Sp_Copsrv.exe  process  in  the Windows Task Manager,  look  for  the one  that  is using  the  largest  amount  of memory. The  child Sp_Copsrv.exe  processes  consume  less memory  than  the parent  process.

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

    Shutdown Considerations on WindowsYou can safely shut down SharePlex for a short time while there is still transactional activity. The next time you start SharePlex, replication resumes at the correct place in the redo  logs or the archive logs, if needed. However, the best practice is to leave SharePlex running while there is transactional activity. Otherwise, SharePlex may need to process a large volume of redo backlog when you start it again, and there will be latency between the source and target data.

    If the redo logs wrap and the archive logs cannot be accessed, resynchronization of the source and target data may be the only option. Take this possibility into account whenever you stop SharePlex while redo is still being generated.

    NOTE: If you want to shut down both SharePlex and the database,  shut down SharePlex first. Otherwise, SharePlex will interpret that the database is failing and generate a warning message.

    As an alternative to stopping SharePlex, you can use the stop command in sp_ctrl to stop individual SharePlex replication processes as needed. See the SharePlex Reference Guide for more information about this command.

    SharePlex 8.6.6 Administrator GuideRun SharePlex

    39

    http://documents.quest.com/

  • 3

    Run multiple instances of SharePlexThis chapter shows you how to  configure and run multiple instances of SharePlex on one machine. For example, when replication is configured from multiple source systems to a central target system, you can run multiple instances of sp_cop to isolate the replication streams.

    ContentsRun multiple instances of SharePlex from separate installationsRun multiple instances of SharePlex from one installation

    Run multiple instances of SharePlex from separate installationsIMPORTANT! This topic assumes that there is no active configuration. It assumes you are configuring multiple instances of sp_cop as part of an initial setup of the replication environment.This method provides a one-to-one relationship between the binaries and the variable-data directory. This procedure creates autonomous SharePlex instances, with nothing in common between them. You start, control and maintain each SharePlex instance separately, and there are no special setup requirements.

    This method has the following benefits:

     l Processes are easily isolated. You do not have to set environment variables to point to the correct port and variable-data directory.

     l You can upgrade or perform other maintenance one product directory at a time, or choose not to perform those tasks.

     l You can run the same or different versions of SharePlex on the same system.

    The disadvantages are:

     l You must install and upgrade each installation separately.

     l More disk space is required to store the product files.

    SharePlex 8.6.6 Administrator GuideRun multiple instances of SharePlex

    40

  •  l In startup and shutdown scripts, and other places where you must map environment variables to SharePlex components, you must map them for each installation. 

    To set up multiple instances of SharePlex in this configuration:

     l Install each one separately. There should be one product directory and one variable-data directory per installation.

     l Install each one on a different TCP/IP port number.

     l IMPORTANT! Make certain to create a different database account for each installation. 

    To install SharePlex, see the SharePlex Ins