SPO 75 Ref Guide(2)

Embed Size (px)

Citation preview

SharePlex For Oracle

Reference GuideVersion 7.5

Quest Software, Inc. 2010 All rights reserved. U.S. Patent Numbers: 7,065,538 and 7,461,103 Additional patents pending.This guide contains proprietary information protected by copyright. The software described in this guide is furnished under a software license or nondisclosure agreement. This software may be used or copied only in accordance with the terms of the applicable agreement. No part of this guide may be reproduced or transmitted in any form or by any means, electronic or mechanical, including photocopying and recording for any purpose other than the 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 Headquarters LEGAL Dept 5 Polaris Way Aliso Viejo, CA 92656 www.quest.com email: [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 no warranty of any kind with respect to this information. QUEST SOFTWARE SPECIFICALLY DISCLAIMS THE IMPLIED WARRANTY OF THE MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. Quest Software shall not be liable for any direct, indirect, incidental, consequential, or other damage alleged in connection with the furnishing or use of this information.

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

Third Party Licensing For a list of third party components and their applicable licensing please refer to Appendix A in the SharePlex Administrators Guide.

World Headquarters 5 Polaris Way Aliso Viejo, CA 92656 www.quest.com e-mail: [email protected]

CHAPTER 1

iii

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

SharePlex For Oracle Reference Guide Updated 06/02/10 Version 7.5

IV

SHAREPLEX FOR ORACLE Reference Guide Version 7.5

Table of ContentsAbout this guide Viewing this guide in PDF format............................................................................................... xii Conventions used in this guide ................................................................................................... xiii About Quest Software.................................................................................................................. xv Chapter 1: Using SharePlex CommandsPart 1: Overview of SharePlex commands

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

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

vi

SHAREPLEX FOR ORACLE Reference Guide Version 7.5

copy/append ................................................................................................................................. 87 copy config................................................................................................................................... 99 create config............................................................................................................................... 101 deactivate config ........................................................................................................................ 102 delete queue................................................................................................................................ 104 edit.............................................................................................................................................. 107 edit config .................................................................................................................................. 110 exit.............................................................................................................................................. 111 expand ........................................................................................................................................ 112 flush............................................................................................................................................ 114 help............................................................................................................................................. 117 host ............................................................................................................................................. 119 hostinfo....................................................................................................................................... 121 list config.................................................................................................................................... 122 list param.................................................................................................................................... 124 lstatus ......................................................................................................................................... 127 port ............................................................................................................................................. 131 purge config ............................................................................................................................... 133 qstatus......................................................................................................................................... 135 quit ............................................................................................................................................. 137 reconcile ..................................................................................................................................... 138 redo............................................................................................................................................. 142 remove config ............................................................................................................................ 143 remove log compare................................................................................................................... 144 rename config............................................................................................................................. 147 report .......................................................................................................................................... 148 reset param ................................................................................................................................. 150 set log ......................................................................................................................................... 154 set param .................................................................................................................................... 156 show ........................................................................................................................................... 162 show activate.............................................................................................................................. 166 show capture .............................................................................................................................. 169 show compare ............................................................................................................................ 173 show config ................................................................................................................................ 182 show export ................................................................................................................................ 185

TABLE OF CONTENTS

vii

show import ................................................................................................................................186 show log......................................................................................................................................187 show post ....................................................................................................................................191 show read ....................................................................................................................................200 show sql ......................................................................................................................................203 show statusdb..............................................................................................................................205 show sync ...................................................................................................................................207 shutdown.....................................................................................................................................209 start .............................................................................................................................................211 startup .........................................................................................................................................214 status ...........................................................................................................................................216 stop..............................................................................................................................................218 truncate log .................................................................................................................................222 usage ...........................................................................................................................................223 verify config ...............................................................................................................................224 version ........................................................................................................................................226 view config .................................................................................................................................227 view log options..........................................................................................................................228 Chapter 2: SharePlex Parameters About SharePlex parameters ......................................................................................................230 Where parameter information is stored ......................................................................................230 Setting and activating parameters ..............................................................................................230 Viewing a list of SharePlex parameters......................................................................................233 Parameter categories...................................................................................................................234 Descriptions of user-configurable SharePlex parameters...........................................................234 Chapter 3: Preventing and Solving Replication ProblemsPart 1: Tools for preventing and solving problems

Viewing the Status Database ......................................................................................................286 Viewing the Event Log...............................................................................................................286 Viewing the user issued commands............................................................................................287 Viewing the other log files .........................................................................................................288 Viewing and terminating SharePlex processes...........................................................................290 Using the status and lstatus commands to view status ...............................................................294

viii

SHAREPLEX FOR ORACLE Reference Guide Version 7.5

Using the verify config command to test a configuration.......................................................... 295 Using the compare commands to verify synchronization.......................................................... 295 Changing the IP address on the target machine ......................................................................... 295 Getting syntax help for commands ............................................................................................ 296 Monitoring replication to detect and prevent problems ............................................................. 297Part 2: Solving Oracle Setup problems

Incorrect ORACLE_SID and/or ORACLE_HOME.................................................................. 299 More than one oratab file (Sun Solaris) ..................................................................................... 300 Asterisk as the ORACLE_SID entry ......................................................................................... 300 Legacy /etc/logingroups file (HP systems) ................................................................................ 300Part 3: Solving configuration problems

SharePlex cannot locate the configuration................................................................................. 301 A configuration will not activate ............................................................................................... 301 Activation takes too long ........................................................................................................... 306 Explanation of configuration command errors .......................................................................... 307Part 4: Solving synchronization problems

How SharePlex reports out-of-sync conditions ......................................................................... 311 Find and correct the problem before you resynchronize! .......................................................... 312 How to detect and correct common out-of-sync conditions. ..................................................... 313 How to resynchronize objects .................................................................................................... 324Part 5: Solving replication problems

Replication is too slow............................................................................................................... 330 Capture stopped.......................................................................................................................... 336 Post stopped ............................................................................................................................... 337 The post queue is not emptying ................................................................................................. 339 There is an extra import process ................................................................................................ 340 There is a failure to write and open queue error..................................................................... 341 The queues are corrupted ........................................................................................................... 341 The post queue seems too large ................................................................................................. 341 You had to unexpectedly stop replication (UNIX) .................................................................... 342 sp_cop is using too much CPU time .......................................................................................... 344 A table stopped replicating ........................................................................................................ 344

TABLE OF CONTENTS

ix

A source table is corrupted .........................................................................................................344 SharePlex is running out of disk space .......................................................................................345 Oracle 9i+ DDL is not replicating ..............................................................................................346 Oracle 9i+ DDL is not completely displayed in the Event Log .................................................347 Post generates ORA-1762 errors ................................................................................................347 Post generates a shared memory error ........................................................................................348 SharePlex does not run on a Windows system ...........................................................................349 Explanation of replication error messages..................................................................................351Part 6: Solving other problems

A configuration was accidentally deleted...................................................................................359 Conflict resolution generates compile errors..............................................................................359 The reconcile command is slow to complete..............................................................................359 Machine names cannot be resolved ............................................................................................360 A Cant unlink file error occurs on Windows systems ...........................................................360 Solving connection errors ...........................................................................................................360 Solving compare command errors ..............................................................................................362 Solving errors for other sp_ctrl commands ...............................................................................365Part 7: How to get help

Before you call Quest Technical Support...................................................................................370 Other information to send...........................................................................................................372 How to use Quest support...........................................................................................................372 Index ..............................................................................................................................................373

x

SHAREPLEX FOR ORACLE Reference Guide Version 7.5

ABOUT THIS GUIDE

xi

About this guideThis 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 documentation for each command. SharePlex parameters an overview of the SharePlex tuning parameters, how they are set and stored, and detailed documentation for parameters that can be changed by SharePlex users. Problem prevention and solving tips a guide to help you prevent and resolve common problems that might be encountered during configuration activation and replication, plus an overview of the tools available for preventing, detecting and correcting problems. Users of the SharePlex Reference Guide should have a thorough understanding of SharePlex before issuing commands, changing parameters or attempting to solve problems. 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.

xii

SHAREPLEX FOR ORACLE Reference Guide Version 7.5

Viewing this guide in PDF formatThis manual is available in Adobe PDF format on a documentation CD provided with the SharePlex software and from the Quest SupportLink web site at http://support.quest.com. The PDF document is viewable with Adobe Acrobat Reader Version 7 or 8 which is free software that can be downloaded from the Adobe web site at http://www.adobe.com if it is not installed on your system.

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 syntax 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 commandstrings.

{Braces} enclose available required arguments. [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]

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)

