SPO 76 Ref Guide

Embed Size (px)

Citation preview

  • 7/31/2019 SPO 76 Ref Guide

    1/446

    SharePlex

    For OracleReference GuideVersion 7.6

  • 7/31/2019 SPO 76 Ref Guide

    2/446

    Quest Software, Inc. 2011 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 isfurnished under a software license or nondisclosure agreement. This software may be used or copied only inaccordance with the terms of the applicable agreement. No part of this guide may be reproduced ortransmitted in any form or by any means, electronic or mechanical, including photocopying and recording forany purpose other than the purchasers personal use without the written permission of Quest Software, Inc.

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

    Quest Software World HeadquartersLEGAL Dept5 Polaris WayAliso Viejo, CA 92656

    www.quest.comemail: [email protected]

    Refer to our Web site for regional and international office information.

    WarrantyThe information contained in this document is subject to change without notice. Quest Software makes nowarranty of any kind with respect to this information. QUEST SOFTWARE SPECIFICALLY DISCLAIMSTHE IMPLIED WARRANTY OF THE MERCHANTABILITY AND FITNESS FOR A PARTICULARPURPOSE. Quest Software shall not be liable for any direct, indirect, incidental, consequential, or other dam-age alleged in connection with the furnishing or use of this information.

    TrademarksQuest, Quest Software, the Quest Software logo, and SharePlex are trademarks and registered trademarks of Quest Software, Inc in the United States of America and other countries. Other trademarks and registeredtrademarks used in this guide are property of their respective owners.

    Third Party LicensingFor a list of third party components and their applicable licensing please refer to Appendix A in the SharePlex

    Administrators Guide .

    World Headquarters5 Polaris Way

    Aliso Viejo, CA 92656www.quest.come-mail: [email protected]

    http://www.quest.com/mailto:[email protected]:[email protected]://www.quest.com/
  • 7/31/2019 SPO 76 Ref Guide

    3/446

    CHAPTER1 iii

    Please refer to our Web site for regional and international office information.

    SharePlex For OracleReference GuideUpdated 03/22/11

    Version 7.6

    http://-/?-http://-/?-
  • 7/31/2019 SPO 76 Ref Guide

    4/446

    IV SHAREPLEX FOR ORACLEReference Guide Version 7.6

  • 7/31/2019 SPO 76 Ref Guide

    5/446

    Table of ContentsAbout t h i s gu ide

    Viewing this guide in PDF format............................................................................................... xiiConventions used in this guide ................................................................................................... xiiiAbout Quest Software.................................................................................................................. xv

    Chapte r 1 : Us ing SharePlex Comm andsPart 1: Overview of SharePlex commands

    Monitoring replication with SharePlex commands ....................................................................... 2Controlling replication with SharePlex commands ....................................................................... 2Understanding command authorization levels............................................................................... 3SharePlex commands at a glance................................................................................................... 5

    Part 2: Using SharePlex commands

    Issuing SharePlex commands ...................................................................................................... 13Issuing commands for a remote system....................................................................................... 14Issuing commands for clustered systems..................................................................................... 15Getting online help in sp_ctrl....................................................................................................... 15Producing a scroll bar for viewing command output (Windows)................................................ 15Alphabetical reference for SharePlex commands........................................................................ 16abort config .................................................................................................................................. 17abort service................................................................................................................................. 19activate config.............................................................................................................................. 22orainfo.......................................................................................................................................... 27authlevel....................................................................................................................................... 29clear status.................................................................................................................................... 30compare config ............................................................................................................................ 31compare using.............................................................................................................................. 32

  • 7/31/2019 SPO 76 Ref Guide

    6/446

  • 7/31/2019 SPO 76 Ref Guide

    7/446

  • 7/31/2019 SPO 76 Ref Guide

    8/446

    viii SHAREPLEX FOR ORACLEReference Guide Version 7.6

    Chapte r 3 :

    Chap te r 4 : Preven t ing and So lv ing Rep l i ca t ion Prob lems

    Part 1: Tools for preventing and solving problems

    Viewing the Status Database...................................................................................................... 314Viewing the Event Log .............................................................................................................. 314Viewing the user issued commands........................................................................................... 315Viewing the other log files......................................................................................................... 316Viewing and terminating SharePlex processes .......................................................................... 318Using the status and lstatus commands to view status............................................................... 322Using the verify config command to test a configuration.......................................................... 323Using the compare commands to verify synchronization.......................................................... 323Changing the IP address on the target machine ......................................................................... 323

    Getting syntax help for commands ............................................................................................ 324Monitoring replication to detect and prevent problems............................................................. 325

    Part 2: Solving Oracle Setup problems

    Incorrect ORACLE_SID and/or ORACLE_HOME.................................................................. 327More than one oratab file (Sun Solaris) ..................................................................................... 328Asterisk as the ORACLE_SID entry ......................................................................................... 328Legacy /etc/logingroups file (HP systems) ................................................................................ 328

    Part 3: Solving configuration problems

    SharePlex cannot locate the configuration................................................................................. 329A configuration will not activate ............................................................................................... 329Activation takes too long ........................................................................................................... 334

    Explanation of configuration command errors .......................................................................... 334Part 4: Solving synchronization problems

    How SharePlex reports out-of-sync conditions ......................................................................... 338Find and correct the problem before you resynchronize! .......................................................... 339How to detect and correct common out-of-sync conditions. ..................................................... 340How to resynchronize objects .................................................................................................... 350

    Part 5: Solving replication problems

    Replication is too slow............................................................................................................... 356

  • 7/31/2019 SPO 76 Ref Guide

    9/446

    TABLE OF CONTENTS ix

    Capture stopped ..........................................................................................................................362Post stopped................................................................................................................................363The post queue is not emptying..................................................................................................365There is an extra import process.................................................................................................366There is a failure to write and open queue error .....................................................................367The queues are corrupted............................................................................................................367The post queue seems too large..................................................................................................367You had to unexpectedly stop replication (UNIX).....................................................................368sp_cop is using too much CPU time...........................................................................................370A source table is corrupted .........................................................................................................370SharePlex is running out of disk space.......................................................................................371DDL is not replicating ................................................................................................................372Replicated DDL is not completely displayed in the Event Log .................................................372

    Post generates ORA-1762 errors ................................................................................................373Post generates a shared memory error........................................................................................374SharePlex does not run on a Windows system...........................................................................374Explanation of replication error messages..................................................................................377

    Part 6: Solving other problems

    A configuration was accidentally deleted...................................................................................385Conflict resolution generates compile errors..............................................................................385The reconcile command is slow to complete..............................................................................385Machine names cannot be resolved ............................................................................................386A Cant unlink file error occurs on Windows systems ...........................................................386Solving connection errors...........................................................................................................386Solving compare command errors..............................................................................................387

    Solving errors for other sp_ctrl commands ...............................................................................391

    Part 7: How to get help

    Before you call Quest Technical Support...................................................................................396Other information to send...........................................................................................................398How to use Quest support...........................................................................................................398

    Index ..............................................................................................................................................399

  • 7/31/2019 SPO 76 Ref Guide

    10/446

    x SHAREPLEX FOR ORACLEReference Guide Version 7.6

  • 7/31/2019 SPO 76 Ref Guide

    11/446

    ABOUT THIS GUIDE xi

    About this guide

    This guide is a reference for the following:

    SharePlex commands an overview of the commands that control replication

    through sp_ctrl , an explanation of command authorization levels, and detailed docu-mentation for each command.

    SharePlex parameters an overview of the SharePlex tuning parameters, how theyare set and stored, and detailed documentation for parameters that can be changed bySharePlex users.

    Problem prevention and solving tips a guide to help you prevent and resolve com-mon problems that might be encountered during configuration activation and replica-tion, plus an overview of the tools available for preventing, detecting and correctingproblems.

    Users of the SharePlex Reference Guide should have a thorough understanding of SharePlex before issuing commands, changing parameters or attempting to solve prob-lems.

    Please see the SharePlex Administrators Guide for information about:

    How SharePlex works. How to run the SharePlex programs. How to plan, implement and monitor a replication environment. Failover/failback procedures for high-availability environments. Procedures for performing administrative operations. How to use SharePlex utilities.

  • 7/31/2019 SPO 76 Ref Guide

    12/446

    xi i SHAREPLEX FOR ORACLEReference Guide Version 7.6

    Viewing this guide in PDF formatThis manual is available in Adobe PDF format on a documentation CD provided withthe SharePlex software and from the Quest SupportLink web site athttp://support.quest.com .

    The PDF document is viewable with Adobe Acrobat Reader Version 7 or 8 which isfree software that can be downloaded from the Adobe web site at

    http://www.adobe.com if it is not installed on your system.

  • 7/31/2019 SPO 76 Ref Guide

    13/446

    ABOUT THIS GUIDE xiii

    Conventions used in this guideThe following typographic conventions are used in this guide.

    Command-line syntax is expressed in Arial Narrow. The following explains the syn-tax components.

    Bold represents required components of a command or option that must be typedas shown.

    Italics represent variables defined, named or entered by the user. Bold Italics represents required user defined variables in example command

    strings. {Braces}enclose available required arguments. [Brackets]represent optional command components and may also be used in exam-

    ple command strings to emphasize required user defined variables in long strings.Example:

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

    A vertical bar, or pipe character ( | ) within brackets or braces indicates that youcan use only one of the enclosed components.Example:

    abort service {service | all}

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

    Examples:

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

    System displays, such as prompts and command output, are expressed in Courier .Examples:

    sp_ctrl(sysA)>User is a viewer (level=3)

  • 7/31/2019 SPO 76 Ref Guide

    14/446

    xiv SHAREPLEX FOR ORACLEReference Guide Version 7.6

    Windows menu items, dialog boxes, and options within dialog boxes are expressed inArial Bold .

    Example:

    From the File menu, select Print .

    Text is set in Times New Roman, with italics and bold styles used either for emphasis orwarnings.

    System names are expressed generically or fictitiously. When necessary, the source sys-tem (or primary system) is referred to as SysA. Target systems (or secondary systems)are referred to as SysB, SysC , SysD , and so forth.

    The following icons are used to highlight important or helpful information:

    This icondenotes addi-tional informa-tion that you

    should know.

    This icondenotes advicethat can helpyou save time or

    prevent prob-lems.

    This icon refersyou to relateddocumentationfor more infor-

    mation.

    This icon callsattention to criti-cal issues thatmust not be

    ignored.

  • 7/31/2019 SPO 76 Ref Guide

    15/446

    ABOUT THIS GUIDE xv

    About Quest SoftwareNow more than ever, organizations need to work smart and improve efficiency. QuestSoftware creates and supports smart systems management productshelping our cus-tomers solve every day IT challenges faster and easier. Visit www.quest.com for moreinformation.

    Contacting Quest SoftwareEmail: [email protected]

    Mail: Quest Software, Inc.World Headquarters5 Polaris WayAliso Viejo, CA 92656

    USAWeb site: http:// www.quest.com

    Please refer to our web site for regional and international office information.

    Contacting Quest SupportQuest Support is available to customers who have a trial version of a Quest product orwho have purchased a Quest product and have a valid maintenance contract. Quest Sup-port provides unlimited 24x7 access to SupportLink, our self-service portal. Visit Sup-portLink at http:// support.quest.com/

    From SupportLink, you can do the following:

    Retrieve thousands of solutions from our online Knowledgebase

    Download the latest releases and service packs Create, update and review Support cases

    View the Global Support Guide for a detailed explanation of support programs, onlineservices, contact information, and policies and procedures. The guide is available in at:http:// support.quest.com/

    mailto:[email protected]://www.quest.com/http://support.quest.com/http://support.quest.com/http://support.quest.com/http://support.quest.com/http://support.quest.com/http://www.quest.com/mailto:[email protected]
  • 7/31/2019 SPO 76 Ref Guide

    16/446

    xvi SHAREPLEX FOR ORACLEReference Guide Version 7.6

  • 7/31/2019 SPO 76 Ref Guide

    17/446

    1

    Using SharePlex Commands

    This chapter shows you how to use the sp_ctrl commands that configure, start, stop,control, and monitor the replication process. It is divided into parts for easier use.

    The first part provides an overview of the available commands and command authoriza-tion levels. The second part contains guidelines for using the commands followed by analphabetical reference guide with full descriptions and syntax.

    Conten t s

    Overview of SharePlex commandsUsing SharePlex commands

  • 7/31/2019 SPO 76 Ref Guide

    18/446

    2 SharePlex For OracleReference Guide Version 7.6

    Part 1: Overview of SharePlex commands

    SharePlex requires little user intervention to maintain a replication environment, butoccasionally you will need to make adjustments, diagnose a problem, or perform statuschecks. Many of these tasks are performed by issuing commands in sp_ctrl .

    Monitoring replication with SharePlex commandsLike any mission-critical software, SharePlex should be monitored regularly for situa-tions or events that could interfere with processing, especially those that could result in

    loss of data synchronization. The information commands summarized on page 7 helpyou monitor different aspects of replication. Issue them frequently to:

    Monitor for out-of-sync tables. Verify that replication processes are running. View the number of replicated messages in the queues. View the Event Log to view warnings, errors and other notifications.

    View process statistics that are helpful for tuning and problem solving. Detect tables or operations that are slowing down the replication process.

    Tip: To supplement the information commands, you can configure the SharePlex moni-toring scripts to notify you when key replication events occur. For more information, seeChapter 9 of the SharePlex Administrators Guide .

    Controlling replication with SharePlex commandsComplementing the information commands are numerous other commands that enableyou to:

    Create, verify, copy, edit, or delete configurations. Start, stop or abort replication processes. Delete and rebuild corrupt queues.

    http://../Admin/SP_ADM_GD.pdfhttp://../Admin/SP_ADM_GD.pdfhttp://../Admin/SP_ADM_GD.pdf
  • 7/31/2019 SPO 76 Ref Guide

    19/446

    CHAPTER1 3Using SharePlex Commands

    Remove orphaned Export processes. Change parameter settings and port connections. Detect and repair out-of-sync target rows. Remove old messages from the logs. View command syntax. Repeat a previous command.

    Understanding command authorization levelsTo execute a command, a SharePlex user must have that commands authorization levelor higher. You assign a users authorization level when you add that person to one of theSharePlex user groups on the system where he or she will be issuing commands. Eachgroup represents a different level of authorization. The groups were created whenSharePlex was installed.

    The table on page 4 shows the SharePlex user authorization levels, groups and roles.

  • 7/31/2019 SPO 76 Ref Guide

    20/446

    4 SharePlex For OracleReference Guide Version 7.6

    User Authorization Levels and Roles

    To add SharePlex usersDecide the authorization level you want each user to have, and then add the names tothe corresponding groups using the operating systems standard method for addingusers.

    UNIX systemsEdit the /etc/group file.

    Windows systemsUse the Users and Passwords control panel or the Computer Management tool inAdministrative Tools .

    AUTHLEVEL

    USER TYPE USER GROUP USER ROLES

    1 Administrator spadmin Can issue all SharePlex commands. Com-mands that can only be issued by a Share-Plex Administrator are: startup, shutdown

    all configuration commands relating toan active configuration all parameter commands except list

    param start capture stop capture abort capture truncate log

    2 Operator spopr Can issue all SharePlex commands exceptthose listed above.

    3 Viewer spview Can view lists, status screens, and logs tomonitor replication only .

  • 7/31/2019 SPO 76 Ref Guide

    21/446

    CHAPTER1 5Using SharePlex Commands

    SharePlex commands at a glanceThis section provides an overview of all SharePlex commands, grouped according to theprocesses or functions they control. Commands with an asterisk ( *) should be issuedfrequently. A detailed, alphabetical reference guide for SharePlex commands begins onpage 17 .

    Configuration commandsThe configuration commands control all aspects of managing SharePlex configurations.

    List of configuration commands

    Command Auth.Level Description

    abort config 1 Immediately terminates replication for the desig-nated configuration file whether or not data hasposted. Deactivates the configuration and deletesqueues and processes.

    activate config 1 Begins replication of the data specified in a config-uration.

    copy config 2 Duplicates a configuration to edit and save as a newfile.

    create config 2 Creates a new configuration file in which you enterinformation about objects to be replicated.

    deactivate config 1 Gracefully terminates replication of the data speci-fied in a configuration, allowing data in the queuesto be posted to the target database before the queuesare deleted.

    edit config 2 Modifies an existing configuration file using thedefault text editor.

    list config 3 Displays all of the configuration files on a sourcesystem, both active and inactive.

    purge config 1 Removes data from queues generated by an activeconfiguration, but does not deactivate the configu-ration or remove the queues themselves.

    remove config 2 Deletes a configuration file from the system perma-nently.

  • 7/31/2019 SPO 76 Ref Guide

    22/446

    6 SharePlex For OracleReference Guide Version 7.6

    Connect commandsThe connect commands control connections made to replication systems through thesp_ctrl interface.

    rename config 2 Assigns a different name to a configuration file.verify config 3 Verifies that the objects in a configuration are valid

    and that the configuration is structured properly toensure successful activation and replication.

    view config 3 Displays the contents of a configuration file.

    List of connect commands

    Command Auth.Level Description

    exit 3 Exits the sp_ctrl command-line session and dis-connects the TCP/IP link. (Used interchangeablywith quit .)

    host 3 Sets a default machine for the current sp_ctrl con-nection.

    port 3 Sets a default sp_cop port number for the currentsp_ctrl session.

    quit 3 Exits the sp_ctrl command-line session and dis-connects the TCP/IP link. (Used interchangeablywith exit .)

    List of configuration commands (continued)

    Command Auth.Level Description

  • 7/31/2019 SPO 76 Ref Guide

    23/446

    CHAPTER1 7Using SharePlex Commands

    Information commandsThe information commands provide information about the replication environment. Usethese commands when you are trying to resolve a replication problem or you want toview certain process conditions.

    List of information commands

    Command Auth.

    LevelDescription

    orainfo 3 Displays the Oracle database information.copy/appendstatus

    3 Displays status history for previous copy/append commands

    lstatus 3 Displays detailed information about the state of SharePlex replication.

    qstatus * 3 Displays the state of the capture, export and postqueues.reportcopy/append

    3 Displays copy/append history for a table.

    show 3 Displays the source and destination of the databeing processed by each replication process on asystem, and displays the status of each process.

    show activate 3 Displays the status of all configuration activationactivity on a source system.

    show capture 3 Displays brief or detailed statistics for the Captureprocess for use in tuning and problem solving.

    show compare 3 Displays the results of the compare using andcompare commands.

    show config 3 Displays properties of the active configuration.

    show export 3 Displays the number of messages sent to the targetsystem(s).

    show import 3 Displays the number of messages received from thesource system(s).

    show log 3 Displays the Event Log, Command Log, VerifyLog, Trace Log, or a process log.

    show post 3 Displays brief or detailed statistics for the Post pro-cess for use in tuning and problem solving.

  • 7/31/2019 SPO 76 Ref Guide

    24/446

    8 SharePlex For OracleReference Guide Version 7.6

    Maintenance commandsThe maintenance commands control command displays and files.

    show read 3 Displays brief or detailed statistics for the Readprocess for use in tuning and problem solving.

    show sql 3 Displays the current or last SQL statement pro-cessed by the Post process.

    show statusdb * 3 Displays the Status Database, which containsrecords of important replication events.

    show sync * 3 Displays information about out-of-sync conditions.

    status* 3 Displays an overview of the state of SharePlex rep-lication.

    List of maintenance commands

    Command Auth.Level Description

    clear status 2 Removes warning messages from the Status Data-base.

    remove logcompare

    3 Removes old compare reports and logs from thesystem.

    set log 3 Sets the default values for the show log command.

    truncate log 1 Clears the records from the Event Log, with the

    exception of logged commands.

    List of information commands (continued)

    Command Auth.Level Description

  • 7/31/2019 SPO 76 Ref Guide

    25/446

    CHAPTER1 9Using SharePlex Commands

    Parameter commandsThe parameter commands control the environment parameters that define how Share-Plex operates.

    Properties commandsThe properties commands display information about a users authorization level, thelocal system, and the local SharePlex installation.

    List of parameter commands

    Command Auth.Level Description

    list param 3 Displays a list of SharePlex parameters with currentand default values and set-at points.

    reset param 1 Restores the value of a SharePlex parameter to thedefault setting.

    set param 1 Changes the value of a SharePlex parameter on aglobal basis or for a specified replication process.

    List of properties commands

    Command Auth.Level Description

    authlevel 3 Displays the SharePlex authorization level of a userwho logs into sp_ctrl .

    hostinfo 3 Displays a machines name and operating system.

    version 3 Displays the version of SharePlex installed on a

    machine.

  • 7/31/2019 SPO 76 Ref Guide

    26/446

    10 SharePlex For OracleReference Guide Version 7.6

    Queue commandsThe queue commands eliminate orphaned or corrupt queues, and they delete orphanedexport processes.

    Run CommandsThe run commands control the operation of SharePlex with options for starting andstopping processes, starting and shutting down replication, re-synchronizing data, andenabling/disabling confirmation messages.

    List of queue commands

    Command Auth.Level Description

    delete queue 2 Removes a capture, export or post queue if thequeue is orphaned or corrupted.

    delete quser 2 Removes an unneeded Export process when a tar-get system is removed from the replication configu-ration.

    List of run commands

    Command Auth.Level Description

    abort service 2 or 1 Stops one or all replication processes immediately,without finishing processing. (Level 1 required forCapture.)

    clear status 3 Removes warning messages from the Status Data-base.

    shutdown 1 Shuts down sp_cop and all replication processes.start 2 or 1 Starts a replication process. (Level 1 required for

    Capture.)startup 1 Starts replication if sp_cop was started with the -s

    option to keep the SharePlex replication processesstopped.

    stop 2 or 1 Stops a replication process gracefully after it is fin-ished reading from or writing to its queues. (Level 1required for Capture.)

    CHAPTER1 11

  • 7/31/2019 SPO 76 Ref Guide

    27/446

    CHAPTER1 11Using SharePlex Commands

    Synchronization commandsThe synchronization commands control aspects of data synchronization.

    List of synchronization commands

    Command Auth.Level Description

    compare using 2 Compares the contents of all tables in a configura-tion to those of the target tables to verify synchroni-zation.

    compare 2 Compares the contents of a source table to those of a target table to verify synchronization.

    copy/append 2 Uses the Oracle Export/Import utility to allow usersto set-up replication and/or (re)synchronize tablesalready in replication.

    flush 2 Puts a marker in the data stream to establish a pointof synchronization between the source and targetdata, then stops the Post process at that point.

    reconcile 1 Synchronizes the results of a hot backup or hot copyapplied to the target system with ongoing usertransactions from the source system.

    repair 2 Compares the contents of a source table to those of a target table to repair out-of-sync rows, if neces-sary.

    repair using 2 Compares the contents of all tables in a configura-tion to those of the target tables to repair out-of-sync rows, if necessary.

    12 SharePlex For Oracle

  • 7/31/2019 SPO 76 Ref Guide

    28/446

    12 SharePlex For OracleReference Guide Version 7.6

    Miscellaneous commandsThese miscellaneous commands provide additional controls for using SharePlex.

    List of miscellaneous commands

    Commands Auth.Level Description

    edit 3 Displays the previously issued command in the texteditor so that you can edit it and execute the editedversion.

    expand 3 Will expand a wildcard specification and displaythe expanded specification to the screen.

    help 3 Displays descriptions and syntax for SharePlexcommands from the sp_ctrl command-line inter-face.

    redo N/A Executes the previous command again.usage 3 Displays the syntax for a SharePlex command.

    view log options 3 Displays the default values for the show log com-mand.

    CHAPTER1 13

  • 7/31/2019 SPO 76 Ref Guide

    29/446

    CHAPTER1 13Using SharePlex Commands

    Part 2: Using SharePlex commands

    This part provides basic information about issuing SharePlex commands and an alpha-betical reference guide for each one.

    Issuing SharePlex commandsSharePlex commands are issued through the sp_ctrl command-line interface. Thesp_ctrl prompt appears in one of two ways, depending on whether or not you set adefault system.

    The following are guidelines for issuing SharePlex commands:

    You can run sp_ctrl and issue commands for a local machine where SharePlex isrunning, or you can use one of the [ on host ] options to issue commands from onemachine to affect any other machine involved in replication (see the followingtopic) .

    To issue commands for a machine, sp_cop must be running on that machine. The maximum string length of a SharePlex command is 255 characters, including

    spaces. To work around this operating-system limitation, use the edit command. Formore information, see page 96 .

    For more information on running sp_ctrl , see the SharePlex Administrators Guide .

    sp_ctrl> Basic sp_ctrl prompt.

    sp_ctrl(this_host:3304)>

    Prompt when a default system and port are set by issu-ing the host (see page 108 ) and port (see page 120 )commands.

    14 SharePlex For Oracle

  • 7/31/2019 SPO 76 Ref Guide

    30/446

    14 SharePlex For OracleReference Guide Version 7.6

    Issuing commands for a remote systemTo issue a command that will affect a remote machine and to script commands thatinclude a login name, password, port number, or combination of those items, use one of the [on host ] command options. These options are available for most commands. Todetermine whether or not the [ on host ] options are available for a command, look in thecommands syntax description in the alphabetical reference section in this chapter.

    The following table describes the command options for remote connection using the [ onhost ] options.

    [on host ] optionsOPTION DESCRIPTION

    on host Use this option to execute a command on a system other thanthe one to which you currently are connected. (The currentsystem is shown in parentheses after the sp_ctrl prompt.) You

    are prompted for a login name and password for the system towhich you are connecting. This option, if used, must be thelast component of a commands syntax.Example: sp_ctrl(sysB)> status on SysAIn this example, the status command is being issued on sysBto show replication status on sysA.

    on host : portnumber Use this option for scripting SharePlex commands when a

    remote login and port number must be provided. This option,if used, must be the last component of a commands syntax.Example: sp_ctrl(sysB)> status on SysA:8304

    on login / password @host Use this option for scripting SharePlex commands when aremote login, password, and host name must be provided.This option, if used, must be the last component of a com-mands syntax.

    Example:sp_ctrl(sysB)> status on john/rosebud@SysA

    on login / password @host :portnumber Use this option for scripting SharePlex commands when aremote login, password, host name, and port number must beprovided. This option, if used, must be the last component of a commands syntax.Example:

    sp_ctrl(sysB)> status on john/rosebud@SysA:8304

    CHAPTER1 15

  • 7/31/2019 SPO 76 Ref Guide

    31/446

    Using SharePlex Commands

    Issuing commands for clustered systemsTo issue sp_ctrl commands on clustered systems, use the name set with theSP_SYS_HOST_NAME parameter as the host in the [ on host ] options when connectingfrom a remote system, or set it as the default for sp_ctrl by using the host command(see page 108 ). For more information about configuring SharePlex within a cluster, seethe SharePlex Installation and Demonstration Guide .

    Getting online help in sp_ctrlTo view descriptions and syntax for SharePlex commands from within the sp_ctrl inter-face, issue the help command (see page 106 ). To view just the syntax for a command,issue the usage command (see page 252 ).

    Producing a scroll bar for viewing command output(Windows)

    Scrolling might be necessary to view the entire output of certain sp_ctrl commands. If your Command Prompt window does not have a scroll bar, you can change the window

    properties to produce one.1 Click the Command Prompt icon at

    the top left corner of the console,then select Properties from themenu.

    2 In the Command Prompt Properties dialog box, click the Layout tab.

    16 SharePlex For Oracle

  • 7/31/2019 SPO 76 Ref Guide

    32/446

    Reference Guide Version 7.6

    3 In the Screen Buffer Size optionbox, increase the Height value until itproduces a scroll bar in the Com-mand Prompt window.

    4 Click OK to apply the settings.

    5 In the Apply Properties To Shortcut dialogbox, select one of the options, either toapply the new properties to the current com-mand session or to apply them as the newdefault for all sessions.

    6 Click OK to close the dialog box.

    Alphabetical reference for SharePlex commandsThe remainder of this chapter contains detailed documentation for each SharePlex com-mand. The commands appear in alphabetical order, beginning on the next page.

    CHAPTER1 17U i Sh Pl C d

  • 7/31/2019 SPO 76 Ref Guide

    33/446

    Using SharePlex Commands

    abort configUse the abort config command to deactivate a configuration instantly and delete all associated queues and replication processes at the same time. This command stops allreplication activity for the configured datasource on the source and target systems,whether or not data in the queues has been posted. It is a forceful deactivation.

    The abort config command is effective when there has been a system, configuration, ordata problem and you need to prevent posting to the target system(s). Because you aredeleting whatever data remains in the pipeline, the source and target instances will goout of synchronization after this command takes effect.

    If any SharePlex replication process stops before or during the abort config command,the command also stops. When the process starts again, the command resumes working.This allows abort config to work even if the network is temporarily down it remainsin the queues until the connection is restored.

    Aborting when there are multiple active configurationsWhen there are multiple active configurations on the same source system, use the abortconfig command only if there are named export queues that separate the replicationstreams for each one. Without named export queues, SharePlex funnels all replicateddata through one export queue, and an abort config command for one configuration

    deletes the data for all of them. To create named queues, see Chapter 5 of the SharePlex Administrators Guide .

    SYNTAX

    Authorization level: Administrator (1)Issued for: source systemRelated commands: deactivate config, purge config

    BASIC COMMAND [ON HOST] OPTIONS

    The [on host] options enable issuing of remote commands. For more information aboutthese options, see page 14 .

    abort configfilename available

    18 SharePlex For OracleR f G id V i 7 6

    http://../Admin/SP_ADM_GD.pdfhttp://../Admin/SP_ADM_GD.pdfhttp://../Admin/SP_ADM_GD.pdfhttp://../Admin/SP_ADM_GD.pdfhttp://../Admin/SP_ADM_GD.pdf
  • 7/31/2019 SPO 76 Ref Guide

    34/446

    Reference Guide Version 7.6

    Required argumentsARGUMENT DESCRIPTION

    filename The name of the configuration that you want to abort. Configurationnames are case-sensitive.Example:sp_ctrl(sysA)> abort config sales

    CHAPTER1 19Using SharePlex Commands

  • 7/31/2019 SPO 76 Ref Guide

    35/446

    Using SharePlex Commands

    abort serviceUse the abort service command to terminate a SharePlex replication process (service)immediately, whether or not that process has finished reading from, or writing to, itsqueues. This command is effective when you cannot wait for a process to stop grace-fully, or in unusual circumstances when a process will not shut down when you issue thestop command.

    This command does not affect replicated data. The data remains safely in the queues,and SharePlex resumes normal processing when the process is started again.

    A process aborted with the abort service command remains stopped even if SharePlexis shut down and re-started. Only the start command can start it again (see page 240 ).

    The abort service command provides options with which you can abort a process forany (or all) systems, or for a named queue, without affecting replication for other routes.

    SYNTAX

    Authorization level: Operator (2); Administrator (1) to abort CaptureIssued for: abort service for Capture, Read and Export are issued for

    the source system.abort service for Import and Post are issued for the targetsystem.

    Related commands: start, stop

    BASICCOMMAND

    COMMAND OPTIONS [ON HOST] OPTIONS

    The [on host] options enable issuing of remote commands. For more information aboutthese options, see page 14 .

    abort service service [to host ][fromhost ][fordatasource ]

    [fordatasource-datadest ][queue queuename ]

    available

    20 SharePlex For OracleReference Guide Version 7 6

  • 7/31/2019 SPO 76 Ref Guide

    36/446

    Reference Guide Version 7.6

    Required argumentsARGUMENT DESCRIPTION

    service The SharePlex replication process you want to abort. Valid values are:CaptureReadExportImportPost

    Example:sp_ctrl(sysA)> abort service capture

    Command options

    OPTION DESCRIPTIONto host This option aborts Export to a designated system, while allowing

    Export to other systems to continue. host is the name of the target system.

    Example:sp_ctrl(sysA)> abort service export to sysBIn this example, Export is aborted from sysA to sysB, but other Export

    processes from sysA to other target systems will continue.from host This option aborts Import from a designated system, while allowing

    Import from other systems to continue. host is the name of the source system.

    Example:sp_ctrl(sysD)> abort service import from sysCIn this example, Import from sys C is aborted on sysD, but other Import

    processes on sysD from other source systems will continue.for datasource This option aborts Capture or Read for a designated datasource, but

    other replicating datasources on the same system are unaffected. datasource is expressed as o.SID , where SID is the ORACLE_SID

    of the source Oracle instance.Example:sp_ctrl(sysA)> abort service read for o.oraA

    In this example, Read is aborted on sysA for instance oraA, but otherRead processes for other instances on sysA will continue.

    CHAPTER1 21Using SharePlex Commands

  • 7/31/2019 SPO 76 Ref Guide

    37/446

    g

    for datasource-datadest This option aborts Post for a designated source SID-target SID datastream, while allowing other Post activities to continue.

    datasource is expressed as o.SID , where SID is the ORACLE_SIDof the source Oracle instance.

    datadest is expressed as o.SID , where SID is the ORACLE_SID of the target Oracle instance.

    Example:sp_ctrl(sysC)> abort service post for o.oraA-o.oraC In this example, Post is aborted on sysC for instance oraA replicating tooraC, but other Post processes on sysC will continue.

    queue queuename This option aborts the Export, Import or Post process associated with anamed queue, while allowing replication through other named queuesto continue.

    queuename is the name of the queue.Example:sp_ctrl(sysA)> abort service export queue QAIn this example, Export of data through named export queue QA isaborted on sysA, but Export will continue for data assigned to all othernamed queues.

    Command options (continued)OPTION DESCRIPTION

    22 SharePlex For OracleReference Guide Version 7.6

  • 7/31/2019 SPO 76 Ref Guide

    38/446

    activate configUse the activate config command to activate a configuration. Replication begins imme-diately as soon as the activation process is complete.

    To activate a configuration, the database containing the objects to be replicated must bemounted and open. The length of time that activation takes varies, depending on thesize, number and structure of the configured objects.

    You can activate one configuration per datasource (Oracle instance) on each system.For example, if there are ConfigA, ConfigB and ConfigC for instance ora10, you canactivate only one of them at a time. Activating another configuration for the same data-source automatically deactivates the first one.

    The process that sp_cop calls to activate a configuration is sp_tconf .

    The activation process retains control of the sp_ctrl interface until the activation is fin-ished. To activate multiple configurations for different datasources on the same system,activate the first one, then open another session of sp_ctrl to activate the second one.Open as many sessions of sp_ctrl as you have configurations to activate.

    Activation processes the configuration file, generating all the information that is used bySharePlex to identify the objects that are in replication, route the replication changes tothe appropriate target database, and to generate the correct SQL for applying thechanges to the target. After this is done the process activates all of the tables that havebeen added to replication.

    Activation creates asynchronous, parallel processing threads to activate multiple tablessimultaneously. Each table is locked for a very short time, just long enough to activatethe table. Replication of each table begins as soon as its activation is complete. Shouldone or more table fail to activate, SharePlex continues with the activation of the othertables. If an application uses NOWAIT locking on tables in the replication configura-tion, it could fail if it attempts to obtain a lock on an object being activated.

    Warning! Do not perform DDL, including TRUNCATE, during activation. DMLchanges are the only permissible changes during activation.

    Warning! Activation requires that the applications have retry logic. NOWAIT locking ontables in the replication configuration may cause the application to fail if it attempts to

    obtain a lock on an object that is being activated.

    CHAPTER1 23Using SharePlex Commands

  • 7/31/2019 SPO 76 Ref Guide

    39/446

    Controlling the number of activation threadsThe SP_OCF_THREAD_COUNT parameter (see page 265 ) controls the default num-ber of activation threads. You can change the default number of threads by issuing theset param command for SP_OCF_THREAD_COUNT (see page 182 ), or you can over-ride the default by using the [threads= n ] option of the activate config command.

    Changing the PROCESSES parameter

    Configuration activation creates four database log-ons (LDAs) per thread.Before you activate a configuration, you might need to change the PROCESSES param-eter in the init.ora file to accommodate the activation log-ons.

    For Oracle, the PROCESSES parameter should be set to the highest number of usersexpected to log onto the database at any given time.

    For SharePlex, add to the Oracle value the number of log-ons that the activation

    threads will generate, plus three more.

    Verifying the configurationBefore you activate a configuration, use the verify config command to confirm thatbasic requirements for successful activation and replication have been satisfied. Thecommand alerts you to potential problems that can cause the activation to fail. See

    page 253 for more information.

    Viewing configuration activation statusSharePlex activates objects according to their object ID, not their order in the configura-tion file, so there is no way to predict the order of activation. You can use the show acti-vate command on the source system to view activation statistics (see page 192 ).

    Viewing results of the activationBecause SharePlex continues with activation whether or not individual tables fail toactivate, it alerts you when tables fail to activate by displaying the following error mes-sage at the sp_ctrl prompt: WARNING, not all objects activated successfully. Checkactivation log.

    To view the results of activation:

    Issue the show config command (see page 200 )

    24 SharePlex For OracleReference Guide Version 7.6

  • 7/31/2019 SPO 76 Ref Guide

    40/446

    Or...

    View the SID _oconf ## .log file (SID is the ORACLE_SID of the datasource for theconfiguration). SharePlex prints activation status and error messages in this file,which resides in the log sub-directory in the SharePlex variable-data directory.

    Note: The activation log file name is comprised of three (3) components: the Oracle SID,the activation process identifier ( oconf ), and a log number. There may be more than onelog, each being differentiated from the others by the log number.

    The following is an excerpt from a SID _oconf ## .log log for default activation:

    oconf 08-07-08 16:17:03.297156 23372 1 Oracle compatible parameterstr=11.1.0.0.0, int=111oconf 08-07-08 16:17:03.404378 23372 1 Parsing the configuration fileoconf 08-07-08 16:17:03.445080 23372 1 Completed parsing the configurationfileoconf 08-07-08 16:17:03.445225 23372 1 New activation id 1348

    oconf 08-07-08 16:17:03.850244 23372 1 Building object cacheoconf 08-07-08 16:17:03.884861 23372 1 Oracle version 111oconf 08-07-08 16:17:04.158338 23372 1 Finished building object cacheoconf 08-07-08 16:17:04.244146 23372 1 Comparing object cachesoconf 08-07-08 16:17:04.244387 23372 1 Completed comparing object cachesoconf 08-07-08 16:17:06.370400 23372 1 Oracle supplemental logging is onoconf 08-07-08 16:17:06.546159 23372 1 Activation id 1348, supplemental log-ging enabledoconf 08-07-08 16:17:06.796741 23372 1 Placing items in replicationoconf 08-07-08 16:17:06.796823 23372 1 "QARUN"."DEMO_SRC": NEW, Type is T,

    oconf 08-07-08 16:17:06.796853 23372 1 DetLock: Attempting to do a non-waitlock on "QARUN"."DEMO_SRC"oconf 08-07-08 16:17:07.335588 23372 1 Completed placing items in replica-tionoconf 08-07-08 16:17:12.575705 23372 1 Activation complete

    What to do if activation fails

    Many things can cause the activation of a table or the entire configuration to fail, suchas the following:

    Syntax error: If one or more components in the configuration file were enteredincorrectly, activation of the affected objects fails

    If you did not issue the verify config command before you activated, run it now, andcorrect any problems that it finds. Then, try activating again. If the configuration stilldoes not activate, see Solving configuration problems on page 329 .

    CHAPTER1 25Using SharePlex Commands

  • 7/31/2019 SPO 76 Ref Guide

    41/446

    .

    SYNTAX

    Authorization level: Administrator (1)Issued for: source systemRelated commands: abort config, copy config, create config, deactivate

    config, edit config, list config, purge config, removeconfig, rename config, show activate, show config,verify config, view config

    BASIC COMMAND COMMAND OPTIONS [ON HOST] OPTIONS

    The [on host] options enable issuing of remote commands. For more information aboutthese options, see page 14 .

    activate configfilename [threads=n ] {nolock] available

    Required argumentsARGUMENT DESCRIPTION

    filename The name of the configuration that you want to activate. Configura-tion names are case-sensitive.Example:sp_ctrl(sysA)> activate config sales

    Command optionsOPTION DESCRIPTION

    threads=n Use this option to control the number of analysis threads that the acti-vation process generates. This option overrides the default value set bythe SP_OCF_THREAD_COUNT parameter (see page 265 ).The range of valid values for n is 1 to 32, but it is recommended that

    you use no more than 5 threads because the benefits of using threadsgenerally diminish beyond that point. SharePlex will not start morethreads than the number of tables to be analyzed.When used, this option must appear after the required command argu-ments.Example:sp_ctrl(sysA)> activate config sales threads=3

    26 SharePlex For OracleReference Guide Version 7.6

  • 7/31/2019 SPO 76 Ref Guide

    42/446

    nolock Use this option to activate without locking the tables being added toreplication.

    Command options (continued)

    OPTION DESCRIPTION

    CHAPTER1 27Using SharePlex Commands

  • 7/31/2019 SPO 76 Ref Guide

    43/446

    orainfoUse the orainfo command to view the Oracle database informationthe including theSID. The following is an example of the display:

    sp_ctrl (alvspxl11:2101)> orainfo

    Oracle instance #1:

    Oracle SID w111a64fOracle HOME /oracle/products/111

    Oracle Version 111

    Oracle instance #2:

    Oracle SID ora111

    Oracle HOME /oracle/products/111

    Oracle Version 111

    Oracle instance #3:

    Oracle SID ora11132f

    Oracle HOME /oracle/products/111

    Oracle Version 111

    The following will be displayed if ora_setup was not run and/or the statusdb disap-peared and/or the command is executed from a version of SPO that doesn't support it.

    sp_ctrl (alvspxl11:2101)> orainfo

    Oracle information not available

    SYNTAX

    Authorization level: Viewer (3)Issued for: source or target systemRelated commands: none

    BASIC COMMAND [ON HOST] OPTIONS

    orainfo available

    28 SharePlex For OracleReference Guide Version 7.6

  • 7/31/2019 SPO 76 Ref Guide

    44/446

    The [on host] options enable issuing of remote commands. For more information aboutthese options, see page 14 .

    CHAPTER1 29Using SharePlex Commands

  • 7/31/2019 SPO 76 Ref Guide

    45/446

    authlevelUse the authlevel command to determine your authorization level for issuing SharePlexcommands on a system. The following is an example of the display:

    User is a viewer (level=3)

    SYNTAX

    Authorization level: Viewer (3)

    Issued for: source or target systemRelated commands: none

    BASIC COMMAND [ON HOST] OPTIONS

    The [on host] options enable issuing of remote commands. For more information aboutthese options, see page 14 .

    authlevel available

    30 SharePlex For OracleReference Guide Version 7.6

  • 7/31/2019 SPO 76 Ref Guide

    46/446

    clear statusUse the clear status command to remove old warning messages from the Status Data-base. To use this command:

    1 Issue the show statusdb detail command (see page 234 ) to find out which messagescan be cleared. Clearable messages have a Yes in the Clear column.

    2 If you dont want to clear all messages, make a note of the status ID of each one thatyou want to clear.

    3 Issue the clear status command for each status ID, or use the all argument to removeall clearable messages at once.

    SharePlex puts a message in the Event Log identifying the messages that were cleared.

    This command clears messages from the Status Database for the default system. To

    clear messages from a Status Database on a different system, use the [on host ] option.

    clear statusThe Status Database shows a single mes-sage, and when cleared it is evident thatthis message cant be cleared from thestatus database. Some message cant becleared.

    Authorization level: Operator (2)Issued for: source or target systemRelated commands: show statusdb

    CHAPTER1 31Using SharePlex Commands

  • 7/31/2019 SPO 76 Ref Guide

    47/446

    SYNTAX

    compare configThe compare config command will be deprecated in the next release. See the compareusing command.

    BASIC COMMAND [ON HOST] OPTIONS

    The [on host] options enable issuing of remote commands. For more information aboutthese options, see page 14 .

    clear status {statusID | all} available

    Required argumentsARGUMENT DESCRIPTION

    statusID The SharePlex-assigned ID of an individual message (obtained usingthe show statusdb command) that you want to remove.Example:sp_ctrl(sysA)> clear status 20

    all This argument removes all clearable messages.

    Example:sp_ctrl(sysA)> clear status all

    32 SharePlex For OracleReference Guide Version 7.6

  • 7/31/2019 SPO 76 Ref Guide

    48/446

    compare usingUse the compare using command to compare the data in all of the source tables in aconfiguration file to the data in the corresponding target tables. Use the repair com-mand to bring out-of-sync target rows back into synchronization with the source rows.

    How to use the compare using commandUse the compare using command in the following ways:

    On a routine basis to detect and correct hidden out-of-sync conditions in target tablesbefore they become large problems that require the tables to be resynchronized.

    To determine the cause of a problem when SharePlex returns out-of-sync errors.

    Tip: To compare the contents of an individual source table to its target table, see com-

    pare on page 49 .

    What the compare using command supportsThe compare using command detects out-of-sync conditions in target tables that arecaused by DML operations. It detects:

    extra or missing rows. rows whose values do not match.

    Those conditions typically are caused by user-initiated DML operations or by automaticprocesses such as triggers or cascading deletes. Out-of-sync conditions resulting fromDML on target objects can go undetected until the Post process attempts to post achange to the affected rows.

    Important! The compare using command supports configs that employ Oracle wilcards;however, if the set of objects indicated by the wildcard specification includes objects thatare not presently in replication, the compare command will only compare those objectscurrently in replication. Please refer to the Specifying source tables using wildcards section of the SharePlex Administrators Guide for information on employing Oracle wild-cards in a configuration file.

    CHAPTER1 33Using SharePlex Commands

    http://../Admin/SP_ADM_GD.pdfhttp://../Admin/SP_ADM_GD.pdf
  • 7/31/2019 SPO 76 Ref Guide

    49/446

    What the compare using command does not supportThe compare using command does not detect out-of-sync conditions caused by DDL operations, including those that SharePlex supports. However, once you correct an out-of-sync condition caused by DDL, you can use the repair command to resynchronizethe data in the rows.

    Do not use the compare using command for:

    configurations that replicate sequences. tables for which transformation is being used. network configurations in which a pass-through server is used to pass data between

    the source and target servers.Such objects are skipped and an error is logged to the compare log.

    Important! Running DDL on a table while it is being compared will cause the compareprocess to fail with the following error:Oracle Error: ORA-01466: unable to read data - table definition has changed

    Overview of compare using command optionsUsed without options, the compare using command compares data values in all of thecolumns in the tables, including the keys. The following options are available to opti-mize and customize the comparison process. These options are described in more detaillater in this documentation.

    Use the [ key ] option to compare only the key columns in source and target tables,instead of all of the columns.

    Use the [ quickcheck ] option to obtain a quick determination of the existance of out-of-sync rows without an indication of where the out-of-sync is located. This option

    may NOT be used in conjunction with any repair, key or where options. This optiondoes NOT support LONG or LOB columns. This option does NOT log any out-of-sync row information to the compare client SQL file.

    Note: The port and sshport options and the sp_deq_ip_mapping parameter are nolonger needed with SharePlex 7.5 as long as both the source and all targets are 7.5 (orabove). If, however, either the source or at least one target is a version lower than 7.5,

    these options may still be necessary. Please refer to your SharePlex documentation forthat release on their use.

    34 SharePlex For OracleReference Guide Version 7.6

  • 7/31/2019 SPO 76 Ref Guide

    50/446

    Overview of compare using processesThe compare using command initiates a multi-threaded process to compare multipletables concurrently, with no limit on the number of tables.

    The following is the sequence of events and an illustration of the processes:

    1 The sp_cop process spawns an sp_desvr (server) process on the source system.

    2 The sp_desvr process returns control of the sp_ctrl interface to the user, and repli-cation continues while the commands processes are working.

    3 The sp_desvr process sends a message through the SharePlex queues and initiatesprocessing threads on the target system, the number of which is based on the valueset by the SP_DEQ_THREADS parameter (see page 311 ). The default number of threads is 2.

    4 Each thread spawns an sp_declt (client) process.

    5 The server and client processes establish direct communication with each other, andthe processing load is divided between the client processes.

    The compare using command does not affect the source tables in any way. SharePlexlogs into Oracle only to query for read consistency, and the locks on the source tablesare brief.

    SharePlex briefly locks the target tables during the comparison, but users can continueaccessing them with little or no awareness of the lock.

    Running concurrent compare processesYou can issue multiple compare using commands at a time, for example to compare

    subsets of the active configuration (see Comparing subsets of a configuration onpage 42 ). There is a limit to the number of concurrent comparison processes that youcan run.

    CHAPTER1 35Using SharePlex Commands

  • 7/31/2019 SPO 76 Ref Guide

    51/446

    A maximum of 20 SharePlex processes can read from, and write to, the post queue at

    the same time, including the replication processes and the compare processes. There isno practical way to determine how many compare processes can be running withoutexceeding this limit. Therefore, it is recommended that you allow a maximum of fivecompare processes to run at any given time.

    An entry similar to the following in the Event Log indicates that the maximum numberof queue readers and writers has been exceeded, and that the offending compare processfailed: Can not add DataEquator queue reader, tried for 300 seconds. Error:

    que_TOOMANYUSERS: User table is full. An error most likely will occur when a repair option is used, because a repair accessesthe queue much longer than a basic compare process.

    Using the compare cancel id commandThe compare cancel id command is used to stop a running compare process. This com-mand can be issued any time you are running a compare using or compare operation.To stop a running compare operation, issue the following command:

    sp_ctrl(sysA)> compare cancel id PID

    Identifying compare processesCompare processes are identified in two ways.

    Job IDEvery time that a copy , append , compare or repair command is issued, it is assignedunique job ID . The job ID reflected in the compare status command output.

    Session IDThe session ID is the same as the operating system process ID number (PID) of thesp_desvr process on the source system. To determine the session ID, issue the basicshow compare command, and look in the ID column.

    Viewing compare status and resultsThe best way to view the status or results of one or more compare processes is to use theshow compare command in sp_ctrl .

    36 SharePlex For OracleReference Guide Version 7.6

  • 7/31/2019 SPO 76 Ref Guide

    52/446

    The basic command displays the processing status of all compare using and com-

    pare processes on a system. Additional command options display statistics for each table that was compared, as

    well as an option to view a compare report for each of the compared tables. Thecompare report contains the SQL statements required to bring a target table back intosynchronization (or those that were applied by the repair process). It also can be con-figured with the SP_DEQ_LOG_ROWID parameter to show the row ID of eachsource row.

    For more information about using the show compare command, see page 200 .For more information about the SP_DEQ_LOG_ROWID parameter, see page 307 .

    You can view compare reports directly from the log sub-directory of the SharePlex vari-able-data directory on the target system. The compare report file naming convention is:sid_schema -table -processID .sql , where:

    sid is the ORACLE_SID of the associated Oracle instance. schema_name is the name of the target tables schema. table_name is the name of the target table. processID is the SharePlex-assigned process identifier for the compare session.

    Example compare report file name:

    j102a32f_SP_IOT-IOT_BASIC-21744.sql

    Sample compare report file/*

    * Compare Report** Session ID : 21744* Schema : SP_IOT* Table : IOT_BASIC* Repair : Off* Target Route: alvlabl17@j102a32f* Key Compare : Off* Select Hint :* Log File : /splex/SharePlex-6.0.0.65/var10/log/j102a32f_SP_IOT-

    IOT_BASIC-21744.sql* Date : Tue May 15 09:19:28 2007**/

    /** Compare Results

    CHAPTER1 37Using SharePlex Commands

  • 7/31/2019 SPO 76 Ref Guide

    53/446

    ** 440 source and 440 target rows compared successfully (L320).* No out-of-sync rows were found in this table.** Inserts : 0* Updates : 0* Deletes : 0**/

    Viewing compare logsSharePlex logs notices, warnings, and errors for each compare session in a log file in thelog sub-directory of the SharePlex variable-data directory on both systems. There is alog file for the sp_desvr process on the source system, and there is a log for each asso-ciated sp_declt process on the target system. The file name differs depending on whichprocess you are looking at. The file name for the sp_desvr process is SID _desvr -proces- sID -log# .log, where:

    SID is the ORACLE_SID of the Oracle instance associated with the process. process ID is the SharePlex-assigned process id for the compare session. log# is the log number in the series.

    The file name for the sp_declt process is SID_declt-schema-table-processID-log# .log,where:

    SID is the ORACLE_SID of the Oracle instance associated with the process. schema is the name of the target tables schema. table is the name of the target table. process ID is the SharePlex-assigned process id for the compare session. log# is the log number in the series.

    SharePlex creates logs in a circular fashion to control its disk usage. When the maxi-mum log size is reached, as determined by an internal parameter, SharePlex generatesanother log file until the number of logs reaches an internal limit. At that point, the logswrap (just like the Oracle redo logs wrap), and the oldest log is replaced with a new one.Subsequent logs wrap as well, maintaining the number of logs at or below the limitvalue. For the compare using command, there rarely is more than one log file.

    Example log file names:

    w102a64f_desvr-13942854-01.log

    a102a64f_declt-SP_DDL_ALL-QA_DDL_TAB_2-13942854-01.log

    38 SharePlex For OracleReference Guide Version 7.6

  • 7/31/2019 SPO 76 Ref Guide

    54/446

    Sample sp_desvr log fileThe sp_desvr log contains log information for all tables affected by the compare using command. The following example has been truncated to show just the first table.

    FILE: /splex/SharePlex-6.0.0/var10/log/a102a64f_desvr-21744-01.logDATE: Tue May 15 10:07:57 2007

    000: Read Buffer Size: 1048576 bytes ( 1 mbytes)000: Debug flag: 0x00000000000: 5460382473338/splex/SharePlex-6.0.0.65a102a64f/opt10/bin/sp_desvr

    000: DEBUG:pthread stack size=4096, status=0 (main,L1158)000: Notice: SP_DEQ_NLS_SELECTOR = 0 (DB) (de_trans_set_nls_lang,L1849)000: Threads used: 2000: Notice: ORACLE_HOME=/u01/app/oracle/product/10.2.0/db_2(main,L1286:de_internal_getenv,L1439)000: Notice: ORACLE_SID=a102a64f (main,L1287:de_internal_getenv,L1439)000: OS Version : SunOS 5.10 Generic_118855-36000: Machine : i86pc000: Server Message: 0x0006000: Server Message: OS Version : SunOS 5.10 Generic_118855-36 (LITTLE)000: Server Message: Machine : i86pc000: Server Message: SharePlex Version 6.0.0.115000: Server Message: SharePlex Lib Version 6.0.0.115000: Processing Hori. Partition statement:000: sp_iot.IOT_INCLUDE_OVERFLOW sp_iot.IOT_INCLUDE_OVERFLOW!iot_include_overflow

    000: Processing Vert. Partition statement:000: sp_iot.IOT_BASIC (work_date, employee_no, dash, class_code, paycode,SHIFT_DIFFERENTIAL, HOURS) sp_iot.IOT_BASIC (work_date, employee_no, dash,class_code, paycode, SHIFT_DIFFERENTIAL, HOURS) [email protected]

    000: NOTE: pthread_self_id=1 (de_thrdmgr_main,L2263)000: Notice: SP_DEQ_TIMEOUT set to 3600000: COMPARE CURRENT STATUS:Tue May 15 10:07:58 2007 , Thread started(de_thrdmgr_main,L2264:de_log_line,L301)000: NOTE: pthread_self_id=2 (de_thrdmgr_main,L2263)000: Oracle Session Id = 327, Serial# = 30298000: Notice: Job ID = 10036 (de_oci_getResultSeqNum,L1656)000: Notice: DB NLS_LANG=AMERICAN_AMERICA.AL32UTF8 (de_trans_ora_logon,L988)000: Oracle Session Id = 327, Serial# = 30303000: Oracle Session Id = 307, Serial# = 40856000: COMPARE CURRENT STATUS:Tue May 15 10:07:59 2007 , Thread started(de_thrdmgr_main,L2264:de_log_line,L301)000: Oracle Session Id = 122, Serial# = 42017000: Oracle Session Id = 326, Serial# = 23028001: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - ProductionWith the Partitioning and Data Mining options000: Notice: DB CSID (AL32UTF8,873) is set.(de_oci_coreSetCSIDs,L1253:de_oci_setCSIDs,L1427)000: Notice: DB NCSID (AL16UTF16,2000) is set, NCHAR LEN=2(de_oci_coreSetCSIDs,L1248:de_oci_setCSIDs,L1432)

    CHAPTER1 39Using SharePlex Commands

    ( )

  • 7/31/2019 SPO 76 Ref Guide

    55/446

    000: Notice: DEQ CSID (JA16EUC,830) is set.(de_oci_coreSetCSIDs,L1253:de_oci_setCSIDs,L1451)000: Notice: DEQ NCSID is NA.(de_oci_coreSetCSIDs,L1261:de_oci_setCSIDs,L1456)000: Notice: use SP_DEQ_CHARACTERSET id 830, encoded 830(de_oci_determineFinalCSID,L1305)000: Notice: use DB NCHAR CHARACTERSET id 2000(de_oci_determineFinalCSID,L1358)000: Notice: use NCHAR Character length = 2 (de_oci_determineFinalCSID,L1365)001: Notice: Object ID of "SP_IOT"."IOT_BASIC" is 747414001: Skip LOB column(s) : Off001: Log source rowid : On001: NOTE: rowid size = 4096 for IOT table (de_table_process_iot,L2496)001: Table is veritcal partitioned001: LONG column in VP table, swapping DASH with SUMMIT_WORK_ORDER_NO001: LONG column in VP table, swapping CLASS_CODE with DASH001: LONG column in VP table, swapping PAYCODE with CLASS_CODE001: Notice: Object ID of "SP_IOT"."IOT_BASIC" is 747414001: some nullable column(s) marked as key in object cache, use all column(s)as key instead (de_table_find_key_cols,L1000)001: NOTE: Using all columns as key for table 747414

    (de_table_mark_all_columns_as_key,L795)001: Session ID : 21744001: Source Data : a102a64f001: Source Table: "SP_IOT"."IOT_BASIC"001: Source Node : alvlabu18001: Target Table: "SP_IOT"."IOT_BASIC"001: Target Route: alvlabl17.quest.com@j102a32f001: Target Node : alvlabl17.quest.com001: Batch Size : 10000 rows001: Repair : Off

    001: Key Compare : Off001: Port Number : 53441001: Select Hint :001: Order By :001: COMPARE CURRENT STATUS:Tue May 15 10:07:59 2007 (elapsed 1.396424 sec-onds), ready to do non timed-wait table lock.(de_trans_get_read_consistent_view,L1430:de_log_line,L301)001: COMPARE CURRENT STATUS:Tue May 15 10:07:59 2007 (elapsed 0.004113 sec-onds), got lock & ready to get consistent view.(de_trans_get_read_consistent_view,L1449:de_log_line,L301)

    001: COMPARE CURRENT STATUS:Tue May 15 10:07:59 2007 (elapsed 0.000444 sec-onds), got consistent view.(de_trans_get_read_consistent_view,L1458:de_log_line,L301)001: COMPARE CURRENT STATUS:Tue May 15 10:07:59 2007 (elapsed 0.000015 sec-onds), table unlocked (conn2) & ready to select count rows.(de_thrdmgr_sub_main,L1466:de_log_line,L301)001: COMPARE CURRENT STATUS:Tue May 15 10:07:59 2007 (elapsed 0.007506 sec-onds), done counting rows & ready to insert compare marker.(de_thrdmgr_sub_main,L1471:de_log_line,L301)

    40 SharePlex For OracleReference Guide Version 7.6

    S l d lt l g fil

  • 7/31/2019 SPO 76 Ref Guide

    56/446

    Sample sp_declt log fileThere is a sp_declt log file for each pair of tables compared with the compare using command. The following is a sample log.

    FILE: /splex/SharePlex-6.0.0/var10/log/j102a32f_declt-SP_IOT-IOT_BASIC-21744-01.logDATE: Tue May 15 09:19:25 2007

    000: Debug flag: 0x00000000000: 3929275259 3314 /splex/SharePlex-6.0.0.65/opt10/bin/sp_declt

    000: Notice: ORACLE_HOME=/u01/app/oracle/product/10.1.0/db_1(main,L1710:de_internal_getenv,L1439)000: Notice: ORACLE_SID=j102a32f (main,L1711:de_internal_getenv,L1439)000: OS Version : Linux 2.6.9-11.EL #1 Fri May 20 18:17:57 EDT 2005000: Machine : i686000: Notice: SP_DEQ_NLS_SELECTOR = 0 (DB) (de_trans_set_nls_lang,L1849)000: Oracle Session Id = 299, Serial# = 42075000: Notice: DB NLS_LANG=JAPANESE_JAPAN.JA16EUC (de_trans_ora_logon,L988)000: Oracle Session Id = 299, Serial# = 42077000: Oracle Session Id = 317, Serial# = 1079

    000: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - ProductionWith the Partitioning, OLAP and Data Mining options000: Notice: DB CSID (JA16EUC,830) is set.(de_oci_coreSetCSIDs,L1253:de_oci_setCSIDs,L1427)000: Notice: DB NCSID (AL16UTF16,2000) is set, NCHAR LEN=2(de_oci_coreSetCSIDs,L1248:de_oci_setCSIDs,L1432)000: Notice: OPO CSID is NA.(de_oci_coreSetCSIDs,L1261:de_oci_setCSIDs,L1440)000: Notice: OPO NCSID is NA.(de_oci_coreSetCSIDs,L1261:de_oci_setCSIDs,L1445)000: Notice: DEQ CSID is NA.(de_oci_coreSetCSIDs,L1261:de_oci_setCSIDs,L1451)000: Notice: DEQ NCSID is NA.(de_oci_coreSetCSIDs,L1261:de_oci_setCSIDs,L1456)000: Notice: use DB CHARACTERSET id 830 (de_oci_determineFinalCSID,L1350)000: Notice: use DB NCHAR CHARACTERSET id 2000(de_oci_determineFinalCSID,L1358)000: Notice: use NCHAR Character length = 2 (de_oci_determineFinalCSID,L1365)000: Client Message: 0x0006000: Client Message: OS Version : Linux 2.6.9-11.EL #1 Fri May 20 18:17:57 EDT2005 (LITTLE)000: Client Message: Machine : i686000: Client Message: JA16EUC000: Client Message: AL16UTF16000: Client Message: SharePlex Version 6.0.0.115000: Client Message: SharePlex Lib Version 6.0.0.115000: Server Message: 0x0006000: Server Message: OS Version : SunOS 5.10 Generic_118855-36 (LITTLE)000: Server Message: Machine : i86pc000: Server Message: SharePlex Version 6.0.0.115000: Server Message: SharePlex Lib Version 6.0.0.115000: COMPARE CURRENT STATUS:Tue May 15 09:19:27 2007 , ready to do non timed-wait table lock. (de_trans_get_read_consistent_view,L1430:de_log_line,L301)

    CHAPTER1 41Using SharePlex Commands

    000: COMPARE CURRENT STATUS:Tue May 15 09:19:27 2007 (elapsed 0 010074 sec-

  • 7/31/2019 SPO 76 Ref Guide

    57/446

    000: COMPARE CURRENT STATUS:Tue May 15 09:19:27 2007 (elapsed 0.010074 sec-onds), got lock & ready to get consistent view.(de_trans_get_read_consistent_view,L1449:de_log_line,L301)000: COMPARE CURRENT STATUS:Tue May 15 09:19:27 2007 (elapsed 0.007243 sec-onds), got consistent view.(de_trans_get_read_consistent_view,L1458:de_log_line,L301)000: COMPARE CURRENT STATUS:Tue May 15 09:19:27 2007 (elapsed 0.000160 sec-onds), removed semaphore, poster lock file. & ready to select count rows(conn1). (main,L2083:de_log_line,L301)000: COMPARE CURRENT STATUS:Tue May 15 09:19:28 2007 (elapsed 1.024283 sec-onds), done with row count. (main,L2087:de_log_line,L301)000: Notice: Reducing batch from 10000 to 440 (main,L2158)000: NOTE: use new numeric compare flag is ON000: Key Compare : Off000: Notice: client qualified rows count = 440000: Notice: client total rows count = 440000: Session ID : 21744000: Source Table: "SP_IOT"."IOT_BASIC"000: Source Node : alvlabu18.quest.com000: Target Table: "SP_IOT"."IOT_BASIC"000: Target Route2: alvlabl17@j102a32f000: Batch Size : 440 rows000: Repair : Off000: Source Port : 53441000: Select Hint :000: sp_declt PID: 29949000: Read Buffer Size : 1 mbytes000: No new key column order, using default column order for SP_IOT.IOT_BASIC000: running sql statement : (de_select_prepare_to_fetch,L1525)000: select rowid,"WORK_DATE","EMPLOYEE_NO","DASH","CLASS_CODE","PAY-CODE","SHIFT_DIFFERENTIAL","HOURS" from "SP_IOT"."IOT_BASIC" order by 2, 3,

    4, 5, 6, 7, 8000: COMPARE CURRENT STATUS:Tue May 15 09:19:28 2007 (elapsed 0.074330 sec-onds), ready to fetch first batch, including the order by sorting.(de_batch_setup,L1102:de_log_line,L301)000: COMPARE CURRENT STATUS:Tue May 15 09:19:28 2007 (elapsed 0.007571 sec-onds), got first batch (de_batch_setup,L1117:de_log_line,L301)000: SP_DEQ_PART_UPDATE : 0000: Notice: Object ID of "SP_IOT"."IOT_BASIC" is 876751000: Exiting without any errors000: Status : In Sync

    Removing old compare reports and logsTo remove old compare reports and logs from a system, use the remove log compare command (see page 133 ).

    42 SharePlex For OracleReference Guide Version 7.6

    Repairing out of sync rows

  • 7/31/2019 SPO 76 Ref Guide

    58/446

    Repairing out-of-sync rowsTo repair out-of-sync rows found by a basic comparison, use the repair using command.The repair option on the compare command will be deprecated in the next release.

    Comparisons when there are multiple target systemsThe compare using command compares each source table in a configuration to all of

    its target tables on all target systems. To limit a comparison to specific target tables orsystems, you can make one or more subsets of the active configuration and list thetables and routes that you want to use.

    Comparing subsets of a configurationYou can compare subsets of an active configuration by making one or more copies of

    the configuration and running the compare using command for the copies. For exam-ple, you can create copies based on schemas or routes. Tables and routes in the subsetsmust also be contained in the active configuration.

    To compare a subset of a configuration, do the following without deactivating the activeconfiguration:

    1 Copy the active configuration with the copy config command.

    sp_ctrl(sysA)>copy configfilename to newname

    2 Edit the copy with the edit config command to exclude tables or routes that you donot want to compare.

    sp_ctrl(sysA)> edit confignewname

    3 Save the new configuration.

    4 Repeat these steps for each subset configuration that you want to create.5 Issue the compare using command for one or more configuration subsets, but do not

    activate them, and do not deactivate the original configuration.

    Repairing dissimilar source and target tables

    The repair using command can be used for target tables that have more columns thantheir source tables, but the command ignores target columns that are not contained in thesource table. A repair does the following:

    CHAPTER1 43Using SharePlex Commands

    An INSERT inserts values into target columns that have corresponding columns in

  • 7/31/2019 SPO 76 Ref Guide

    59/446

    S se ts va ues to ta get co u s t at ave co espo d g co u s

    the source table, but not into the extra columns. Columns with NOT NULL con-straints but no default values cause Oracle errors. Default values are recommendedfor extra columns in target tables.

    An UPDATE resynchronizes values in target columns that have corresponding col-umns in the source table, but not the values in the extra columns.

    A DELETE is not affected by extra columns in the target table, because the compare command selects rows based on column data in the matching columns.

    Comparing only the key valuesFor a faster comparison, you can use the [ key ] option to compare only the key columnsin source and target rows instead of all of the columns. Use it for fast comparisons of large tables to ensure that the same rows exist in both databases. If key values match,the rows are considered synchronized.

    Use these options with caution and only as a first-level solution. They might not detectall of the out-of-sync conditions. Even though key values match, it is possible for valuesin non-key columns to be out-of-sync.

    Comparing tables that have LONG columns

    SharePlex for Oracle has no size constraint when comparing tables with a LONG orLONG RAW column. Compare/Repair supports the maximum LONG column size, cur-rently 2 GB, that Oracle can support.

    Comparing tables that have LOB columnsSharePlex for Oracle command supports tables with LOB columns when the

    SP_DEQ_SKIP_LOB parameter is set to 0 when employing the compare using com-mand. For more information about the SP_DEQ_SKIP_LOB parameter, see page 310 .

    To log row IDs for manual repair of LOBsWhen you need to know the source row ID in order to manually repair target LOB col-umns, set the SP_DEQ_LOG_ROWID parameter on the source system to 1. Enablingthis parameter directs SharePlex to log the source row IDs for all rows that are inserted

    or updated in the target tables. For more information about the SP_DEQ_LOG_ROWIDparameter, see page 307 .

    44 SharePlex For OracleReference Guide Version 7.6

    Using the compare command with DDL replication

  • 7/31/2019 SPO 76 Ref Guide

    60/446

    Using the compare command with DDL replicationWhen the compare process starts, it acquires a read-consistent view of the table, gets thetable definition, and parses SQL to SELECT from the table. If the table definition ismodified by executing DDL after the compare process determines the table definitionand parses the SELECT SQL, then the following error will occur when compare tries toSELECT from the table:

    Oracle Error: ORA-01466: unable to read data - table definition has changed

    Therefore, do not run DDL on a table while it is being compared.

    Using compare with consolidated replicationDo not use the compare using command when any of the source tables are part of aconsolidated replication environment. The compare using command will causeunwanted deletion of target rows that do not exist in those source tables.

    As a workaround, create a subset of the configuration that excludes the tables involvedin consolidated replication, and compare the subset configuration instead. You can usethe compare command to compare the tables that are involved in consolidated replica-tion. See for more page 49 information.

    Using compare with partitioned replicationWhen tables in a configuration use partitioned replication, the compare using com-mand determines the rows and columns to compare by reading the configuration fileand, for horizontally partitioned replication, the column conditions in theSHAREPLEX_PARTITION table.

    For vertically partitioned tables where source and target column names are different,the compare using command maps the source columns to the target columns.

    For horizontally partitioned replication, the compare using command reads the col-umn conditions for the source table and selects rows for the source and target tablesbased on those conditions.

    Rows and columns that are excluded from replication are not compared.

    Using compare with peer-to-peer replicationTo use the compare using command in a peer-to-peer replication environment, decidewhich system is the trusted source system the one with the valid data and which

    CHAPTER1 45Using SharePlex Commands

    are the target , or secondary, systems containing data that will be repaired, if needed.

  • 7/31/2019 SPO 76 Ref Guide

    61/446

    Before you run the comparison, follow these steps:1 Stop user access on the target systems and wait for replicated operations to post to

    the source database. Users can continue to access the source database.

    2 Issue the qstatus command on the source and target systems. (For more informationabout the qstatus command, see page 124 ).

    3 When there are 10 or fewer messages in the queues, run the compare using com-mand on the source system.

    4 Do one of the following:

    For comparisons without a repair, you can permit user access to all databases afterthe sp_desvr and sp_declt processes have started.

    For comparisons with a repair, make the users wait until a tables repair is finishedbefore permitting access to that table.

    Controlling the number of processing threadsTo take advantage of machines with multiple processors, you can set the number of compare processing threads on the source system with the SP_DEQ_THREADS param-eter. The default number of threads is two threads, and the range of valid values is fromone thread to 15.

    With multi-threaded processing, there is additional load on the system. Regardless of the system configuration, there will be a point where additional threads provide noadded benefit. Generally, two to five threads should be sufficient, but for machines withone processor, use a value of 1. For more information about the SP_DEQ_THREADSparameter, see page 311 .

    Controlling the batch sizeThe default batch (block) size for comparisons is 10,000 rows. A larger or smaller batchsize might be required for your comparisons, depending on the size and volume of yourtables and your system resources. To change the batch size, change the value of theSP_DEQ_BATCHSIZE parameter.

    If the value of SP_DEQ_BATCHSIZE is larger than the number of rows in the sourcetable being compared, SharePlex reduces the batch size to the number of rows in the

    46 SharePlex For OracleReference Guide Version 7.6

    table. This prevents SharePlex from allocating more space than necessary for the com-

  • 7/31/2019 SPO 76 Ref Guide

    62/446

    pare processes. For more information about this parameter, see page 305 .

    Other conditions and requirements for using compare All SharePlex processes (Capture, Read, Export, Import, Post) must be running

    when you issue the compare using command, and they must remain runningthroughout the compare process.

    The success of the compare using command depends on the activity on the sourcesystem. Because the command relies on the replication queues to spawn thesp_declt process on the target system, and because SharePlex forwards data (includ-ing the compare using command) in the order in which it is received, the compari-son cannot start until all previous messages in the queues have been processed. If adelay causes the compare process to lose its read consistency, the command returnsan error. To avoid errors, consider doing comparisons during non-peak hours.

    The tables that you want to compare must be currently replicating. Large open transactions (without a COMMIT) on a source table prevent the compare

    process from obtaining the brief lock i