xiv

SHAREPLEX FOR ORACLE Reference Guide Version 7.5

Windows menu items, dialog boxes, and options within dialog boxes are expressed in Arial Bold. Example: From the File menu, select Print. Text is set in Times New Roman, with italics and bold styles used either for emphasis or warnings. 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. The following icons are used to highlight important or helpful information:

This icon denotes additional information that you should know.

This icon denotes advice that can help you save time or prevent problems.

This icon calls attention to critical issues that must not be ignored.

This icon refers you to related documentation for more information.

ABOUT THIS GUIDE

xv

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

Contacting Quest SoftwareEmail: Mail: [email protected] Quest Software, Inc. World Headquarters 5 Polaris Way Aliso Viejo, CA 92656 USA http://www.quest.com

Web site:

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 or who have purchased a Quest product and have a valid maintenance contract. Quest Support provides unlimited 24x7 access to SupportLink, our self-service portal. Visit SupportLink 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 casesView the Global Support Guide for a detailed explanation of support programs, online services, contact information, and policies and procedures. The guide is available in at: http://support.quest.com/

xvi

SHAREPLEX FOR ORACLE Reference Guide Version 7.5

1Using SharePlex CommandsThis 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 authorization levels. The second part contains guidelines for using the commands followed by an alphabetical reference guide with full descriptions and syntax. Contents Overview of SharePlex commands Using SharePlex commands

2

SHAREPLEX FOR ORACLE Reference Guide Version 7.5

Part 1: Overview of SharePlex commandsSharePlex requires little user intervention to maintain a replication environment, but occasionally you will need to make adjustments, diagnose a problem, or perform status checks. 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 situations or events that could interfere with processing, especially those that could result in loss of data synchronization. The information commands summarized on page 7 help you monitor different aspects of replication. Issue them frequently to:

Monitor for out-of-sync tables. Verify that replication processes are running. View the number of replicated messages in the queues. View the Event Log to view warnings, errors and other notifications. View process statistics that are helpful for tuning and problem solving. Detect tables or operations that are slowing down the replication process.

Tip: To supplement the information commands, you can configure the SharePlex monitoring scripts to notify you when key replication events occur. For more information, see Chapter 9 of the SharePlex Administrators Guide.

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

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

CHAPTER 1 Using SharePlex Commands

3

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 level or higher. You assign a users authorization level when you add that person to one of the SharePlex user groups on the system where he or she will be issuing commands. Each group represents a different level of authorization. The groups were created when SharePlex was installed. The table on page 4 shows the SharePlex user authorization levels, groups and roles.

4

SHAREPLEX FOR ORACLE Reference Guide Version 7.5

User Authorization Levels and RolesAUTH LEVEL USER TYPE USER GROUP USER ROLES

1

Administrator

spadmin

Can issue all SharePlex commands. Commands that can only be issued by a SharePlex Administrator are:

startup, shutdown all configuration commands relating toan active configuration

all parameter commands except list 2 3 Operator Viewerspopr spview param start capture stop capture abort capture truncate log

Can issue all SharePlex commands except those listed above. Can view lists, status screens, and logs to monitor replication only.

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

UNIX systemsEdit the /etc/group file.

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

CHAPTER 1 Using SharePlex Commands

5

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

Configuration commandsThe configuration commands control all aspects of managing SharePlex configurations. List of configuration commands Command abort config Auth. Level 1 Description Immediately terminates replication for the designated configuration file whether or not data has posted. Deactivates the configuration and deletes queues and processes. Begins replication of the data specified in a configuration. Duplicates a configuration to edit and save as a new file. Creates a new configuration file in which you enter information about objects to be replicated. Gracefully terminates replication of the data specified in a configuration, allowing data in the queues to be posted to the target database before the queues are deleted. Modifies an existing configuration file using the default text editor. Displays all of the configuration files on a source system, both active and inactive. Removes data from queues generated by an active configuration, but does not deactivate the configuration or remove the queues themselves. Deletes a configuration file from the system permanently.

activate config copy config create config deactivate config

12 2

1

edit config list config purge config

2 3 1

remove config

2

6

SHAREPLEX FOR ORACLE Reference Guide Version 7.5 List of configuration commands (continued) Command rename config verify config Auth. Level 2 3 Description Assigns a different name to a configuration file. Verifies that the objects in a configuration are valid and that the configuration is structured properly to ensure successful activation and replication. Displays the contents of a configuration file.

view config

3

Connect commandsThe connect commands control connections made to replication systems through the sp_ctrl interface. List of connect commands Command exit Auth. Level 3 Description Exits the sp_ctrl command-line session and disconnects the TCP/IP link. (Used interchangeably with quit.) Sets a default machine for the current sp_ctrl connection. Sets a default sp_cop port number for the current sp_ctrl session. Exits the sp_ctrl command-line session and disconnects the TCP/IP link. (Used interchangeably with exit.)

host port quit

3 3 3

CHAPTER 1 Using SharePlex Commands

7

Information commandsThe information commands provide information about the replication environment. Use these commands when you are trying to resolve a replication problem or you want to view certain process conditions. List of information commands Command orainfo copy/append status lstatus qstatus* report copy/append show Auth. Level 3 3 3 3 3 3 Description Displays the Oracle database information. Displays status history for previous copy/append commands Displays detailed information about the state of SharePlex replication. Displays the state of the capture, export and post queues. Displays copy/append history for a table. Displays the source and destination of the data being processed by each replication process on a system, and displays the status of each process. Displays the status of all configuration activation activity on a source system. Displays brief or detailed statistics for the Capture process for use in tuning and problem solving. Displays the results of the compare config and compare table commands. Displays properties of the active configuration. Displays the number of messages sent to the target system(s). Displays the number of messages received from the source system(s). Displays the Event Log, Command Log, Verify Log, Trace Log, or a process log. Displays brief or detailed statistics for the Post process for use in tuning and problem solving.

show activate show capture show compare show config show export show import show log show post

3 3 3 3 3 3 3 3

8

SHAREPLEX FOR ORACLE Reference Guide Version 7.5 List of information commands (continued) Command show read show sql show statusdb* show sync* status* Auth. Level 3 3 3 3 3 Description Displays brief or detailed statistics for the Read process for use in tuning and problem solving. Displays the current or last SQL statement processed by the Post process. Displays the Status Database, which contains records of important replication events. Displays information about out-of-sync conditions. Displays an overview of the state of SharePlex replication.

Maintenance commandsThe maintenance commands control command displays and files. List of maintenance commands Command clear status remove log compare set log truncate log Auth. Level 2 3 3 1 Description Removes warning messages from the Status Database. Removes old compare reports and logs from the system. Sets the default values for the show log command. Clears the records from the Event Log, with the exception of logged commands.

CHAPTER 1 Using SharePlex Commands

9

Parameter commandsThe parameter commands control the environment parameters that define how SharePlex operates. List of parameter commands Command list param reset param set param Auth. Level 3 1 1 Description Displays a list of SharePlex parameters with current and default values and set-at points. Restores the value of a SharePlex parameter to the default setting. Changes the value of a SharePlex parameter on a global basis or for a specified replication process.

Properties commandsThe properties commands display information about a users authorization level, the local system, and the local SharePlex installation. List of properties commands Command authlevel hostinfo version Auth. Level 3 3 3 Description Displays the SharePlex authorization level of a user who logs into sp_ctrl. Displays a machines name and operating system. Displays the version of SharePlex installed on a machine.

10

SHAREPLEX FOR ORACLE Reference Guide Version 7.5

Queue commandsThe queue commands eliminate orphaned or corrupt queues, and they delete orphaned export processes. List of queue commands Command delete queue delete quser Auth. Level 2 2 Description Removes a capture, export or post queue if the queue is orphaned or corrupted. Removes an unneeded Export process when a target system is removed from the replication configuration.

Run CommandsThe run commands control the operation of SharePlex with options for starting and stopping processes, starting and shutting down replication, re-synchronizing data, and enabling/disabling confirmation messages. List of run commands Command abort service Auth. Level 2 or 1 Description Stops one or all replication processes immediately, without finishing processing. (Level 1 required for Capture.) Removes warning messages from the Status Database. Shuts down sp_cop and all replication processes. Starts a replication process. (Level 1 required for Capture.) Starts replication if sp_cop was started with the -s option to keep the SharePlex replication processes stopped. Stops a replication process gracefully after it is finished reading from or writing to its queues. (Level 1 required for Capture.)

clear status shutdown startstartup

3 1 2 or 1 1

stop

2 or 1

CHAPTER 1 Using SharePlex Commands

11

Synchronization commandsThe synchronization commands control aspects of data synchronization. List of synchronization commands Command compare config Auth. Level 2 Description Compares the contents of all tables in a configuration to those of the target tables to verify synchronization and repair out-of-sync rows, if necessary. Compares the contents of a source table to those of a target table to verify synchronization and repair out-of-sync rows, if necessary. Uses the Oracle Export/Import utility to allow users to set-up replication and/or (re)synchronize tables already in replication. Puts a marker in the data stream to establish a point of synchronization between the source and target data, then stops the Post process at that point. Synchronizes the results of a hot backup or hot copy applied to the target system with ongoing user transactions from the source system.

compare table

2

copy/append

2

flush

2

reconcile

1

Miscellaneous commandsThese miscellaneous commands provide additional controls for using SharePlex. List of miscellaneous commands Commands edit Auth. Level 3 Description Displays the previously issued command in the text editor so that you can edit it and execute the edited version. Will expand a wildcard specification and display the expanded specification to the screen. Displays descriptions and syntax for SharePlex commands from the sp_ctrl command-line interface.

expand help

3 3

12

SHAREPLEX FOR ORACLE Reference Guide Version 7.5 List of miscellaneous commands (continued) Commands redo usage view log options Auth. Level N/A 3 3 Description Executes the previous command again. Displays the syntax for a SharePlex command. Displays the default values for the show log command.

CHAPTER 1 Using SharePlex Commands

13

Part 2: Using SharePlex commandsThis part provides basic information about issuing SharePlex commands and an alphabetical reference guide for each one.

Issuing SharePlex commandsSharePlex commands are issued through the sp_ctrl command-line interface. The sp_ctrl prompt appears in one of two ways, depending on whether or not you set a default system.sp_ctrl> sp_ctrl(this_host:3304) >

Basic sp_ctrl prompt. Prompt when a default system and port are set by issuing the host (see page 119) and port (see page 131) commands.

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 one machine to affect any other machine involved in replication (see the following topic).

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, includingspaces. To work around this operating-system limitation, use the edit command. For more information, see page 107.For more information on running sp_ctrl, see the SharePlex Administrators Guide.

14

SHAREPLEX FOR ORACLE Reference Guide Version 7.5

Issuing commands for a remote systemTo issue a command that will affect a remote machine and to script commands that include 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. To determine whether or not the [on host] options are available for a command, look in the commands syntax description in the alphabetical reference section in this chapter. The following table describes the command options for remote connection using the [on host] options. [on host] optionsOPTION DESCRIPTION

on host

Use this option to execute a command on a system other than the one to which you currently are connected. (The current system is shown in parentheses after the sp_ctrl prompt.) You are prompted for a login name and password for the system to which you are connecting. This option, if used, must be the last component of a commands syntax. Example: sp_ctrl(sysB)> status on SysA In this example, the status command is being issued on sysB to show replication status on sysA. 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 Use this option for scripting SharePlex commands when a remote login, password, and host name must be provided. This option, if used, must be the last component of a commands syntax. Example: sp_ctrl(sysB)> status on john/rosebud@SysA Use this option for scripting SharePlex commands when a remote login, password, host name, 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 john/rosebud@SysA:8304

on host:portnumber

on login/password@host

on login/password@host:portnumber

CHAPTER 1 Using SharePlex Commands

15

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

Getting online help in sp_ctrlTo view descriptions and syntax for SharePlex commands from within the sp_ctrl interface, issue the help command (see page 117). To view just the syntax for a command, issue the usage command (see page 223).

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 the menu.

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

16

SHAREPLEX FOR ORACLE Reference Guide Version 7.5

3 In the Screen Buffer Size option box, increase the Height value until it

produces a scroll bar in the Command Prompt window.4 Click OK to apply the settings.

5 In the Apply Properties To Shortcut dialog

box, select one of the options, either to apply the new properties to the current command session or to apply them as the new default 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 command. The commands appear in alphabetical order, beginning on the next page.

CHAPTER 1 Using SharePlex Commands

17

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 all replication 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, or data problem and you need to prevent posting to the target system(s). Because you are deleting whatever data remains in the pipeline, the source and target instances will go out 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 remains in 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 abort config command only if there are named export queues that separate the replication streams for each one. Without named export queues, SharePlex funnels all replicated data 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. Authorization level: Issued for: Related commands: SYNTAXBASIC COMMAND [ON HOST] OPTIONS

Administrator (1) source systemdeactivate config, purge config

abort config filename

available

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

18

SHAREPLEX FOR ORACLE Reference Guide Version 7.5

Required argumentsARGUMENT DESCRIPTION

filename

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

CHAPTER 1 Using SharePlex Commands

19

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, its queues. This command is effective when you cannot wait for a process to stop gracefully, or in unusual circumstances when a process will not shut down when you issue the stop 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 SharePlex is shut down and re-started. Only the start command can start it again (see page 211). The abort service command provides options with which you can abort a process for any (or all) systems, or for a named queue, without affecting replication for other routes. Authorization level: Issued for: Operator (2); Administrator (1) to abort Capture abort service for Capture, Read and Export are issued for the source system. abort service for Import and Post are issued for the target system.start, stop

Related commands: SYNTAXBASIC COMMAND

COMMAND OPTIONS

[ON HOST] OPTIONS

abort service service

[to host] [from host] [for datasource] [for datasource-datadest] [queue queuename]

available

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

20

SHAREPLEX FOR ORACLE Reference Guide Version 7.5

Required argumentsARGUMENT DESCRIPTION

service

The SharePlex replication process you want to abort. Valid values are: Capture Read Export Import Post Example: sp_ctrl(sysA)> abort service capture

Command optionsOPTION DESCRIPTION

to 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 sysB In this example, Export is aborted from sysA to sysB, but other Export processes from sysA to other target systems will continue. 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 sysC In this example, Import from sys C is aborted on sysD, but other Import processes on sysD from other source systems will continue. 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 other Read processes for other instances on sysA will continue.

from host

for datasource

CHAPTER 1 Using SharePlex Commands Command options (continued)OPTION DESCRIPTION

21

for datasource-datadest

This option aborts Post for a designated source SID-target SID data stream, while allowing other Post activities to continue. datasource is expressed as o.SID, where SID is the ORACLE_SID of 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 to oraC, but other Post processes on sysC will continue. This option aborts the Export, Import or Post process associated with a named queue, while allowing replication through other named queues to continue. queuename is the name of the queue. Example: sp_ctrl(sysA)> abort service export queue QA In this example, Export of data through named export queue QA is aborted on sysA, but Export will continue for data assigned to all other named queues.

queue queuename

22

SHAREPLEX FOR ORACLE Reference Guide Version 7.5

activate configUse the activate config command to activate a configuration. Replication begins immediately as soon as the activation process is complete. To activate a configuration, the database containing the objects to be replicated must be mounted and open. The length of time that activation takes varies, depending on the size, number and structure of the configured objects, the amount of row chaining, and the type of activation you are using. 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 can activate only one of them at a time. Activating another configuration for the same datasource automatically deactivates the first one. The process that sp_cop calls to activate a configuration is sp_tconf. If you ever need to kill an activation process, look for that name. The activation process retains control of the sp_ctrl interface until the activation is finished. 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.

Available activation methodsSharePlex provides the following methods for activating a configuration.

Default activation Live activation

Using default activationThe default activate config command initiates a multi-threaded process that creates one or more asynchronous parallel threads, each handling the analysis for a different object. All tables are locked for the entire configuration activation, during which time users cannot access them. Multi-threaded processing makes this time as short as possible. If one or more objects should fail to activate, SharePlex continues to activate the other ones. If SharePlex cannot obtain a lock on any table in the configuration, the entire activation will fail. To minimize the amount of time that users are locked out of tables, you can use a progressive activation. See Chapter 7 of the SharePlex Administrators Guide for more information.

CHAPTER 1 Using SharePlex Commands

23

Warning! If your application uses NOWAIT locking on tables that will be activated in a replication configuration, it could fail if it attempts to obtain a lock on a row or object that is being activated.

Using live activationWhen you synchronize data with an Oracle hot backup and the reconcile command, you can take advantage of live configuration activation by using the [live] option with the activate config command. Activation with the [live] option allows users to access the tables while the activation is taking place, so you need not quiet the database. Successful live activation is dependent upon running the reconcile command after the target database has been recovered on the target system, following the instructions in the synchronization procedure you are using.Warning! Live activation requires that the applications have retry logic. NOWAIT locking on tables in the replication configuration may cause the application to fail if it attempts to obtain a lock on an object that is being activated.

What to expect during live activationDuring live activation, SharePlex creates asynchronous, parallel processing threads to activate multiple tables simultaneously, while keeping track of row chaining. Replication of each table begins as soon as its activation is complete. Should one or more table fail to activate, SharePlex continues with the activation of the other tables. During live activation, SharePlex locks the tables as needed at the beginning of the activation to get read consistency, and at the completion of the activation. For this reason, if an application uses NOWAIT locking on tables in the replication configuration, it could fail if it attempts to obtain a lock on an object being activated.

Other considerations when using live activation Do not perform DDL, including TRUNCATE, during live activation. DML changesare the only permissible changes during live activation.

Do not use live activation to reactivate tables to which an Oracle partition has beenadded. Activate newly partitioned tables by using default activation.

24

SHAREPLEX FOR ORACLE Reference Guide Version 7.5

Controlling the number of activation threadsMulti-threaded activation is intended for systems with multiple processors. The SP_OCF_THREAD_COUNT parameter (see page 235) controls the default number of analysis threads. You can change the default number of threads by issuing the set param command for SP_OCF_THREAD_COUNT (see page 156), or you can override the default by using the [threads=n] option of the activate config command. The more threads, the higher the load on the system. Generally, there is a point of diminishing returns when there are more than 5 threads, regardless of the hardware configuration. Therefore, it is recommended that you use from 3 to 5 threads.

Changing the PROCESSES parameterConfiguration activation creates the following number of database log-ons (LDAs) per thread:

For the standard activation process, there are three log-ons per thread. For live activation, there are four log-ons per thread.Before you activate a configuration, you might need to change the PROCESSES parameter 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 activationthreads will generate, plus three more.

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

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

CHAPTER 1 Using SharePlex Commands

25

Viewing results of the activationBecause SharePlex continues with activation whether or not individual tables fail to activate, it alerts you when tables fail to activate by displaying the following error message 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 173)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 one log, 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 str=11.1.0.0.0, int=111 oconf 08-07-08 16:17:03.404378 oconf 08-07-08 16:17:03.445080 file oconf 08-07-08 16:17:03.445225 oconf 08-07-08 16:17:03.850244 oconf 08-07-08 16:17:03.884861 oconf 08-07-08 16:17:04.158338 oconf 08-07-08 16:17:04.244146 oconf 08-07-08 16:17:04.244387 oconf 08-07-08 16:17:06.370400 oconf 08-07-08 16:17:06.546159 ging enabled oconf 08-07-08 16:17:06.796741 oconf 08-07-08 16:17:06.796823 oconf 08-07-08 16:17:06.796853 lock on "QARUN"."DEMO_SRC" oconf 08-07-08 16:17:07.335588 tion oconf 08-07-08 16:17:12.575705 23372 1 Oracle compatible parameter 23372 1 Parsing the configuration file 23372 1 Completed parsing the configuration 23372 1 New activation id 1348 23372 1 Building object cache 23372 1 Oracle version 111 23372 1 Finished building object cache 23372 1 Comparing object caches 23372 1 Completed comparing object caches 23372 1 Oracle supplemental logging is on 23372 1 Activation id 1348, supplemental log23372 1 Placing items in replication 23372 1 "QARUN"."DEMO_SRC": NEW, Type is T, 23372 1 DetLock: Attempting to do a non-wait 23372 1 Completed placing items in replica23372 1 Activation complete

26

SHAREPLEX FOR ORACLE Reference Guide Version 7.5

What to do if activation failsMany things can cause the activation of a table or the entire configuration to fail, such as the following:

Locking: Default activation uses NOWAIT locking, and if a lock cannot beobtained, the activation fails. Locks are tolerated by live activation.

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, and correct any problems that it finds. Then, try activating again. If the configuration still does not activate, see Solving configuration problems on page 301. . Authorization level: Administrator (1) Issued for: source system abort config, copy config, create config, deactivate Related commands:config, edit config, list config, purge config, remove config, rename config, show activate, show config, verify config, view config

SYNTAXBASIC COMMAND COMMAND OPTIONS [ON HOST] OPTIONS

activate config filename

[threads=n] [live]

available

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

Required argumentsARGUMENT DESCRIPTION

filename

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

CHAPTER 1 Using SharePlex Commands

27

Command optionsOPTION DESCRIPTION

live

Use this option to activate a configuration when users are accessing the tables. When you use this option, you must issue the reconcile command (see page 138) after the target database has been recovered, according to the instructions for the synchronization procedure you are using. When used, this option must appear after the [threads=n] option, but it must precede any other command options in the syntax. Example: sp_ctrl(sysA)> activate config sales threads=3 live Use this option to control the number of analysis threads that the activation process generates. This option overrides the default value set by the SP_OCF_THREAD_COUNT parameter (see page 235). Multi-threaded activation 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 threads generally diminish beyond that point. SharePlex will not start more threads than the number of tables to be analyzed. When used, this option must appear after the required command arguments, and it must appear before the [live] option. Examples: sp_ctrl(sysA)> activate config sales threads=3 sp_ctrl(sysA)> activate config sales threads=3 live

threads=n

28

SHAREPLEX FOR ORACLE Reference Guide Version 7.5

orainfoUse the orainfo command to view the Oracle database informationthe including the SID. The following is an example of the display:sp_ctrl (alvspxl11:2101)> orainfo Oracle instance #1: Oracle SID w111a64f Oracle 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 disappeared 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

Authorization level: Issued for: Related commands: SYNTAXBASIC COMMAND

Viewer (3) source or target system none

[ON HOST] OPTIONS

orainfo

available

CHAPTER 1 Using SharePlex Commands

29

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

30

SHAREPLEX FOR ORACLE Reference Guide Version 7.5

authlevelUse the authlevel command to determine your authorization level for issuing SharePlex commands on a system. The following is an example of the display:User is a viewer (level=3)

Authorization level: Issued for: Related commands: SYNTAXBASIC COMMAND

Viewer (3) source or target system none

[ON HOST] OPTIONS

authlevel

available

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

CHAPTER 1 Using SharePlex Commands

31

clear statusUse the clear status command to remove old warning messages from the Status Database. To use this command:1 Issue the show statusdb detail command (see page 205) to find out which messages can 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 that

you want to clear.3 Issue the clear status command for each status ID, or use the all argument to remove

all 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 message, and when cleared it is evident that this message cant be cleared from the status database. Some message cant be cleared.

Authorization level: Issued for: Related commands:

Operator (2) source or target systemshow statusdb

32

SHAREPLEX FOR ORACLE Reference Guide Version 7.5

SYNTAXBASIC COMMAND [ON HOST] OPTIONS

clear status {statusID | all}

available

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

Required argumentsARGUMENT DESCRIPTION

statusID

The SharePlex-assigned ID of an individual message (obtained using the show statusdb command) that you want to remove. Example: sp_ctrl(sysA)> clear status 20 This argument removes all clearable messages. Example: sp_ctrl(sysA)> clear status all

all

CHAPTER 1 Using SharePlex Commands

33

compare configUse the compare config command to compare the data in all of the source tables in a configuration file to the data in the corresponding target tables. This command also provides repair options that apply the SQL statements needed to bring out-of-sync target rows back into synchronization with the source rows.

How to use the compare config commandUse the compare config 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 andthen repair out-of-sync rows.Important! Before you begin using this command, please review all of this documentation. Improper use could result in lost target data and out-of-sync conditions.

Tip: To compare the contents of an individual source table to its target table, see compare table on page 55.

What the compare config command supportsThe compare config command detects out-of-sync conditions in target tables that are caused 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 automatic processes such as triggers or cascading deletes. Out-of-sync conditions resulting from DML on target objects can go undetected until the Post process attempts to post a change to the affected rows.Important! The compare config command supports configs that employ Oracle wilcards; however, if the set of objects indicated by the wildcard specification includes objects that are not presently in replication, the compare command will only compare those objects currently in replication. Please refer to the Specifying source tables using

34

SHAREPLEX FOR ORACLE Reference Guide Version 7.5wildcards section of the SharePlex Administrators Guide for information on employing Oracle wildcards in a configuration file.

What the compare config command does not supportThe compare config command does not detect out-of-sync conditions caused by DDL operations, including those that SharePlex supports. However, once you correct an outof-sync condition caused by DDL, you can use the compare config command with a repair option to resynchronize the data in the rows. Do not use the compare config 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 betweenthe 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 compare process to fail with the following error: Oracle Error: ORA-01466: unable to read data - table definition has changed

Overview of compare config command optionsUsed without options, the compare config command compares data values in all of the columns in the tables, including the keys. The following options are available to optimize and customize the comparison process. These options are described in more detail later in this documentation.

Use the [repair] option to resynchronize the source and target tables after the comparison.

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

Use the [key-repair] option to compare the key columns in source and target tablesand repair all of the columns in rows whose keys do not match.

Use the [quickcompare] option to obtain a quick determination of the existance ofout-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

CHAPTER 1 Using SharePlex Commands

35

option does 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 no longer needed with SharePlex 7.5 as long as both the source and all targets are 7.5 (or above). 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 for that release on their use.

Overview of compare config processesThe compare config command initiates a multi-threaded process to compare multiple tables 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 initiates

processing threads on the target system, the number of which is based on the value set by the SP_DEQ_THREADS parameter (see page 282). 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, and

the processing load is divided between the client processes.

36

SHAREPLEX FOR ORACLE Reference Guide Version 7.5

The compare config command does not affect the source tables in any way. SharePlex logs into Oracle only to query for read consistency, and the locks on the source tables are brief. SharePlex briefly locks the target tables during the comparison, but users can continue accessing them with little or no awareness of the lock. When a [repair] option is used, target tables are locked when it is their turn to be repaired, and then the lock is released.

Running concurrent compare processesYou can issue multiple compare config commands at a time, for example to compare subsets of the active configuration (see Comparing subsets of a configuration on page 46). There is a limit to the number of concurrent comparison processes that you can run. 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 is no practical way to determine how many compare processes can be running without exceeding this limit. Therefore, it is recommended that you allow a maximum of five compare processes to run at any given time. An entry similar to the following in the Event Log indicates that the maximum number of queue readers and writers has been exceeded, and that the offending compare process failed: 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 accesses the 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 command can be issued any time you are running a compare config or compare table operation. To stop a running compare operation, issue the following command: sp_ctrl(sysA)> compare cancel id PID

Identifying compare config processesCompare processes are identified in two ways.

CHAPTER 1 Using SharePlex Commands

37

Session IDBecause multiple compare config commands can run concurrently, SharePlex keeps track of the processes for each one by assigning them a session ID number that corresponds to the operating-system-assigned process ID (PID) of the sp_desvr process. The session ID is reflected in the show compare command output and in the logs.

Process IDOn UNIX systems, the operating-system PID of the sp_desvr and sp_declt processes are displayed by the status and lstatus commands, as shown in this illustration.

The compare server process (sp_desvr) on the source system shown with the status command

On Windows systems, each sp_desvr and sp_declt process has an associated sp_cop process. The lstatus and status commands display the PID of the sp_cop process, not the actual PID of the sp_desvr or sp_declt process.

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

The basic command displays the processing status of all compare config and compare table processes on a system.

Additional command options display statistics for each table that was compared, aswell as an option to view a compare report for each of the compared tables. The compare report contains the SQL statements required to bring a target table back into synchronization (or those that were applied by the repair process). It also can be configured with the SP_DEQ_LOG_ROWID parameter to show the row ID of each source row.

38

SHAREPLEX FOR ORACLE Reference Guide Version 7.5

For more information about using the show compare command, see page 173. For more information about the SP_DEQ_LOG_ROWID parameter, see page 277.

You can view compare reports directly from the log sub-directory of the SharePlex variable-data directory on the target system. The compare report file naming convention is: sid_schema-table-sessionID.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. sessionID is the SharePlex-assigned session 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_IOTIOT_BASIC-21744.sql * Date : Tue May 15 09:19:28 2007 * */ /* * Compare Results * * 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 * */

CHAPTER 1 Using SharePlex Commands

39

Viewing compare config logsSharePlex logs notices, warnings, and errors for each compare session in a log file in the log sub-directory of the SharePlex variable-data directory on both systems. There is a log file for the sp_desvr process on the source system, and there is a log for each associated sp_declt process on the target system. The file name differs depending on which process you are looking at. The file name for the sp_desvr process is SID_desvr-sessionID-log#.log, where:

SID is the ORACLE_SID of the Oracle instance associated with the process. sessionID is the SharePlex-assigned session identifier 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-sessionID-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. sessionID is the SharePlex-assigned session identifier 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 maximum log size is reached, as determined by an internal parameter, SharePlex generates another log file until the number of logs reaches an internal limit. At that point, the logs wrap (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 limit value. For the compare config 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

Sample sp_desvr log fileThe sp_desvr log contains log information for all tables affected by the compare config 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.log DATE: Tue May 15 10:07:57 2007 000: Read Buffer Size: 1048576 bytes ( 1 mbytes) 000: Debug flag: 0x00000000

40

SHAREPLEX FOR ORACLE Reference Guide Version 7.5

000: 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: 2 000: 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-36 000: Machine : i86pc 000: Server Message: 0x0006 000: Server Message: OS Version : SunOS 5.10 Generic_118855-36 (LITTLE) 000: Server Message: Machine : i86pc 000: Server Message: SharePlex Version 6.0.0.115 000: Server Message: SharePlex Lib Version 6.0.0.115 000: 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 3600 000: 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# = 30298 000: 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# = 30303 000: Oracle Session Id = 307, Serial# = 40856 000: 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# = 42017 000: Oracle Session Id = 326, Serial# = 23028 001: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production With the Partitioning and Data Mining options 000: 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) 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 747414 001: Skip LOB column(s) : Off

CHAPTER 1 Using SharePlex Commands

41

001: Log source rowid : On 001: NOTE: rowid size = 4096 for IOT table (de_table_process_iot,L2496) 001: Table is veritcal partitioned 001: LONG column in VP table, swapping DASH with SUMMIT_WORK_ORDER_NO 001: LONG column in VP table, swapping CLASS_CODE with DASH 001: LONG column in VP table, swapping PAYCODE with CLASS_CODE 001: Notice: Object ID of "SP_IOT"."IOT_BASIC" is 747414 001: 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 : 21744 001: Source Data : a102a64f 001: Source Table: "SP_IOT"."IOT_BASIC" 001: Source Node : alvlabu18 001: Target Table: "SP_IOT"."IOT_BASIC" 001: Target Route: alvlabl17.quest.com@j102a32f 001: Target Node : alvlabl17.quest.com 001: Batch Size : 10000 rows 001: Repair : Off 001: Key Compare : Off 001: Port Number : 53441 001: Select Hint : 001: Order By : 001: COMPARE CURRENT STATUS:Tue May 15 10:07:59 2007 (elapsed 1.396424 seconds), 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 seconds), 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 seconds), 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 seconds), 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 seconds), done counting rows & ready to insert compare marker. (de_thrdmgr_sub_main,L1471:de_log_line,L301)

42

SHAREPLEX FOR ORACLE Reference Guide Version 7.5

Sample sp_declt log fileThere is a sp_declt log file for each pair of tables compared with the compare config command. The following is a sample log.FILE: /splex/SharePlex-6.0.0/var10/log/j102a32f_declt-SP_IOT-IOT_BASIC-2174401.log DATE: Tue May 15 09:19:25 2007 000: Debug flag: 0x00000000 000: 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 2005 000: Machine : i686 000: Notice: SP_DEQ_NLS_SELECTOR = 0 (DB) (de_trans_set_nls_lang,L1849) 000: Oracle Session Id = 299, Serial# = 42075 000: Notice: DB NLS_LANG=JAPANESE_JAPAN.JA16EUC (de_trans_ora_logon,L988) 000: Oracle Session Id = 299, Serial# = 42077 000: Oracle Session Id = 317, Serial# = 1079 000: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production With the Partitioning, OLAP and Data Mining options 000: 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: 0x0006 000: Client Message: OS Version : Linux 2.6.9-11.EL #1 Fri May 20 18:17:57 EDT 2005 (LITTLE) 000: Client Message: Machine : i686 000: Client Message: JA16EUC 000: Client Message: AL16UTF16 000: Client Message: SharePlex Version 6.0.0.115 000: Client Message: SharePlex Lib Version 6.0.0.115 000: Server Message: 0x0006 000: Server Message: OS Version : SunOS 5.10 Generic_118855-36 (LITTLE) 000: Server Message: Machine : i86pc 000: Server Message: SharePlex Version 6.0.0.115 000: Server Message: SharePlex Lib Version 6.0.0.115 000: COMPARE CURRENT STATUS:Tue May 15 09:19:27 2007 , ready to do non timedwait table lock. (de_trans_get_read_consistent_view,L1430:de_log_line,L301)

CHAPTER 1 Using SharePlex Commands

43

000: COMPARE CURRENT STATUS:Tue May 15 09:19:27 2007 (elapsed 0.010074 seconds), 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 seconds), 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 seconds), 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 seconds), 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 ON 000: Key Compare : Off 000: Notice: client qualified rows count = 440 000: Notice: client total rows count = 440 000: Session ID : 21744 000: Source Table: "SP_IOT"."IOT_BASIC" 000: Source Node : alvlabu18.quest.com 000: Target Table: "SP_IOT"."IOT_BASIC" 000: Target Route2: alvlabl17@j102a32f 000: Batch Size : 440 rows 000: Repair : Off 000: Source Port : 53441 000: Select Hint : 000: sp_declt PID: 29949 000: Read Buffer Size : 1 mbytes 000: No new key column order, using default column order for SP_IOT.IOT_BASIC 000: running sql statement : (de_select_prepare_to_fetch,L1525) 000: select rowid,"WORK_DATE","EMPLOYEE_NO","DASH","CLASS_CODE","PAYCODE","SHIFT_DIFFERENTIAL","HOURS" from "SP_IOT"."IOT_BASIC" order by 2, 3, 4, 5, 6, 7, 8 000: COMPARE CURRENT STATUS:Tue May 15 09:19:28 2007 (elapsed 0.074330 seconds), 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 seconds), got first batch (de_batch_setup,L1117:de_log_line,L301) 000: SP_DEQ_PART_UPDATE : 0 000: Notice: Object ID of "SP_IOT"."IOT_BASIC" is 876751 000: Exiting without any errors 000: 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 144).

44

SHAREPLEX FOR ORACLE Reference Guide Version 7.5

Repairing out-of-sync rowsTo repair out-of-sync rows found by a basic comparison (without the [key] option), use the [repair] option. The following summarizes your choices when deciding how and when to use the [repair] option.

The recommended procedure is to run the compare config command without the[repair] option first, then view the results with the show compare command to find out if (or which) tables are out-of-sync and the possible cause. Unless the problem is corrected, replication probably will go out of synchronization again. After the problem is fixed, either re-issue the compare config command with the [repair] option or use the compare table command with the [repair] option for individual tables (see page 55). Or...

You can run the compare config command with the [repair] option without doing apreliminary comparison.See Solving synchronization problems on page 311 for causes and solutions for out-ofsync conditions.

When to run the repairThe best time to repair target tables depends on their size, the cause of the problem, the extent of out-of-sync rows, and how long you are willing to tolerate users being locked out. Before you initiate a repair, consider the following:

Although users are not affected by locks when tables are compared, they are lockedout of a target table for the duration of its repair process. For a small table, this might not be disruptive, but for a large table needing extensive repairs, the wait can be significant.

Locks on a target table can impede the Post process if Post must wait for the repair tofinish before it can apply changes to that table and move on to other tables. This can increase the latency of the target data and cause operations to accumulate in the post queue. (Note: If the objects Post needs to change are different than those being processed by the compare config command, the two processes can run simultaneously.)

If you must repair a table immediately, but cannot tolerate locks or replicationlatency, you can use the [key-repair] option, keeping in mind that