Home

IBM Informix Dynamic Server Enterprise Replication Guide

image

Contents

1. Command Line Utility Reference A 79 Command Syntax Example The following example connects to the default database server specified by INFORMIXSERVER and suspends the replicate set accounts set cdr sus replset account set See Also cdr change replicateset on page A 6 cdr define replicate on page A 10 cdr delete replicateset on page A 26 cdr list replicateset on page A 42 cdr modify replicateset on page A 53 cdr resume replicateset on page A 61 cdr start replicateset on page A 69 cdr stop replicateset on page A 75 A 80 IBM Informix Dynamic Server Enterprise Replication Guide Command Syntax cdr suspend server The cdr suspend server command suspends the delivery of replication data to a database server from either a specified list of database servers or from all database servers in the enterprise Syntax cdr suspend server to server group Connect Option from_server_ group 87 p A Element Purpose Restrictions Syntax to_server_group Name of database server The database server group must group to which to suspend be currently active in Enterprise delivery of replication data Replication from server group Name of the database server The database server group must group from which to stop be currently active in Enterprise sending data to Replication to seroer group The cdr suspend server command suspends delivery o
2. p A p A 11 JC replicate 6 participant modifier Connect Option 87 Scope Options Frequency Options Special Options 92 z p A 11 p A 9 p A 13 Element Purpose Restrictions Syntax modifier Specifies the rows and columns See Considerations for the Participant to replicate SELECT Statement on Modifier on page A 91 page A 90 participant Name of a participant in the The participant must exist Participant on replication page A 88 replicate Name of the new replicate The replicate name must be Long Identifiers unique on page A 86 Usage To be useful a replicate must include at least two participants You can define a replicate that has only one participant but before you can use that replicate you must use cdr change replicate to add more participants Important You cannot start and stop replicates that have no participants When you define a replicate the replicate does not begin until you explicitly change its state to active For more information see cdr start replicate on page A 67 A 10 IBM Informix Dynamic Server Enterprise Replication Guide Command Syntax Important Do not create more than one replicate definition for each row and column set of data to replicate If the participant is the same Enterprise Replication attempts to insert duplicate values during replication
3. Conflict Options The conflict options specify how Enterprise Replication should resolve conflicts with data arriving at the database server Conflict Options Back to cdr define replicate p A 10 Back to cdr modify replicate p A 48 gt conflict ignore SPL_routine i optimize J timestamp T SPL_routine J Ac optimize Element Purpose Restrictions SPL routine SPL routine for conflict resolution Syntax The SPL routine must exist Long Identifiers on page A 86 Scope Options The scope options specify how Enterprise Replication should handle problems with data arriving at the database server Scope Options Back to cdr define replicate p A 10 Back to cdr modify replicate p A 48 scopez c transaction S Command Line Utility Reference A 11 Command Syntax A 12 Options Long Form Short Form For more information see Conflict Resolution on page 3 10 The following table describes the conflict and scope options conflict C optimize O scope S IBM Informix Dynamic Server Enterprise Replication Guide Specifies the rule that will be used for conflict resolution The action that Enterprise Replication takes depends upon the scope Specifies that the SPL routine is optimized An optimized SPL routine is called only when a collision is detected and t
4. cdr change replicateset on page A 6 cdr define replicate on page A 10 cdr delete replicateset on page A 26 cdr list replicateset on page A 42 cdr modify replicateset on page A 53 cdr start replicateset on page A 69 cdr stop replicateset on page A 75 cdr suspend replicateset on page A 79 A 62 IBM Informix Dynamic Server Enterprise Replication Guide Command Syntax cdr resume server The cdr resume server command resumes delivery of replication data to a suspended database server Syntax cdr resume server Yi to server group Connect Option from server group p A 87 Element Purpose Restrictions Syntax to server group Name of database server The database server group must group to which to resume be currently active in Enterprise delivery of replication data Replication from server group Name of the database server The database server group must group from which to resume be currently active in Enterprise sending data to Replication to seroer group The cdr resume server command resumes delivery of replication data to the to server eroup database server from the database servers included in the from server group list If the from server eroup list is omitted the command resumes replication of data from all database servers participating in the Enterprise Replication system to the to server group Replication data must have previously been suspende
5. Documentation Notes This item includes additions or corrections to manuals with information about features that might not be covered in the manuals or that have been modified since publication workarounds mand to display the error messages online Start2Programs Informix from the taskbar Related Reading IBM Informix Dynamic Server Enterprise Replication Guide Release Notes This item describes feature differences from earlier versions of IBM Informix products and how these differences might affect current products This file also contains information about any known problems and their Machine notes do not apply to Windows platforms m IBM Informix software products provide ASCII files that contain all of the error messages and their corrective actions For a detailed description of these error messages refer to IBM Informix Error Messages in the IBM Informix Online Documentation site at http www 3 ibm com software data informix pubs library To read the error messages on UNIX you can use the finderr com To read error messages and corrective actions on Windows NT use the Informix Error Messages utility To display this utility choose For a list of publications that provide an introduction to database servers and operating system platforms refer to your Getting Started Guide Compliance with Industry Standards Compliance with Industry Standards The American National Standards
6. Testing the Network Environment In this example cdr1 and serv1 are two connection ports on the same database server Encrypted client server communications uses the serv1 port while encrypted Enterprise Replication uses the cdr1 port For more information on encrypting client server network communications see the IBM Informix Dynamic Server Administrator s Guide For more information on encrypting Enterprise Replication see Setting Configuration Parameters on page 4 20 and Appendix B Configuration Parameter and Environment Variable Reference Testing the Network Environment Once you have verified the network setup information test the network environment To test the network environment 1 Verify the network connection Use the ping command to test the connection between two systems For example from sydney test the connection to melbourne ping melbourne 2 Test the trusted environment a Run dbaccess b Select the Connection menu option c Select the Connect menu option d Connect to the server group name and the server name of the other hosts For example if you are running dbaccess on sydney and you are testing the connection to a database server on melbourne select paul and g paul e When prompted for the USER NAME press ENTER If you can connect to the host database server the host server is trusted for user informix For more information see the IBM Informix DB Access User s Guide
7. To cause a replication 1 Use DB Access to insert a line into the stock table on usa INSERT INTO stores usa stock VALUES 401 PRC ski boots 200 00 pair pair 2 Observe the change on the italy and japan database servers SELECT from stores italy stock SELECT from stores japan stock To update the stock table on the japan database server 1 Use DB Access to change a value in the stock table on japan UPDATE stores japan stock SET unit price 190 00 WHERE stock num 401 2 Verify that the change has replicated to the stock table on usa and on italy SELECT from stores usa stock WHERE stock num 401 SELECT from stores italy stock WHERE stock num 401 E 10 BM Informix Dynamic Server Enterprise Replication Guide Hierarchy Example Hierarchy Example The example in this section adds a replication tree to the fully connected environment of the usa italy and japan replication servers The nonroot servers boston and denver are children of usa The leaf server miami is a child of boston Figure E 1 shows the replication hierarchy Figure E 1 Hierarchical Tree Example denver nonroot Replication Examples E 11 Preparing for a Hierarchy Example Preparing for a Hierarchy Example To try this example you need to prepare three additional database servers boston denver and miami To prepare the database servers use the techniques described in Replication Exam
8. Preparing the Replication Environment 4 9 Preparing the Disk Preparing the Disk Preparing your disk for Enterprise Replication includes the following m Planning for Disk Space Requirements m Setting Up Send and Receive Queue Spool Areas m Creating ATS and RIS Directories Planning for Disk Space Requirements Enterprise Replication requires additional disk space for storing the logical logs and depending on your conflict resolution configuration delete tables and shadow columns Logical Log Configuration Disk Space The database server uses the logical log to store a record of changes to the data since the last archive Enterprise Replication requires the logical log to contain entire row images for updated rows including deleted rows The database server normally logs only columns that have changed This behavior is called the logical log record reduction option Enterprise Replication deactivates this option for tables that participate in replication The logical log record reduction option remains enabled for tables that do not participate in Enterprise Replication Enterprise Replication logs all columns not only the columns that have changed which increases the size of your logical log To determine the size of your logical log examine your data activity for normal operations and for the replication system you defined Keep in mind that defining replication on a table causes Enterprise Replication to deactivate lo
9. Using the IEEE Floating Point or Canonical Format The FLOAT and SMALLFLOAT data types are handled inconsistently across different platforms You can specify sending this data in either IEEE floating point format or machine independent decimal representation Enable IEEE floating point format to send all floating point values in either 32 bit for SMALLFLOAT or 64 bit for FLOAT IEEE floating point format To use IEE floating point format include the floatieee option in your replicate definition It is recommended that you define all new replicates with the floatieee option Enable canonical format to send floating point values in a machine independent decimal representation when you replicate data between dissimilar hardware platforms To use canonical format include the floatcanon option in your rep licate definition The floatcanon option is provided for backward compatibility only it is recommended that you use the floatieee option when defining new replicates If you specify neither IEEE or canonical formats Enterprise Repli cation sends FLOAT and SMALLFLOAT data types as a straight copy of machine representation If you are replicating across different platforms replicated floating point numbers will be incorrect For more information see Special Options on page A 13 Important Once set you cannot modify the replicate to change the floatieee or floatcanon options Defining and Modifying Replic
10. Command Syntax Use this command to add replicates to a replicate set or to remove replicates from an exclusive or non exclusive replicate set If you add a replicate to an exclusive replicate set Enterprise Repli cation changes the existing state and replication frequency settings of the replicate to the current properties of the exclusive replicate set If you remove a replicate from an exclusive replicate set the replicate retains the properties of the replicate set at the time of removal not the state the replicate was in when it joined the exclusive replicate set When you add or remove a replicate from an exclusive replicate set that is suspended or that is defined with a frequency interval Enter prise Replication transmits all the data in the queue for the replicates in the replicate set up to the point when you added or removed the replicate For more information see Suspending a Replicate Set on page 8 7 and Frequency Options on page A 92 If you add or remove a replicate to a non e xclusive replicate set the replicate retains its individual state and replication frequency settings Examples The following example adds the replicates house and barn to replicate set building set cdr change replicateset add building set house barn The following example removes the replicates teepee and wigwam from replicate set favorite set cdr cha replset del favorite set teepee wigwam See Also cdr define replicat
11. Day of week To specify a specific day of the week give either the long or short form of the day followed by a period and then the time For example atime Sunday 18 40 or a Sun 18 40 specifies that the action should occur every Sunday at 6 40 P M The day of the week is given in the locale of the client For example with a French locale you might have atime Lundi 3 30 or a Lun 3 30 The time and day are in the time zone of the server Day of month To specify a specific date in the month give the date followed by a period and then the time For example 1 3 00 specifies that the action should occur at 3 00 A M on the first day of every month The special character L represents the last day of the month For example L 17 00 is 5 00 P M on the last day of the month Command Line Utility Reference A 93 Frequency Options m Daily To specify that replication should occur each day give only the time For example 4 40 specifies that the action should occur every day at 4 40 AM Intervals The e length option lets you specify the interval between actions The length of time between replications can be either of the following formats m The number of minutes To specify the number of minutes specify an integer value For example e 60 indicates 60 minutes between replications If you specify the length of time between replications in minutes the longest interval allowed is 1966020 m The number of hours and
12. IBM Informix Dynamic Server Enterprise Replication Guide ersion March 2003 Part No CT1T2NA Note Before using this information and the product it supports read the information in the appendix entitled Notices This document contains proprietary information of IBM It is provided under a license agreement and is protected by copyright law The information contained in this publication does not include any product warranties and any statements provided in this manual should not be interpreted as such When you send information to IBM you grant IBM a nonexclusive right to use or distribute the information in any way it believes appropriate without incurring any obligation to you Copyright International Business Machines Corporation 1996 2003 All rights reserved US Government User Restricted Rights Use duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp ii IBM Informix Dynamic Server Enterprise Replication Guide Table of Contents Introduction In This Introduction About This Manual Types of Users Software Dependencies Assumptions About Your Locale Demonstration Databases New Features in Dynamic Server Version 9 4 Extensibility Enhancements Functionality Improvements Security Enhancements Command Line Changes Configuration Parameters and Ensiroraneni Variable Chane Documentation Conventions Typographical Conventions Icon Conven
13. Monitoring Disk Usage for Send and Revive Gene Sposi Increasing the Sizes of Storage Spaces Recovering when Storage Spaces Fill 9 3 9 4 9 7 Solving Common Configuration Problems 9 17 Enterprise Replication Event Alarms 920 9 2 IBM Informix Dynamic Server Enterprise Replication Guide In This Chapter Enterprise Replication provides tools to help diagnose problems that arise during replications The Aborted Transaction Spooling ATS and Row Infor mation Spooling RIS files contain information about failed transactions In addition you can use tools provided with the server such as the onstat command to display statistics that you can use to diagnose problems For more information on the onstat commands that are relevant to Enterprise Replication see Appendix C onstat Command Reference This chapter covers the following topics Aborted Transaction Spooling Files Row Information Spooling Files Preventing Memory Queues from Overflowing Solving Common Configuration Problems Enterprise Replication Event Alarms Aborted Transaction Spooling Files When ATS is active all failed replication transactions are recorded in ATS files Each ATS file contains all the information pertinent to a single failed transaction If a replicated transaction fails for any reason constraint violation duplication and so on all the buffers in the replication message that compos
14. You cannot use SPL routines for conflict resolution if the replicate includes any UDTs in the SELECT statement or if the replicate is defined to replicate only changed columns See Conflict Resolution on page 3 10 and Replicating Only Changed Columns on page 6 11 Enterprise Replication allows you to define replicates on tables that contain one or more UDT columns as the primary key For more information see the section on primary key constraints in the IBM Informix Guide to SQL Syntax Replicating Table Hierarchies To replicate tables that form a hierarchy you must define a separate replicate for each table If you define a replicate on a super table Enterprise Repli cation does not automatically create implicit replicate definitions on the subordinate tables Tip Enterprise Replication does not require that the table hierarchies be identical on the source and target servers You must use conflict resolution uniformly for all tables in the hierarchy In other words either no conflict resolution for all tables or conflict resolution for all tables IBM Informix Dynamic Server Enterprise Replication Guide Setting Up and Managing Enterprise Replication Chapter 3 Chapter 4 Chapter 5 Chapter 6 Chapter 7 Chapter 8 Selecting the Enterprise Replication System and Network Topology Preparing the Replication Environment Using High Availability Data Replication with Enterprise Replication Defining
15. from tablel db20server2 carlo table2 select from table2 The following example removes the same two participants from replicate repl 1 cdr change repl d repl 1 dbleserverl antonio tablel db2 server2 carlo table2 See Also cdr define replicate on page A 10 cdr delete replicate on page A 24 cdr list replicate on page A 38 cdr modify replicate on page A 48 cdr resume replicate on page A 59 cdr start replicate on page A 67 cdr stop replicate on page A 73 cdr suspend replicate on page A 77 Command Line Utility Reference A 5 Command Syntax cdr change replicateset The cdr change replicateset or cdr change replset command changes a replicate set by adding or deleting replicates Syntax cdr change replicateset add repl set es Connect Option J Jt l AS delete p A Element Purpose Restrictions Syntax repl set Name of the replicate set to The replicate set must exist Long Identifiers change on page A 86 replicate Name of the replicates to add to The replicates must exist Long Identifiers or delete from the set on page A 86 The following table describes the options to cdr change replicateset Options Long Form Short Form Meaning add a Add replicates to a replicate set delete d Remove replicates from a replicate set A 6 IBM Informix Dynamic Server Enterprise Replication Guide Usage
16. onstat Command Reference 6 5 onstat g atc The following table describes the values for modifier Modifier Action UDR Prints summary information about any UDR invocations by the data sync threads UDRx Prints expanded information including a summary of error infor mation about any UDR invocations by the data sync threads The Procid column lists the UDR procedure ID onstat g dtc The onstat g dtc command prints statistics about the delete table cleaner The delete table cleaner removes rows from the delete table when they are no longer needed The g dtc option is used primarily as a debugging tool and by Technical Support onstat g grp The onstat g grp command prints statistics about the grouper The grouper evaluates the log records rebuilds the individual log records into the original transaction packages the transaction and queues the transaction for transmission The g grp option is used primarily as a debugging tool and by Technical Support The onstat g grp command has the following formats onstat g grp onstat g grp modifier C 6 IBM Informix Dynamic Server Enterprise Replication Guide onstat g grp The following table describes the values for modifier Modifier Action A Prints all the information printed by the G T P E R and S modifiers E Prints grouper evaluator statistics Ex Prints grouper evaluator statistics expa
17. The ENCRYPT_MACFILE configuration parameter specifies a list of the full path names of MAC key files To specify the built in key use the keyword builtin Using the builtin option provides limited message verification some validation of the received message and determination that it appears to have come from a Dynamic Server client or server The strongest verification is done by a site generated MAC key file To generate a MAC key file 1 Execute the following command from the command line GenMacKey o filename The filename is the name of the MAC key file 2 Update the ENCRYPT MACFILE configuration parameter on all Enterprise Replication servers to include the location of the new MAC key file 3 Distribute the new MAC key file Each of the entries for the ENCRYPT MACFILE configuration parameter is prioritized and negotiated at connect time The prioritization for the MAC key files is based on their creation time by the GenMacKey utility The builtin option has the lowest priority Because the MAC key files are negotiated you should periodically change the keys Configuration Parameter and Environment Variable Reference B 19 ENCRYPT SWITCH Configuration Parameter syntax ENCRYPT SWITCH cipher switch time key switch time m cipher switch time specifies the minutes between cipher renegotiation m key switch time specifies the minutes between secret key renegotiation default value 60 60 units minutes range of values po
18. feature Intro 10 Important Intro 10 platform Intro 10 product Intro 10 Tip Intro 10 Warning Intro 10 ID column cdr list server output A 45 Identifiers A 86 See also IBM Informix Guide to SQL Syntax idle option cdr define server 6 6 A 22 cdr modify server A 56 Idle timeout modifying 6 14 setting 6 6 specifying A 21 IEEE floating point format 6 13 A 14 Ignore conflict resolution rule 3 11 3 12 6 10 A 40 database action 3 12 immed option 6 10 A 93 Immediate frequency A 41 Important paragraphs icon for Intro 10 Inactive state definition of 7 8 description of A 40 Inconsistent data with blobspaces or sbspaces 2 20 Increasing storage space size 9 17 Indexes creating or altering clustered 2 16 Industry standards compliance with Intro 17 Information consistency update anywhere 3 9 informix user 2 4 Informix Admin group Windows 2 4 INFORMIXDIR environment variable 4 20 INFORMIXDIR bin directory Intro 5 INFORMIXDIR gls cv9 directory 2 18 INFORMIXDIR incl esql cdrerr h file A 37 INFORMIXSERVER environment variable 4 6 4 20 6 5 7 4 INFORMIXSOLHOSTS environment variable 4 20 F 2 init option 6 5 A 20 Initializing database servers 6 4 See also IBM Informix Dynamic Server Administrator s Guide In place alters ADD and DROP CRCOLS 4 26 Installing UDTs 2 25 Interval formats A 94 Invalid sbspace 6 5 IP addresses specifying in hosts file 4 4 ISA See IBM Informix Server Administrator ISO 8
19. logging It is recommended that you replicate tables only from databases created with unbuffered logging Enterprise Replication evaluates the logical log for trans actions that modify tables defined for replication If a table defined for replication resides in a database that uses buffered logging the transactions are not immediately written to the logical log but are instead buffered and then written to the logical log in a block of logical records When this occurs Enterprise Replication evaluates the buffer of logical log records all at once which consumes excess CPU time and memory When you define a table for replication in a database created with unbuffered logging Enterprise Repli cation can evaluate the transactions as they are produced To create a database with unbuffered logging use CREATE DATABASE db name WITH LOG To minimize impact on the system Enterprise Replication uses buffered logging whenever possible even if the database is defined as unbuffered For more information see the section on CREATE DATABASE in the IBM Informix Database Design and Implementation Guide Table Types The following table types are not supported by Enterprise Replication m RAW tables Because RAW tables are not logged they cannot be replicated using Enterprise Replication m Temporary tables Because the database server deletes temporary tables when an appli cation terminates or closes the database you should not include these
20. see Unbuffered Logging on page 2 10 m For replicates that use any conflict resolution rule except ignore make sure that you define shadow columns CRCOLS for each table involved in replication For more information see Preparing Tables for Conflict Resolution on page 4 25 9 18 IBM Informix Dynamic Server Enterprise Replication Guide Solving Common Configuration Problems If you defined a participant using SELECT from table name make sure that the tables are identical on all database servers defined for the replicate For more information see Defining Participants on page 6 8 and Participant Type on page A 89 Verify that each replicated column in a table on the source database server has the same data type as the corresponding column on the target server Enterprise Replication does not support replicating a column with one data type to a column on another database server with a different data type The exception to this rule is cross replication between simple large objects and smart large objects For more information see Enterprise Replication Data Types on page 2 19 Verify that all tables defined in a replicate have one PRIMARY KEY constraint For more information see Primary Key Constraint on page 2 11 the IBM Informix Database Design and Implementation Guide and IBM Informix Guide to SQL Syntax If HDR is enabled in the replication system then all row data sbspaces must be cre
21. smart large objects 9 8 UDT information 9 8 UDTs 9 8 ats option 6 6 6 11 9 4 A 13 cdr define server A 22 cdr modify replicate A 50 cdr modify server A 56 Attributes replicate changing 6 15 viewing 7 4 Average large object size See AVG LO SIZE parameter AVG LO SIZE parameter 4 15 Backing up databases considerations 2 9 Batch jobs 2 15 BEGIN WORK WITHOUT REPLICATION 2 15 4 22 behavior 4 23 DB Access 4 24 ESQL C 4 24 Bitmap information in logical log files 6 13 BLOB and CLOB information in ATS files 9 8 in RIS files 9 12 BLOB data type spooled row data 4 14 Blobspaces inconsistent replicated data 2 20 replicating from 2 20 storing simple large objects 2 20 Blobs See Simple large objects 2 20 Blocking replication 4 22 Boldface type Intro 9 Buffer tables columns D 17 Buffers transaction spooling to disk 4 13 9 12 Business models primary target systems 3 4 JK LM NOPQR STU VW X Y Z BYTE data ATS files 9 7 distributing 2 24 loading with deluxe mode 4 27 RIS files 9 11 SPL conflict resolution 2 22 storing in tblspaces 2 21 C Canonical format 6 13 A 14 Capacity planning for delete tables 4 12 primary target 3 8 spooling directories 4 19 update anywhere 3 10 Capture mechanisms log based data capture 1 5 trigger based data capture 1 5 trigger based transaction capture 1 5 Cascading deletes considerations 2 12 cdr change replicate 6 15 A 4 examples A 5 cdr change replicateset 8 9 A
22. syscdr that the database server creates when it is initialized Multiple database servers can be on the same physical computer and each database server can participate in Enterprise Replication Important For each server participating in replication you must set up a database server group in the SOLHOSTS file UNIX or registry Windows For more infor mation see Setting up Database Server Groups on page 4 5 and Appendix F SQLHOSTS Registry Key Tip This manual uses the convention that the name of a database server group is g followed by the name of a database server that is in the group for example g italy For more information see Defining Replication Servers on page 6 5 and cdr define server on page A 19 Overview of Enterprise Replication Administration 2 5 Replicate Replicate A replicate defines the replication participants and various attributes of how to replicate the data such as frequency and how to handle any conflicts during replication For more information see Defining Replicates on page 6 7 and cdr define replicate on page A 10 Participant A participant specifies the data database table and columns to replicate and the database servers to which the data replicates Important You cannot start and stop replicates that have no participants For more information see Defining Participants on page 6 8 and Partic ipant on page A 88 Rep
23. usa and italy in the replicate m The P indicates that in this replicate usa is a primary server That is if any data in the selected columns changes that changed data should be sent to the secondary servers m The R indicates that in this replicate italy is a secondary server receive only The specified table and columns receive infor mation that is sent from the primary server Changes to those columns on italy are not replicated IBM Informix Dynamic Server Enterprise Replication Guide Preparing for a Primary Target Replication Display the replicate that you defined so that you can verify that the definition succeeded cdr list replicate The command returns the following information CURRENTLY DEFINED REPLICATES REPLICATE STATE CONFLICT FREQUENCY QUEUE SIZE PARTICIPANT repli Inactive Ignore immediate 0 g usa informix manufact g italy informix manufact Step 5 defines a replicate but does not make the replicate active The output of step 6 shows that the STATE of the replicate is INACTIVE Make the replicate active cdr start replicate repll Display the replicate so that you can verify that the STATE has changed to ACTIVE cdr list replicate The command returns the following information CURRENTLY DEFINED REPLICATES REPLICATE STATE CONFLICT FREQUENCY QUEUE SIZE PARTICIPANT repli Active Ignore immediate 0 g usa informix manufact g italy informix manufac
24. 14 of the Introduction Hierarchical Routing Topologies and SQLHOSTS For hierarchical routing HR topologies m Rootandnonroot servers must each have complete SOLHOSTS server group information for the entire enterprise m Fach leaf server must have SOLHOSTS connectivity information only for itself and its parent hub Root and nonroot servers contain the complete global catalog leaf servers do not For more information see HR Topology Terminology on page 3 20 and Global Catalog on page 2 6 Network Encryption and SQLHOSTS Client server network communication is encrypted by specifying the ENCCSM module with the communications support module CSM option in the SOLHOSTS file However Enterprise Replication can only be encrypted by setting encryption configuration parameters The ENCRYPT CDR confirgu ration parameter must be set to 1 or 2 to allow encryption Important Enterprise Replication cannot use a connection configured with a CSM To combine client server network encryption with Enterprise Replication encryption configure two network connections for each database server The configuration in the SOLHOSTS file would look like the following example dbservername nettype hostname servicename options g groupi group ied cdri ontlitcp texpdx mp cdri g g groupl servi ontlitcp texpdx mp servi csm ENCCSM 4 8 BM Informix Dynamic Server Enterprise Replication Guide
25. 2 Local SQLHOSTS Registry Key Local SQLHOSTS Registry Key If you use the SQLHOSTS registry key on the local computer for all database servers the correct SOLHOSTS registry key must exist on all computers involved in replication In addition the hosts and services files on each computer must include information about all database servers For example to set up replication between the server instance srv1 on the computer host1 and the server instance srv2 on host2 you must ensure the following m Both host1 and host2 include SOLHOSTS registry key entries for srv1 and srv2 m The services file on both computers include the details of the services used by both database server instances Shared SQLHOSTS Registry Key If you use a shared SOLHOSTS registry key you do not need to maintain the same sglhosts information on multiple computers However the hosts and services files on each computer must contain information about all computers that have database servers If you specify a shared SOLHOSTS registry key you must set the environment variable INFORMIXSQLHOSTS on your local computer to the name of the Windows computer that stores the registry The database server first looks for the SOLHOSTS registry key on the INFORMIXSQLHOSTS computer If the database server does not find an SOLHOSTS registry key on the INFORMIX SQLHOSTS computer or if INFORMIXSQLHOSTS is not set the database server looks for an SOLHOSTS registry key on th
26. 8 3 A 20 connect option A 87 delete 6 15 8 9 A 4 A 6 every 6 10 A 93 exclusive 8 4 A 17 firetrigger 6 14 A 14 A 51 floatcanon 6 13 A 14 follow A 35 frequency A 92 fullrow 6 11 A 14 A 51 idle 6 6 A 22 A 56 immed 6 10 A 93 in SQLHOSTS description of 4 7 init 6 5 A 20 leaf 6 7 A 20 mode A 56 nomark A 35 nonroot 6 7 A 20 optimize 6 10 A 12 order of A 85 participant owner A 89 primary A 89 prune A 35 read only A 89 ris 6 6 6 11 9 9 A 13 A 22 A 50 A 56 scope A 11 scope 6 10 A 12 seq A 35 Index 11 A BC D EF GH I sync 6 6 A 20 zap A 35 Out of row data sharing during replication 2 24 Overflowing memory queues preventing 9 12 Overview of Enterprise Replication administration 2 3 Overwriting logical log files 9 14 P Parameters AVG_LO_SIZE 4 15 CDR_DBSPACE 4 20 B 3 CDR_DSLOCKWAIT B 4 CDR_ENV B 5 CDR_EVALTHREADS B 6 to B 7 CDR_MAX_DYNAMIC_LOGS B 8 CDR_NIFCOMPRESS B 9 to B 10 CDR_QDATA_SBSPACE 4 14 4 16 4 21 B 11 CDR_QHDR_DBSPACE 4 13 4 20 B 12 CDR_QUEUEMEM 4 12 4 20 B 13 CDR_SBSPACE 6 5 CDR_SERIAL 4 21 B 14 configuration B 1 to B 20 DBSERVERALIASES 4 20 B 1 DBSERVERNAME 4 20 B 1 ENCRYPT_CDR B 15 ENCRYPT_CIPHER B 16 ENCRYPT_MAC B 18 ENCRYPT_MACFILE B 19 ENCRYPT SWITCH B 20 LOGGING 4 15 LTXEHWM 4 11 LTXHWM 4 11 setting in ONCONFIG file 2 12 4 20 Parent database server definition of 3 20 Parent child definition of 3 20
27. A 48 replicate sets 8 9 to 8 10 A 53 replicates 6 15 replication servers 6 14 to 6 16 A 55 Monitoring dbspaces onstat command 9 16 disk usage 9 16 sbspaces 9 16 oncheck command 9 16 onstat command 9 16 See also IBM Informix Dynamic Server Administrator s Guide IBM Informix Administrator s Reference IBM Informix Dynamic Server Performance Guide Multiple references to a smart large object 2 24 updates to the same row 1 13 A BC D EF GH net time command synchronizing clocks 2 18 nettype description of 4 7 Network connections dropping 7 11 encryption setting up for 4 8 managing 7 11 to 7 12 reestablishing 7 12 troubleshooting 9 13 viewing status 7 11 Network encryption See Encryption Network environment preparing 4 3 testing 4 9 See also IBM Informix Administrator s Guide Network topologies choosing 3 18 forest of trees 1 7 fully connected 1 7 hierarchical tree 1 7 supported types 3 18 New features Intro 5 to Intro 7 nomark option cdr error A 35 Non exclusive replicate sets adding replicates to 8 9 characteristics of 8 5 definition of 8 5 example of 8 5 Nonoptimized SPL routine 3 17 nonroot option 6 7 A 20 Nonroot servers definition of 3 20 global catalog 2 6 4 8 specifying type 6 7 SQLHOSTS information 4 8 OLTP and data dissemination business model 3 4 oncheck command monitoring sbspaces 9 16 JK LM NOPQRST UU VW X Y Z ONCONFIG file configuration parameters B 1 to B 20 co
28. File Next make sure that the services file includes the port numbers and service names for all the database servers involved in Enterprise Replication The services file is in the following location Operating System File UNIX etc services Windows WINDIR system32 drivers etc services Important Leave a blank line at the end of the services file on Windows 4 4 IBM Informix Dynamic Server Enterprise Replication Guide Setting Up the Trusted Environment For example your services file might look like the following Sydney 5327 tcp melbourne 5327 tcp If the database servers reside on the same system you must provide unique port numbers for each Setting Up the Trusted Environment To establish the trust relationship for all users set up the hosts equiv file The hosts equiv file is in the following location Operating System File UNIX letc hosts equiv Windows WINDIR system32 drivers etc hosts equiv For example your hosts equiv file might look like the following sydney melbourne Tip Instead of allowing access to all users you can set up rhosts files in the home directory of specific users See your operating system documentation for more information Verifying SQLHOSTS Make sure that the SQLHOSTS file is set up properly on each server partici pating in replication Setting up Database Server Groups Enterprise Replication requires that all database ser
29. Important Do not remove the delete tables created by Enterprise Replication The delete table is automatically removed when the last replicate defined with conflict resolution is deleted Shadow Column Disk Space When you define a replicate that uses any conflict resolution rule except ignore you must define shadow columns CRCOLS with the WITH CRCOLS clause The shadow columns cdrserver and cdrtime store server and time stamp information that Enterprise Replication uses for conflict resolution The two shadow columns are integers which adds a total of 8 bytes to each row in the table involved in a replicate that uses conflict resolution Tip If you plan to use only the ignore conflict resolution rule you do not need to define the cdrserver and cdrtime shadow columns For more information see Conflict Resolution Rule on page 3 11 and Preparing Tables for Conflict Resolution on page 4 25 Setting Up Send and Receive Queue Spool Areas The term data queue refers to both the send queue and the receive queue Enter prise Replication collects information from the logical logs and places the data to be transferred in the send queue Then Enterprise Replication transfers the contents of the send queue to the receive queue on the target server Enterprise Replication on the target reads the data from the receive queue and applies the changes to the tables on the target server The send and receive queues
30. JK LM NOPQR STU VW X Y Z Participant definition contents 6 8 example 6 9 Participant modifiers description of A 88 restrictions 2 26 A 91 Participant type changing 6 15 default 6 9 Primary 6 9 Target 6 9 Participants adding to replicates 6 15 changing mode A 48 defining 6 8 A 88 definition of 2 6 6 3 A 88 deleting from replicates 6 15 modifier A 90 owner option A 89 primary option A 89 read only option A 89 specifying type A 89 update anywhere 6 9 Pathnames ATS and RIS directories 4 19 dbspaces 4 13 sbspaces 4 15 Pending state description of A 40 Performance Enterprise Replication 1 6 Permitted SQL statements 2 17 ping command testing network connection 4 9 Planning considerations 2 8 for disk space requirements 4 10 Platform icons Intro 10 Port numbers services file 4 5 Preparing consistent data 4 22 data for replication description of 4 22 example of 4 29 to 4 30 database server environment 4 19 disk for Enterprise Replication 4 10 for UDR replication 4 25 for UDT replication 4 25 12 IBM Informix Dynamic Server Enterprise Replication Guide hosts file 4 4 logging databases 4 26 network environment 4 3 services file 4 4 SQLHOSTS connectivity information F 3 tables for conflict resolution 4 25 to use ATS 9 4 to use RIS 9 9 Preventing DDRBLOCK mode 9 14 Preventing memory queues from overflowing 9 12 Primary option A 89 participant type 6 9 primary 2 26 Primary conflict resolution rule 3 11 3 1
31. S1 rlogin s3 S2 dbaccessdemo log stores For information on preparing data for replication see Data Prepa ration Example on page 4 29 E 2 IBM Informix Dynamic Server Enterprise Replication Guide Primary larget Example Primary Target Example This section contains a simple example of primary target replication In primary target replication only changes to the primary table are replicated to the other tables in the replicate Changes to the secondary tables are not replicated Preparing for a Primary Target Replication In this example define the g_usa and g_italy database server groups as Enterprise Replication servers and create a replicate repll1 To define the database server groups and create the replicate 1 Create and populate the database that defines the usa database server as a replication server cdr define server init g usa Before replicating data you must define the database servers as rep lication servers A replication server is a database server that has an extra database that holds replication information The init option specifies that this server is a new replication server When you define a replication server you must use the name of the database server group g usa rather than the database server name Display the replication server that you defined to verify that the definition succeeded cdr list server The command returns the following information SERVER ID STATE STATUS QU
32. Sending thread for site connection CDRNsAn 1 per CDRNrn Receiving thread for site connection 2 CDRACK 7n Accepts acknowledgments from site At least 2 up to a maximum of the number of active connections 10f2 onstat Command Reference C 3 onstat g cat Number of Threads Thread Name Thread Description CPUs CDRD_n Replays transaction on the target system DataSync thread At least one thread is created for each CPU virtual processor VP The maximum number of threads is 4 number of CPU VPs 1 CDRSchedMgr Schedules internal Enterprise Replication events Oor1 CDRM Monitor Monitors and adjusts DataSync performance for optimum performance on the target Oorl CDRDTCleaner Deletes cleans rows from the deleted rows shadow table when they are no longer needed 2 of 2 onstat g cat The onstat g cat command prints information from the Enterprise Repli cation global catalog The global catalog contains a summary of information about the defined servers replicates and replicate sets on each of the servers within the enterprise For example use this command to determine the current bitmap mask for a given server which table matches a given replicate or whether a server is a root or leaf server The onstat g cat command has the following formats onstat g cat onstat g cat scope onstat g cat replname C 4 BM Informix Dynamic Server Enterprise Replication Guide onstat g ddr The fo
33. Server Groups on UNIX On UNIX a database server group is defined in the sqlhosts file The following example shows a very simple sqlhosts file for four Enterprise Replication servers john paul george and ringo and their database server groups The first line describes the database server group g john which includes the database server john and so on dbservername nettype hostname servicename options g john group i 143 john ontlitcp sydney australia com 10110 g g_john g paul group i 144 paul ontlitcp melbourne australia com 2939 g g paul g george group i 145 george ontlitcp perth australia com 5329 g g george g ringo group i 146 ringo ontlitcp brisbane australia com 10101 g g ringo mmm 4 6 IBM Informix Dynamic Server Enterprise Replication Guide l l Verifying SQLHOSTS The following table describes the fields in the sqlhosts example above dbservername Database server group name or database server name nettype Type of connection composed of the database server product interface type and network protocol hostname The name of the computer where the database server resides servicename The service name or port number entry in the services file options m The g option specifies the name of the group to which the database server belongs m The i option specifies a unique identifier for the database server Make sure that this identifier is c
34. a transaction is applied only if all interconnected distributed sites agree to accept the transaction Synchronous data replication is appropriate for appli cations that require immediate data synchronization However synchronous data replication requires that all hardware components and networks in the replication system be available at all times For more information about synchronous replication refer to the discussion of two phase commit in your IBM Informix Dynamic Server Administrator s Guide Asynchronous replication is often preferred because it allows for system and network failures Asynchronous replication allows the following replication models m Primary target Primary Target Replication System on page 3 3 All database changes originate at the primary database and are replicated to the target databases Changes at the target databases are not replicated to the primary m Update anywhere Update Anywhere Replication System on page 3 8 All databases have read and write capabilities Updates are applied at all databases IBM Informix Dynamic Server Enterprise Replication Guide Log Based Data Capture The update anywhere model provides the greater challenge in asynchronous replication For example if a replication system contains three replication sites that all have read and write capabilities conflicts occur when the sites try to update the same data at the same time Conflicts must be detected and resolved s
35. and Modifying Replication Servers Replicates and Participants Managing Replication Servers and Replicates Creating and Managing Replicate Sets Chapter Selecting the Enterprise Replication System and Network Topology In This Chapter Selecting the Enterprise Replication System Primary Target Replication System Primary Target Business Models Primary Target Considerations Update Anywhere Replication System Conflict Resolution Conflict Resolution Rule Scope Choosing a Replication Network Topology Fully Connected Topology Hierarchical Replication Topologies HR Topology c T Hierarchical Tree Forest of Trees 3 3 3 3 3 3 3 8 3 8 3 10 3 11 3 17 3 18 3 19 3 19 3 20 3 21 3 22 3 2 BM Informix Dynamic Server Enterprise Replication Guide In This Chapter This chapter describes types of replication systems provided by Enterprise Replication and discusses the trade offs associated with performance and data availability Selecting the Enterprise Replication System Enterprise Replication supports the following types of replication systems m Primary Target Replication System m Update Anywhere Replication System Primary Target Replication System In the primary target replication system the flow of information is in one direction That is the primary always sends data to the target The target does not send data to the primary In primary target replication all data
36. and operating system requirements For example the hardware and operating system of the computers running the primary and secondary database servers must be identical m Database and data requirement For example all databases must have logging turned on and all data must reside in logged dbspaces or sbspaces m Database server configuration requirements For example the database server version storage space and chunk configuration and many other configurations must be identical m Connectivity For example the connectivity information on each of the computers must identify the database server running on it and the other data base server in the HDR pair 5 8 IBM Informix Dynamic Server Enterprise Replication Guide Setting Up Database Server Groups For a complete list of configuration requirements see the IBM Informix Dynamic Seroer Administrator s Guide Setting Up Database Server Groups When defining an HDR server pair within Enterprise Replication the HDR server pair must appear to be a single logical entity within the replication domain To accomplish this define the two HDR servers within the same database server group in the SOLHOSTS file For example Figure 5 6 illus trates two Enterprise Replication nodes one of which is an HDR pair Figure 5 6 Database Server Groups for Enterprise Replication with HDR Servi sec g servi In this example the HDR pair consists of
37. applied while other replicated rows might not be applied m Transaction scope When you choose a transaction scope Enterprise Replication applies the entire transaction if the replicated transaction wins the conflict resolution If the target wins the conflict or other database errors are present the entire replicated transaction is not applied A transaction scope for conflict resolution guarantees transactional integrity Selecting the Enterprise Replication System and Network Topology 3 17 Choosing a Replication Network Topology 3 18 Important Enterprise Replication defers some constraint checking on the target tables until the transaction commits If a unique constraint or foreign key constraint violation is found on any row of the transaction at commit time the entire trans action is rejected regardless of the scope and if you have ATS set up written to the ATS directory For more information see Aborted Transaction Spooling Files on page 9 3 Choosing a Replication Network Topology Enterprise Replication topology describes connections that replication servers make to interact with each other You must define the replication topology within the topology of the physical network but the replication topology is not synonymous with the physical network topology The order in which you define the database servers for replication and the options that you use when you define the database
38. buffers spooling to disk 4 13 9 12 constraint checking 3 18 evaluation examples 1 15 to 1 18 evaluation logic 1 11 processing 2 14 tables D 16 Transaction conflict resolution scope 3 13 3 17 6 10 Transaction records default dbspace 4 13 storage 4 13 Transactional integrity 3 17 Transactions distributed 2 14 failed ATS and RIS files 6 11 9 3 large 2 15 JK LM NOPQRST UU VW X Y Z Tree topology illustrated 3 21 Tree definition of 3 20 Triggers activating A 14 changing 6 15 data capture 1 5 definition of 1 5 enabling 6 14 errors with Enterprise Replication 2 13 firing A 51 in primary key updates 1 13 permissions A 89 transaction capture 1 5 Troubleshooting configuration problems 9 17 to 9 19 spooled transactions 9 13 Trusted environment configuring 4 5 testing 4 9 Two phase commit definition of 1 4 distributed transactions 2 14 TXH label ATS files 9 6 TZ environment variable A 93 UDRs HDR servers preparing 5 10 installing 4 25 preparing to replicate 4 25 registering 4 25 SPL conflict resolution 3 15 UDTs columns primary key 2 26 HDR servers preparing 5 10 in ATS files 9 8 information in ATS files 9 8 information in RIS files 9 12 installing 4 25 installing and registering 2 25 loading with deluxe mode 4 27 preparing to replicate 4 25 registering 4 25 replicating only changed columns 6 12 Index 17 A BC D EF GH I preparation 2 25 spooled row data 4 14 support for 2 25
39. cdr define replset See cdr define replicateset cdr define server 6 5 A 19 cdr delete replicate 7 10 A 24 cdr delete replicateset 8 8 A 26 cdr delete replset See cdr delete replicateset cdr delete server 7 6 A 28 cdr disconnect server 7 11 A 32 cdr error A 34 cdr finderr A 37 A 92 cdr list replicate 7 7 A 38 cdr list replicateset 8 6 A 42 cdr list replset See cdr list replicateset cdr list server 7 3 7 11 A 44 cdr modify replicate 6 15 A 48 cdr modify replicateset 8 10 A 53 cdr modify replset See cdr modify replicateset Index 3 A BC D EF GH cdr modify server 6 14 A 55 cdr remove A 58 cdr resume replicate 7 10 A 59 cdr resume replicateset 8 8 A 61 cdr resume replset See cdr resume replicateset cdr resume server 7 6 A 63 cdr start 7 5 A 65 cdr start replicate 7 8 A 67 cdr start replicateset 8 7 A 69 cdr start replset See cdr start replicateset cdr stop 7 5 A 71 cdr stop replicate 7 8 A 73 cdr stop replicateset 8 7 A 75 cdr stop replset See cdr stop replicateset cdr suspend replicate 7 9 A 77 cdr suspend replicateset 8 7 A 79 cdr suspend replset See cdr suspend replicateset cdr suspend server 7 5 A 81 dbaccess 4 9 error return codes A 92 net time 2 18 oninit 6 4 onmode 6 4 onspaces 4 13 4 15 9 16 onstat 9 3 9 16 C 1 to C 11 onstat g ath C 3 onstat g cat C 4 onstat g ddr C 5 onstat g dss C 5 onstat g dtc C 6 onstat g grp C 6 onstat g ni
40. child table only Defining and Modifying Replication Servers Replicates and Participants 6 9 Specifying Conflict Resolution Rules and Scope Specifying Conflict Resolution Rules and Scope For update anywhere replication systems you must specify the conflict resolution rules in the replicate definition using the conflict rule option The conflict resolution rules are m ignore m timestamp m routine name If you use an SPL routine for your conflict resolution rule you can also use the optimize option to specify that the routine is optimized For more information see the following m Update Anywhere Replication System on page 3 8 Conflict Resolution Rule on page 3 11 Conflict Options on page A 11 You can also specify the scope using the scope scope option m transaction default NH row For more information see Scope on page 3 17 and Scope Options on page A 11 Specifying Replication Frequency The replication frequency options allow you to specify the interval between replications or the time of day when an action should occur If you do not specify the frequency the default action is that replication always occurs immediately when data arrives The frequency options are m immed m every interoal m at time 6 10 IBM Informix Dynamic Server Enterprise Replication Guide Setting Up Error Logging For more information see Frequency Options on page
41. data types 2 26 for simple large objects 2 22 smart large objects 2 23 time stamp 3 14 See also Conflict resolution S Sample code conventions Intro 13 Sbspaces 2 20 grouper paging file 4 18 guidelines for spooled data 4 14 inconsistent replicated data 2 20 increasing sizes 9 17 invalid 6 5 monitoring disk usage 9 16 pathname limitations 4 15 row data 4 14 to 4 18 spooled row data 4 13 4 14 See also IBM Informix Dynamic Server Administrator s Guide IBM Informix Administrator s Reference SBSPACETEMP parameter 4 18 Scope definition of 3 17 row 3 13 3 17 transaction 3 13 See also Conflict resolution scope option 6 10 A 12 Scope options A 11 Secondary conflict resolution rule 3 11 Security See Encryption SELECT statement considerations A 91 limitations A 91 participant modifier A 90 with shadow columns 4 27 Send queues definition of 1 14 4 12 See also Memory queues seq option cdr error A 35 Sequence objects 2 14 SERIAL data types 2 12 2 19 SERIALS data types 2 12 2 19 A BC D EF GH Server administrator Enterprise Replication 2 4 SERVER column cdr list server output A 45 Server connections stopping A 32 Server definitions global catalog 2 7 Server groups See Database server groups Server state global catalog 2 7 Server See Database servers servicename description of 4 7 services file example 4 5 preparing 4 4 Sets See Replicate sets Setting AVG LO SIZE 4 15 CDR O
42. delta At this point you might see some transactions aborted because of conflict Transaction can abort because alpha beta and gamma started queueing data from delta in step 4 However those same transactions might have been moved in steps 5 and 7 You must declare replication on server delta and then immediately suspend replication because while you are preparing the replicates and unloading and loading files the other servers in the replicate alpha beta and gamma might be collecting information that needs to be replicated After you finish loading the initial data to delta and resume replication the information that was generated during the loading process can be replicated 4 30 IBM Informix Dynamic Server Enterprise Replication Guide Chapter Using High Availability Data Replication with Enterprise Replication In This Chapter High Availability Replication System Using HDR in a Hierarchical Tree Topology Using HDR in a Forest of Trees Topology Preparing HDR Database Servers HDR Requirements Setting Up Database Server Groups Preparing to Replicate UDTs UDRs and DataBlade Modules Loading and Unload Data Managing Enterprise Replication with D i pared Data Replication Row Data Sbspace Logging HDR Failure Performance Goncidemitons 5 3 5 3 5 6 5 7 5 8 5 8 5 9 5 10 5 10 5 11 5 11 5 11 5 13 5 2 IBM Informix Dynamic Server Enterprise Replication Guide In This Ch
43. eroup and the server specified in the connect option If the connect option is omitted the command drops the connection between server group and the default database server SINFORMIXSERVER Example The following example drops the connection between the default database server SINFORMIXSERVER and the server group g_store1 cdr disconnect server g storel See Also m cdr connect server on page A 9 m cdr define server on page A 19 m cdr delete server on page A 28 m cdr list server on page A 44 A 32 IBM Informix Dynamic Server Enterprise Replication Guide Command Syntax cdr modify server on page A 55 cdr resume server on page A 63 cdr suspend server on page A 81 Command Line Utility Reference A 33 Command Syntax cdr error The cdr error command manages the error table and provides convenient displays of errors Syntax cdr error Z Y Connect on n seq err server seqno p A ES prune follow all nomark Element Purpose Restrictions Syntax err Server Name of database server group The server must be registered for Long Identifiers on that holds the error table Enterprise Replication page A 86 Start date for a range You must provide a valid date Time of Day on and time page A 93 Ending date for range You must provide a later date Time of Day on and time than first page A 93 Sequence number of a
44. error command also allows you to administer the cdr error table remotely The reviewed flag lets you watch for new errors while keeping the old errors in the table For example you could run cdr error periodically and append the output to a file Command Line Utility Reference A 35 Command Syntax Examples The following command displays the current list of errors on database server hill cdr error connect hill After the errors are displayed Enterprise Replication marks the errors as reviewed The following command connects to the database server lake and removes from the error table all errors that occurred before the time when the command was issued cdr error c lake zap The following command deletes all errors from the error table that occurred at or before 2 56 in the afternoon on May 1 2000 cdr error p 2000 05 01 14 56 00 The following command deletes all errors from the error table that occurred at or after noon on May 1 2000 and before or at 2 56 in the afternoon on May 1 2000 cdr error p 2000 05 01 14 56 00 2000 05 01 12 00 00 A 36 IBM Informix Dynamic Server Enterprise Replication Guide Command Syntax cdr finderr The cdr finderr command looks up a specific Enterprise Replication error number and displays the corresponding error text Syntax cdr finderr ER error number Element Purpose Restrictions Syntax error number Enterprise Replication error Must be a posit
45. frequency for the sales_data replicate to every Sunday at noon enter cdr modify replicate sales data Sunday 12 00 For more information see cdr modify replicate on page A 48 Resynchronizing Replication Servers You might want to resynchronize servers in your replication environment for example if replicated tables between Enterprise Replication servers have become out of sync after stopping and restarting replication for a server Warning Make sure that there are no user transactions performing updates on any replicated tables while you run this procedure To synchronize the replication g papeete with the g raratonga 1 Suspend replication to the replication server group g papeete See Suspending Replication for a Server on page 7 5 2 Unload the table from the server group g raratonga See Loading and Unloading Data on page 4 26 3 Load the table on g papeete and specify BEGIN WORK WITHOUT REPLICATION See Loading and Unloading Data on page 4 26 and Blocking Rep lication on page 4 22 4 Resume replication to g papeete See Resuming a Suspended Replication Server on page 7 6 6 16 IBM Informix Dynamic Server Enterprise Replication Guide Resynchronizing Replication Servers Important If tables that you are synchronizing include shadow columns you must explicitly unload and load these columns If these values are not included Enterprise Replication inserts NULL values
46. in the replicate will be replicated to the stock table on the other database servers E 6 IBM Informix Dynamic Server Enterprise Replication Guide Preparing for an Update Anywhere Replication Preparing for an Update Anywhere Replication In this example define the repl2 replicate To prepare for update anywhere replication 1 Define the replicate rep12 cdr define replicate conflict ignore repl2 storesGg usa informix stock select from stock stores g_italy informix stock select from stock These lines are all one command The backslashes at the end of the lines indicate that the command continues on the next line This step specifies that conflicts should be ignored and describes two participants usa and italy including the table and the columns to replicate in the replicate Because neither P primary nor R receive only is specified the rep licate is defined as update anywhere If any data in the selected columns changes on either participant that changed data should be sent to the other participants in the replicate Display all the replicates so that you can verify that your definition of repl2 succeeded cdr list replicate The command returns the following information CURRENTLY DEFINED REPLICATES REPLICATE repli STATE Active CONFLICT Ignore FREQUENCY immediate QUEUE SIZE 0 PARTICIPANT g usa informix manufact g italy informix manufact REPLICATE repl2 STATE I
47. it Using High Availability Data Replication with Enterprise Replication 5 3 High Availability Replication System Read only Enterprise Replication High Availability Data Replication HDR Secondary Target Read only KY N Target P Read only 4 NS HDR Primary Read write 5 4 IBM Informix Dynamic Server Enterprise Replication Guide High availability replication systems are most useful for replication systems in which the failure of a critical server prevents other servers from participating in replication Figure 5 1 illustrates the combination of a primary target replication system with a high availability replication system Figure 5 1 Using High Availability with a Primary Target Replication System High Availability Replication System If the primary server fails the secondary server is set to standard mode the target database connections are redirected to it and Enterprise Replication continues as illustrated in Figure 5 2 Figure 5 2 HDR A switched to standard mode Redirection to the Secondary Database Target Target Read only Read only L HDR Primary offline Target Target Read only Read only Lf In an update anywhere replication system you can use HDR with any server for which you need high availability as illustrated in Figure 5 3 Figure 5 3 Critical server Using High HDR Primar Availability with an
48. m Administration Update anywhere replication systems allow peer to peer updates and therefore require conflict resolution see Conflict Resolution on page 3 10 Update anywhere replication systems require more administration than primary target replication systems m Information consistency Some risk is associated with delivering consistent information in an update anywhere replication system You determine the amount of risk based on the type of conflict resolution rules and routines you choose for resolving conflicts You can configure an update any where replication system where no data is ever lost however you might find that other factors for example performance outweigh your need for a fail safe mechanism to deliver consistent information Selecting the Enterprise Replication System and Network Topology 3 9 Conflict Resolution m Capacity Planning All replication systems require you to plan for capacity changes For more information see Preparing Data for Replication on page 4 22 In particular if you choose the time stamp or time stamp plus SPL routine conflict resolution rule see Delete Table Disk Space and Shadow Column Disk Space on page 4 12 m High Availability If any of your database servers are critical consider using HDR to provide backup servers For more information see High Availabil ity Replication System on page 5 3 Conflict Resolution When multiple database servers try to u
49. m Enterprise Replication encryption requires setting encryption config uration parameters Enterprise Replication cannot accept a connection that is configured with a CSM To combine client server network encryption with Enterprise Repli cation encryption configure two network connections for each database server one with CSM and one without For more information see Network Encryption and SOLHOSTS on page 4 8 Important HDR does not support encryption If you combine Enterprise Replication with HDR communication between Enterprise Replication servers and the HDR primary server can be encrypted but the communication between the HDR primary server and the HDR secondary server cannot be encrypted Enterprise Replication encryption configuration parameters are documented in Appendix B Configuration Parameter and Environment Variable Reference How Enterprise Replication Replicates Data Before you can replicate data you must declare a database server for repli cation and define the replicates the data to replicate and the database servers that participate in replication To declare a database server for replication see Defining Replication Servers on page 6 5 To define replicates see Defining Replicates on page 6 7 Appendix E Replication Examples has simple examples of declaring replication servers and defining replicates After the servers and replicates are defined Enterprise Replication uses the following
50. model matches the partition model for the employee tables The Asia Pacific database server owns the partition and can therefore update insert and delete employee records for personnel in its region The changes are then propagated to the U S and European regions The Asia Pacific database server can query or read the other partitions locally but cannot update those partitions locally This strategy applies to other regions as well Workflow Replication Unlike the data dissemination model in a workflow replication system the data moves from site to site Each site processes or approves the data before sending it on to the next site Figure 3 4 Accountin Pid Shi A Workflow 9 management p Replication System S uo me e Where Update 1235 XSPORTS 1235 XSPORTS 1235 XSPORTS Authority Moves From Site to Site Order Order Order processing processing processing Figure 3 4 illustrates an order processing system Order processing typically follows a well ordered series of steps orders are entered approved by accounting inventory is reconciled and the order is finally shipped In a workflow replication system application modules can be distributed across multiple sites and databases Data can also be replicated to sites that need read only access to the data for example if order entry sites want to monitor the progress of an order A workflow replication system like the primary target replic
51. more information see SERIAL Data Types and Primary Keys on page 2 12 Replicating on Heterogeneous Hardware Enterprise Replication supports all primitive data types across heterogeneous hardware If you define a replicate that includes non primitive data types for example BYTE and TEXT data the application must resolve data representation issues that are architecture dependent If you use floating point data types with heterogeneous hardware you might need to use IEEE floating point or canonical format for the data transfers For more information see Using the IEEE Floating Point or Canonical Format on page 6 13 Overview of Enterprise Replication Administration 2 19 Enterprise Replication Data Types Replicating Simple and Smart Large Objects Enterprise Replication replicates m Simple large object data types TEXT and BYTE You can store simple large objects either in the tblspace with the rest of the table columns in a dbspace or in a blobspace m Smart large object data types BLOB and CLOB You must store smart large objects in sbspaces For more information about database storage see the IBM Informix Dynamic Server Administrator s Guide Replicating Simple Large Objects from Tblspaces Simple large object data that is stored in tblspaces rather than in blobspaces is placed in the logical log Enterprise Replication reads the logical log to capture and evaluate the data for potential replication Repli
52. of this database server A Active S Suspended Q Quiescent initial sync state only ishub char 1 Y Server is a hub N Server is not a hub isleaf char 1 Y Server is a leaf server N Server connection is not a leaf server rootserverid integer The identifier of the root server forwardnodeid integer The identifier of the parent server idletimeout integer Idle time out atsdir lvarchar ATS directory spooling name risdir lvarchar RIS directory spooling name D 12 IBM Informix Dynamic Server Enterprise Replication Guide syscdrsync buf syscdrsync buf The syscdrsync_buf table contains buffers that give information about the synchronization queue Enterprise Replication uses this queue only when defining a replication server and synchronizing its global catalog with another replication server For information on the columns of the syscdrsync buf table refer to Columns of the Buffer Tables on page D 17 syscdrsync txn The syscdrsync txn table contains information about the synchronization queue This queue is currently used only when defining a replication server and synchronizing its global catalog with another replication server The synchronization queue is an in memory only queue For information on the columns of the syscdrsync txn table refer to Columns of the Transaction Tables on page D 16 syscdrtx The syscdrtx table contains information about Enterprise Replication transa
53. on all computers that participate in replication See Setting Up the Database Server Group Registry Key on page F 5 Verifying the services Files on All Computers Finally on each computer that participates in replication make sure that the services file located in the C NWindows system32 drivers etc directory contains entries for all the database servers To verify the services files on all computers 1 Check the services file on the first host for example host1 The file might look like this techpubs27 4599 tcp service for online instance denver techpubs28 4600 tcp service for online instance boston 2 Check the services file on the second host for example host2 The file might should look the same as the file on host1 techpubs27 4599 tcp service for online instance denver techpubs28 4600 tcp service for online instance boston F 8 IBM Informix Dynamic Server Enterprise Replication Guide Notices IBM may not offer the products services or features discussed in this document in all countries Consult your local IBM repre sentative for information on the products and services currently available in your area Any reference to an IBM product program or service is not intended to state or imply that only that IBM product program or service may be used Any functionally equivalent product program or service that does not infringe any IBM intellectual property right may be used instead However it
54. or in the associated delete table or if a replication order error is detected A delete table stores the row images of deleted rows A replication order error is the result of replication data that arrives from different database servers with one of the following illogical results m A replicated DELETE that finds no row to DELETE on the target Wm An UPDATE that finds no row to UPDATE on the target m An INSERT that finds a row that already exists on the target About IBM Informix Enterprise Replication 1 19 Chapter Overview of Enterprise Replication Administration In This Chapter Overview of Enterprise Replication Administration Enterprise Replication Server Administrator Enterprise Replication Terminology Enterprise Replication Server Replicate Participant Replicate Set Global Catalog Enterprise Replication C ontidelatoss Operational Considerations Backup and Restore Considerations Database and Table Design Considerations Unbuffered Logging Table Types Out of Row Data Shadow Columns Primary Key Constraint SERIAL Data Types and Primary Keys Cascading Deletes lriggers Sequence Objects Transaction Processing Considerations Replication Volume Distributed Transactions Large Transactions Supported SOL Statements 2 3 2 3 2 4 2 5 2 5 2 6 2 6 2 6 2 6 2 8 2 8 2 9 2 9 2 10 2 10 2 11 2 11 2 11 2 12 2 12 2 13 2 14 2 14 2 14 2 14 2 15 2 15 2 2 Replication Envir
55. previous file contents will be overwritten ATS does not append to a spool file if aname collision does occur with an existing file the original contents of the file will be lost The following is an example ATS filename for a transaction sent by server g_amsterdam to server g_beijing ats g beijing g amsterdam D 2 000529 23 27 16 6 Monitoring and Troubleshooting Enterprise Replication 9 5 About ATS File Information Label Name About ATS File Information The first three characters in each line of the ATS spool file describe the type of information for the line as the following table defines Description TXH Transaction heading This line contains information from the transaction header including the sending server ID and the commit time the receiving server ID and the received time and any Enterprise Replication SQL or ISAM error infor mation for the transaction RRH Replicated row heading This line contains header information from the replicated rows including the row number within the transaction the group ID the replicate ID same as replicate group ID if replicate is not part of any replicate group the database owner table name and the database operation RRS Replicated row shadow columns This line contains shadow column information from repli cated rows including the source server ID and the time when the row is updated on the source server This line is printed only if the replica
56. procedures see the IBM Informix Guide to SQL Tutorial If the routine returns an action code of A D I or U the routine parses the return values of the replicated columns Each BYTE or TEXT column can return a two character field For information about the action codes refer to SPL Conflict Resolution Rule on page 3 14 2 22 BM Informix Dynamic Server Enterprise Replication Guide Enterprise Replication Data Types The first character defines the desired option for the BYTE or TEXT column as the following table shows Value Function C Performs a time stamp check for this column as used by the time stamp rule N Sets the replicate column to NULL R Accepts the replicated data as it is received L Retains the local data The second character defines the desired option for blobspace data if the data is found to be undeliverable as the following table shows Value Function N Sets the replicated column to NULL L Retains the local data default O Aborts the row X Aborts the transaction SPL Conflict Resolution for Smart Large Objects Enterprise Replication handles conflict resolution for smart large objects using the SPL conflict resolution rule in the same way as for simple large objects See Conflict Resolution for Simple and Smart Large Objects on page 2 21 Overview of Enterprise Replication Administration 2 23 Enterprise Replication Data Types Distributing BYTE and TEXT Da
57. queue and ATS directory The command returns the following information NAME ID ATTRIBUTES g usa 1 timeout 15 hub sendq rootdbs recvq rootdbs atsdir tmp E 14 BM Informix Dynamic Server Enterprise Replication Guide Appendix SQLHOSTS Registry Key When you install the database server the setup program creates the following key in the Windows registry HKEY LOCAL MACHINE SOFTWARE INFORMIX SQLHOSTS This branch of the HKEY_LOCAL_MACHINE subtree stores the sqlhosts information Each key on the SQLHOSTS branch is the name of a database server When you click the database server name the registry displays the values of the HOST OPTIONS PROTOCOL and SERVICE fields for that particular database server Each computer that hosts a database server or a client must include the connectivity information either in the SQLHOSTS registry key or in a central registry When the client application runs on the same computer as the database server they share a single SQLHOSTS registry key The Location of the SQLHOSTS Registry Key When you install the database server on Windows the instal lation program asks where you want to store the SQLHOSTS registry key You can specify one of the following two options m The local computer where you are installing the database server m Another computer in the network that serves as a central shared repository of sqlhosts information for multiple database servers in the network F
58. range of values 0 Donotencrypt 1 Encrypt when possible 2 Always encrypt takes effect when Enterprise Replication is initialized The ENCRYPT CDR configuration parameter sets the level of encryption for Enterprise Replication If the ENCRYPT CDR configuration parameter is set to 1 then encryption is used for Enterprise Replication transactions only when the database server being connected to also supports encryption This option allows unencrypted communication with versions of Dynamic Server prior to 9 40 If the ENCRYPT CDR configuration parameter is set to 2 then only connec tions to encrypted database servers are allowed If you use both encryption and compression by setting the CDR_NIFCOMPRESS configuration parameter then compression occurs before encryption Configuration Parameter and Environment Variable Reference B 15 B 16 ENCRYPT CIPHER Configuration Parameter syntax ENCRYPT CYPHER all allbut list of ciphers and modes cipher model cipher mode mall Specifies to include all available ciphers and modes except ECB mode For example ENCRYPT_CIPHER all m allbut list of ciphers and modes Specifies to include all ciphers and modes except the ones in the list Separate ciphers or modes with a comma For example ENCRYPT CIPHER allbut lt cbc bf gt m cipher mode Specifies the ciphers and modes Separate cipher mode pairs with a comma For example ENCRYPT CIPHER des3 cbc des3 ofb de
59. replicate by this destination tx stamp 2 integer Together with tx_stamp1 forms the stamp of the last transaction acknowledged for this replicate by this destination 2 of 2 The syscdrq table contains information about Enterprise Replication queues D 6 IBM Informix Dynamic Server Enterprise Replication Guide Column Type Description srvid integer The identifier number of the database server repid integer The identifier number of the replicate srcid integer The server ID of the source database server In cases where a particular server is forwarding data to another server srvid is the target and srcid is the source that originated the transaction srvname char 128 The name of the database server replname char 128 Replicate name srcname char 128 The name of the source database server bytesqueued integer Number of bytes queued syscarqueued syscdrqueued The syscdrqueued table contains data queued information Column Type Description servername char 128 Sending to database server name name char 128 Replicate name bytesqueued decimal 32 0 Number of bytes queued for the server servername syscdrrecv_buf The syscdrrecv_buf table contains buffers that provide information about the data receive queue When a replication server receives replicated data from a source database server it puts this data on the receive queue for processing On the target side Enterprise Replication pic
60. replication message for a row that could not be applied to a target is written to this directory For more information see Chapter 9 Monitoring and Troubleshooting Enterprise Replication 3 12 IBM Informix Dynamic Server Enterprise Replication Guide Conflict Resolution Time Stamp Conflict Resolution Rule The time stamp rule evaluates the latest time stamp of the replication against the target and determines a winner Tip All time stamps and internal computations are performed in Greenwich Mean Time GMT The time stamp resolution rule behaves differently depending on which scope is in effect m Row scope Enterprise Replication evaluates one row at a time The row with the most recent time stamp wins the conflict and is applied to the target database servers If an SPL routine is defined as a secondary conflict resolution rule the routine resolves the conflict when the row times are equal m Transaction scope Enterprise Replication evaluates the most recent row update time among all the rows in the replicated transaction This time is com pared to the time stamp of the appropriate target row If the time stamp of the replicated row is more recent than the target the entire replicated transaction is applied If a routine is defined as a second ary conflict resolution rule it is used to resolve the conflict when the time stamps are equal For more information see Scope on page 3 17 A secondary ro
61. reside in memory and are managed by the Reliable Queue Manager ROM The CDR QUEUEMEM configuration parameter CDR_QUEUEMEM Configuration Parameter on page B 13 specifies the amount of memory space that is available for the data queues 4 12 BM Informix Dynamic Server Enterprise Replication Guide Setting Up Send and Receive Queue Spool Areas When a queue in memory fills for the receive queue this only occurs with large transactions the transaction buffers are written spooled to disk Spooled transactions consist of transaction records headers that contain internal information for Enterprise Replication replicate information summaries of the replication information for each transaction and row data the actual replicated data Spooled transaction records and replication records are stored in transaction tables and replication tables in a single dbspace Spooled row data is stored in one or more sbspaces Important To prevent the send and receive queues from spooling to disk see Preventing Memory Queues from Overflowing on page 9 12 Transaction Record dbspace By default the transaction records and replication records are stored in the root dbspace Because Enterprise Replication and other database servers become unavailable if the root dbspace fills you should define a single separate dbspace for the send and receive queue transaction records and replication records before you define the
62. resume replicate 7 10 A 59 examples A 59 cdr resume replicateset 8 8 A 61 cdr resume replset See cdr resume replicateset cdr resume server 7 6 A 63 cdr start 7 5 A 65 A BC D EF GH examples A 65 cdr start replicate 7 8 A 67 examples A 68 cdr start replicateset 8 7 A 69 examples A 70 cdr start replset See cdr start replicateset cdr stop 7 5 A 71 examples A 72 cdr stop replicate 7 8 A 73 examples A 74 cdr stop replicateset 8 7 A 75 examples A 76 cdr stop replset See cdr stop replicateset cdr suspend replicate 7 9 A 77 examples A 78 cdr suspend replicateset 8 7 A 79 examples A 80 cdr suspend replset See cdr suspend replicateset cdr suspend server 7 5 A 81 examples A 64 A 82 cdrerr h file A 37 cdrserver shadow column 2 11 2 21 behavior with BEGIN WORK WITHOUT REPLICATION 4 23 definition of 4 12 See also Shadow columns cdrtime shadow column 2 11 2 21 behavior with BEGIN WORK WITHOUT REPLICATION 4 23 definition of 4 12 See also Shadow columns CDR_DBSPACE parameter 4 20 B 3 CDR_DSLOCKWAIT parameter B 4 CDR_ENV parameter B 5 CDR_EVALTHREADS parameter B 6 to B 7 CDR_LOGDELTA environment variable B 21 CDR_MAX_DYNAMIC_LOGS parameter 9 15 B 8 JK L MN OP QRS TU VW X Y Z CDR_NIFCOMPRESS parameter B 9 to B 10 CDR_PERFLOG environment variable B 22 CDR_QDATA_SBSPACE parameter 4 14 4 16 4 21 B 11 CDR_QHDR_DBSPACE parameter 4 13 4 20 B 12 CDR_QUEUEMEM parameter 4 12 4 20 B 13 CDR_RMSCA
63. server 3 21 6 6 terminology 3 20 Hierarchical tree definition of 3 21 network topology 1 7 using HDR with 3 22 Hierarchies replicating table hierarchies 2 26 replication examples E 11 A BC D EF GH I High availability planning primary target 3 8 using Enterprise Replication for 1 6 High Availability Data Replication HDR database server groups 4 6 database server groups defining 5 9 DRINTERVAL setting 5 13 encryption not supported 5 8 forest of trees topology 5 7 hierarchical routing topologies 5 6 loading data 5 10 logging sbspaces for spooled row data 4 16 managing 5 11 to 5 13 oninit D command 5 12 onmode d standard command 5 11 performance 5 13 preparing servers 5 8 primary server failure 5 11 primary target replication systems 5 4 replication system 5 3 secondary server switching to 5 11 spooled row data sbspace logging 5 11 starting primary without ER or HDR 5 12 UDRs preparing for 5 10 UDTs preparing for 5 10 update anywhere replication 5 5 with fully connected topology 3 19 with hierarchical tree topology 3 22 High availability replication system 5 3 High Performance Loader 4 27 See also IBM Informix High Performance Loader User s Guide HKEY LOCAL MACHINE F 1 hostname in sqlhosts 4 7 JK L MN OP QRS TU VW XY ze Hosts file preparing 4 4 hosts equiv file 4 5 HPL See High Performance Loader IBM Informix Server Administrator ISA 1 8 setting up SQLHOSTS registry 4 8 F 3 Icons
64. server definition 6 6 Data applying 1 18 capture types 1 5 distributing 1 18 inconsistent 2 20 loading 4 26 maintaining consistency 1 7 preparing 4 22 unloading 4 26 Data delivery resuming A 59 A 61 A 63 suspending for replicate sets A 79 for replicates A 77 for replication servers A 81 Data dissemination model description of 3 4 Data propagation considerations for asynchronous 2 9 JK L MN OP QRS TU VW XY ze Data replication asynchronous definition of 1 4 capture mechanisms log based data capture 1 5 trigger based data capture 1 5 trigger based transaction capture 1 5 definition of 1 3 synchronous definition of 1 4 Data types built in 1 8 extensible 2 26 FLOAT 6 13 floating point 2 19 SERIAL 2 12 SERIAL and SERIAL8 2 19 SERIALS 2 12 SMALLFLOAT 6 13 support for 2 25 supported Intro 6 2 19 user defined 1 8 See also UDTS Database server groups conventions 4 6 HDR defining for 5 9 registry key F 5 SOLHOSTS file 2 5 4 5 UNIX 4 6 usage 4 6 6 5 Windows 4 7 See also IBM Informix Dynamic Server Administrator s Guide Database servers aliases 4 6 4 7 connecting to A 9 declaring for Enterprise Replication 6 3 disconnecting from A 32 initializing 6 4 listing A 44 preparing environment 4 19 preparing for HDR 5 8 removing from Enterprise Replication A 28 resuming data delivery A 63 specifying type 6 7 suspending data delivery A 81 See also IBM Informix Dynamic Server Administrator s Guide Datab
65. server determine the replication topology Enterprise Replication supports two types of network topology m Fully Connected Topology m Hierarchical Replication Topologies The topology that you choose influences the types of replication that you can use The next sections describe the topologies that Enterprise Replication supports IBM Informix Dynamic Server Enterprise Replication Guide Fully Connected Topology Fully Connected Topology Fully connected replication topology indicates that all database servers connect to each other and that Enterprise Replication establishes and manages the connections Replication messages are sent directly from one database server to another No additional routing is necessary to deliver replication messages Figure 3 9 shows a fully connected replication topology Each database server connects directly to every other database server in the replication environment Figure 3 9 Europe Fully Connected J did Ital aly b Germany LJ L France If necessary you can also add HDR and a backup server to any server to provide high availability For more information see High Availability Replication System on page 5 3 Hierarchical Replication Topologies Enterprise Replication provides two types of Hierarchical Routing topology m Hierarchical Tree m Forest of Trees Selecting the Enterprise Replication System and Network Topology 3 19 Hierarchical Replication Topo
66. table defined for replication you must first stop not suspend the replicate that contains the table before running the SOL statement After modifying the table restart the replicate For more information see Managing Replicates on page 7 7 2 16 IBM Informix Dynamic Server Enterprise Replication Guide Replication Environment Considerations Permitted SQL Statements Enterprise Replication permits the following SOL statements with no limitations SET object mode no disabling of primary key constraint START VIOLATIONS TABLE STOP VIOLATIONS TABLE CREATE TRIGGER DROP TRIGGER CREATE VIEW DROP VIEW CREATE SYNONYM DROP SYNONYM ADD INDEX DROP INDEX ALTER INDEX except TO CLUSTER ALTER TABLE constraints except for the primary key Replication Environment Considerations Each replication system that you create affects your environment Consider the following when setting up your replication environment m Time Synchronization m Using GLS with Enterprise Replication Time Synchronization Wherever you use replication that requires time stamp conflict resolution see Conflict Resolution on page 3 10 the operating system times of the database servers that participate in the replicate must be synchronized All time stamps and internal computations are performed in Greenwich Mean Time GMT and have an accuracy of plus or minus one second Overview of Enterprise Replication Administration 2 17 Replic
67. tables in your replication environment For more information on table types see IBM Informix Database Design and Implementation Guide IBM Informix Dynamic Server Enterprise Replication Guide Dalabase and Table Design Considerations Out of Row Data Enterprise Replication collects out of row data for transmission after the user transaction has committed Due to activity on the replicated row the data might not exist at the time Enterprise Replication collects it for replication In such cases Enterprise Replication normally applies a NULL on the target system Therefore you should avoid placing a NOT NULL constraint on any replicated column that includes out of row data Shadow Columns In an update anywhere replication environment you must provide for conflict resolution using a conflict resolution rule see Conflict Resolution on page 3 10 When you create a table that uses the time stamp or time stamp plus SPL conflict resolution rule you must define the shadow columns cdrserver and cdrtime on both the source and target replication servers Tip If you plan to use only the ignore conflict resolution rule you do not need to define the cdrseroer and cdrtime shadow columns For more information see Preparing Tables for Conflict Resolution on page 4 25 Primary Key Constraint All tables involved in replication must have a PRIMARY KEY constraint defined on at least one column which forces th
68. the CDR NIFCOMPRESS values of the two servers are compared and changed to the higher compression values Configuration Parameter and Environment Variable Reference B 9 The compression values determine how much memory can be used to store information while compressing as follows no additional memory 128k 1k 129k 128k 128k 128k 128k nou ow g W ou Ww OANNEFOA 128k 256k 256k Higher levels of CDR_NIFCOMPRESS cause greater compression Different sites can have different levels For example Figure B 2 shows a set of three root servers connected with LAN and a nonroot server connected over a modem The CDR_NIFCOMPRESS configuration parameter is set so that connections between A B and C use no compression The connection from C to D uses level 6 Figure B 2 Database Servers with Different Compression Levels Important Do not disable NIF compression if the network link performs compression in hardware B 10 IBM Informix Dynamic Server Enterprise Replication Guide CDR QDATA SBSPACE Configuration Parameter default value none separators comma range of values up to 128 characters for each sbspace name up to 32 sbspace names Use a comma to separate each name in the list At least one sbspace name must be specified takes effect when Enterprise Replication is initialized The CDR_QDATA_SBSPACE configuration parameter specifies the li
69. the IEEE Floating Point or Canonical Format 2 643 Enabling Triggers ww ee 644 Modifying Replication Servers 644 Modifying Replicates ode de Pe Se a ee ox uw VOS Adding or Deleting Participants vom x Ok 8 aOR Boa at 96415 Changing Replicate Attributes 6 415 Resynchronizing Replication Servers 6 16 vi BM Informix Dynamic Server Enterprise Replication Guide Chapter 7 Chapter 8 Managing Replication Servers and Replicates In This Chapter 7 3 Managing Replication Servers 7 3 Viewing Replication Server Attributes 7 4 Connecting to Another Replication Server 7 4 Stopping Replication on a Server 7 4 Restarting Replication on a Stopped Seve 7 5 Suspending Replication for a Server 7 5 Resuming a Suspended Replication Server 7 6 Deleting a Replication Server 7 6 Managing Replicates 7 7 Viewing Replicate Properties 7 7 Starting a Replicate 7 8 Stopping a Replicate 7 8 Suspending a Replicate 7 9 Resuming a Suspended Replicate 7 10 Deleting a Replicate 7 10 Managing Replication Server Network Colincttions 7 11 Viewing Network Connection Status 7 11 Dropping the Network Connection 7 11 Reestablishing the Network Connection 7 12 Creating and Managing Replicate Sets In This Chapter 8 3 Creating Replicate Sets 8 4 Exclusive Replicate Sets 8 4 Non Exclusive Replicate Sets s 8 5 Customizing the Replicate Set Def
70. the database server that is removed rejoins any replicate however you must synchronize bring tables to consistency with the other database servers see Resynchronizing Replication Servers on page 6 16 Data Evaluation Examples Figure 1 2 Figure 1 4 on page 1 16 and Figure 1 6 on page 1 17 show three examples of how Enterprise Replication uses logic to evaluate transactions for potential replication Figure 1 2 Replicate SQL SELECT emp id salary FROM employee WHERE exempt N Insert Followed by a Delete dallas office phoenix office BEGIN WORK INSERT INTO employee VALUES 927 Smith DELETE FROM employee WHERE emp id 927 COMMIT WORK Figure 1 2 shows a transaction that takes place at the Dallas office Enterprise Replication uses the logic in Figure 1 3 to evaluate whether any information is sent to the destination database server at the Phoenix office About IBM Informix Enterprise Replication 1 15 Evaluating Data for Replication Figure 1 3 Insert Followed by a Delete Evaluation Logic Replicate Replicate Primary Key Send to Destination Initial Image Evaluates Final Image Evaluates Changed Database Server INSERT TorF DELETE TorF Yes or no Nothing Enterprise Replication determines that the insert followed by a delete results in no replication operation therefore no replication data is sent In Figure 1 4 Enterprise Replication uses the log
71. the following SELECT statement returns a list of all trans actions queued on the send queue SELECT FROM syscdrsend txn The following example returns a list of all transactions queued on the in memory send queue and returns the number of buffers and the size of each buffer for each transaction on the send queue SELECT cbkeyserverid cbkeyid cbkeypos count sum cbsize from syscdrsend buf group by cbkeyserverid cbkeyid cbkeypos order by cbkeyserverid cbkeyid cbkeypos Allqueues are present on all the replication servers regardless of whether the replication server is a source or a target for a particular transaction Some of the queues are always empty For instance the send queue on a target only server is always empty Each queue is two dimensional Every queue has a list of transaction headers Each transaction header in turn has a list of buffers that belong to that transaction SMI Table Reference D 15 Columns of the Transaction Tables D 16 IBM Informix Dynamic Server Enterprise Replication Guide Columns of the Transaction Tables All the tables whose names end with _txn have the same columns and the same column definitions The information in the tables represents only trans actions in memory and not those spooled to disk The ctstamp1 and ctstamp2 columns combine to form the primary key for these tables Column Type Description ctkeyserverid integer Server ID of the database server
72. the primary server serv1 and the secondary server serv1 sec These two servers belong to the same database server group g serv1 The non HDR server serv2 belongs to the database server group g serv2 The following example displays the SOLHOSTS file for this configuration dbservername nettype hostname servicename options g servi group S E i l serv1 ontlitcp machinelpri porti g g servi servl_ sec ontlitcp machinelsec porti g g servl g serva group z i i 2 serv2 ontlitcp machine2 porti g g serv2 Using High Availability Data Replication with Enterprise Replication 5 9 Preparing to Replicate UDTs UDRs and DataBlade Modules For more information on setting up the SOLHOSTS file see Verifying SOLHOSTS on page 4 5 Either HDR or Enterprise Replication can be set up first on the HDR pair serv1 and serv1 sec but Enterprise Replication cdr commands must be executed only on the primary server If any cdr commands are attempted on the secondary server a 117 error is returned Attempting to process a cdr command on an HDR secondary server Preparing to Replicate UDTs UDRs and DataBlade Modules If you are using HDR with Enterprise Replication with user defined types user defined routines or DataBlade modules perform the tasks shown in Figure 5 7 on the primary and secondary database servers Figure 5 7 Preparing to Replicate UDTs UDRs and DataBlade Modules Step On the Primary On the Secondary 1 Install the user de
73. the root dbspace For more information see Transaction Record dbspace on page 4 13 Warning Do not change the value of CDR QHDR DBSPACE after you initialize Enterprise Replication B 12 BM Informix Dynamic Server Enterprise Replication Guide CDR QUEUEMEM Configuration Parameter default value 4096 units kilobytes range of values 2 500 takes effect when shared memory is initialized The CDR_QUEUEMEM configuration parameter specifies the maximum amount of memory that is used for the send and receive queues If your logical logs are large the Enterprise Replication reads a large amount of data into queues in memory You can use CDR QUEUEMEM to limit the amount of memory devoted to the queues The maximum memory used for queued elements on a replication server is the total number of database servers involved in replication multiplied by the value of CDR QUEUEMEM When you increase the value of CDR QUEUEMEM you reduce the number of elements that must be written to disk which can eliminate I O overhead Therefore if elements are frequently stored on disk increase the value of CDR QUEUEMEM Conversely if you set the value of CDR QUEUEMEM too high you might adversely impact the performance of your system High values for CDR QUEUEMEM also increase the time necessary for recovery Tune the value of CDR QUEUEMEM for the amount of memory available on your computer Configuration Parameter and Environment Variable Refere
74. the row data sbspace If the CDR ODATA SBSPACE configuration parameter is not set in ONCONHIG or the sbspace name specified by CDR_QDATA_SBSPACE is invalid Enterprise Replication fails to define the server For more information see Row Data sbspaces on page 4 14 CDR SERIAL is set to enable control over generating values for serial columns in tables defined for replication For more information see SERIAL Data Types and Primary Keys on page 2 12 If you wish to encrypt network communications in the ONCONFIG file for each database server make sure that the following configuration parameters are set ENCRYPT CDRis setto 1 or 2 to enable encryption The default value is 0 which prevents encryption ENCRYPT CIPHER specifies which ciphers and cipher modes are used for encryption ENCRYPT MAC controls the level of Message Authentication Code MAC used to ensure message integrity un ENCRYPT_MACFILE is set to the full path and filenames of the MAC files ENCRYPT SWITCH is set to the number of minutes between automatic renegotiations of ciphers and keys These configuration parameters are documented in Appendix B Configu ration Parameter and Environment Variable Reference Preparing the Replication Environment 4 21 Preparing Data for Replication Preparing Data for Replication The goal of data replication is to provide identical or at least consistent data on multiple database servers This sectio
75. the sum and the sites sites Prints the NIF site context blocks serverid Prints information about the replication server whose groupID is serverID sum Prints the sum of the number of buffers sent and received for each site onstat g que The onstat g que command prints statistics for the high level queue interface The queuer manages the logical aspects of the queue The ROM reliable queue manager manages the physical queue The g que option is used primarily as a debugging tool and by Technical Support C 8 IBM Informix Dynamic Server Enterprise Replication Guide onstat g rcv onstat g rcv The onstat g rcv command prints statistics about the receive manager The receive manager is a set of service routines between the receive queues and data sync The onstat g rcv command has the following formats onstat g rcv onstat g rcv serverid onstat g rcv full The serverID modifier causes the command to print only those output messages received from the replication server whose groupID is serverid The full modifier causes the command to print all statistics The onstat g rcv command includes the Receive Parallelism Statistics section a summary of the data sync threads by source server Field Description Server Source server ID Tot Txn Total number of transactions applied from this source server Pending Number of current transactions in the pending list for this source server Active Number of cur
76. the unload and load operations For example you cannot unload data with the onunload utility and then load the data with a LOAD statement If you are using HDR with Enterprise Replication follow the instructions in the section Loading and Unload Data on page 5 10 4 26 IBM Informix Dynamic Server Enterprise Replication Guide Loading and Unloading Data If the table that you are preparing for replication is in a database that already uses replication you might need to block replication while you prepare the table See Blocking Replication on page 4 22 for information on how to do this If a table that you plan to replicate includes the shadow columns cdrserver and cdrtime the statements that you use for unloading the data must explicitly name the shadow columns If you use FROM table name to the data to unload the data from the shadow columns will not be unloaded To include the shadow columns in the unloaded data use a statement like the following SELECT cdrserver cdrtime FROM table name For more information see Shadow Columns on page 2 11 High Performance Loader The High Performance Loader HPL provides a high speed tool for moving data between databases How you use the HPL depends on how you defined the tables to replicate If the table definition included the WITH CRCOLS clause you must take special steps when you unload the data If the table contains shadow columns you must m Include the cd
77. to avoid Enterprise Replication starting on either server after they are split To prevent Enterprise Replication and HDR from running start the database servers with the oninit D command If you remove a server from an HDR pair use the cdr remove command to eliminate Enterprise Replication from that server For example the two HDR servers are being split and the secondary server is to be used for reporting purposes After the report processing is complete HDR can be reestablished Figure 5 10 shows how to remove a secondary server from HDR and Enter prise Replication 5 12 BM Informix Dynamic Server Enterprise Replication Guide Performance Considerations Figure 5 10 Removing the Secondary Server from HDR and ER Step On the Primary On the Secondary 1 onmode command onmode command onmode d standard onmode d standard 2 cdr command cdr remove If the HDR primary server has problems communicating to its secondary server Enterprise Replication is in a suspended state until one of the following actions is taken m Resolve the connection problem between HDR pairs m Convert the primary server to standard mode For more information on managing HDR servers see the IBM Informix Dynamic Server Administrator s Guide Performance Considerations When Enterprise Replication is running on an HDR pair some operations cannot be performed until the logs are shipped to the secondary server This delay prevents possible incon
78. transaction represented by this buffer cbkeypos integer Log position on the source server for the transaction represented by this buffer cbkeysequence integer Sequence number for this buffer within the transaction cbreplid integer Replicate identifier for the data in this buffer cbcommittime integer Time when the transaction represented by this buffer was committed The following columns combine to form the primary key for this table cbkeyserverid cbkeyid cbkeypos cbkeysequence The columns cbkeyserverid cbkeyid and cbkeypos form a foreign key that points to the transaction in the _txn table that the buffer represents SMI Table Reference D 17 Replication Examples This appendix contains simple examples of replication using the command line utility CLU Appendix A Command Line Utility Reference documents the CLU Replication Example Environment To run the replication examples in this chapter you need three Informix database servers Each database server must be in a database server group This example uses the following environment m Three computers s1 s2 and s3 are hosts for the database servers usa italy and japan respectively Each computer has active network connections to the other two computers m The database servers usa italy and japan are members of the database server groups g usa g italy and g japan respectively For information about database serv
79. where this data originated This server ID is the group ID from the sqlhosts file or the SOLHOSTS registry key ctkeyid integer Logical log ID ctkeypos integer Position in the logical log on the source server for the transaction represented by the buffer ctkeysequence integer Sequence number for the buffer within the transaction ctstamp1 integer Together with ctstamp2 forms an insertion stamp that specifies the order of the transaction in the queue ctstamp2 integer Together with ctstamp1 forms an insertion stamp that specifies the order of the transaction in the queue ctcommittime integer Time when the transaction represented by this buffer was committed ctuserid integer Login ID of the user who committed this transaction ctfromid integer Server ID of the server that sent this transaction Used only in hierarchical replication Columns of the Buffer Tables Columns of the Buffer Tables The tables whose names end with buf give information about the buffers that form the transactions listed in the txn table All the buf tables have the same columns and the same column definitions Column Type Description cbflags integer Internal flags for this buffer cbsize integer Size of this buffer in bytes cbkeyserverid integer Server ID of the database server where this data originated This server ID is group ID from the sqlhosts file or the SOLHOSTS registry key cbkeyid integer Login ID of the user who originated the
80. 0338478 00 08 17 20 21 18 In this example NoChange after the 500 indicates that the TEXT data has a size of 500 but the data has not been changed on the source server Therefore the data is not sent from the source server Example 3 Keep local blob 75400 BYTE PB 877 necromsv 840338515 00 08 17 20 21 55 In this example Keep local blob indicates that the replicated data for this column was not applied on the target table but instead the local BYTE data was kept This usually happens when time stamp conflict resolution is defined and the local column has a time stamp greater than the replicated column Monitoring and Troubleshooting Enterprise Replication 9 7 Changed Column Information in ATS Files Changed Column Information in ATS Files If you define a replicate to only replicate columns that changed the RRD entry in the ATS and RIS files show a for the value of any columns that are not available For example For more information see Replicating Only Changed Columns on page 6 11 BLOB and CLOB Information in ATS Files If a replicate includes one or more BLOB or CLOB columns the RRD entry in the ATS file displays the smart blob metadata the in row descriptor of the data not the smart blob itself in hexadecimal format in the ATS file See UDT Information in ATS Files for an example UDT Information in ATS Files If a replicate includes one or more UDT columns the RRD entry in the ATS file d
81. 2 PRIMARY KEY constraint 2 11 See also IBM Informix Guide to Database Design and Implementation IBM Informix Guide to SQL Syntax Primary keys and SERIAL data types 2 12 constraints 2 11 modifying column 2 16 removing constraint 2 16 replicating changed columns 6 12 UDT columns 2 26 updates 1 13 Primary target example E 3 replication systems business models 3 4 combining with HDR 5 4 considerations 3 8 definition of 3 3 Problems solving configuration 9 17 to 9 19 Procedure conflict resolution rule A 40 Product icons Intro 10 Program group Documentation notes Intro 16 Release notes Intro 16 Properties replicate sets 8 6 prune option cdr error A 35 A BC D EF GH Q QUEUE column cdr list server output A 46 Queues See Memory queues Quiescent state description of A 40 server A 45 RAW tables unsupported 2 10 rdate command synchronizing clocks 2 18 Read only option A 89 participant type See Target participant type Receive queues definition of 1 14 4 12 See also Memory queues Recording failed transactions in ATS files 9 4 Recreating Enterprise Replication objects 2 9 replicate sets 8 8 replicates 7 10 replication servers 7 7 Reestablishing network connections 7 12 Referential constraints 8 4 and time based replication 6 11 Referential integrity and replicate sets 8 4 regedt32 program and sqlhosts registry F 4 Registering UDTs 2 25 Release notes Intro 15 Release notes program item Intro 1
82. 6 Reliable Queue Manager definition of 4 12 Removing primary key constraint 2 16 RENAME TABLE statement 2 16 Renaming columns 2 16 Replicate information storage 4 13 JK LM NO P QR Replicate sets adding and deleting replicates 8 9 changing replication frequency 8 10 changing state A 61 connect option 8 3 creating 8 4 customizing 8 5 defining A 16 definition of 2 6 8 3 deleting 8 8 A 26 examples A 61 A 70 A 76 A 80 exclusive 8 4 frequency 8 5 listing A 42 managing 8 6 to 8 8 modifying 8 9 to 8 10 A 53 non exclusive 8 5 recreating 8 8 referential constraints 6 11 resuming 8 8 A 61 starting 8 7 A 69 stopping 8 7 A 75 supported versions 8 3 A 16 suspending 8 7 A 79 viewing properties 8 6 Replicates activating ATS A 13 RIS A 13 active state 7 8 adding participants A 4 to replicate sets 8 9 CONFLICT field A 40 conflict options A 11 customizing 6 7 defining 6 7 to 6 14 A 10 definition of 2 6 6 3 deleting from global catalog 7 10 A 24 from replicate sets 8 9 participants A 4 displaying information about A 40 FREQUENCY field A 41 inactive state 7 8 listing A 38 S TUVWXYZ ea managing 7 7 to 7 10 modifying 6 15 A 48 recreating 7 10 resuming 7 10 A 59 exclusive replicate sets 7 10 starting 7 8 A 67 exclusive replicate sets 7 8 STATE field A 40 stopping 7 8 A 73 exclusive replicate sets 7 9 suspending 7 9 A 77 exclusive replicate sets 7 9 viewing properties 7 7 Replicating changed column
83. 6 examples A 7 cdr change replset See cdr change replicateset cdr connect server 7 12 A 9 cdr define replicate 6 7 A 10 defining participants 6 8 examples A 14 options A 13 cdr define replicateset 8 4 A 16 abbreviation A 84 examples A 18 cdr define replset See cdr define replicateset cdr define server 6 5 A 19 examples A 22 options A 21 to A 22 cdr delete replicate 7 10 A 24 examples A 24 cdr delete replicateset 8 8 A 26 examples A 27 cdr delete replset See cdr delete replicateset 2 BM Informix Dynamic Server Enterprise Replication Guide cdr delete server 7 6 A 28 examples A 29 to A 30 cdr disconnect server 7 11 A 32 examples A 32 cdr error A 34 examples A 36 options A 35 cdr finderr A 37 A 92 cdr list replicate 7 7 A 38 examples A 39 A 41 cdr list replicate brief examples A 39 cdr list replicateset 8 6 A 42 examples A 42 cdr list replset See cdr list replicateset cdr list server 7 3 A 44 CONNECTION CHANGED column A 46 description of output A 45 examples A 44 A 46 QUEUE column A 46 STATE column A 45 STATUS column A 45 viewing network connection status 7 11 cdr modify replicate 6 15 A 48 examples A 51 options A 50 restrictions A 49 cdr modify replicateset 8 10 A 53 examples A 54 cdr modify replset See cdr modify replicateset cdr modify server 6 14 A 55 examples A 56 options A 56 CDR record type 6 13 See also IBM Informix Dynamic Server Administrator s Reference cdr remove A 58 cdr
84. 8 8 8 9 8 9 8 10 8 2 IBM Informix Dynamic Server Enterprise Replication Guide In This Chapter This chapter covers creating replicate sets viewing replicate set properties and managing and modifying replicate sets A replicate set is a collection of several replicates that you can manage together as a unit By default you can manage replicates that belong to a replicate set both individually and as part of the set or as a set only Important Enterprise Replication supports replicate sets for IBM Informix Dynamic Server Version 9 3 and later only You cannot define or modify replicate sets to include replicates with participants that are Version 9 2 and earlier In addition replicate sets are different from and incompatible with replicate groups in Version 9 2 and earlier To create manage or modify a replicate set on a database server other than the server specified by INFORMIXSERVER use the connect option Connecting to Another Replication Server on page 7 4 to connect to that server Creating and Managing Replicate Sets 8 3 Creating Replicate Sets 8 4 Creating Replicate Sets To create a replicate set use the cdr define replicateset command Enterprise Replication supports two types of replicate sets exclusive and non exclusive Exclusive Replicate Sets To maintain referential integrity between replicates that include tables that have
85. 84 Aborted rows and ATS files 9 4 Aborted Transaction Spooling See ATS Activating ATS A 18 A 22 RIS A 13 A 22 triggers A 14 Active state definition of 7 8 replicates A 40 server A 45 ADD CRCOLS defining shadow columns 4 25 add option cdr change replicate 6 15 A 4 cdr change replicateset 8 9 A 6 Adding chunks to storage spaces 9 16 columns to a table 2 16 participants to replicates 6 15 A 4 replicates to replicate sets 8 9 A 6 rowids 2 16 Administering Enterprise Replication CLU 1 8 ISA 1 8 overview 2 3 Administration primary target replication systems 3 8 update anywhere replication systems 3 9 Advantages replicating only changed columns 6 12 Alarms event 9 20 all option cdr error A 35 ALTER FRAGMENT statement 2 16 ALTER TABLE statement ADD and DROP CRCOLS 4 26 See also IBM Informix Guide to SQL Syntax Alters in place 4 26 ANSI compliance level Intro 17 Application specific routines 3 16 Applying data process 1 18 Arguments in SPL routine 3 15 3 16 Asynchronous data replication 1 4 propagation considerations 2 9 at option 6 10 A 93 time formats A 93 ATS activating A 13 A 22 capacity planning 4 19 filenames description of 9 5 modifying directory 6 14 specifying directory 6 6 A 21 A 55 ATS files BLOB and CLOB information 9 8 BYTE and TEXT data 9 7 A BC D EF GH changed column information 9 8 configuring 6 11 description of 9 3 naming conventions 9 5 preparing to use 9 4
86. 859 1 code set Intro 4 Keys primary and constraints 2 11 and SERIAL data types 2 12 and UDT columns 2 26 removing constraints 2 16 L Large objects replicating only changed columns 6 12 Index 9 A BC D EF GH Large transactions grouper paging file 4 18 Large transactions considerations for Enterprise Replication 2 15 leaf option 6 7 A 20 Leaf servers definition of 3 20 global catalog 2 6 4 8 limited catalog 2 7 specifying 6 7 SQLHOSTS information 4 8 Limitations SPL conflict resolution 3 15 Limited SQL statements 2 16 Listing Enterprise Replication servers A 44 replicate sets A 42 replicates A 38 LOAD statement 4 26 4 28 See also IBM Informix Guide to SQL Syntax Loading data ER servers 4 26 HDR servers 5 10 Local status replication servers A 45 Locales different 2 18 Enterprise Replication 2 18 specifying nondefault 2 18 Locking databases 2 15 Locks exclusive See Exclusive locks Log based data capture 1 5 Logging aborted transactions 9 4 databases preparing 4 26 errors 6 11 unbuffered 2 10 4 26 Logging mode for spooled row data sbspaces 4 16 LOGGING parameter 4 15 Logicallog files 4 11 and maximum transaction size 4 11 bitmap information about updated columns 6 13 capacity planning 4 10 JK LM NOPQR STU VW X Y Z configuration guidelines 4 11 determining size 4 10 disk space error 9 18 requirements 4 10 dynamically adding 9 15 increasing size 9 13 over
87. A 2 SMI tables D 1 superstores_demo database Intro 5 Support functions for replicating UDTs 2 25 4 25 streamread 2 25 4 25 streamwrite 2 25 4 25 writing 2 25 4 25 16 IBM Informix Dynamic Server Enterprise Replication Guide S TUVWXYZ See also IBM Informix DataBlade API Programmer s Manual Supported data types 2 19 database servers 2 8 SQL statements 2 15 table types 2 10 Suspended state description of A 40 server A 45 Suspending data delivery for replicate sets A 79 for replicates A 77 database servers A 81 replicate sets 8 7 replicates 7 9 replication 7 5 Switching logical log files 4 10 sync option 6 6 A 20 Synchronization servers 3 21 6 6 times 3 14 Synchronizing clocks net time command 2 18 rdate command 2 18 data onload and onunload utilities 4 28 using DB Access 4 24 using ESQL C 4 24 global catalog 6 6 operating system times 2 17 9 18 Synchronous data replication definition of 1 4 two phase commit technology 1 4 Synonyms and Enterprise Replication 2 8 Syntax command line utility A 83 participant definition A 88 syscdr database 2 6 syscdrack buf table D 3 syscdrack txn table D 3 syscdrctrl buf table D 3 syscdrctrl txn table D 4 syscdrerror table D 4 D 13 A BC D EF GH syscdrpart table D 5 syscdrprog table D 5 syscdrq table D 6 syscdrqueued table D 7 syscdrrecv buf table D 7 syscdrrecv txn table D 7 syscdrrepl table D 8 syscdrreplset table D 9 syscdrs table D 10 syscdrsend buf ta
88. A 92 Important If you use time based replication and two tables have referential constraints the replicates must belong to the same exclusive replicate set For more information see Exclusive Replicate Sets on page 8 4 Setting Up Error Logging The Aborted Transaction Spooling ATS files and Row Information Spooling RIS files contain information about failed transactions and aborted rows You can use this information to help you diagnose problems that arise during replication It is recommended that until you become thoroughly familiar with the behavior of the replication system you select both options For more information about these files refer to Chapter 9 Monitoring and Trouble shooting Enterprise Replication To configure your replicate to use ATS and RIS 1 First set up the ATS and RIS directories Creating ATS and RIS Directories on page 4 19 2 Then when you define your server Defining Replication Servers on page 6 5 specify the location of the ATS and RIS directories 3 Now when you define the replicate specify that the replicate use ATS and RIS by including the ats and ris options in the replicate definition For more information see Special Options on page A 13 Replicating Only Changed Columns By default Enterprise Replication replicates the entire row even if only one column changed For more information on how Enterprise Replication evaluates data for replication s
89. Could not drop delete table while deleting the replicate from the local participant ALRM ATTENTION CDR Could not drop delete table SQL code sql error code ISAM code isam error code Table database name table name Please drop the table manually Grouper is unable to copy the transaction into send queue ALRM EMERGENCY CDR Could not copy transaction at log id log unique id position log position Skipped Grouper detected paging error ALRM EMERGENCY Monitoring and Troubleshooting Enterprise Replication CDR Paging error detected 2 of 2 9 21 Appendixes Appendix A Appendix B Appendix C Appendix D Appendix E Appendix F Appendix G Command Line Utility Reference Configuration Parameter and Environment Variable Reference onstat Command Reference SMI Table Reference Replication Examples SQLHOSTS Registry Key Notices Command Line Utility Reference The command line utility CLU lets you configure and control Enterprise Replication from the command line on your UNIX or Windows operating system This appendix covers the following topics m Command Summary m Command Syntax m Interpreting the Command Line Utility Syntax Command Summary The following table shows the commands and the page where the command is documented Command Page cdr change replicate A 4 cdr change replicateset A 6 cdr co
90. DATA SBSPACE 4 16 environment variables 4 20 idle timeout 6 6 LOGGING parameter 4 15 Setting up error logging 6 11 SOLHOSTS file 4 5 SOLHOSTS registry key F 3 setup program for SOLHOSTS registry F 1 Shadow columns ADD CRCOLS 4 25 adding 2 16 behavior with BEGIN WORK WITHOUT REPLICATION 4 23 cdrserver 2 11 2 21 cdrtime 2 11 2 21 conflict resolution rules 3 11 creating 2 11 4 12 9 18 defining 4 25 disk space requirements 4 10 4 12 dropping 2 16 4 26 High Performance Loader 4 27 in ATS files 9 6 loading and unloading data 4 27 UNLOAD statement 4 28 updating with DB Access 4 24 WITH CRCOLS statement 4 25 Simple large objects conflict resolution 2 21 cross replication 2 21 replicating 2 20 to 2 24 from blobspaces 2 20 from tblspaces 2 20 SPL conflict resolution 2 22 storing in blobspaces 2 20 in tblspaces 2 20 timestamp conflict resolution 2 21 Size storage spaces 9 16 transaction record dbspace 4 13 SMALLFLOAT data type 6 13 Smart blobs See Smart large objects Smart large objects cross replication 2 21 in ATS files 9 8 multiple references to 2 24 replicating 2 20 to 2 24 replicating only changed columns 6 12 specifying default behavior 4 15 SPL conflict resolution 2 23 spooled row data 4 14 storing in sbspaces 2 20 SMI tables D 1 to D 17 summary D 1 syscdrack_buf D 3 syscdrack_txn D 3 syscdrctrl buf D 3 syscdrctrl txn D 4 syscdrerror D 4 D 13 syscdrpart D 5 syscdrprog D 5 syscdrq D 6 syscdrqueu
91. DATE T UPDATE T Yes DELETE with initial Ensures old primary row image and key does not INSERT with final replicate row image UPDATE T UPDATE T No UPDATE with final Simple update row image UPDATE T UPDATE F Yes or no DELETE with initial Row no longer row image matches replicate definition UPDATE F UPDATE T Yes or no INSERT with final Row now matches row image replicate definition UPDATE F UPDATE F Yes or no Nothing No match exists and therefore no replication About IBM Informix Enterprise Replication 1 11 Evaluating Data for Replication Where m Initial image is the before image of the transaction in the logical log m The replicate evaluates to T true or F false m Final image is the image of the transaction that is replicated The table in Figure 1 1 on page 1 11 illustrates how Enterprise Replication evaluates the row image type INSERT UPDATE DELETE the results of evaluating the replicate WHERE clause for both the initial and final image and whether the primary key changes as a result of the transaction Tip The evaluation logic in Figure 1 1 on page 1 11 assumes that the source and the destination tables are initially synchronized identical before replication begins If the tables were not synchronized anomalous behavior could result After Enterprise Replication identifies transactions that qualify for repli cation Enterprise Replication transfers the transaction data to a queue 1 12 IBM Inform
92. EUE CONNECTION CHANGED g usa 1 Active Local 0 Replication Examples E 3 Preparing for a Primary Target Replication E 4 3 Define the second database server italy as a replication server cdr define server connect italy init Sync g usa g italy The connect option allows you to define italy on the s2 computer while working at the s1 usa computer The sync option instructs the command to use the already defined replication server g usa as a pattern for the new definition The sync option also links the two replication servers into a replication environment Tip In all options except the connect option Enterprise Replication uses the name of the database server group to which a database server belongs instead of the name of the database server itself 4 Verify that the second definition succeeded cdr list server The command returns the following information SERVER ID STATE STATUS QUEUE CONNECTION CHANGED g italy 8 Active Connected 0 JUN 14 14 38 44 2000 g usa 1 Active Local 0 5 Define the replicate repl1 cdr define replicate conflict ignore repli P storesGg usa informix manufact Select from manufact R stores g_italy informix manufact select from manufact These lines are all one command The backslashes at the end of the lines indicate that the command continues on the next line This step specifies that conflicts should be ignored and describes two participants
93. Enterprise Replication writes ATS and RIS files to directories on the system m ATS files If you are using primary target replication create the ATS directory on the target system If you are using update anywhere replication Update Anywhere Replication System on page 3 8 and have conflict resolution Conflict Resolution on page 3 10 enabled cre ate the ATS directory on all participating replication systems m RIS files If you have conflict resolution enabled create the RIS directory on all participating replication systems The default location for these directories is tmp UNIX or tmp Windows Specify a location other than tmp or tmp for the spooling directories Create the new location for these directories before you define the server for replication The pathnames for the ATS and RIS directories can be no longer than 256 characters For information about ATS and RIS refer to Chapter 9 Monitoring and Troubleshooting Enterprise Replication Preparing the Database Server Environment To prepare the database server environment complete the following tasks m Setting Environment Variables m Setting Configuration Parameters If you are using High Availability Data HDR replication with Enterprise Replication set up your HDR servers according to the instructions in the section HDR Requirements on page 5 8 Preparing the Replication Environment 4 19 Setting Environment Variables Setting Envi
94. For example in Figure 3 12 on page 3 22 Asia Europe China and Guangzhou should use HDR to provide backup servers as illustrated in Figure 5 5 Figure 5 5 Europe HDR in a Forest of Trees Topology secondary Eu North America France Europe NF T me primary Y Germany ry go e mm EE a 5 Beijing N Guangzhou Guangzhou Se Era EN Kong E LJ Shanghai Using High Availability Data Replication with Enterprise Replication 5 7 Preparing HDR Database Servers Preparing HDR Database Servers To prepare HDR database server for Enterprise Replication perform the following tasks m Configure HDR database servers according to HDR requirements m Set up the SQLHOSTS file with both the primary and secondary HDR servers as members of the same database server group m Install and register user defined data types user defined routines and DataBlade modules m Load data using backup and restore procedures Important HDR does not support encryption If you combine Enterprise Replication with HDR communication between Enterprise Replication servers and the HDR primary server can be encrypted but the communication between the HDR primary server and the HDR secondary server cannot be encrypted For more information see ENCRYPT_CDR Configuration Parameter on page B 15 HDR Requirements Make sure the HDR database servers meet HDR requirements in the following categories m Hardware
95. For more information see Shadow Column Disk Space on page 4 12 and Loading and Unloading Data on page 4 26 Defining and Modifying Replication Servers Replicates and Participants 6 17 Managing Replication Servers and Replicates In ThisChapter nof on eR Ge qox A 0 AA GS Rr 7 3 Managing Replication Servers hex Sey MAR fuso 6s 7 3 Viewing Replication Server Attributes be Nin gic Rie DE 7 4 Connecting to Another Replication Server 7 4 Stopping Replication on a Server 2G eaha gh oe e d 7 4 Restarting Replication on a Stopped dores Row gaa uf tote d 7 5 Suspending Replication for a Server 7 5 Resuming a Suspended Replication Server 7 6 Deleting a Replication Server a 7 6 Managing Replicates Jy E ex Vie ny tn cie Vere ek utes d 7 7 Viewing Replicate Properties oS i 3 X218 Ris vk xin e i tus 7 7 Starting a Replicate 2 7 8 StoppingaReplicate 7 8 SuspendingaReplicate 7 9 Resuming a Suspended Replicate 740 Deleting a Replicate 7410 Managing Replication Server Network Connections 74 Viewing Network Connection Status 74M Dropping the Network Connection 74 Reestablishing the Network Connection 742 7 2 BM Informix Dynamic Ser
96. INFORMIXSERVER environment variable C Server connect server c server group connect server group Element Purpose Restrictions Syntax server Name of the database server to The name must be the name ofa Long Identifiers connect to database server on page A 86 server group Name of the database server The name mustbe the nameofan Long Identifiers group that includes the database existing database server group on page A 86 server to connect to E _ _ __ __ EE EEEEEEEq _ E 7_ __ lt E gt EEE S You must use the connect option when you add a database server to your replication environment with the cdr define server command You might use the connect option if the database server to which you would normally attach is unavailable For more information about the global catalog refer to Global Catalog on page 2 6 Command Line Utility Reference A 87 Participant Participant A participant defines the data database table and columns on a database server to be replicated A replicate contains two or more participants The participant definition includes the following information Database server group Setting up Database Server Groups on page 4 5 Database in which the table resides Table name Table owner Table Owner on page A 89 Participant type Participant Type on page A 89 SELECT statement Participant M
97. Institute ANSI has established a set of industry standards for SOL IBM Informix SQL based products are fully compliant with SQL 92 Entry Level published as ANSI X3 135 1992 which is identical to ISO 9075 1992 In addition many features of Informix database servers comply with the SOL 92 Intermediate and Full Level and X Open SQL CAE common applications environment standards IBM Welcomes Your Comments To help us with future versions of our manuals let us know about any correc tions or clarifications that you would find useful Include the following information m The name and version of your manual m Any comments that you have about the manual m Your name address and phone number Send electronic mail to us at the following address docinf us ibm com This address is reserved for reporting errors and omissions in our documen tation For immediate help with a technical problem contact Customer Services Introduction 17 Introducing Enterprise Replication Chapter 1 About IBM Informix Enterprise Replication Chapter 2 Overview of Enterprise Replication Administration About IBM Informix Enterprise Replication In ThisChapter s x 02 cn aR a eo ek A a ot 4 Re HK A63 1 3 IBM Informix Enterprise Replication 1 3 Asynchronous Data Replication 14 Log Based Data Capture a 1 5 High Performance 4 ac8 Re OW rx x a ate 26 High Availabilit
98. LEFACT environment variable B 24 CDR_ROUTER environment variable B 23 CDR_SBSPACE parameter 6 5 CDR_SERIAL parameter 4 21 B 14 Central registry SQLHOSTS F 1 Changed column information in ATS files 9 8 in RIS files 9 12 Changed columns replicating 6 11 Changing database triggers 6 15 participant mode A 48 replicate attributes 6 15 replicate set state A 61 Child database server 3 20 Choosing a replication network topology 3 18 Chunks adding to storage spaces 9 16 Ciphers encryption B 16 CLOB data type spooled row data 4 14 Clock synchronization 2 17 9 18 Clustered indexes creating or altering 2 16 CLU See Command line utility Commands Code samples conventions for Intro 13 Codeset conversion files 2 18 Collision definition of 1 18 example 1 18 Columns D 16 adding 2 16 dropping 2 16 modifying type 2 16 primary key 6 12 renaming 2 16 replicating changed only 6 11 shadow See Shadow columns virtual 2 26 columns D 17 Command line conventions elements of Intro 11 example diagram Intro 13 how to read Intro 13 Command line utility administering Enterprise Replication connect option 6 5 description of A 1 syntax interpreting A 83 terminology A 83 See also Commands Commands abbreviations A 84 cdr change replicate 6 15 A 4 cdr change replicateset 8 9 A 6 cdr change replset See Commands cdr change replicateset cdr connect server 7 12 A 9 cdr define replicate 6 8 A 10 cdr define replicateset 8 4 A 16
99. NTLY DEFINED REPLICATES REPLICATE Repli STATE Inactive CONFLICT Ignore FREQUENCY immediate QUEUE SIZE 0 PARTICIPANT bank joe teller OPTIONS row ris ats REPLICATE Rep12 STATE Inactive CONFLICT Ignore FREQUENCY immediate QUEUE SIZE 0 PARTICIPANT bank joe account OPTIONS row ris ats SELECT Command Syntax The following example displays a list of the replicates on the current server The output from the previous command might be the following The following example displays a list of the replicates on the current server The output from the previous command might be the following bankeg newyork joe teller bankeg sanfrancisco joe teller bankeg portland joe teller bankeg atlanta joe teller select select select select from joe teller from joe teller from joe teller from joe teller Command Line Utility Reference A 39 Command Syntax Displaying Information About Replicates The STATE field can include the following values Value Description Active Specifies that Enterprise Replication captures data from the logical log and transmits it to participants Definition Indicates that the replication definition failed on a peer server Failed Inactive Specifies that no database changes are captured transmitted or processed Pending Indicates that a cdr delete replicate command has been issued and the replicate is waiting for acknowledgement from the participants Quiescent S
100. OAD and LOAD statements allow you to move data within the context of an SOL program If the table contains shadow columns you must m Include the cdrserver and cdrtime columns explicitly in your statement when you unload your data m Listthecolumns that you want to load in the INSERT statement and explicitly include the cdrserver and cdrtime columns in the list when you load your data For more information about the UNLOAD and LOAD statements see the IBM Informix Guide to SQL Syntax 4 28 IBM Informix Dynamic Server Enterprise Replication Guide Data Preparation Example Data Preparation Example The following steps provide an example of how to add a new participant delta to an existing replicate using the LOAD UNLOAD and BEGIN WORK WITHOUT REPLICATION statements Replicate zebra replicates data from table table1 for the following database servers alpha beta and gamma The servers alpha beta and gamma belong to the server groups g alpha g beta and g gamma respectively Assume that alpha is the database server from which you want to get the initial copy of the data To add a new participant to an existing replicate 1 Declare server delta to Enterprise Replication For example cdr def ser c delta I S g alpha g delta At the end of this step all servers in the replication environment include information in the syscdr database about delta and delta has information about all other servers Add delta as
101. PU VP For more information see Appendix B Configuration Parameter and Environment Variable Reference IBM Informix Dynamic Server Enterprise Replication Guide Documentation Conventions Documentation Conventions This section describes the conventions that this manual uses These conventions make it easier to gather information from this and other volumes in the documentation set Typographical Conventions This manual uses the following conventions to introduce new terms illustrate screen displays describe command syntax and so forth Convention Meaning KEYWORD All primary elements in a programming language statement Keywords appear in uppercase letters in a serif font italics Within text new terms and emphasized words appear in italics italics Within syntax and code examples variable values that you are italics to specify appear in italics boldface Names of program entities such as classes events and tables boldface environment variables file and pathnames and interface elements such as icons menu items and buttons appear in boldface monospace Information that the product displays and information that you monospace enter appear ina monospace typeface KEYSTROKE Keys that you are to press appear in uppercase letters in a sans serif font This symbol indicates the end of one or more product or platform specific paragraphs gt This symbol indicates a menu item For
102. SAMS Foundation 2000 IBM Informix 4GL IBM Informix DataBlade Module Client SDK Cloudscape Cloudsync IBM Informix Connect IBM Informix Driver for JDBC Dynamic Connect IBM Informix Dynamic Scalable Architecture DSA IBM Informix Dynamic Server IBM Informix Enterprise Gateway Manager Enterprise Gateway Manager IBM Informix Extended Parallel Server i Financial Services J Foundation MaxConnect Object Translator Red Brick Decision Server IBM Informix SE IBM Informix SQL InformiXML RedBack SystemBuilder U2 UniData UniVerse wintegrate are trademarks or registered trademarks of International Business Machines Corporation Java and all Java based trademarks and logos are trademarks or registered trademarks of Sun Microsystems Inc in the United States and other countries Windows Windows NT and Excel are either registered trademarks or trade marks of Microsoft Corporation in the United States and or other countries UNIX is a registered trademark in the United States and other countries licensed exclusively through X Open Company Limited Other company product and service names used in this publication may be trademarks or service marks of others G 4 IBM Informix Dynamic Server Enterprise Replication Guide ABCDEFGH I JK L MN OPQRS TUVWX Y Ze Index A Abbreviations cdr define replicate set A 84 commands A 84 options A
103. SELECT Statement on Modifier on page A 91 page A 90 participant Specifies the database server and The participant must exist Participant on table for replication page A 88 replicate Name of the replicate to change The replicate must exist Long Identifiers on page A 86 The following table describes the options to cdr change replicate Options Long Form Short Form Meaning add a Add participants to a replicate delete d Remove participants from a replicate A 4 IBM Informix Dynamic Server Enterprise Replication Guide l Command Syntax Usage Use this command to add or delete a participant from a replicate You can define a replicate that has zero or one participants but to be useful a replicate must have at least two participants Important You cannot start and stop replicates that have no participants Important Enterprise Replication adds the participant to the replicate in an inactive state regardless of the state of the replicate To activate the new participant run cdr start replicate with the name of the server group See cdr start replicate on page A 67 Examples The following example adds two participants to the replicate named repl 1 db1 serverl antonio table with the modifier select from tablei and db2 server2 carlo table2 with the modifier select from table2 cdr change repl a repl 1 dbleserverl antonio tablel select
104. The participant must be a Participant on replication member of the replicate page A 88 replicate Name of the replicate to modify The replicate name must exist Long Identifiers on page A 86 Usage The cdr modify replicate command modifies the attributes of a replicate or of one or more participants in the replicate You can also change the mode of a participant If the command does not specify participants the changes apply to all participants in the replicate For attribute information see cdr define replicate on page A 10 To add or delete a participant see cdr change replicate on page A 4 A 48 IBM Informix Dynamic Server Enterprise Replication Guide Command Syntax Important If you change the conflict resolution rule with cdr modify replicate you must also explicitly state SCOPE parameter even if the SCOPE value does not change Restrictions The attributes for cdr modify replicate are the same as the attributes for cdr define replicate with the following exceptions m You cannot change the machine independent decimal representation floatcanon or IEEE floating point floatieee formats m You cannot change the conflict resolution from ignore to a non ignore option time stamp SPL routine or time stamp and SPL routine You cannot change a non ignore conflict resolution option to ignore However you can change from time stamp resolution to SPL routine resol
105. a participant to replicate zebra For example cdr cha rep a zebra dbnameGg delta owner tablel This step updates the replication catalog The servers alpha beta and gamma do not queue any qualifying replication data for delta because the replicate on delta although defined has not been started Suspend server to delta on alpha beta and gamma cdr sus ser g alpha g beta g gamma As a result of this step replication data is queued for delta but no data is delivered Start replication for replicate zebra on delta cdr sta rep zebra g delta This step causes servers alpha beta and gamma to start queueing data for delta No data is delivered to delta because delta is sus pended Then delta queues and delivers qualifying data if any to the other servers Do not run any transactions on delta that affect table table1 until you finish the synchronization process Preparing the Replication Environment 4 29 Data Preparation Example Unload data from table table1 using the UNLOAD statement or the unload utility on HPL Copy the unloaded data to delta Start transactions with BEGIN WORK WITHOUT REPLICATION load the data using the LOAD statement and commit the transaction If you used the HPL to unload the data in step 5 then use the HPL Deluxe load without replication to load the data into table1 on delta Resume server delta on alpha beta and gamma This step starts the flow of data from alpha beta and gamma to
106. a secondary rule if desired Figure 3 6 shows the valid combinations of Enterprise Replication conflict resolution rules Figure 3 6 Valid Conflict Resolution Rule Combinations Primary Rule Secondary Rule Ignore None Time stamp None Time stamp SPL routine SPL routine None Selecting the Enterprise Replication System and Network Topology 3 11 Conflict Resolution Ignore Conflict Resolution Rule The ignore conflict resolution rule does not attempt to detect or resolve conflicts A row or transaction either applies successfully or it fails A row might fail to replicate because of standard database reasons such as a deadlock situation when an application locks rows The ignore conflict resolution rule can only be used as a primary conflict resolution rule and can have either a transaction or a row scope as described in Scope on page 3 17 Figure 3 7 describes the ignore conflict resolution rule Figure 3 7 Ignore Conflict Resolution Rule Database Operation Row Exists in Target Insert Update Delete No Apply row Discard row Discard row Yes Discard row Apply row Apply row When a replication message fails to apply to a target you can spool the information to one or both of the following directories m Aborted transaction spooling ATS If selected all buffers in a failed replication message that compose a transaction are written to this directory m Row information spooling RIS If selected the
107. ach row image contains the data in the row as well as the action performed on that row A row might change more than once in a particular transaction For example a transaction might insert and then update a row prior to committing Enter prise Replication evaluates the net effect final state of a transaction based on the row buffers in the log Enterprise Replication then determines what should replicate based on the net effect the initial state of the row and whether the replicate definition in particular the WHERE clause applies to the initial and final state The table in Figure 1 1 shows the logic that determines which rows are candi dates for replication 1 10 IBM Informix Dynamic Server Enterprise Replication Guide Evaluating Data for Replication Figure 1 1 Enterprise Replication Evaluation Logic Initial Replicate Final Replicate Primary Key Send to Destination Image Evaluates Image Evaluates Changed Database Server Comments INSERT TorF DELETE TorF Yes or no Nothing Net change of trans action results in no replication INSERT TorF UPDATE T Yes or no INSERT with final Inserts final data of row image transaction INSERT TorF UPDATE F Yes or no Nothing Final evaluation determines no replication UPDATE T DELETE TorF Yes or no DELETE with initial Net result of trans row image action is delete UPDATE F DELETE TorF Yes or no Nothing Net change of trans action results in no replication UP
108. adow columns 4 12 Restarting replication 7 5 Restoring databases considerations 2 9 Restrictions cdr modify replicate A 49 participant modifiers A 91 Resuming data delivery for replicate sets A 61 for replicates A 59 for replication servers A 63 replicate sets 8 8 14 JK LM NOPQR STU VW X Y Z suspended replicates 7 10 replication servers 7 6 Resynchronizing replication servers 6 16 Return codes description of A 92 rhosts file 4 5 RIS activating A 13 A 22 capacity planning 4 19 filenames description of 9 10 modifying directory 6 14 specifying directory 6 6 A 21 A 55 RIS files BLOB and CLOB information 9 12 BYTE and TEXT data 9 11 changed column information 9 12 configuring 6 11 description of 9 9 preparing to use 9 9 UDT information 9 12 ris option 6 6 6 11 9 9 A 13 cdr define server A 22 cdr modify replicate A 50 cdr modify server A 56 root dbspace transaction records 4 13 Root servers definition of 3 20 global catalog 2 6 4 8 SOLHOSTS information 4 8 Routines application specific 3 16 Row conflict resolution scope 3 13 3 17 6 10 9 4 Row data creating sbspace for 4 14 storage 4 13 Row Information Spooling See RIS Rowids adding and dropping 2 16 Rows replicating entire 6 12 ROM See Reliable Queue Manager RRD label ATS files 9 6 RRH label ATS files 9 6 RRS label ATS files 9 6 Rules conflict resolution 3 11 IBM Informix Dynamic Server Enterprise Replication Guide for extensible
109. age 2 13 Enterprise Replication supports the replication of BYTE and TEXT data types simple large objects and BLOB and CLOB data types smart large objects and opaque user defined data types as well as all built in Informix data types However Enterprise Replication implements the replication of these types of data somewhat differently from the replication of other data types For more information see Replicating Simple and Smart Large Objects on page 2 20 and Replicating Opaque User Defined Data Types on page 2 25 About IBM Informix Enterprise Replication 1 13 Evaluating Data for Replication 1 14 Send Data Queues and Receive Data Queues Enterprise Replication uses send and receive queues to receive and deliver replication data to and from database servers that participate in a replicate m Send queue Enterprise Replication stores replication data in memory to be delivered to target database servers that participate in a replicate If the send queue fills Enterprise Replication spools the send queue transaction records to a dbspace and the send queue row data to an sbspace m Receive queue Enterprise Replication stores replication data in memory at the target database server until the target database server acknowledges receipt of the data If the receive queue fills as a result of a large trans action Enterprise Replication spools the receive queue transaction header and replicate records to a dbspace and the rece
110. aging Replicates on page 7 7 IBM Informix Dynamic Server Enterprise Replication Guide Starting a Replicate Set Starting a Replicate Set To change the state of all the replicates in the replicate set to active use the cdr start replicateset command For example to start the replicate set sales_set enter cdr start replicateset sales set Warning Run the cdr start replicateset command on an idle system when no transactions are occurring or use the BEGIN WORK WITHOUT REPLICATION statement after you successfully start the replicate For more information see cdr start replicateset on page A 69 and cdr start replicate on page A 67 Stopping a Replicate Set To stop the replicates in the replicate set use the cdr stop replicateset command This command changes the state of all the replicates in the set to inactive For example to stop the sales set replicate set enter cdr stop replicateset sales set For more information see cdr stop replicateset on page A 75 and cdr stop replicate on page A 73 Suspending a Replicate Set If you do not want to completely halt all processing for the replicates in a replicate set you can suspend the replicates in the set using the cdr suspend replicateset command For example to suspend the sales set replicate set enter cdr suspend replicateset sales set For more information see cdr suspend replicateset on page A 79 and cdr suspend replicate on page A 77 C
111. alized Administration Enterprise Replication allows administrators to easily manage all the distributed components of the replication system from a single point of control You can use the command line utility CLU to administer the replication system from your system command prompt and connect to other servers involved in replication as necessary For information see Appendix A Command Line Utility Reference In addition you can use IBM Informix Server Administrator ISA to admin ister your replication system from a web browser For more information see the Documentation Notes described in Additional Documentation on page 14 of the Introduction Network Encryption Enterprise Replication supports the same network encryption that you can use with client server communications to provide complete data encryption with the OpenSSL library A message authentication code MAC is trans mitted as part of the encrypted data transmission to ensure data integrity A MAC is an encrypted message digest The encryption algorithms use OpenSSL 0 9 6 as the code base 1 8 BM Informix Dynamic Server Enterprise Replication Guide How Enterprise Replication Replicates Data However encryption is implemented differently for Enterprise Replication than for client server communications m Client server network encryption uses the ENCCSM communica tions support module CSM that is specified in the SOLHOSTS file
112. ange replicate Table Owner The O owner option causes permission checks for owner to be applied to the operation such as insert or update that is to be replicated and to all actions fired by any triggers When the O option is omitted all operations are performed with the privileges of user informix If a trigger requires any system level commands as specified using the system command in an SPL statement the system level commands are executed as the table owner if the participant includes the O option Ifatrigger requires any system level commands the system level commands are executed as a less privileged user because on Windows you cannot impersonate another user without having the password whether or not the participant includes the O option Use the I option to disable the table owner option Participant Type In a primary target replicate specify the participant type using the P primary and R receive only or target options in the participant definition m A primary participant both sends and receives replicate data m A target participant only receives data from primary participants The replicate can contain multiple primary participants In an update anywhere replicate do not specify either P or R for the participant Enterprise Replication defines the participant as primary in an update any where replication system Command Line Utility Reference A 89 Participant For example in the following
113. apter This chapter covers how to include High Availability Data Replication HDR in your Enterprise Replication system The following topics are covered m The design of a high availability replication system using HDR m Preparing HDR database server m Managing Enterprise Replication with HDR For a complete description of HDR see the IBM Informix Dynamic Server Administrator s Guide High Availability Replication System You can combine Enterprise Replication and HDR to create a high avail ability replication system in which a critical read write database server in an Enterprise Replication system maintains a backup server with HDR An HDR system consists of two database servers the primary database server which receives updates and the secondary read only copy of the primary database server The secondary server is a mirror image of the primary system and is in perpetual recovery mode applying logical log records from the primary server to its dbspaces and sbspaces The HDR secondary server does not participate in Enterprise Replication it receives updates through HDR When the HDR primary server receives an update through Enterprise Replication the transaction is not committed until the log records containing that transaction are sent to the secondary server If the primary server becomes unavailable you replace it with the secondary server by switching the secondary server into standard mode and redirecting connections to
114. arent and child are replicated to the target servers If the same table definition exists on the target database Enterprise Repli cation attempts to delete the child rows twice Enterprise Replication usually processes deletes on the parent first and then the children When Enterprise Replication processes deletes on the children an error might result because the rows were already deleted when the parent was deleted The table in Figure 2 1 indicates how Enterprise Replication resolves cascading deletes with conflict resolution scopes and rules For more information on cascading deletes see the ON DELETE CASCADE section in the IBM Informix Guide to SQL Syntax 2 12 BM Informix Dynamic Server Enterprise Replication Guide Dalabase and Table Design Considerations Figure 2 1 Resolving Cascade Deletes Conflict Resolution Rule Conflict Resolution Scope Actions on Delete Errors Result Time stamp Row by row or transaction Note as replication Process children rows exceptions Ignore Transaction Report as errors Abort entire transaction Ignore Row by row Report as errors Reject row Triggers A trigger is a database object that automatically sets off a specified set of SOL statements when a specified event occurs If the firetrigger option is enabled on a replicate any triggers defined on a table that participates in replication are invoked when transactions are processed on the target server However because Enterpris
115. articipants for each server involved in the replicate in the replicate definition using the cdr define replicate command Important You cannot start and stop replicates that have no participants Each participant definition includes the following information Database server group name Database in which the table to be replicated resides Table name Table owner See Table Owner on page A 89 m SELECT statement and optional WHERE clause See Participant Modifier on page A 90 If you use a SELECT FROM table name statement the tables must be identical on all database servers defined for the replicate Important Do not create more than one participant definition for each row and column to replicate If the participant is the same Enterprise Replication attempts to insert or update duplicate values during replication For example if one participant modifier includes WHERE x lt 50 and another includes WHERE x lt 100 Enterprise Replication sends the data twice 6 8 IBM Informix Dynamic Server Enterprise Replication Guide Defining Participants In addition for a primary target replication system you can specify the participant type as either primary or target receive only If you do not specify the participant type Enterprise Replication defines the participant as update anywhere by default For more information see Primary Target Replicati
116. ase triggers changing 6 15 Databases considerations backing up 2 9 restoring 2 9 creating demonstration Intro 5 with unbuffered logging 2 10 designing considerations 2 9 locking 2 15 logging 4 26 unbuffered logging 2 10 DataBlade modules preparing for HDR 5 10 Data consolidation model description of 3 5 dbaccess command testing network environment 4 9 See also DB Access utility DB Access User s Manual DB Access utility BEGIN WORK WITHOUT REPLICATION 4 24 included databases Intro 5 dbexport utility 4 28 See also IBM Informix Migration Guide dbimport utility 4 28 See also IBM Informix Migration Guide DBSERVERALIASES parameter 4 7 4 20 B 1 DBSERVERNAME parameter 4 7 4 20 B 1 dbservername description of 4 7 Dbspaces creating 4 14 delete table storage 4 11 increasing size 9 17 monitoring disk usage 9 16 pathname limitations 4 13 root 4 13 size of transaction record 4 13 spooled transaction records 4 13 transaction record 4 13 See also IBM Informix Dynamic Server Administrator s Guide Index 5 A BC D EF GH IBM Informix Dynamic Server Administrator s Reference DDRBLOCK mode preventing 9 14 Deadlock situation definition of 3 12 Decision support systems See DSS Declaring database server for Enterprise Replication 6 3 Default behavior of Enterprise Replication 6 11 dbspace for transaction records 4 13 locale Intro 4 spooling directories 4 19 Defining participants 6 8 replicate sets A 16 rep
117. ata types 2 19 database server groups for HDR 5 9 default behavior 6 11 definition of 1 3 deleting and recreating objects 2 9 encryption configuring 4 21 evaluation logic 1 10 event alarms 9 20 flexible architecture 1 7 high availability 1 6 managing 2 4 performance 1 6 process for replicating data 1 9 queues D 15 role of logical log files 2 10 selecting replication systems 3 3 server administrator 2 4 definition of 2 5 definitions in global catalog 2 7 starting A 65 stopping A 71 supported database servers 2 8 synonyms 2 8 terminology 2 5 threads list of C 3 restarting 7 5 stopping 7 5 using Global Language Support 2 18 views 2 8 Environment database server preparing 4 19 network preparing 4 3 testing 4 9 trusted configuring 4 5 Environment variables Intro 9 CDR LOGDELTA B 21 CDR PERFLOG B 22 CDR RMSCALEFACT B 24 CDR ROUTER B 23 INFORMIXDIR 4 20 JK L MN OP QRS TU VW XY ze INFORMIXSERVER 4 6 4 20 6 5 7 4 INFORMIXSQLHOSTS 4 20 F 2 setting 4 20 TZ A 93 See also IBM Informix Dynamic Server Administrator s Reference en_us 8859 1 locale Intro 4 Error interpreting error numbers A 37 logging changing 6 15 setting up 6 11 message files cdrerr h A 37 replication server status A 45 return codes A 92 table managing A 34 ESQL C BEGIN WORK WITHOUT REPLICATION 4 24 etc hosts file 4 4 etc hosts equiv file 4 5 etc services file 4 4 etc hosts file 4 4 etc hosts equiv file 4 5 etc services file 4 4 E
118. atabase server from all participating replicates and purges all replication data from the send queues for the specified database server The command shuts down Enterprise Replication on the database server and removes the global catalog from the database server When you delete an Enterprise Replication server you must issue the cdr delete server command twice once on the server being deleted and once on another server in the enterprise The first cdr delete server removes the Enterprise Replication server from the local global catalog and removes the Enterprise Replication connection to other hosts The second cdr delete server removes the Enterprise Replication server from the other replication servers in the system For more information see the Examples on page A 29 A 28 BM Informix Dynamic Server Enterprise Replication Guide Command Syntax You can issue the cdr delete server command from any replication server The only limitation is that you cannot delete a server with children You must delete the children of a server before deleting the parent server You cannot delete a server from the enterprise if it is stopped To delete a server with cdr delete server you must issue a cdr start command first Warning Avoid deleting a replication server and immediately re creating it with the same name If you re create the objects immediately before the operation finishes propagating to the other Enterprise Replication database serve
119. ate on page A 73 A 78 IBM Informix Dynamic Server Enterprise Replication Guide Command Syntax cdr suspend replicateset The cdr suspend replicateset or cdr suspend replset command suspends delivery of replication data for all the replicates in a replicate set Syntax cdr suspend replicateset U Connect Option f p A 87 Element Purpose Restrictions Syntax repl_set Name of replicate set to suspend Long Identifiers on page A 86 Usage The cdr suspend replicateset command causes all the replicates in the replicate set repl_set to enter the suspend state Information is captured but no data is sent for any replicate in the set The data is queued to be sent when the set is resumed Warning When a replicate set is suspended Enterprise Replication holds the repli cation data in the send queue until the set is resumed If a large amount of data is generated for the replicates in the set while it is suspended the send queue space can fill causing data to be lost Warning Enterprise Replication does not synchronize transactions if a replicate in a replicate set is suspended For example a transaction that updates tables X and Y will be split if replication for table X is suspended a Important If not all the replicates in the non exclusive replicate set are active the cdr suspend replicateset command displays a warning and only suspends the repli cates that are currently active
120. ated table contains any extensible data types See Replicating Only Changed Columns on Enterprise Replication passes the following information to an SPL routine as Description Server name CHAR 18 From the local target row NULL if local target row does not exist Time stamp DATETIME YEAR TO SECOND From the local target row NULL if local target row does not exist Local delete table indicator CHAR 1 or Local key delete row indicator CHAR 1 m Y indicates the origin of the row is the delete table m K indicates the origin of the row is the replicate key delete row for a key update that is sent as a key delete and a key insert because the local target row with the old key does not exist Server name CHAR 18 Of the replicate source Time stamp DATETIME YEAR TO SECOND From the replicated row Replicate action type CHAR 1 I insert D delete U update Local row data returned in regular SOL format Where the regular SOL format is taken from the SELECT clause of the participant list Replicate row data after image returned in regular SOL format Where the regular SOL format is taken from the SELECT clause of the participant list Selecting the Enterprise Replication System and Network Topology 3 15 Conflict Resolution The routine must set the following arguments before the routine can be applied to the replication message Argument Description An indica
121. ated with logging by using the Df LOGGING ON option of the onspaces command For more information see Row Data sbspaces on page 4 14 and the IBM Informix Dynamic Server Administrator s Guide Monitoring and Troubleshooting Enterprise Replication 9 19 Enterprise Replication Event Alarms Situation Level Enterprise Replication Event Alarms The following table describes the alarms that are raised by Enterprise Repli cation and the events that trigger the alarms For more information on handling event alarms see the appendix on event alarms in the IBM Informix Administrator s Reference Message Snoopy receives a bad buffer during a log read ALRM EMERGENCY Log corruption detected or read error occurred while snooping logs Snoopy sets DDRBLOCK Preventing DDRBLOCK Mode on page 9 14 ALRM ATTENTION DDR Log Snooping Catchup phase started userthreads blocked Snoopy unsets DDRBLOCK Preventing DDRBLOCK Mode on page 9 14 ALRM ATTENTION DDR Log Snooping Catchup phase completed userthreads unblocked Snoopy detects that the replay position has been overwritten page 9 14 ALRM EMERGENCY WARNING The replay position was overrun data may not be replicated An ROM queue runs out of room to spool Recovering when Storage Spaces Fill on page 9 17 ALRM EMERGENCY CDR QUEUER Send Queue space is FULL waiting for space in sbspace name ROM cannot find t
122. ation Environment Considerations 2 18 Important Enterprise Replication does not manage clock synchronization between database servers that participate in a replicate To synchronize the time on one database server with the time on another database server use one of the following commands Operating System Command UNIX rdate hostname Windows net time servername set net time domain servername set Important These commands do not guarantee the times will remain synchronized You should use a product that supplies a network time protocol to ensure that times remain synchronized For information on tools for synchronizing the times refer to your operating system documentation Using GLS with Enterprise Replication An Enterprise Replication system can include databases in different locales with the following restrictions m When you define a database server for Enterprise Replication that server must be running in the English locale In other words the syscdr database on every Enterprise Replication server must be in the English locale You can replicate only between databases that are in the same locale Replicate names can be in the locale of the database Code set conversion with the GLS library requires only those code set conversion files found in the INFORMIXDIR gls cv9 directory m For U S English locales are handled automatically by the Client SDK Infor
123. ation Servers Replicates and Participants 6 13 Enabling Triggers Enabling Triggers By default when a replicate causes an insert update or delete on a target table triggers associated with the table are not executed However you can specify that triggers are executed when the replicate data is applied by enabling triggers in the replicate definition To enable triggers include the firetrigger option in your replicate definition For information refer to Triggers on page 2 13 and Special Options on page A 13 Modifying Replication Servers To modify a replication server use the cdr modify server command With this command you can change the following attributes of the server m Idle timeout m Location of the directory for the Aborted Transaction Spooling ATS files m Location of the directory for the Row Information Spooling RIS files For information about each of these attributes see Defining Replication Servers on page 6 5 For more information see cdr modify server on page A 55 6 14 IBM Informix Dynamic Server Enterprise Replication Guide Modifying Replicates Modifying Replicates You can modify replicates in two ways m Adding or Deleting Participants m Changing Replicate Attributes Adding or Deleting Participants To be useful a replicate must include atleast two participants You can define a replicate Defining Replicates on page 6 7 that has fewer than two parti
124. ation can send the data the next update from the source database server a complete row image corrects the data on the target server Replicating only the columns that changed has the following disadvantages Enterprise Replication does not apply upserts If the row to replicate does not exist on the target Enterprise Repli cation does not apply it If you set up error logging Setting Up Error Logging on page 6 11 Enterprise Replication logs this infor mation as a failed operation You cannot use the SPL routine or time stamp with SPL routine conflict resolution rules For more information see Conflict Resolution on page 3 10 You cannot use update anywhere replication doing so can result in inconsistent conflict resolution All database servers in the enterprise must be Version 9 3 or later Enterprise Replication does not enforce this restriction If you attempt to replicate only changed columns to a pre Version 9 3 data base server you will corrupt the data on that database server IBM Informix Dynamic Server Enterprise Replication Guide Using the IEEE Floating Point or Canonical Format Enterprise Replication logs bitmap information about the updated columns in the logical log file For more information see the CDR record type in the logical logs chapter in the IBM Informix Administrator s Reference For more information on the fullrow option see Special Options on page A 13
125. ation system allows only unidirectional updates Many facts that you need to consider for a primary target replication system should also be considered for the workflow replication system However unlike the primary target replication system availability can become an issue if a database server goes down The database servers in the workflow replication system rely on the data updated at a previous site Consider this fact when you select a workflow replication system Selecting the Enterprise Replication System and Network Topology 3 7 Upaate Anywhere Replication System 3 8 Primary Target Considerations The following sections describe some of the factors to consider when you select a primary target replication system m Administration Primary target replication systems are the easiest to administer because all updates are unidirectional and therefore no data update conflicts occur Primary target replication systems use the ignore con flict resolution rule See Conflict Resolution Rule on page 3 11 m Capacity planning All replication systems require you to plan for capacity changes For more information see Preparing Data for Replication on page 4 22 m High availability planning In the primary target replication system if a target database server or network connection goes down Enterprise Replication continues to log information for the database server until it becomes available again If a database server is un
126. available for some time you might want to remove the database server from the replication system If the unavailable database server is the read write database server you must plan a course of action to change read write capabilities on another database server If you require a fail safe replication system you should select a high availability replication system For more information see High Availability Replication System on page 5 3 Update Anywhere Replication System In update anywhere replication changes made on any participating database server are replicated to all other participating database servers This capability allows users to function autonomously even when other systems or networks in the replication system are not available IBM Informix Dynamic Server Enterprise Replication Guide Update Anywhere Replication System Figure 3 5 illustrates an update anywhere replication system Figure 3 5 Washingt B Update Anywhere Replication System New York server 7 service centey oap ste e Ca genver 7 rA Angeles service center Because each service center can update a copy of the data conflicts can occur when the data is replicated to the other sites To resolve update conflicts Enterprise Replication uses conflict resolution For more information see Conflict Resolution on page 3 10 Review the following information before you select your update anywhere replication system
127. ax cdr stop replicate The cdr stop replicate command stops the capture and transmittal of trans actions for replication Syntax repl name C 2 V Connect Option f p A 87 Te server_ ms Element Purpose Restrictions Syntax repl_name Name of the new replicate The replicate must be active and Long Identifiers not in a replicate group on page A 86 at server group List of database server groupson The database server groups must which to stop the replicate be defined for Enterprise Replication The cdr stop replicate command changes the state of the replicate repl_name to inactive no capture no send on the replicate servers in the specified at_server_group list In addition this command deletes any data in the send queue for the stopped replicate Important You cannot stop replicates that have no participants Warning If there was any data in the send queue when you issued the cdr stop replicate command or if any database activity occurs while the replicate is stopped the replicate servers will get out of sync For information on resynchronizing repli cation servers see Resynchronizing Replication Servers on page 6 16 If you omit the at_server_group list the replicate enters the inactive state on all database servers participating in the replicate and all send queues for the replicate are deleted Command Line Utility Reference A 73 Com
128. base changes originate at the primary database and are replicated to the target databases Changes at the target databases are not replicated to the primary Selecting the Enterprise Replication System and Network Topology 3 3 Primary Target Replication System 3 4 A primary target replication system can provide one to many or many to one replication m One to many replication In one to many distribution replication all changes to a primary database server are replicated to many target database servers Use this replication model when information gathered at a central site must be disseminated to many scattered sites m Many to one replication In many to one consolidation replication many primary servers send information to a single target server Use this replication model when many sites are gathering information for example local field studies for an environmental study that needs to be centralized for final processing Primary Target Business Models Primary target Enterprise Replication systems support the following business models Data Dissemination Data Consolidation Workload Partitioning Workflow Replication Data Dissemination Data dissemination supports business needs where data is updated in a central location and then replicated to read only sites This method of distri bution can be particularly useful for online transaction processing OLTP systems where data is required at several sites bu
129. base server specified by INFORMIXSERVER and deletes the replicate smile cdr del rep smile A 24 BM Informix Dynamic Server Enterprise Replication Guide Command Syntax See Also cdr change replicate on page A 4 cdr define replicate on page A 10 cdr list replicate on page A 38 cdr modify replicate on page A 48 cdr resume replicate on page A 59 cdr start replicate on page A 67 cdr stop replicate on page A 73 cdr suspend replicate on page A 77 Command Line Utility Reference A 25 Command Syntax cdr delete replicateset The cdr delete replicateset or cdr delete replset command deletes a replicate set Syntax 1 repl set Ja cdr delete replicateset Y Connect Option J p A 87 Element Purpose Restrictions Syntax repl_set Name of replicate set to delete The replicate set must exist Long Identifiers on page A 86 Usage The cdr delete replicateset command deletes the exclusive or non exclusive replicate set repl_set from the global catalog The cdr delete replicateset command does not affect the replicates or associated data When a replicate set is deleted the individual replicates within the replicate set are unchanged Warning Do not delete time based exclusive replicate sets Doing so might result in inconsistent data Warning Avoid deleting a replicate set and immediately re creating it with the same name If you re create the obje
130. base server this command affects is the one specified by the value of the INFORMIXSERVER environment variable Warning Do not use this command on a database server that does not participate in AN HDR A 58 IBM Informix Dynamic Server Enterprise Replication Guide Command Syntax cdr resume replicate The cdr resume replicate command resumes delivery of replication data Syntax cdr resume replicate Y Connect Option n 87 p A Purpose Restrictions Syntax Name of the replicate to change The replicate must be suspended Long Identifiers to active state on page A 86 The cdr resume replicate command causes all participants in the replicate repl name to enter the active state For more information on replicate states refer to The STATE Column on page A 45 Important If a replicate belongs to an exclusive replicate set Exclusive Replicate Sets on page 8 4 you cannot run cdr resume replicate to resume that individual replicate You must use cdr resume replicateset to resume all replicates in the exclusive replicate set If a replicate belongs to a non exclusive replicate set you can resume the individual replicates in the set Example The following example connects to the default database server INFORMIXSERVER and resumes the replicate smile cdr res repl smile Command Line Utility Reference A 59 Command Syntax See Also cd
131. be the same as a replicate on page A 86 name replicate Name of a replicate to be The replicate must exist Long Identifiers included in the replicate set on page A 86 A 16 IBM Informix Dynamic Server Enterprise Replication Guide Command Syntax The following table describes the option to cdr define replicateset Options Long Form Short Form Meaning exclusive X Creates an exclusive replicate set For more information see Exclusive Replicate Sets on page 8 4 Usage Use the cdr define replicateset command to define a replicate set Any valid replicate can be defined as part of a replicate set A replicate can belong to more than one non exclusive replicate set but to only one exclusive replicate set For details on the differences between exclusive and non exclusive replicate sets see Creating Replicate Sets on page 8 4 When you create an exclusive replicate set the state is initially set to active For more information see Displaying Information About Replicates on page A 40 To create an exclusive replicate set and set the state to inactive 1 Create an empty replicate set 2 Stop the replicate set 3 Add replicates to the replicate set 4 Set the state of the replicate set to active by running cdr start replicateset Because individual replicates in a non exclusive replicate set can have different states the non exclusive replicate set itself has no state Im
132. ble D 11 syscdrsend txn table D 11 syscdrserver table D 12 syscdrtx table D 13 sysmaster database SMItables D 1 System Monitoring Interface See SMI tables System names in hosts file 4 4 System requirements database Intro 4 software Intro 4 T Table hierarchies replicating 2 26 Table types unsupported 2 10 Tables buffer D 17 designing considerations 2 9 locking 2 15 preparing for conflict resolution 4 25 RAW 2 10 SMI D 1 to D 17 temporary 2 10 transaction D 16 unsupported 2 10 Target participant type 6 9 Tblspaces 2 20 storing BYTE and TEXT data 2 20 2 21 Temporary tables 2 10 Terminology command line utility A 83 Enterprise Replication 2 5 Enterprise Replication servers 2 5 global catalog 2 6 hierarchical topology 3 20 participant 2 6 replicate 2 6 replicate set 2 6 replication servers 2 5 Testing network environment 4 9 trusted environment 4 9 TEXT data ATS files 9 7 distributing 2 24 RIS files 9 11 SPL conflict resolution 2 22 storing in tblspaces 2 21 types loading 4 27 Threads used by Enterprise Replication C 3 Time formats A 93 Time synchronization 2 17 3 14 9 18 Timeout idle setting 6 6 status replication servers A 45 Timestamp conflict resolution rule 3 11 3 13 6 10 A 40 database action 3 14 definition of 3 13 delete table 4 11 simple large objects 2 21 Tip icons Intro 10 Tools for loading and unloading data 4 26 Topology choosing network 3 18 Transaction
133. business model 3 6 Writing support functions 2 25 transaction buffers to disk 9 12 X X Open compliance level Intro 17 Z zap option cdr error A 35 18 IBM Informix Dynamic Server Enterprise Replication Guide
134. c ipants but before you can use that replicate you must add more participants To add a participant to an existing replicate use cdr change replicate add For example to add two participants to the sales data replicate enter cdr change replicate add sales data dblGehawaii jane tablel select from tablel db2 maui john table2 select from table2 To delete a participant from the replicate use cdr change replicate delete For example to delete these two participants from the replicate enter cdr change replicate delete sales data dblGhawaii jane tablel db2 maui john table2 For more information see cdr change replicate on page A 4 Changing Replicate Attributes You can change the following attributes of a replicate using the cdr modify replicate command Conflict resolution rules and scope Replication frequency Error logging Replicate full rows or only changed columns Database triggers Participant type Defining and Modifying Replication Servers Replicates and Participants 6 15 Resynchronizing Replication Servers Important You cannot change the conflict resolution from ignore to a non ignore Cc option time stamp SPL routine or time stamp and SPL routine You cannot change a non ignore conflict resolution option to ignore For information on each of these attributes see Defining Replicates on page 6 7 For example to change the replication
135. cates in the replicate set Command Line Utility Reference A 69 Command Syntax Important If not all the replicates in a non exclusive replicate state are inactive the cdr start replicateset command displays a warning and only starts the replicates that are currently inactive Example The following example connects to the default database server specified by INFORMIXSERVER and starts the replicate set accounts set on the server groups g hill and g lake cdr sta replset accounts set g hill g lake See Also cdr change replicateset on page A 6 cdr define replicate on page A 10 cdr delete replicateset on page A 26 cdr list replicateset on page A 42 cdr modify replicateset on page A 53 cdr resume replicateset on page A 61 cdr stop replicateset on page A 75 cdr suspend replicateset on page A 79 A 70 IBM Informix Dynamic Server Enterprise Replication Guide Command Syntax cdr stop The cdr stop command stops Enterprise Replication processing Syntax cdr stop U Connect Option 87 p A Usage In most situations Enterprise Replication starts when cdr define server is first executed The replication threads remain running until the database server is shut down or until the local database server is deleted with the cdr delete server command If you shut down the database server while Enterprise Replication is running replication begin
136. cating Large Objects from Blobspaces or Sbspaces Enterprise Replication does not retrieve simple large object data that is stored in blobspaces and smart large object data that is stored in sbspaces from the logical log Instead Enterprise Replication retrieves the large object data directly from the blobspace or sbspace before sending the data to the target database server Itis possible that a transaction subsequent to the transaction being replicated has modified or deleted a simple or smart large object that Enterprise Repli cation is trying to retrieve If Enterprise Replication encounters a row whose large object simple or smart has been modified or deleted by a subsequent transaction Enterprise Replication does not send the data in the large object In most cases the subsequent transaction that modified or deleted the large object will also be replicated so the data again becomes consistent once that transaction is replicated The data in the large object is inconsistent only in a small window of time 2 20 IBM Informix Dynamic Server Enterprise Replication Guide Enterprise Replication Data Types Keep in mind that if you specify sending only the columns that changed the data might not get updated during the next update of the row For more information see Replicating Only Changed Columns on page 6 11 Tip Enterprise Replication allows cross replication between simple large objects and smart large objects For e
137. cation of various handles to the queue and the contents of the various progress tables If a queue is empty no information is printed for that queue The onstat g rqm command has the following formats onstat g rqm onstat g rqm modifier The following table describes the values for modifier Modifier Action ACKO Prints the ack send queue CNTRLO Prints the control send queue RECVO Prints the receive queue 1 of 2 C 10 IBM Informix Dynamic Server Enterprise Replication Guide onstat g rqm SENDQ Prints the send queue SYNCQ Prints the sync send queue FULL Prints full information about every in memory transaction for every queue BRIEF Prints a brief summary of the number of transactions in each of the queues and the replication servers for which the data is queued Use this modifier to quickly identify sites where a problem exists If large amounts of data are queued for a single server then that server is probably down or off the network VERBOSE Prints all the buffer headers in memory 2 of 2 When you specify a modifier to select a specific queue the command prints all the statistics for that queue and information about the first and last in memory transactions for that queue The other modifiers of the onstat g rqm command are used primarily as a debugging tool and by Technical Support onstat Command Reference 6 11 onstat g rqm C 12 IBM Informix Dynamic Server Enter
138. cdrsync buf Buffers in the synchronization page D 13 queue syscdrsync txn Transactions in the synchronization page D 13 queue syscdrtx Transaction information page D 13 2 of 2 syscarack buf SMI Tables for Enterprise Replication The following sections describe the individual tables of the sysmaster database that refer to Enterprise Replication syscdrack buf The syscdrack buf table contains information about the buffers that form the acknowledgment queue When the target database server applies transac tions it sends an acknowledgment to the source database server When the source database server receives the acknowledgment it can then delete those transactions from its send queue For information on the columns of the syscdrack buf table refer to Columns of the Buffer Tables on page D 17 syscdrack txn The syscdrack txn table contains information about the acknowledgment queue When the target database server applies transactions it sends an acknowledgment to the source database server When the source database server receives the acknowledgment it can then delete those transactions from its send queue The acknowledgment queue is an in memory only queue That is it is a volatile queue that is lost if the database server is stopped For information on the columns of the syscdrack txn table refer to Columns of the Transaction Tables on page D 16 syscdrctrl buf The syscdrctrl buf table contains buffers t
139. cept the connect option which can use both use the name of the database server group also known as a server group instead of the more familiar database server name for all references to database servers This manual uses the convention that the name of a server group is g followed by the server group name Important If the CDR SBSPACE configuration parameter is not set in ONCONFIG or specifies an invalid sbspace Enterprise Replication fails to define the server For more information see Row Data sbspaces on page 4 14 Defining and Modifying Replication Servers Replicates and Participants 6 5 Customizing the Replication Server Definition Customizing the Replication Server Definition When you define a replication server you can change the following aspects of the server in the replication environment m Synchronize the new server s global catalog Global Catalog on page 2 6 with another Enterprise Replication server For all servers except the first server you define in your Enterprise Replication system you must use sync sync server in your server definition to synchronize the global catalog with an existing server For Hierarchical Routing HR topologies Enterprise Replication also uses the synchronization server as the parent of the new server in the current topology For example if you add a new server kauai and synchronize its global catalog with hawaii kauai is connected to hawaii in the Enterprise Replicatio
140. chical Replication Topologies E America E Asia is the root database server Japan China and Guangzhou are nonroot database servers You can define Beijing Shanghai and Hong Kong as either nonroot database servers or leaf database servers depending on how you plan to use them The dashed connection from China to Shanghai indicates that Shanghai is a leaf server Parent servers are good candidates for using HDR to provide backup servers For more information see Hierarchical Replication Topologies on page 3 19 Forest of Trees A forest of trees consists of several hierarchical trees whose root database servers are fully connected Each hierarchical tree starts with a root database server The root database servers transfer replication messages to the other root servers for delivery to its child database servers Figure 3 12 shows a forest of trees Figure 3 12 France Forest of Trees Topology t ond Germany Asia A China EE ED Hong Kong 7 gt Shanghai mmm 3 22 IBM Informix Dynamic Server Enterprise Replication Guide Hierarchical Replication Topologies In Figure 3 12 North America Asia and Europe are root database servers That is they are fully connected with each other France and Germany are in a tree whose root is Europe Asia is the root for the six database servers in its tree Ina forest of trees all replication messages from one tree to another must pass through t
141. ctions Column Type Description srvid integer Server ID srvname char 128 Name of database server from which data is received txprocssd integer Transaction processed from database server sruname txcmmtd integer Transaction committed from database server sruname txabrtd integer Transaction aborted from database server sroname 1 of 2 SMI Table Reference D 13 syscdrtx D 14 IBM Informix Dynamic Server Enterprise Replication Guide Column Type Description rowscmmtd integer Rows committed from database server sroname rowsabrtd integer Rows aborted from database server sruname txbadcnt integer Number of transactions with source commit time on database server srvname greater than target commit time 2 of 2 syscartx Enterprise Replication Queues One group of sysmaster tables shows information about Enterprise Repli cation queues The sysmaster database reports the status of these queues in the tables that have the suffixes _buf and _txn The name of each table that describes an Enterprise Replication queue is composed of the following three pieces m syscdr which indicates that the table describes Enterprise Replication m An abbreviation that indicates which queue the table describes m A suffix either bufor txn which specifies whether the table includes buffers or transactions Selecting from these tables provides information about the contents of each queue For example
142. cts immediately before the operation finishes propa gating to the other Enterprise Replication database servers in the network failures might occur in the Enterprise Replication system at the time of the operation or later For more information see Operational Considerations on page 2 8 A 26 IBM Informix Dynamic Server Enterprise Replication Guide Command Syntax Example The following example connects to the default database server and deletes the replicate set accounts set cdr del replset accounts set See Also cdr change replicateset on page A 6 cdr define replicate on page A 10 cdr list replicateset on page A 42 cdr modify replicateset on page A 53 cdr resume replicateset on page A 61 cdr start replicateset on page A 69 cdr stop replicateset on page A 75 cdr suspend replicateset on page A 79 Command Line Utility Reference A 27 Command Syntax cdr delete server The cdr delete server command deletes a database server from the global catalog Syntax cdr delete server server group Xi Connect Option f p A 87 Element Purpose Restrictions Syntax server group Name of database server group The database server group must to remove from the global catalog be currently defined in Enter g g y prise Replication Usage The cdr delete server command deletes the database server in server group from the global catalog removes the d
143. d and its variation The command specifies the action that should be taken m Options The options modify the action of the command Each option starts with a minus or a double minus m Target The target specifies the Enterprise Replication object that should be acted upon m Other objects Other objects specify objects that are affected by the change to the target If you enter an incorrect cdr command at the command line prompt the database server returns a usage message that summarizes the cdr commands For a more detailed usage message enter cdr variation h For example cdr list server h Important You must be the Enterprise Replication server administrator to execute any of the CLU commands except the cdr list options For more information see Enterprise Replication Server Administrator on page 2 4 This section covers the following topics Command Abbreviations Option Abbreviations Option Order Long Command Line Examples Long Identifiers Connect Option Command Line Utility Reference A 83 Command Abbreviations m Participant m Return Codes m Frequency Options Command Abbreviations For most commands each of the words that make up a cdr command variation can be abbreviated to three or more characters For example the following commands are all equivalent cdr define replicate cdr define repl cdr def rep The exceptions to this rule are the replicateset commands which can be abbrev
144. d italy are root servers denver and boston are nonroot servers and miami is a leaf server The usa server is the parent of denver and boston and boston is the parent of miami Figure A 2 usa italy cdr list server example LJ N denver boston IL miami s LJ A 46 IBM Informix Dynamic Server Enterprise Replication Guide Command Syntax The example is created by running the following commands cdr list g usa cdr list g denver cdr list g denver cdr list g miami See Also Server g usa 1 timeout 15 hub Server c denver g denver 27 root g usa Server c italy g denver 27 root g usa forward g usa Server g miami 4 root g boston leaf cdr connect server on page A 9 cdr define server on page A 19 cdr delete server on page A 28 cdr disconnect server on page A 32 cdr modify server on page A 55 cdr resume server on page A 63 cdr start on page A 65 cdr suspend server on page A 81 Command Line Utility Reference A 47 Command Syntax cdr modify replicate The cdr modify replicate command modifies replicate attributes Syntax cdr modify replicate 7 2 replicate Conflict Options p A 11 participant Connect Option p A 87 Scope Options p A 11 Frequency X Options p A 92 Special Options p A 50 Element Purpose Restrictions Syntax participant Name of a participant in the
145. d to the server with the cdr suspend server command cdr suspend server on page A 81 Command Line Utility Reference A 63 Command Syntax Example The following example connects to the default server SINFORMIXSERVER and resumes replication of data to the server g iowa from the servers g ohio and g utah cdr sus serv g iowa g ohio g utah See Also cdr connect server on page A 9 cdr define server on page A 19 cdr delete server on page A 28 cdr disconnect server on page A 32 cdr list server on page A 44 cdr modify server on page A 55 cdr suspend server on page A 81 A 64 IBM Informix Dynamic Server Enterprise Replication Guide Command Syntax cdr start The cdr start command starts Enterprise Replication processing Syntax cdr start U Connect Option 87 p A Usage Use cdr start to restart Enterprise Replication after you stop it with cdr stop When you issue cdr start Enterprise Replication brings up all connections to other adjacent replication servers Replication servers replicates and groups that were suspended before the cdr stop command was issued remain suspended no data is sent for the suspended servers replicates or groups Enterprise Replication resumes evaluation of the logical log if required for the instance of Enterprise Replication at the replay position The replay position is the position where Enterprise Replication stops e
146. date lt Apply row Apply row Apply row Trepi Convert INSERT to UPDATE Tiast update Discard row Trepi Tiast update B Trepi Apply row if no routine is defined as a secondary conflict resolution rule Otherwise invoke the routine The time stamp conflict resolution rule assumes time synchronization between cooperating Enterprise Replication servers For more information see Time Synchronization on page 2 17 SPL Conflict Resolution Rule Tip The SPL rule allows you complete flexibility to determine which row prevails in the database However for most users the time stamp conflict resolution rule provides sufficient conflict resolution You can assign an SPL routine as the primary conflict resolution rule If you use an SPL routine as a secondary conflict resolution rule the time stamp conflict resolution rule must be the primary rule 3 14 BM Informix Dynamic Server Enterprise Replication Guide not allow user defined page 6 11 arguments Argument Conflict Resolution Important The owner of an SPL routine used for conflict resolution must be the Cc same as the owner of the table Routines for conflict resolution must be in SPL Enterprise Replication does routines in C or in Java Important You cannot use an SPL routine or a time stamp with an SPL routine if the replicate is defined to replicate only changed columns or the replic
147. ded Enterprise Replication can be configured to dynamically add a logical log file instead of placing the database server in DDRBLOCK mode Set the CDR MAX DYNAMIC LOGS configuration parameter to enable Enterprise Replication to dynamically add a logical log file when the system is in danger of a log wrap This allows the system to better adjust to unusual activity Set CDR MAX DYNAMIC LOGS to one of the following values a positive Enterprise Replication is allowed to dynamically add up to number that number of logical log files 1 Enterprise Replication is allowed to dynamically add an unlimited number of logical log files Zero Enterprise Replication does not dynamically add logical log files and the system can enter DDRBLOCK mode Monitoring and Troubleshooting Enterprise Replication 9 15 Monitoring Disk Usage for Send and Receive Queue Spool 9 16 Monitoring Disk Usage for Send and Receive Queue Spool You should periodically monitor disk usage for the dbspace specified by CDR OHDR DBSPACE Configuration Parameter configuration parameter and the sbspace CDR_QDATA_SBSPACE Configuration Parameter that Enterprise Replication uses to spool the queues to disk To check disk usage for m dbspaces Use onstat d For more information see the section on monitoring disk usage in the IBM Informix Dynamic Seroer Administrator s Guide and the utilities chapter of the IBM Informix Administrator s Reference m sbspaces Us
148. definition replicate Rone is update anywhere cdr define repl c servl C timestamp S tran Rone db servl owner table select from table db serv2 owner table select from table In replicate Rtwo serv2 is the primary and serv is receive only cdr define repl c servi C ignore S tran Rtwo R db servl owner table select from table P db serv2 owner table select from table For more information see Primary Target Replication System on page 3 3 Participant Modifier The participant modifier is a restricted SELECT statement The participant modifier specifies the rows and columns that will be replicated The participant modifier must be enclosed in quote marks 3 M SELECT L amd FROM table WHERE Clause Element Purpose Restrictions Syntax column Name of a column in the table The column must exist Long Identifiers specified by the participant on page A 86 table The table specified by the This must be the tablename only Long Identifiers paruc pant You cannot specify an owner ora 9 P28e ABE database server You cannot specify a synonym or a view WHERE Clause Clause that specifies a subset of WHERE clause table rows to be replicated syntax refer to IBM Informix Guide to SQL Syntax A 90 IBM Informix Dynamic Server Enterprise Replication Guide Participant Considerations for the SELECT Statement The following guidelines apply to a SELECT s
149. difying replicates A 51 FLOAT data type 6 13 floatcanon option 6 13 A 14 Floating point data types 2 19 numbers canonical format A 14 IEEE format A 14 numbers canonical format A 14 values and canonical message format 6 13 follow option cdr error A 35 Forbidden SQL statements 2 16 Forest of trees combining with HDR 5 7 definition of 3 22 illustrated 3 22 network topology 1 7 Frequency attributes description of 6 10 examples A 51 description of A 92 replication specifying 6 10 FREQUENCY field cdr list replicate output A 41 Full row replication changing 6 15 fullrow option 6 11 A 14 modifying replicates A 51 Fully connected topology definition of 3 19 support for 1 7 8 IBM Informix Dynamic Server Enterprise Replication Guide using HDR with 3 19 Functions writing for UDT replication 2 25 Global catalog contents of 2 7 description of 2 6 leaf servers 2 7 4 8 root and nonroot servers 4 8 synchronizing 6 6 Global Language Support description of Intro 4 locale of date A 93 support of 1 8 using with Enterprise Replication 2 18 GLS See Global Language Support Grouper paging file setting up 4 18 Groups See Database server groups Guidelines for configuring logical log files 4 11 Hardware platforms dissimilar 6 13 heterogeneous 2 19 Help Intro 14 Heterogeneous hardware replicating on 2 19 Hierarchical routing topologies combing with HDR 5 6 SQLHOSTS 4 8 supported types 3 19 synchronization
150. e partstate char 50 Participant state ACTIVE INACTIVE partmode char 1 P primary database server read write R target database server receive only dbsname lvarchar Database name owner lvarchar Owner name tabname lvarchar Table name syscdrprog The syscdrprog table lists the contents of the Enterprise Replication progress tables The progress tables keep track of what data has been sent to which servers and which servers have acknowledged receipt of what data Enter prise Replication uses the transaction keys and stamps to keep track of this information The progress table is two dimensional For each server to which Enterprise Replication sends data the progress tables keep progress information on a per replicate basis Column Type Description dest id integer Server ID of the destination server repl id integer The ID that Enterprise Replication uses to identify the replicate for which this information is valid source id integer Server ID of the server from which the data originated 1 of 2 SMI Table Reference D 5 Syscdrq syscdrq Column Type Description key_acked_srv integer Last key for this replicate that was acknowledged by this destination key_acked_lgid integer Logical log ID key acked lgpos integer Logical log position key acked seq integer Logical log sequence tx stamp 1 integer Together with tx stamp2 forms the stamp of the last transaction acknowledged for this
151. e cdr change replicateset on page A 6 Creating and Managing Replicate Sets 8 9 Changing Replication Frequency For the Replicate Set Changing Replication Frequency For the Replicate Set You can change the replication frequency for the replicates in an exclusive or non exclusive replicate set using the cdr modify replicateset command For more information see Specifying Replication Frequency on page 6 10 For example to change the replication frequency for each of the replicates in the sales set to every Monday at midnight enter cdr modify replicateset sales set Monday 24 00 For more information see cdr change replicateset on page A 6 8 10 IBM Informix Dynamic Server Enterprise Replication Guide Chapter Monitoring and Troubleshooting Enterprise Replication In This Chapter Aborted Transaction Spooling Files Preparing to Use ATS About ATS Filenames About ATS File Information BYTE and TEXT Information in ATS Files Example 1 Example 2 Example3 Changed Column Information i in ATS Files BLOB and CLOB Information in ATS Files UDT Information in ATS Files Row Information Spooling Files Preparing to Use RIS About RIS Filenames BYTE and TEXT informatori in RIS Files Example 1 Example 2 F Changed Column Information i in RIS Files BLOB and CLOB Information in RIS Files UDT Information in RIS Files Preventing Memory Queues from Overflowing Preventing DDRBLOCK Mode
152. e on page A 10 cdr delete replicateset on page A 26 cdr list replicateset on page A 42 cdr modify replicateset on page A 53 Command Line Utility Reference A 7 Command Syntax cdr resume replicateset on page A 61 cdr start replicateset on page A 69 cdr stop replicateset on page A 75 cdr suspend replicateset on page A 79 A 8 IBM Informix Dynamic Server Enterprise Replication Guide Command Syntax cdr connect server The cdr connect server command reestablishes a connection to a database server that has been disconnected with a cdr disconnect server command Syntax cdr connect server server group ny Connect Option f p A 87 Element Purpose Restrictions Syntax server group Name of database server group The database server group must to resume be defined for replication and be disconnected The cdr connect server command reestablishes a connection to the server seroer group See Also cdr define server on page A 19 cdr delete server on page A 28 cdr disconnect server on page A 32 cdr list server on page A 44 cdr modify server on page A 55 cdr resume server on page A 63 cdr suspend server on page A 81 Command Line Utility Reference A 9 Command Syntax cdr define replicate cdr define replicate The cdr define replicate command defines a replicate in the global catalog Syntax Conflict Options
153. e Replication only replicates the final result of a transaction triggers execute only once on the target regardless of how many triggers executed on the source In cases where the final evaluation of the transaction results in no replication for example an INSERT where the final row image is a DELETE as shown in Figure 1 3 on page 1 16 no triggers execute on the target database If the same triggers are defined on both the source and target tables any INSERT UPDATE or DELETE operation that the triggers generate are also sent to the target database server For example the target table might receive replicate data caused by a trigger that also executes locally Depending on the conflict resolution rule and scope these operations can result in errors To avoid this problem define the replicate to not fire triggers on the target table For more information on triggers see Enabling Triggers on page 6 14 and the CREATE TRIGGER section in IBM Informix Guide to SQL Syntax Overview of Enterprise Replication Administration 2 13 Transaction Processing Considerations Sequence Objects In bi directional Enterprise Replication if you replicate tables using sequence objects for update insert or delete operations the same sequences might be generated on different servers at the same time leading to collisions To avoid this problem define sequence objects on each server so that the generated sequences are disjoint For more informa
154. e column to be unique For more information about primary keys see the IBM Informix Database Design and Implementation Guide and the IBM Informix Guide to SQL Syntax Important Because primary key updates are sent as DELETE INSERT statement pairs avoid changing the primary key and updating data in the same transaction Overview of Enterprise Replication Administration 2 11 Database and Table Design Considerations SERIAL Data Types and Primary Keys If you plan to use SERIAL data types SERIAL and SERIALS as the primary key for a table the same serial value might be generated on two servers at the same time To avoid this problem use the CDR SERIAL configuration parameter to generate non overlapping unique values for SERIAL columns across all database servers in your replication environment Set CDR SERIAL in the ONCONHIG file for each primary source database server For more infor mation and examples see CDR SERIAL Configuration Parameter on page B 14 If you do not set CDR SERIAL you must specify that the serial column is part of a composite primary key to avoid generating non unique SERIAL primary keys The non serial column part of the primary key identifies the server on which the row was initially created Cascading Deletes If a table includes a cascading delete when a parent row is deleted the children are also deleted If both the parent and child tables participate in replication the deletes for both the p
155. e listed in the example they are not delimited by semicolons For instance you might see the code in the following example CONNECT TO stores demo DELETE FROM customer WHERE customer num 121 COMMIT WORK DISCONNECT CURRENT Introduction 13 Additional Documentation 14 To use this SOL code for a specific product you must apply the syntax rules for that product For example if you are using DB Access you must delimit multiple statements with semicolons If you are using an SOL API you must use EXEC SQL at the start of each statement and a semicolon or other appro priate delimiter at the end of the statement Tip Ellipsis points in a code example indicate that more code would be added in a full application but it is not necessary to show it to describe the concept being discussed For detailed directions on using SOL statements for a particular application development tool or SOL API see the manual for your product Additional Documentation IBM Informix Dynamic Server documentation is provided in a variety of formats m Online manuals The documentation CD in your media pack allows you to print the product documentation You can obtain the same online manuals at the IBM Informix Online Documentation site at http www 3 ibm com software data informix pubs library m Online help This facility provides context sensitive help an error message reference language syntax and more m Documentation notes and
156. e local computer You must comply with Windows network access conventions and file permissions to ensure that the local computer has access to the shared SQLHOSTS registry key For information about network access conventions and file permissions see your Windows documentation IBM Informix Dynamic Server Enterprise Replication Guide Preparing the SQLHOSTS Connectivity Information Preparing the SQLHOSTS Connectivity Information Preparing the SOLHOSTS connectivity information consists of setting up registry keys on each computer that hosts a database server that participates in a replicate To prepare the SQLHOSTS connectivity information 1 Setup the SOLHOSIS registry key on the local computer 2 Set up the database server group registry key on the local computer See Setting Up the Database Server Group Registry Key on page F 5 3 Set up the SOLHOSTS and group registry keys on all computers that are participants in the replicate See Setting up the Registry Keys on All Computers on page F 8 4 Ensurethat the services files on each computer include entries for all database servers that are participants in the replicate See Verifying the services Files on All Computers on page F 8 Setting up the SQLHOSTS Registry with ISA Important It is strongly recommended that you use IBM Informix Server Adminis trator ISA rather than regedt32 to set up the SQLHOSTS regis
157. e onstat d or oncheck cs cS ce pe ps and pS For more information see the section on monitoring sbspaces in the IBM Informix Dynamic Seroer Performance Guide and the utilities chap ter of the IBM Informix Administrator s Reference Tip When you use onstat d to monitor disk usage the s flag in the Flags column indicates an sbspace For each sbspace chunk the first row displays information about the whole sbspace and user data area The second row displays information about the metadata area Increasing the Sizes of Storage Spaces If you notice that the Enterprise Replication dbspace or sbspace is running out of disk space you can increase the size of the space by adding chunks to the space To add a chunk to a dbspace use onspaces a For example to add a 110 kilobyte chunk with an offset of 0 to the er dbspace dbspace enter onspaces a er dbspace p dev raw dev2 o 0 s 110 To add a chunk to an sbspace use the same onspaces command above however you can specify more information about the chunk that you are adding After you add a chunk to the sbspace you must perform a level 0 backup of the root dbspace and the sbspace IBM Informix Dynamic Server Enterprise Replication Guide Recovering when Storage Spaces Fill For more information see the sections on adding chunks to dbspaces and sbspaces in the IBM Informix Extended Parallel Server Administrator s Guide and the utilities chapter of the IBM Informix Adm
158. e perf command Use the CDR ENV config uration parameter to set this environment variable For more information see CDR ENV Configuration Parameter on page B 5 Important Do not use the CDR_PERFLOG environment variable unless instructed to do so by Technical Support IBM Informix Dynamic Server Enterprise Replication Guide CDR ROUTER Environment Variable default value 0 range of values any number takes effect when Enterprise Replication is initialized When set to 1 the CDR ROUTER environment variable disables intermediate acknowledgements of transactions in hierarchical topologies The normal behavior for Enterprise Replication is that transaction are acknowledged when they are received on the first server to which they are sent When CDR ROUTER is set transactions are only acknowledged when they have been received on leaf servers Use the CDR ENV configuration parameter to set this environment variable For more information see CDR_ENV Config uration Parameter on page B 5 Important Do not use the CDR ROUTER environment variable unless instructed to do so by Technical Support Configuration Parameter and Environment Variable Reference B 23 B 24 CDR RMSCALEFACT Environment Variable default value 4 range of values positive number takes effect when Enterprise Replication is initialized The CDR_RMSCALEFACT environment variable sets the number of DataSync t
159. e queue However if the volume of transactions during queue recovery is so large that the logical log is in danger of being overwritten replication is blocked m Large transactions support Enterprise Replication automatically spools large transactions to disk instead of holding them in memory Rows from spooled trans actions are paged in and out of memory as needed Enterprise Replication can replicate transactions up to 4 TB in size IBM Informix Dynamic Server Enterprise Replication Guide Security Enhancements m Improved availability You can use High Availability Data Replication HDR on critical database servers in an Enterprise Replication system to provide identical backup database servers m Dynamic log file Enterprise Replication can request the database server to add a new dynamic log file if replication enters DDRBLOCK mode For more information see Preventing DDRBLOCK Mode on page 9 14 Security Enhancements Enterprise Replication supports the same levels of network encryption available for client server communications Encryption is implemented in Enterprise Replication with configuration parameters For more information see for Network Encryption on page 1 8 for an overview of encryption Encryption configuration parameters are documented in Appendix B Configuration Parameter and Environment Variable Reference Command Line Changes This release includes the following updates to the co
160. e results obtained in other operating environ ments may vary significantly Some measurements may have been made on development level systems and there is no guarantee that these measure ments will be the same on generally available systems Furthermore some measurements may have been estimated through extrapolation Actual results may vary Users of this document should verify the applicable data for their specific environment Information concerning non IBM products was obtained from the suppliers of those products their published announcements or other publicly available sources IBM has not tested those products and cannot confirm the accuracy of performance compatibility or any other claims related to non IBM products Questions on the capabilities of non IBM products should be addressed to the suppliers of those products All statements regarding IBM s future direction or intent are subject to change or withdrawal without notice and represent goals and objectives only All IBM prices shown are IBM s suggested retail prices are current and are subject to change without notice Dealer prices may vary This information contains examples of data and reports used in daily business operations To illustrate them as completely as possible the examples include the names of individuals companies brands and products All of these names are fictitious and any similarity to the names and addresses used by an actual business enterprise is e
161. e smile to replicate every five hours cdr modify repl every 300 smile The following example modifies the frequency attributes of replicate smile to replicate daily at 1 00 A M cdr modify repl a 01 00 smile The following example modifies the frequency attributes of replicate smile to replicate on the last day of every month at 5 00 A M to generate ATS files and not to fire triggers cdr modify repl a L 5 00 A y T n smile The following example changes the mode of the first participant listed to receive only and the mode of the second to primary cdr mod repl smile R dblGserverl antonio tablel P db2 server2 carlo table2 See Also cdr change replicate on page A 4 cdr define replicate on page A 10 m u m cdr delete replicate on page A 24 m cdr list replicate on page A 38 m cdr resume replicate on page A 59 Command Line Utility Reference A 51 Command Syntax m cdr start replicate on page A 67 cdr stop replicate on page A 73 m cdr suspend replicate on page A 77 A 52 IBM Informix Dynamic Server Enterprise Replication Guide Command Syntax cdr modify replicateset The cdr modify replicateset or cdr modify replset command modifies all the replicates in a replicate set Syntax cdr modify replicateset C repl set Connect Option p A 87 Frequency Options p A 92 Element Purpose Restrictions Syntax r
162. e the transaction are written to a local operating system file You can use the ATS files to identify problems or as input to custom utilities that extract or reapply the aborted rows Monitoring and Troubleshooting Enterprise Replication 9 3 Preparing to Use ATS Aborted transaction spooling only occurs if the entire transaction is aborted Transactions defined with row scope that have aborted rows but are success fully committed on the target tables are not logged All rows that fail conflict resolution for a transaction that has row scope defined are also written to the RIS file Row Information Spooling Files on page 9 9 if defined In some cases such as with long transactions the database server itself aborts transactions In these cases Enterprise Replication does not generate an ATS file Preparing to Use ATS Failed transactions are not automatically recorded in ATS files To collect ATS information 1 Create a directory for Enterprise Replication to store ATS files m If you are using primary target replication create the directory on the target system m If you are using update anywhere replication and have conflict resolution enabled create the directory on all participating repli cation systems For more information see Creating ATS and RIS Directories on page 4 19 2 When you define a server for Enterprise Replication specify the location of the ATS directory you created in step 1 To do this incl
163. each transaction as replication data to the target servers At each target server Enterprise Replication receives and applies each trans action contained in the replication data to the appropriate databases and tables as a normal logged transaction IBM Informix Enterprise Replication provides the following Asynchronous Data Replication Log Based Data Capture High Performance High Availability Consistent Information Delivery Flexible Architecture About IBM Informix Enterprise Replication 1 3 Asynchronous Data Replication 1 4 m Centralized Administration m Network Encryption Asynchronous Data Replication Enterprise Replication uses asynchronous data replication to update the databases that reside at a replicated site after the primary database has committed a change With asynchronous replication the delay to update the replicated site databases can vary depending on the business application and user require ments However the data eventually synchronizes to the same value at all sites The major benefit of this type of data replication is that if a particular database server fails the replication process can continue and all transactions in the replication system will be committed In contrast with synchronous data replication the data is replicated immedi ately when the source data is updated Synchronous data replication uses the two phase commit technology to protect data integrity In a two phase commit
164. ear alone or precede one or more options You must spell a command exactly as shown and use lowercase letters variable A word in italics represents a value that you must supply such as a database file or program name A table following the diagram explains the value flag A flag is usually an abbreviation for a function menu or option name or for a compiler or preprocessor argument You must enter a flag exactly as shown including the preceding hyphen 10f2 Introduction 11 Command Line Conventions 12 Element Description ext A filename extension such as sql or cob might follow a variable that represents a filename Type this extension exactly as shown immediately after the name of the file The extension might be optional in certain products Punctuation and mathematical notations are literal symbols that you must enter exactly as shown Single quotes are literal symbols that you must enter as shown Privileges p 5 17 A reference in a box represents a subdiagram Imagine that the subdiagram is spliced into the main diagram at this point When a page number is not specified the subdiagram appears on the same page ALL A shaded option is the default action Syntax within a pair of arrows indicates a subdiagram il The vertical line terminates the command f X OFF ON A branch below the main path indicates an optional path Any term on t
165. ection to this database server C Connected D Connection disconnected will be retried T Idle time out caused connection to terminate X Connection closed by user command Connection unavailable until reset by user cnnstatechg integer Time that connection state was last changed servstate char 1 Status of database server A Active S Suspended Q Quiescent initial sync state only ishub char 1 Y Server is a hub N Server is not a hub A hub is any replication server that forwards infor mation to another replication server isleaf char 1 Y Server is a leaf server N Server is not a leaf server rootserverid integer The identifier of the root server forwardnodeid integer The identifier of the parent server timeout integer Idle timeout syscarsend buf Although not directly connected a nonroot server is similar to a root server except it forwards all replicated messages through its parent root server All nonroot servers are known to all root servers and other nonroot servers A nonroot server can be a terminal point in a tree or it can be the parent for another nonroot server or a leaf server Nonroot and root servers are aware of all replication servers in the replication environment including all the leaf servers A leaf server is a nonroot server that has a partial catalog A leaf server has knowledge only of itself and its parent server It does not contain information about replicates of which it is not a participa
166. ects with the same name Doing so can cause failures in the Enterprise Replication system at the time of the operation or later These failures might manifest themselves in ways that do not directly indicate the source of the problem If you must delete and re create a definition use a different name for the new object for example delete replicate a 001 and recreate it as a 002 or wait until the delete action has successfully propagated through the entire Enterprise Replication system before you re create the object The former strategy is especially appropriate if you have database servers that are not connected to the Enterprise Replication network at all times It might take a significant amount of time before the operation is propagated to those disconnected servers Backup and Restore Considerations When backing up and restoring database servers that participate in repli cation do not stop Enterprise Replication before performing a backup on an Enterprise Replication system Database and Table Design Considerations Consider the following when designing databases and tables for replication Unbuffered Logging Table Types Shadow Columns SERIAL Data Types and Primary Keys Cascading Deletes Triggers Sequence Objects Overview of Enterprise Replication Administration 2 9 Database and Table Design Considerations 2 10 Unbuffered Logging Databases on all server instances involved in replication must be created with
167. ed D 7 syscdrrecv_buf D 7 syscdrrecv_txn D 7 syscdrrepl D 8 syscdrreplset D 9 syscdrs D 10 syscdrsend buf D 11 syscdrsend txn D 11 syscdrserver D 12 syscdrtx D 13 Software dependencies Intro 4 JK L MN OP QRS TU VW XY ze Solving configuration problems 9 17 to 9 19 Specifying ATS directory A 21 A 55 conflict resolution options A 11 rules 6 10 scope 6 10 database server type 6 7 default behavior for smart large objects 4 15 idle timeout A 21 location ATS directory 6 6 RIS directory 6 6 replication frequency 6 10 RIS directory A 21 A 55 SPL conflict resolution limitations 3 15 rule 3 11 3 14 6 10 simple large objects 2 22 smart large objects 2 23 SPL routines arguments 3 15 considerations 3 16 delete table 3 15 information passed by Enterprise Replication 3 15 limitations for conflict resolution 2 26 nonoptimized 3 17 optimized 3 17 Spooled row data sbspace dropping 4 17 logging and HDR 5 11 Spooled row data sbspaces changing logging mode 4 17 guidelines for creating 4 14 logging mode 4 16 Spooled transactions 9 12 definition of 4 13 storage 4 13 troubleshooting 9 13 Spooling directories ATS and RIS 3 12 capacity planning 4 19 default 4 19 more than usual causes of 9 15 Index 15 A BC D EF GH I planning for disk space 4 12 SQL code Intro 13 SQL statements forbidden 2 16 limited 2 16 permitted 2 17 supported 2 15 See also IBM Informix Guide to SQL Syntax SQLHOSTS hierarchical routine topolog
168. ediate stmt IBM Informix Dynamic Server Enterprise Replication Guide Preparing to Replicate User Defined Types Preparing to Replicate User Defined Types You must install and register user defined types on all database servers prior to starting replication If you are using HDR with Enterprise Replication follow the instructions in the section Preparing to Replicate UDTs UDRs and DataBlade Modules on page 5 10 For Enterprise Replication to be able to replicate opaque user defined types UDTs the UDT designer must provide two support functions streamwrite and streamread For more information see Replicating Opaque User Defined Data Types on page 2 25 Preparing to Replicate User Defined Routines You must install and register user defined routines on all database servers prior to starting replication If you are using HDR with Enterprise Replication follow the instructions in the section Preparing to Replicate UDTs UDRs and DataBlade Modules on page 5 10 Preparing Tables for Conflict Resolution To use any conflict resolution rule other than ignore you must define the shadow columns cdrserver and cdrtime Tip If you plan to use only the ignore conflict resolution rule you do not need to define the cdrserver and cdrtime shadow columns For more information about update anywhere and conflict resolution see Update Anywhere Replication System on page 3 8 To define the shadow columns in y
169. ee Evaluating Data for Replication on page 1 10 You can change the default behavior to replicate only the columns that changed To replicate only changed columns include the fullrow n option in the replicate definition Defining and Modifying Replication Servers Replicates and Participants 6 11 Replicating Only Changed Columns 6 12 Tip Enterprise Replication always sends the primary key column even if you specify to replicate only changed columns Replicating only the columns that changed has the following advantages Sends less data This is particularly useful when replicating large objects such as data stored as smart large objects and opaque user defined types UDTs For example when you replicate a row with a large column that changes infrequently and a small column that changes fre quently Enterprise Replication sends significantly less data each time it updates the row if it only replicates the changed columns Uses fewer Enterprise Replication resources such as memory If Enterprise Replication replicates an entire row from the source and the corresponding row does not exist on the target Enterprise Replication applies the update as an INSERT also known as an UPSERT on the target By replicating the entire row Enterprise Replication self corrects any errors during replication If any errors occur in an update of the target database server for example a large object is deleted before Enterprise Replic
170. epl_set Name of replicate set to modify The replicate set must exist Long Identifiers on page A 86 Usage The cdr modify replicateset command modifies the attributes of all the repli cates in the replicate set repl_set To add or delete replicates from a replicate set use the cdr change replicateset command cdr change replicateset on page A 6 Important Once you create a replicateset you cannot change it from exclusive to non exclusive or vice versa Command Line Utility Reference A 53 Command Syntax Example The following example connects to the default server SINFORMIXSERVER and modifies the replicate set sales set to process replication data every hour cdr mod replset every 60 sales set See Also cdr change replicateset on page A 6 cdr define replicate on page A 10 cdr delete replicateset on page A 26 cdr list replicateset on page A 42 cdr resume replicateset on page A 61 cdr start replicateset on page A 69 cdr stop replicateset on page A 75 cdr suspend replicateset on page A 79 A 54 IBM Informix Dynamic Server Enterprise Replication Guide Command Syntax cdr modify server The cdr modify server command modifies the Enterprise Replication attributes of a database server Syntax cdr modify server C KS server group N Connect Option F p A 8 Khe e idle interval mode X
171. eplicate belongs to an exclusive replicate set you cannot manage the replicates individually For more information see Exclusive Replicate Sets on page 8 4 With the exception of deleting the replicate you must manage the replicate as part of the exclusive replicate set For more information see Managing Replicate Sets on page 8 6 If the replicate belongs to a non exclusive replicate set you can manage the replicates both individually and as part of the set For more information see Non Exclusive Replicate Sets on page 8 5 Viewing Replicate Properties Once you define a replicate you can view the properties of the replicate using the cdr list replicate command For more information see Defining Repli cates on page 6 7 If you do not specify the name of a defined replicate on the command line Enterprise Replication lists detailed information on all the replicates defined on the current server If you use the brief option Enter prise Replication lists participant information about all the replicates If you specify a replicate name Enterprise Replication displays participant infor mation about the replicate For information about this command see cdr list replicate on page A 38 Managing Replication Servers and Replicates 7 7 Starting a Replicate 7 8 Starting a Replicate When you define a replicate the replicate does not begin u
172. er groups see Set ting up Database Server Groups on page 4 5 Replication Example Environment The UNIX sqlhosts file for each database server contains the following connectivity information g usa group Ail usa ontlitcp s1 techpubs1 g g_usa g_italy group i 8 italy ontlitcp s2 techpubs2 g g_italy g_japan group i 6 japan ontlitcp s3 techpub6 g g_usa See Appendix F SOLHOSTS Registry Key for information on how to prepare the SOLHOSTS connectivity information using the infor mation in the UNIX sqlhosts file The ONCONFIG file contains the following CDR_QDATA_SBSPACE entry CDR QDATA SBSPACE sbspace CDR queue smart blob space You must create an sbspace for the row data and set the CDR_QDATA_SBSPACE parameter to the location of that sbspace For more information see Setting Up Send and Receive Queue Spool Areas on page 4 12 and CDR_QDATA_SBSPACE Configuration Parameter on page B 11 All commands in this example except for creation of the sample databases on italy and japan are issued from the computer s1 The databases for the examples in this chapter are identical stores demo databases with logging as follows a Create a database named stores on the usa database server S1 dbaccessdemo log stores a Create a database named stores on the italy database server S1 rlogin s2 S2 dbaccessdemo log stores a Create a database named stores on the japan database server
173. er problems For more information see Setting Up Error Logging on page 6 11 and Chapter 9 Monitoring and Troubleshooting Enterprise Replication 10f2 Command Line Utility Reference A 13 Command Syntax A 14 Options Long Form Short Form fullrow y n fyln floatieee I floatcanon F firetrigger T Examples ron IBM Informix Dynamic Server Enterprise Replication Guide Specifies to y replicate the full row and enable upserts or n replicate only changed columns and disable upserts By default Enterprise Replication always replicates the entire row and enables upserts For more information see Replicating Only Changed Columns on page 6 11 Transfers replicated floating point numbers in in either 32 bit for SMALLFLOAT or 64 bit for FLOAT IEEE floating point format Use this option for all new replicate definitions For more information see Using the IEEE Floating Point or Canonical Format on page 6 13 Transfers replicated floating point numbers in machine independent decimal representation This format is portable but can lose accuracy This format is provided for backward compatibility only use floatieee for all new replicate definitions For more information see Using the IEEE Floating Point or Canonical Format on page 6 13 Specifies that the rows that this replicate inserts fire triggers at the destination For more infor mation see Enabling Trigg
174. erprise Replication is initialized The CDR ENV configuration parameter sets the Enterprise Replication environment variables CDR LOGDELTA CDR PERFLOG CDR ROUTER or CDR_RMSCALEFACT The ONCONFIG file can contain multiple entries for CDR ENV You can specify only one environment variable per CDR ENV entry For example to set the CDR_LOGDELTA environment variable to 30 and the CDR ROUTER environment variable to 1 include the following lines in the ONCONFIG file CDR_ENV CDR_LOGDELTA 30 CDR_ENV CDR_ROUTER 1 Important Use the CDR_LOGDELTA CDR_PERFLOG CDR_ROUTER and CDR_RMSCALEFACT environment variables only if instructed to do so by Technical Support Configuration Parameter and Environment Variable Reference B 5 Logical log CDR_EVALTHREADS Configuration Parameter default value 1 2 units evaluator thread instances range of values 1to129 the number of CPU VPs for each value takes effect when shared memory is initialized Enterprise Replication evaluates the images of a row in parallel to assure high performance Figure B 1 illustrates how Enterprise Replication uses parallel processing to evaluate transactions for replication has Figure B 1 Evaluating transactions for replication Processing in Transaction list Parallel for High Performance E INVE Product Enterprise mA In Replication message queue INV Product 3421 clock gt 3427 china INV P
175. errun If the replay position is overrun the following message appears in the message log file WARNING The replay position was overrun data may not be replicated If this occurs you must manually resynchronize the source and target servers For more information see Resynchronizing Replication Servers on page 6 16 IBM Informix Dynamic Server Enterprise Replication Guide Preventing DDRBLOCK Mode DDRBLOCK mode is usually caused by the logical logs being misconfigured for the current transaction activity or by the Enterprise Replication system having to spool more than usual More than usual spooling could be caused by one of the following situations m Aone time job might be larger than normal and thus require more log space m fone of the target servers is currently unavailable more spooling of replicated transactions can be required m The spool file or paging space could be full and needs to be expanded For more information see Preventing Memory Queues from Overflowing on page 9 12 If Enterprise Replication detects that the log files are configured too small for the current database activity then the following message might appear in the message log file Warning The log space appears to be configured too small for use with Enterprise Replication ER ER may require additional logical logs to avoid a DDRBLOCK state and or replay position log wrap It is recommended that the logical log configuration be expan
176. ers on page 6 14 2 of 2 The following example illustrates the use of cdr define replicate cdr define repl conflict timestamp sp1 scopestran ats fullrow n floatieee newrepl dbleiowa antonio tablel1 select from tablel db2eutah carlo table2 select from table2 Command Syntax Line 1 of the example specifies a primary conflict resolution rule of timestamp If the primary rule fails the SPL routine sp1 will be invoked to resolve the conflict Because no database server is specified here or on any later line the command connects to the database server named in the INFORMIXSERVER environment variable Line 2 specifies that the replicate has a transaction scope for conflict resolution scope and enables aborted transaction spooling Enterprise Repli cation will only replicate the rows that changed and uses the IEEE floating point format to send floating point numbers across dissimilar platforms The final item specifies the name of the replicate newrepl Line 3 defines the first participant db1 iowa antonio table1 with the select statement select from table1 Line 4 defines a second participant db2eutah carlo table2 with the select statement select from table2 The next example is the same as the preceding example with the following exceptions Line 1 instructs Enterprise Replication to use the global catalog on database server ohio Line 2 also specifies that the data s
177. erver Enterprise Replication Guide onstat g ath onstat g ath The onstat g ath command prints information about all threads The following table summarizes the threads that Enterprise Replication uses You can use this information about threads when you evaluate memory use For more information see the utilities chapter of the IBM Informix Adminis trator s Reference Number of Threads Thread Name Thread Description 1 ddr_snoopy Performs physical I O from logical log verifies potential replication and sends applicable log record entries to Enterprise Replication 1 preDDR Runs during queue recovery to monitor the log and sets blockout mode if the log position advances too far before replication resumes 1 CDRGfan Receives log entries and passes entries to evaluator thread n CDRGevaln Evaluates log entry to determine if it should be replicated n is the number of evaluator threads specified by CDR EVALTHREADS This thread also performs transaction compression on the receipt of COMMIT WORK and queues completed replication messages lperlarge CDRPager Performs the physical IO for the temporary smart large object that holds transaction paged transaction records Grouper paging is activated for a transaction when its size is 10 percent of the value of SHMVIRTSIZE or CDR QUEUEMEM or when it includes more than 100 000 records 1 CDRCparse Parses all SOL statements for replicate definitions 1 per CDRNsTn
178. erver group The database server groups must be defined for Enterprise Replication Usage The cdr list server command displays information about servers You do not need to be user informix to use this command Listing All Enterprise Replication Servers When no server group name is given the cdr list server command lists all database server groups that are visible to the current replication server In hierarchical topology leaf servers only have information about their parent database servers in the Enterprise Replication domain Therefore when cdr list server is executed against a leaf server it displays incomplete information about the other database servers For example cdr list server might give the following output SERVER ID STATE STATUS QUEUE CONNECTION CHANGED g newyork 1 Active Local 0 g portland 2 Active Connected 0 Mar 19 13 48 44 g sanfrancisco 3 Active Connected 0 Mar 19 13 48 40 A 44 IBM Informix Dynamic Server Enterprise Replication Guide Command Syntax The SERVER and ID Columns The SERVER and ID columns display the name and unique identifier of the Enterprise Replication server group The STATE Column The STATE column can have the following values Active Indicates that the server is active and replicating data Deleted Indicates that the server has been deleted and that it is not capturing or delivering data and the queues are being drained Quiescent Indicates that the server is
179. ervers except leaf servers thus you can manage the entire replication environment from one non leaf replication server For information about managing replication servers and their global catalogs refer to Managing Replication Servers on page 7 3 Leaf replication servers Replication Topology Terms on page 3 20 have a limited catalog Because the parent database server always manages opera tions that involve a leaf database server the catalog of the leaf database server contains only enough data to allow it to interact with its parent server Limiting the catalog of leaf database servers makes the replication system more efficient because the global catalogs do not need to be replicated to the leaf servers For information on defining root nonroot and leaf servers see Customizing the Replication Server Definition on page 6 6 Overview of Enterprise Replication Administration 2 7 Enterprise Replication Considerations Enterprise Replication Considerations This section discusses items to consider when planning to use Enterprise Replication Operational Considerations Backup and Restore Considerations Database and Table Design Considerations Transaction Processing Considerations Replication Environment Considerations Enterprise Replication Data Types Operational Considerations Enterprise Replication imposes the following operational limitations m Enterprise Replication supports replication on IBM Informi
180. es might look like cdr define server connect honolulu idle 500 ats D cdrfiles ats cdr def ser c honolulu i 500 A D cdr ats For information on how to manage long lines at your command prompt check your operating system documentation Long Identifiers Identifiers are the names of objects that Dynamic Server and Enterprise Repli cation use such as database servers databases columns replicates replicate sets and so on An identifier is a character string that must start with a letter or an under score The remaining characters can be letters numbers or underscores On IBM Informix Dynamic Server all identifiers including replicates and replicate sets can be 128 bytes long However if you have any database servers in your replication environment that are an earlier version you must follow the length restrictions for that version For more information about identifiers see the IBM Informix Guide to SQL Syntax The location of files such as the location of the ATS files can be 256 bytes A 86 IBM Informix Dynamic Server Enterprise Replication Guide Connect Option User login IDs can be a maximum of 32 bytes The owner of a table is derived from a user ID and is thus limited to 32 bytes Connect Option The connect option causes the command to use the global catalog that is on the specified server If you do not specify this option the connection defaults to the database server specified by the
181. example Choose Tools gt Options means choose the Options item from the Tools menu Tip When you are instructed to enter characters or to execute a command immediately press RETURN after the entry When you are instructed to type the text or to press other keys no RETURN is required Introduction 9 Icon Conventions Icon Conventions Throughout the documentation you will find text that is identified by several different types of icons This section describes these icons Comment Icons Comment icons identify three types of information as the following table describes This information always appears in italics Icon Label Description Warning Identifies paragraphs that contain vital instructions A cautions or critical information Important Identifies paragraphs that contain significant gt information about the feature or operation that is being described Tip Identifies paragraphs that offer additional details or shortcuts for the functionality that is being described Feature Product and Platform Icons Feature product and platform icons identify paragraphs that contain feature specific product specific or platform specific information Icon Description Identifies information that relates to the IBM Informix L ate Global Language Support GLS feature Identifies information that is specific to UNIX operating system Ide
182. ey F 5 Setting Up the Database Server Group Registry Key F 6 To set up the database server group registry key 1 2 With the SOLHOSTS key selected choose Edit Add Key In the Add Key dialog box type the name of the database server group in the Key Name dialog box This value must correspond to the OPTIONS value in the database server name key Leave the Class dialog box blank Click OK Select the new key that you just made the key with the database server group name Choose Edit gt Add Value In the Add Value dialog box type one of the fields of the sqlhosts information HOST OPTIONS PROTOCOL SERVICE in the Value Name dialog box Do not change the Data Type dialog box Click OK In the String Editor dialog box type the value for the field that you selected and click OK For a database server group enter the following values HOST E OPTIONS i unique integer value PROTOCOL group SERVICE Each database server group must have an associated identifier value i that is unique among all database servers in your environment Enter a minus for HOST and SERVICE to indicate that you are not assigning specific values to those fields With the database server group key selected choose Edit2Add Key In the Add Key dialog box type the name of the database server in the Key Name field This value must correspond to the database server key whose OPTIONS value was set to the database server grou
183. f C 8 onstat g que C 8 onstat g rcv C 9 onstat g rep C 10 onstat g rqm C 10 ping 4 9 rdate 2 18 starts 6 4 summary of A 2 synchronizing clocks 2 18 Comment icons Intro 10 Communications support module not allowed with ER 4 8 4 JK LM NOPQR STU VW X Y Z Compliance with industry standards Intro 17 Configuration parameters See Parameters Configuration problems solving 9 17 to 9 19 Configuring ATS and RIS files 6 11 logical logs files for Enterprise Replication 4 11 trusted environment 4 5 CONFLICT field cdr list replicate output A 40 conflict option 6 10 A 12 Conflict resolution and table hierarchies 2 26 BYTE data 2 22 cdrserver 2 21 cdrtime 2 21 considerations for SPL routine 3 16 CRCOLS adding and dropping 2 16 delete tables 3 13 4 11 description of 3 10 options A 11 preparing tables for 4 25 rules 3 11 behavior 3 17 changing 6 15 ignore 3 12 6 10 replicating only changed columns 6 12 shadow columns 3 11 specifying 6 10 SPL routine 3 14 6 10 time synchronization 3 14 timestamp 3 13 6 10 valid combinations 3 11 scope changing 6 15 options A 11 row 3 17 6 10 specifying 6 10 transaction 3 17 6 10 shadow columns 2 21 simple large objects 2 21 specifying options A 11 SPL 2 22 IBM Informix Dynamic Server Enterprise Replication Guide support for UDRs 3 15 TEXT data 2 22 timestamp 2 17 2 21 transactional integrity 3 17 triggers 2 13 update anywhere 3 9 Conflicts and asynch
184. f a primary server in an HDR pair fails you switch the secondary server to the standard server allowing it to participate in Enterprise Replication Client connections to the original primary server can be automatically switched to the new standard server For more information on using HDR with Enterprise Replication see Using High Availability Data Replication with Enterprise Replication 1 6 IBM Informix Dynamic Server Enterprise Replication Guide Consistent Information Delivery Consistent Information Delivery Enterprise Replication protects data integrity All Enterprise Replication transactions are stored in a reliable queue to maintain the consistency of transactions Enterprise Replication uses a data synchronization process to ensure that transactions are applied at the target database servers in any order equivalent to the order that they were committed on the source database server If Enter prise Replication can preserve the consistency of the database Enterprise Replication might commit transactions in a slightly different order on the target database If update conflicts occur Enterprise Replication provides built in automatic conflict detection and resolution You can configure the way conflict resolution behaves to meet the needs of your enterprise For more infor mation see Conflict Resolution on page 3 10 Flexible Architecture Enterprise Replication allows replications based on specific business and app
185. f replication data to the to server group database server from the database servers included in the from server group list If the from server group list is omitted the command suspends replication of data from all database servers participating in the Enterprise Replication system to the to server group The connection to the suspended server is unaffected and control and acknowledge messages continue to be sent to that server Enterprise Repli cation continues to replicate data between all database servers unaffected by the cdr suspend server command Command Line Utility Reference A 81 Command Syntax Example The following example connects to the default server SINFORMIXSERVER and suspends replication of data to the server g iowa from the servers g ohio and g utah cdr sus serv g iowa g ohio g utah See Also cdr connect server on page A 9 cdr define server on page A 19 cdr delete server on page A 28 cdr disconnect server on page A 32 cdr list server on page A 44 cdr modify server on page A 55 cdr resume server on page A 63 A 82 IBM Informix Dynamic Server Enterprise Replication Guide Command Syntax Interpreting the Command Line Utility Syntax This section defines the terminology and conventions used in the descrip tions of the command line utility CLU Each command follows the same approximate format with the following components m Comman
186. fault value allbut lt ecb gt takes effect when Enterprise Replication is initialized The ENCRYPT_CIPHER configuration parameter defines all ciphers and modes that can be used by the current database session The cipher list for allbut can include unique abbreviated entries For example bf can represent bf 1 bf 2 and bf 3 However if the abbreviation is the name of an actual cipher then only that cipher is eliminated Therefore des eliminates only the des cipher but de eliminates des des3 and desx Important The encryption cipher and mode used is randomly chosen among the ciphers common between the two servers It is strongly recommended that you do not specify specific ciphers For security reasons all ciphers should be allowed If a specific cipher is discovered to have a weakness then that cipher can be eliminated by using the allbut option IBM Informix Dynamic Server Enterprise Replication Guide The following ciphers are supported For an updated list see the Release Notes des DES 64 bit key bf 1 Blow Fish 64 bit key des3 Triple DES bf 2 Blow Fish 128 bit key desx Extended DES 128 bit key bf 3 Blow Fish 192 bit key The following modes are supported ecb Electronic Code Book ECB cbc Cipher Block Chaining ocb Cipher Feedback ofb Output Feedback All ciphers support all modes except the desx cipher which only supports the cbc mode Because cdb mode is considered
187. fier to repl2 cdr change replicate add repl2 storesGg japan informix stock select from stock 7 Display detailed information about repl2 after adding the partic ipant in step 6 cdr list replicate repl2 IBM Informix Dynamic Server Enterprise Replication Guide Preparing for an Update Anywhere Replication The command returns the following information REPLICATE TABLE SELECT repl2 stores g_usa informix stock select from stock repl2 stores g_italy informix stock select from stock repl2 stores g_ japan informix stock select from stock 8 Make the replicate active cdr start replicate repl2 Changes made to the stock table on usa are reflected in the stock tables on both italy and japan 9 Display a list of replicates so that you can verify that the STATE of repl2 has changed to ACTIVE cdr list replicate The command returns the following information CURRENTLY DEFINED REPLICATES REPLICATE repli STATE Active CONFLICT Ignore FREQUENCY immediate QUEUE SIZE 0 PARTICIPANT g usa informix manufact g italy informix manufact REPLICATE repl2 STATE Active CONFLICT Ignore FREQUENCY immediate QUEUE SIZE 0 PARTICIPANT g usa informix stock g italy informix manufact g japan informix manufact Replication Examples E 9 Cause a Replication Cause a Replication Now you can modify the stock table on one database server and see the change reflected on the other database servers
188. files in the following directory UNIX tmp Windows tmp directory of the drive that contains INFORMIXDIR Monitoring and Troubleshooting Enterprise Replication 9 9 About RIS Filenames If the default directory does not exist Enterprise Replication returns an error For more information see Creating ATS and RIS Directories on page 4 19 3 When you define a replicate specify that RIS is active To do this include the ris option with the cdr define replicate command For more information see Setting Up Error Logging on page 6 11 About RIS Filenames The RIS row information is written at the time that the data synchronization component finishes processing the replicated row and can therefore also provide the local row information The RIS filename algorithm is analogous to the one that ATS uses with the ats prefix replaced by ris The RIS file that corresponds to the ATS file described in the previous section is for example ris g beijing g amsterdam D 2 000529 23 27 16 5 For more information see About ATS Filenames on page 9 5 9 10 IBM Informix Dynamic Server Enterprise Replication Guide BYTE and TEXT Information in RIS Files In addition to the four types of records printed in ATS the RIS file also includes the following information Label Name Description LRH Local row header Indicates if the local row is found in the delete table and not in the target table LRS Local row shad
189. fined types Install the user defined types user user defined routines or defined routines or DataBlade DataBlade modules modules 2 Register the user defined types user defined routines or DataBlade modules When you start HDR the user defined types user defined routines or DataBlade modules are registered on the secondary database server For instructions on starting HDR see the IBM Informix Dynamic Seroer Adminis trator s Guide Loading and Unload Data After you load data onto the HDR primary database server use backup and restore procedures to load the data onto the HDR secondary database server For instructions see the IBM Informix Dynamic Server Administrator s Guide 5 10 IBM Informix Dynamic Server Enterprise Replication Guide Managing Enterprise Replication with High Availability Data Replication Managing Enterprise Replication with High Availability Data Replication This section describes how to manage Enterprise Replication with HDR in the following areas m Row data sbspace logging m HDR failure m Performance Row Data Sbspace Logging All sbspaces used by Enterprise Replication with HDR for spooled trans action row data must be created with logging enabled For more information see Row Data sbspaces on page 4 14 HDR Failure If the primary server within an HDR pair fails the secondary server can be switched to standard mode by executing the onmode d standard command However yo
190. formix Guide to SQL Syntax Preparing the Replication Environment 4 23 Blocking Replication 4 24 Using DB Access to Begin Work Without Replication The following example shows how to use DB Access to begin work without replication as well as update the Enterprise Replication shadow columns cdrserver and cdrtime DATABASE adatabase BEGIN WORK WITHOUT REPLICATION INSERT into mytable cdrserver cdrtime coll col2 VALUES 10 845484154 valuel value2 UPDATE mytable SET cdrserver 10 cdrtime 945484154 WHERE coll gt col2 COMMIT WORK Using ESQL C to Begin Work Without Replication The following example shows how to use ESQL C to begin work without replication as well as update the Enterprise Replication shadow columns cdrserver and cdrtime MAIN argc argv INT argc CHAR argv EXEC SQL CHARstmt 256 EXEC SQL database mydatabase sprintf stmt BEGIN WORK WITHOUT REPLICATION EXEC SQL execute immediate stmt EXEC SQL insert into mytable cdrserver cdrtime coll col2 values 10 845494154 valuel value2 EXEC SQL update mytable set cdrserver 10 cdrtime 845494154 where coll gt col2 EXEC SQL commit work Important You must use the following syntax when you issue the BEGIN WORK WITHOUT REPLICATION statement from ESQL C programs Do not use the syntax sprintf stmt BEGIN WORK WITHOUT REPLICATION EXEC SQL execute imm
191. g Replication Servers m Modifying Replicates m Resynchronizing Replication Servers For information on managing your replication servers and replicates see Managing Replication Servers and Replicates on page 7 1 Initializing Database Servers The database server must be online before you can declare it for replication To bring the server from offline to online issue the following command for your operating system Operating System Command UNIX oninit Windows starts dbservername To bring the server from quiescent mode to online on either UNIX or Windows enter onmode m For more information on initializing the database server see the chapter on database operating modes in the Administrator s Guide for IBM Informix Dynamic Server 6 4 BM Informix Dynamic Server Enterprise Replication Guide Defining Replication Servers Defining Replication Servers Once you bring the database server online the next step is to declare the server to Enterprise Replication To define the replication server use the cdr define server command For example cdr define server init connect server name options server group name The init option initializes the server If INFORMIXSERVER is not set to the server that you are defining specify the connect server name option Connecting to Another Replication Server on page 7 4 Tip All Enterprise Replication commands and options ex
192. g reduction for that table and that your transactions might log more data Important Enterprise Replication performs internal cleanup tasks based on how often the log files switch If the log files switch too frequently Enterprise Replication might perform excessive cleanup work 4 10 IBM Informix Dynamic Server Enterprise Replication Guide Planning for Disk Space Requirements Logical Log Configuration Guidelines Use the following guidelines when configuring your logical log files m Make sure that all logical log files are approximately the same size m Make the size of the logical log files large enough so that the database server switches log files no more than once every 15 minutes during normal processing m Plan to have sufficient logical log space to hold at least four times the maximum transaction size m Set LTXEHWM long transaction exclusive access high watermark 30 percent larger than LTXHWM long transaction high watermark Important If you specify that the database server allocate logical log files dynami cally DYNAMIC_LOGS it is recommended that you set LTXEHWM to no higher than 70 when using Enterprise Replication For more information about logical logs and these configuration parameters see IBM Informix Administrator s Reference and IBM Informix Dynamic Server Administrator s Guide The database server can add dynamic logs when Enterprise Replica
193. gh Availability Data Replication with Enterprise Replication In This Chapter esu AS oe ide Ge Xy Bie Ves AS es 5 3 High Availability Replication ARA E 5 3 Using HDR in a Hierarchical Tree Topology NON E ERN 5 6 Using HDR ina Forest of Trees Topology 5 7 Preparing HDR Database Servers we 5 8 HDR Requirements oU AU m e fir vg dor ui 5 8 Setting Up Database Server Groups ate d 5 9 Preparing to Replicate UDTs UDRs and DataBlad Modules 5 10 Loading and Unload Data ecu us 5310 Managing Enterprise Replication with h High Availability Data Replication amp uuo t eos cs eI Row Data Sbspace Logging 54 HDR Failure BD Performance Considerations 543 Chapter 6 Defining and Modifying Replication Servers Replicates and Participants IniThis Chapter soda aa eo Gig kw ue eU el freu d ne n 6 3 Initializing Database Servers 6 4 Defining Replication Servers y ea sie fe Ge e 6 5 Customizing the Replication Server Definition S ode Up a sm ow 6 6 Defining Replicates 5 s s 6 7 Defining Participants a ee vtt pee we d 6 8 Specifying Conflict Resolution Rules hal Scope zou he wo 6210 Specifying Replication Frequency 610 Setting Up Error Logging 64 Replicating Only Changed Columns Xo hee ee 1 Using
194. hat provide information about the control queue The control queue is a stable queue that contains control messages for the replication system For information on the columns of the syscdrctrl buf table refer to Columns of the Buffer Tables on page D 17 SMI Table Reference D 3 syscdretrl_txn syscdrctri_txn The syscdrctrl_txn table contains information about the control queue The control queue is a stable queue that contains control messages for the repli cation system For information on the columns of the syscdrctrl txn table refer to Columns of the Transaction Tables on page D 16 syscdrerror The syscdrerror table contains information about errors that Enterprise Replication has encountered Column Type Description errornum integer Error number errorserv char 128 Database server name where error occurred errorseqnum integer Sequence number that can be used to prune single error table errortime datetime Time error occurred year to second sendserv char 128 Database server name if applicable that initiated error behavior reviewed char 1 Y if reviewed and set by DBA N if not reviewed errorstmnt text Error description D 4 IBM Informix Dynamic Server Enterprise Replication Guide syscarpart syscdrpart The syscdrspart table contains participant information Column Type Description repIname Ivarchar Replicate name servername char 128 Database server nam
195. he main path is required unless a branch can circumvent it J 1 variable A loop indicates a path that you can repeat Punctuation along the top of the loop indicates the separator symbol for list items E 3 size b A gate B ona path indicates that you can only use that path the indicated number of times even if it is part of a larger loop You can specify size no more than three times within this statement segment 2 of 2 IBM Informix Dynamic Server Enterprise Replication Guide setenv Sample Code Conventions How to Read a Command Line Diagram Figure 1 shows a command line diagram that uses some of the elements that are listed in the previous table Figure 1 Example of a Command Line Diagram INFORMIXC OO compiler Ej pathname To construct a command correctly start at the top left with the command Follow the diagram to the right including the elements that you want The elements in the diagram are case sensitive Figure 1 illustrates the following steps 1 Type setenv 2 Type INFORMIXC 3 Supply either a compiler name or a pathname After you choose compiler or pathname you come to the terminator Your command is complete 4 Press RETURN to execute the command Sample Code Conventions Examples of SOL code occur throughout this manual Except where noted the code is not specific to any single IBM Informix application development tool If only SOL statements ar
196. he replicate in the global catalog for which it has a transaction ALRM ATTENTION CDR CDR subcomponent name bad replicate ID replicate id Unable to allocate memory when ALRM INFO CDR CDR subcomponent name memory analyzing opaque UDTs in allocation failed reason collections rows Datasync received transaction that ALRM INFO Received aborted transaction no was aborted in first buffer so there is nothing to spool to ATS RIS 9 20 IBM Informix Dynamic Server Enterprise Replication Guide data to spool 10f2 Situation Level Enterprise Replication Event Alarms Message Grouper was unable to apply an undo rollback to savepoint to a transaction ALRM ATTENTION CDR CDR subcomponent name Could not apply undo properly SKIPPING TRANSACTION TX Begin Time datetime TX Restart Log Id log id TX Restart Log Position log position TX Commit Time datetime TX End Log Id log id TX End Log Position log position Grouper evaluator is aborting ALRM EMERGENCY CDR Grouper Evaluator thread is aborting Grouper fanout is aborting ALRM EMERGENCY CDR Grouper FanOut thread is aborting Grouper paging sbspace has run out of space Increasing the Sizes of Storage Spaces on page 9 16 ALRM EMERGENCY CDR DS thread name thread is aborting Datasync is aborting ALRM ATTENTION CDR Pager Paging File full Waiting for additional space in sbspace type
197. he row to be replicated meets the following two conditions m It is from the same database server that last updated the local row on the target table m It has a time stamp greater than or equal to that of the local row When this option is not present Enterprise Repli cation always calls the SPL routine defined for the replicate when a conflict is detected Specifies the scope that will be invoked when Enter prise Replication encounters a problem with data or a conflict occurs For more information see Scope on page 3 17 If scope is not specified the default scope is transaction When specifying the scope you can abbreviate trans action to tra Command Syntax Special Options Special Options Back to cdr define replicate p A 10 2 P AN ats Fi M A ris A N N floatieee a ces floatcanon ee KA firetrigger _ AY tullrow X Jm The following table describes the special options to cdr define replicate Options Long Form Short Form Meaning ats A Activates aborted transaction spooling for replicate transactions that fail to be applied to the target database For more information see Setting Up Error Logging on page 6 11 and Chapter 9 Monitoring and Troubleshooting Enterprise Replication ris R Activates row information spooling for replicate row data that fails conflict resolution or encounters replication ord
198. heir roots For example a replication message from Beijing to France must pass through China Asia and Europe Organizing the database servers in a hierarchical tree or a forest of trees greatly reduces the number of physical connections that are required to make a replication system If all the database servers in Figure 3 12 were fully connected instead of being organized in trees 55 connections would be required To ensure that all servers retain access to the replication system use HDR on parent servers For more information see Using HDR in a Forest of Trees Topology on page 5 7 Selecting the Enterprise Replication System and Network Topology 3 23 Preparing the Replication Environment In This Chapter Preparing the Network Environment Setting Up the Hosts File Setting Up the Services File Setting Up the Trusted Environment Verifying SOLHOSTS Setting up Database Server Oups EO Hierarchical Routing Topologies and SQLHOSTS Network Encryption and SOLHOSTS Testing the Network Environment Preparing the Disk Planning for Disk Space Requirements Logical Log Configuration Disk Space Logical Log Configuration Guidelines Delete Table Disk Space e Shadow Column Disk Space Setting Up Send and Receive Queue Spool Areas Transaction Record dbspace Row Data sbspaces Setting Up the Grouper Paging File Creating ATS and RIS Directories Preparing the Database Server Environment Setting Enviro
199. hould be replicated every five hours 1 cdr def repl c ohio C timestamp spl 2 S tran A e 5 00 I newrepl 3 dbl iowa antonio tablel select from tablel 4 db2 utah carlo table2 select from table2 See Also cdr change replicate on page A 4 cdr delete replicate on page A 24 cdr list replicate on page A 38 cdr modify replicate on page A 48 cdr resume replicate on page A 59 cdr start replicate on page A 67 cdr stop replicate on page A 73 cdr suspend replicate on page A 77 Command Line Utility Reference A 15 Command Syntax cdr define replicateset cdr define replicateset The cdr define replicateset or cdr define replset command defines a replicate set A replicate set is a collection of several replicates to be managed together Important Enterprise Replication supports replicate sets for IBM Informix Dynamic Server Version 9 3 and later only You cannot define or modify replicate sets to include replicates with participants that are Version 9 2 and earlier In addition replicate sets are different from and are incompatible with replicate groups in Version 9 2 and earlier Syntax repl set M onem Connect Option p A 87 exclusive Frequency Options p A 92 Element Purpose Restrictions Syntax repl set Name of replicate set to create The name must beuniqueand Long Identifiers cannot
200. hreads started for each CPU VP Specifying a large number of threads can result in wasted resources Use the CDR_ENV configuration parameter to set this environment variable For more information see CDR_ENV Configu ration Parameter on page B 5 Important Do not use the CDR_RMSCALEFACT environment variable unless instructed to do so by Technical Support IBM Informix Dynamic Server Enterprise Replication Guide onstat Command Reference This appendix describes forms of the onstat command that are relevant to Enterprise Replication The onstat utility reads shared memory structures and provides statistics about the database server that are accurate at the instant that the command executes The system monitoring interface SMI also provides information about the database server For general information about onstat and SMI refer to the Administrator s Reference For information specific to Enterprise Replication see Appendix D SMI Table Reference onstat g Command Summary Command Page onstat g ath C 3 onstat g cat C 4 onstat g ddr C 5 onstat g dss CS onstat g dtc C 6 onstat g grp C46 onstat g nif C 8 onstat g que C 8 onstat g rcv C 9 onstat g rep C 10 onstat g rqm C 10 The onstat g commands are provided for support and debugging only You can include only one of these options with each onstat g command This appendix describes the following onstat g commands C 2 BM Informix Dynamic S
201. iated to replset For example the following commands are equivalent cdr define replicateset cdr def replset Option Abbreviations Each option for a command has a long form and a short form You can use either form and you can mix long and short forms within a single command For example using long forms on UNIX you can write cdr define server connect ohio idle 500 ats cdr ats initial utah On Windows this command line might look like cdr define server connect ohio idle 500 ats D cdr ats initial utah Using short forms you can write the previous examples as follows cdr def ser c ohio i 500 A cdr ats I utah A 84 IBM Informix Dynamic Server Enterprise Replication Guide Option Order cdr def ser c ohio i 500 A D cdr ats I utah The long form is always preceded by a double minus Most but not all long forms require an equal sign between the option and its argument The short form is preceded by a single minus and is the first letter of the long form The short form never requires an equal sign However sometimes the short form is capitalized and sometimes not To find the correct syntax for the short form check the table that accompanies each command variation Tip Use the long forms of options to increase readability With the exception of the keyword transaction all keywords or letter combi nations that modify the command options must be written as sho
202. ic in Figure 1 5 to evaluate whether any information is sent to the destination database server Figure 1 4 Replicate SAL SELECT emp_id salary FROM employee WHERE exempt N Insert Followed by an Update dallas_office phoenix_office BEGIN WORK BEGIN WORK INSERT INTO employee VALUES 927 Smith N INSERT INTO employee VALUES 927 Jones UPDATE employee SET Iname Jones WHERE emp id 927 COMMIT WORK COMMIT WORK 1 16 IBM Informix Dynamic Server Enterprise Replication Guide Evaluating Data for Replication Figure 1 5 Insert Followed by An Update Evaluation Logic Replicate Replicate Primary Key Send to Destination Database Initial Image Evaluates Final Image Evaluates Changed Server INSERT TorF UPDATE T Yes or no INSERT with final row image The replicate WHERE clause imposes the restriction that only rows with the exempt column equal to N are replicated Enterprise Replication evaluates the transaction an insert followed by an update and converts it to an insert to propagate the updated final image In Figure 1 6 Enterprise Replication uses the logic in Figure 1 7 to evaluate whether any information is sent to the destination database server Figure 1 6 Replicate SQL SELECT emp id salary FROM employee WHERE exempt N Update Not Selected to dallas office phoeni
203. icate row data that fails conflict resolution or encounters replication order problems For more information see Chapter 9 Monitoring and Troubleshooting Enterprise Replication The following example connects to the database server paris and modifies the idle time out of server group g rome to 10 minutes ATS files go into the cdr modify server c paris i 10 A cdr atsdir g rome The following example connects to the default database server and sets the modes of all participants on g geometrix to primary cdr mod ser m primary g geometrix Command Syntax See Also cdr connect server on page A 9 cdr define server on page A 19 cdr delete server on page A 28 cdr disconnect server on page A 32 cdr list server on page A 44 cdr resume server on page A 63 cdr suspend server on page A 81 Command Line Utility Reference A 57 Command Syntax cdr remove The cdr remove command removes Enterprise Replication from an HDR database server Syntax cdr remove Usage Use this command to remove Enterprise Replication from an HDR primary server after it has been started using the oninit D command For more infor mation see HDR Failure on page 5 11 The cdr remove command removes Enterprise Replication from a database server by deleting its global catalog information Unlike the cdr delete command this command can only be issued when Enterprise Replication is not active The data
204. icate on page A 73 cdr suspend replicate on page A 77 A 68 IBM Informix Dynamic Server Enterprise Replication Guide Command Syntax cdr start replicateset The cdr start replicateset or cdr start replset command starts the capture and transmittal of replication transactions for all the replicates in a replicate set Syntax cdr start replicateset repl set C X Vi 2 V Connect Option i server group 87 p A Element Purpose Restrictions Syntax repl set Name of replicate set to start The replicate set must exist Long Identifiers on page A 86 server group Names of database server groups The database server groups must on which to start the replicate set be defined for Enterprise Replication The replicates defined in the replicate set rep set enter the active state capture send on the database servers in server group If the server group list is omitted the replicate set repl set enters the active state for all database servers participating in the replicate set Because Enterprise Replication does not process log records that were produced before the cdr start replicateset command took place transactions that occur during this period might be partially replicated To avoid problems either issue the cdr start replicateset command on an idle system no transactions are occurring or use the BEGIN WORK WITHOUT REPLI CATION statement until after you successfully start the repli
205. icated data might include UDT and CLOB or BLOB data types therefore the spooled row data is stored as smart large objects in one or more sbspaces Important Before starting Enterprise Replication you must create at least one sbspace for spooled row data and set the CDR QDATA SBSPACE configuration parameter to its location The CDR_QDATA_SBSPACE configuration parameter accepts multiple sbspaces up to a maximum of 32 sbspaces Enterprise Replication can support a combination of logging and non logging sbspaces for storing spooled row data If CDR ODATA SBSPACE is configured for multiple sbspaces then Enterprise Replication uses all appropriate sbspaces in round robin order For more information see CDR_QDATA_SBSPACE Configu ration Parameter on page B 11 Creating sbspaces for Spooled Row Data Follow these guidelines when creating sbspaces for spooled row data m Create all the sbspaces of same default log mode type with the same size m Do not use Enterprise Replication row data sbspaces for non Enter prise Replication activity m Ensure that the sbspaces are sufficiently large To determine the size of your spooled row data sbspaces determine your log usage and then consider how much data you can collect if your network goes down For example assume that you usually log 40 megabytes of data each day but only 10 percent of that is rep licated data If your network is down for 24 hours and you estima
206. ication displays information about the current server including server ID server state and attributes For more information see cdr list server on page A 44 Connecting to Another Replication Server By default when you view information about a server Enterprise Repli cation connects to the global catalog of the database server specified by INFORMIXSERVER You can connect to the global catalog of another database server using the connect option For example to connect to the global catalog of the database server idaho enter cdr list server connect idaho For more information see Global Catalog on page 2 6 and Connect Option on page A 87 Stopping Replication on a Server Enterprise Replication starts automatically when you use cdr define server to declare the server for replication The replication threads continue running until you shut the database server down or you remove the server with cdr delete server If you shut down the database server while Enterprise Repli cation is running replication begins again when you restart the database server For more information about managing the database server see the chapter on database operating modes in the IBM Informix Dynamic Seroer Administrator s Guide 7 4 BM Informix Dynamic Server Enterprise Replication Guide Restarting Replication on a Stopped Server Generally to stop Enterprise Replication on a server you should bring down the server However
207. ies 4 8 INFORMIXSQLHOSTS environment variable F 2 leaf servers 4 8 nonroot servers 4 8 on UNIX E 2 on Windows F 1 preparing connectivity information F 3 registry key F 1 F 8 local F 2 setting up F 3 shared F 2 root servers 4 8 setting up with ISA 4 8 F 3 specifying registry host machine 4 20 SQLHOSTS file database server groups for HDR 5 9 encryption setting up for 4 8 example 4 6 format 9 18 server group 2 5 setting up 4 5 specifying location 4 20 UNIX 4 6 Starting data delivery for replicate sets A 69 for replicates A 67 Enterprise Replication A 65 replicate sets 8 7 replicates 7 8 starts command 6 4 STATE column cdr list server output A 45 JK L MN O P QR STATE field cdr list replicate output A 40 Statements ALTER TABLE 4 26 BEGIN WORK WITHOUT REPLICATION 4 22 CREATE TABLE 4 26 DROP CRCOLS 4 26 LOAD 4 26 4 28 SELECT 4 27 SQL supported 2 15 UNLOAD 4 28 WITH CRCOLS 4 25 States active 7 8 inactive 7 8 STATUS column cdr list server output A 45 Stopping data capture for replicate sets A 75 for replicates A 73 Enterprise Replication A 71 replicate sets 8 7 replicates 7 8 replication 7 4 server connection A 32 Storage delete tables 4 11 increasing size of spaces 9 16 spooled transactions 4 13 Stored procedure language See SPL routines stores_demo database Intro 5 Storing data in tblspaces 2 21 streamread support functions 2 25 4 25 streamwrite support functions 2 25 4 25 Summary commands
208. in server group If no server is specified the repl name starts on all servers that are included in the replicate A replicate can have both active and inactive participants When at least one participant is active the replicate is active Important You cannot start replicates that have no participants L Important If a replicate belongs to an exclusive replicate set you cannot run cdr start replicate to start that individual replicate You must use cdr start replica teset to start all replicates in the exclusive replicate set L Command Line Utility Reference A 67 Command Syntax Because Enterprise Replication does not process log records that were produced before the cdr start replicate command took place transactions that occur during this period might be partially replicated To avoid problems either issue the cdr start replicate command on an idle system no transactions are occurring or use the BEGIN WORK WITHOUT REPLICATION statement until after you successfully start the replicate Example The following command starts the replicate accounts on the server groups g svr1 and g svr2 cdr sta rep accounts g svrl g svr2 See Also cdr change replicate on page A 4 cdr define replicate on page A 10 cdr delete replicate on page A 24 cdr list replicate on page A 38 cdr modify replicate on page A 48 cdr resume replicate on page A 59 cdr stop repl
209. in the process of being defined Suspended Indicates that delivery of replication data to the server is suspended The STATUS Column The STATUS column can have the following values Connected Indicates that the server connection is up Connecting Indicates that the server is attempting to connect Disconnect Indicates that the server connection is down in response to an explicit disconnect Dropped Indicates that the server connection is down due to a network error because the server is unavailable Error Indicates that an error has occurred check the log and contact customer support if necessary Local Identifies that this server is the local server as opposed to a remote server Timeout Indicates that the connection is down due to an idle timeout Command Line Utility Reference A 45 Command Syntax The QUEUE Column The QUEUE column displays the size of the queue for the server group The CONNECTION CHANGED Column The CONNECTION CHANGED column displays the most recent time that the status of the server connection was changed Displaying Details about a Single Replication Server When the cdr list server command includes the name of a database server group the command displays the attributes of that database server For example cdr list server g usa might give the following output NAME ID ATTRIBUTES g usa 3 timeout 15 atsdir w ats risdir w ris Examples In Figure A 2 and in the following examples usa an
210. inistrator s Reference Recovering when Storage Spaces Fill When the Enterprise Replication dbspace runs out of disk space Enterprise Replication raises an alarm and writes a message to the log When the sbspace runs out of disk space Enterprise Replication hangs In either case you must resolve the problem that is causing Enterprise Replication to spool Preventing Memory Queues from Overflowing on page 9 12 or you must allocate additional disk space Increasing the Sizes of Storage Spaces on page 9 16 before you can continue replication Solving Common Configuration Problems If you experience problems setting up Enterprise Replication check the following m Make sure that you created an sbspace for the row data and set the CDR QDATA SBSPACE in the ONCONFIG file For more information see Setting Up Send and Receive Queue Spool Areas on page 4 12 and CDR_QDATA_SBSPACE Configu ration Parameter on page B 11 m Verify that the trusted environment is set up correctly For more information see Setting Up the Trusted Environment on page 4 5 m Verify that your SOLHOSTS file is set up properly on each server participating in replication You must set up database server groups in the SOLHOSTS file For more information see Verifying SOLHOSTS on page 4 5 Monitoring and Troubleshooting Enterprise Replication 9 17 Solving Common Configuration Problems m Verify the format of the SOLHOSTS file The network c
211. inition 8 5 Viewing Replicate Set Properties 8 6 Managing Replicate Sets 8 6 Starting a Replicate Set 8 7 Stopping a Replicate Set 8 7 Suspending a Replicate Set 8 7 Resuming a Replicate Set 8 8 Deleting a Replicate Set 8 8 Modifying Replicate Sets 8 9 Adding or Deleting Replicates Piroti a Replicate Set 8 9 Changing Replication Frequency For the Replicate Set 8 10 Table of Contents vii viii Chapter 9 Monitoring and Troubleshooting Enterprise Replication In This Chapter Aborted Transaction Eroa Files Preparing to Use ATS About ATS Filenames About ATS File Information BYTE and TEXT Information in ATS Files Changed Column Information in ATS Files BLOB and CLOB Information in ATS Files UDT Information in ATS Files Row Information Spooling Files Preparing to Use RIS About RIS Filenames BYTE and TEXT Information in RIS Files Changed Column Information in RIS Files BLOB and CLOB Information in RIS Files UDT Information in RIS Files Preventing Memory Queues from Overflowing Preventing DDRBLOCK Mode Monitoring Disk Usage for Send and Receive Queue Soal Increasing the Sizes of Storage Spaces Recovering when Storage Spaces Fill Solving Common Configuration Problems Enterprise Replication Event Alarms IBM Informix Dynamic Server Enterprise Replication Guide 9 10 9 11 9 12 9 12 9 12 9 12 9 14 9 16 9 16 9 17 9 17 9 20 section Ill Appendixes Appendix A Comma
212. is the user s responsibility to evaluate and verify the operation of any non IBM product program or service IBM may have patents or pending patent applications covering subject matter described in this document The furnishing of this document does not give you any license to these patents You can send license inquiries in writing to IBM Director of Licensing IBM Corporation North Castle Drive Armonk NY 10504 1785 U S A For license inquiries regarding double byte DBCS information contact the IBM Intellectual Property Department in your country or send inquiries in writing to IBM World Trade Asia Corporation Licensing 2 31 Roppongi 3 chome Minato ku Tokyo 106 0032 Japan 6 2 The following paragraph does not apply to the United Kingdom or any other country where such provisions are inconsistent with local law INTERNATIONAL BUSINESS MACHINES CORPORATION PROVIDES THIS PUBLICATION AS IS WITHOUT WARRANTY OF ANY KIND EITHER EXPRESS ORIMPLIED INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF NON INFRINGEMENT MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE Some states do not allow disclaimer of express or implied warranties in certain transactions therefore this statement may not apply to you This information could include technical inaccuracies or typographical errors Changes are periodically made to the information herein these changes will be incorporated in new editions of the publicati
213. isplays the row data in hexadecimal format in the ATS file This represen tation includes a column number in the form cnnn where nnn is the column number For example RRS C001 0000000a RRS C002 394925cb 9ISE RRD C003 00000016 e RRD C004 074b4d70 5d6f784a 00000000 00000000 KMploxJ 9 8 IBM Informix Dynamic Server Enterprise Replication Guide How Information Spooling Files Row Information Spooling Files Row Information Spooling logs the following types of information in RIS files m Individual aborted row errors m Replication exceptions such as when a row is converted by Enter prise Replication from insert to update or from update to insert and so on m Special SPL routine return codes as defined by the application if an SPL routine is called to resolve a conflict Preparing to Use RIS Failed transactions are not automatically recorded in RIS files To collect RIS information 1 Create a directory for Enterprise Replication to store RIS files If you have conflict resolution enabled create the directory on all participating replication systems For more information see Creating ATS and RIS Directories on page 4 19 When you define a server for Enterprise Replication specify the location of the RIS directory you created in step 1 To do this include the ris option with the cdr define server command If you do not specify an RIS directory Enterprise Replication stores the RIS
214. ituations a Replicated systems with HDR Enterprise Replication must use logging sbspaces for transac tions involved in HDR Q Small transactions Enterprise Replication uses logging sbspaces for transactions that are less than a page size 2K or 4K of replicated data For logging sbspaces performance might be enhanced because log ging mode enables asynchronous IO However a logging sbspace consumes additional logical log space m LOGGING OFF Create sbspaces with LOGGING set to OFF to support replication of large transactions greater than a page size of replicated data It is recommended that you mirror non logging sbspaces For more information see the chapter on managing disk space in the IBM Informix Dynamic Server Administrator s Guide and the utilities chapter in the IBM Informix Administrator s Reference For non logging sbspaces performance is enhanced on the database server when Enterprise Replication spools to disk because Enterprise Replication writes less data to disk 4 16 IBM Informix Dynamic Server Enterprise Replication Guide Setting Up Send and Receive Queue Spool Areas Warning Do not change the Enterprise Replication sbspace default log mode while Enterprise Replication is running To change the default log mode follow the procedure below You can change the default logging mode of the row data sbspace if you have more than one sbspace specified by the CDR_QDATA_SBSPACE configuration paramete
215. ive integer number to look up You can also view the Enterprise Replication error messages in the file INFORMIXDIR incl esql cdrerr h Command Line Utility Reference A 37 Command Syntax cdr list replicate The cdr list replicate command displays information about the replicates on the current server Syntax cdr list replicate U Connect Option n brief BOT replicate R full Element Purpose Restrictions Syntax replicate Name of the replicates The replicates must exist Long Identifiers on page A 86 Usage The cdr list replicate command displays information about replicates the full option If no replicates are named the command lists all replicates on the current server If one or more replicates are named the command displays detailed information about those replicates To display only replicate names and participant information use the brief option You do not need to be user informix to use this command In hierarchical topology leaf servers have limited information about other database servers in the Enterprise Replication domain Therefore when cdr list replicate is executed against a leaf server it displays incomplete infor mation about the other database servers A 38 IBM Informix Dynamic Server Enterprise Replication Guide REPLICATE Example with full details cdr list replicate with brief details TABLE cdr list replicate brief CURRE
216. ive queue row data to an sbspace For more information see Large Transactions on page 2 15 For more information see Setting Up Send and Receive Queue Spool Areas on page 4 12 and Preventing Memory Queues from Overflowing on page 9 12 The data contains the filtered log records for a single transaction Enterprise Replication stores the replication data in a stable recoverable send queue on the source database server Target sites acknowledge receipt of data when it is applied to or rejected from the target database If a target database server is unreachable the replication data remains in a stable queue at the source database server Temporary failures are common and no immediate action is taken by the source database server it continues to queue transactions When the target database server becomes available again queued transactions are transmitted and applied see Applying Replicated Data on page 1 18 IBM Informix Dynamic Server Enterprise Replication Guide Evaluating Data for Replication If the target database server is unavailable for an extended period the send queue on the source database server might consume excessive resources In this situation you might not want to save all transactions for the target database server To prevent unlimited transaction accumulation you can remove the unavailable target database server from the replicate see Managing Replication Servers on page 7 3 Before
217. ividually and as part of the set m Because individual replicates in a non exclusive replicate set can have different states the non exclusive replicate set itself has no state m You should not use non exclusive replicate sets for replicates that include tables that have referential constraints placed on columns m A replicate can belong to more than one non exclusive replicate set Important Once you create a non exclusive replicate set you cannot change it to exclusive Use non exclusive replicate sets if you want to add a replicate to more than one replicate set For example you might want to create replicate sets to manage replicates on the target server table or entire database To do this create three non exclusive replicate sets m Aset that contains the replicates that replicate to the target server m A set that contains the replicates on a particular table m A set that contains all the replicates In this scenario each replicate belongs to three non exclusive replicate sets Customizing the Replicate Set Definition You can specify the replication frequency Specifying Replication Frequency on page 6 10 for all the replicates when you define the replicate set For example to define the non exclusive replicate set sales set with the replicates sales fiji and sales tahiti and specify that the members of sales set replicate at 4 00 A M every day enter cdr define replicateset at 4 00 sales set sales fiji Sale
218. ix Dynamic Server Enterprise Replication Guide Evaluating Data for Replication Evaluating Rows for Updates Enterprise Replication evaluates rows for primary key updates for WHERE clause column updates and for multiple updates to the same row The following list describes an occurrence in a transaction and the Enterprise Replication action m Primary key updates Enterprise Replication translates an update of a primary key into a delete of the original row and an insert of the row image with the new primary key If triggers are enabled on the target system insert triggers are executed m WHERE clause column updates If a replicate includes a WHERE clause in its data selection the WHERE clause imposes selection criteria for rows in the replicated table a If an update changes a row so that it no longer passes the selection criteria on the source it is deleted from the target table Enterprise Replication translates the update into a delete and sends it to the target a Ifan update changes a row so that it passes the selection criteria on the source it is inserted into the target table Enterprise Repli cation translates the update into an insert and sends it to the target m Multiple row images in a transaction Enterprise Replication compresses multiple row images and only sends the net change to the target Because of this triggers might not execute on the target database For more information see Triggers on p
219. ked transpool N no transaction spooling is invoked primresolution char 1 Type of primary conflict resolution I ignore T time stamp S SPL routine secresolution char 1 Type of secondary conflict resolution D 8 IBM Informix Dynamic Server Enterprise Replication Guide S SPL routine Null not configured 10f2 Column Type syscarreplset Description storedprocname lvarchar Name of SPL routine for secondary conflict resolution Null if not defined floattype char 1 C converts floating point numbers to canonical format I converts floating point numbers to IEEE format N does not convert floating point numbers sends in native format istriggerfire char 1 Y triggers are invoked N triggers are not invoked isfullrow char 1 Y sends the full row and enables upserts N sends only changed columns and disables upserts 2 of 2 syscdrreplset The syscdrreplset table contains replicate set information Column Type Description replname lvarchar Replicate name replsetname lvarchar Replicate set name SMI Table Reference D 9 syscdrs D 10 IBM Informix Dynamic Server Enterprise Replication Guide syscdrs The syscdrs table contains information about database servers that have been declared to Enterprise Replication Column Type Description servid integer Server identifier servname char 128 Database server name cnnstate char 1 Status of conn
220. ks up transactions from this queue and applies them on the target For information on the columns of the syscdrrecv_buf table refer to Columns of the Buffer Tables on page D 17 syscdrrecv_txn The syscdrrecv txn table contains information about the data receive queue The receive queue is an in memory queue When a replication server receives replicated data from a source database server it puts this data on the receive queue picks up transactions from this queue and applies them on the target For information on the columns of the syscdrrecv_txn table refer to Columns of the Transaction Tables on page D 16 SMI Table Reference D 7 syscarrepl syscdrrepl The syscdrrepl table contains replicate information Column Type Description replname Ivarchar Replicate name replstate char 50 Replicate state For possible values refer to The STATE Column on page A 45 freqtype char 1 Type of replication frequency C continuous I interval T time based M day of month W day of week freqmin smallint Minute after the hour refresh should occur Null if continuous freqhour smallint Hour refresh should occur Null if continuous freqday smallint Day of week or month refresh should occur scope char 1 Replication scope T transaction R row by row invokerow char 1 Y row spooling is invoked spool N no row spooling is invoked invoke char 1 Y transaction spooling is invo
221. l catalog enter cdr delete replicate sales data Warning Avoid deleting a replicate and immediately re creating it with the same name If you re create the objects immediately before the operation finishes propa gating to the other Enterprise Replication database servers in the network failures might occur in the Enterprise Replication system at the time of the operation or later For more information see Operational Considerations on page 2 8 For more information see cdr delete replicate on page A 24 7 10 BM Informix Dynamic Server Enterprise Replication Guide Managing Replication Server Network Connections Managing Replication Server Network Connections Managing replication network connections consists of viewing the network connection status dropping the network connection and reestablish a dropped network connection Viewing Network Connection Status To determine the current status of the network connection to each of the servers participating in replication use cdr list server For more information about network connection status see The STATUS Column on page A 45 For more information see cdr list server on page A 44 Dropping the Network Connection To drop the Enterprise Replication network connection for a server use the cdr disconnect server command When you drop the connection Enterprise Replication continues to function and queue transactions For example to disconnect the netwo
222. licate Set A replicate set combines several replicates to form a set that can be adminis tered together as a unit If your replication system contains many replicates that you define as part of a replicate set you can use a single command to start stop suspend or resume all the replicates in the set For more information see Chapter 8 Creating and Managing Replicate Sets and cdr change replicateset on page A 6 Global Catalog Each database server that participates in Enterprise Replication maintains tables in the syscdr database to keep track of Enterprise Replication configu ration information and state For all root and nonroot replication servers this catalog is a global catalog that maintains a global inventory of Enterprise Replication configuration information The global catalog is created when you define the server for replication For more information see Replication Topology Terms on page 3 20 2 6 IBM Informix Dynamic Server Enterprise Replication Guide Global Catalog The global catalog includes the following Enterprise Replication server definitions and state Routing and connectivity information Replicate definitions and state Participant definitions and state Replicate set definitions and state Conflict detection and resolution rules and any associated SPL routines The tables in one global catalog instance are automatically replicated to the global catalogs of all other replication s
223. licates 6 7 to 6 14 A 10 replication servers 6 3 6 5 A 19 shadow columns 4 25 Definition Failed state A 40 delete option 6 15 8 9 cdr change replicate A 4 cdr change replicateset A 6 Delete tables capacity planning 4 12 definition of 1 19 4 11 disk space 4 11 in conflict resolution 3 13 3 15 storage 4 11 timestamp conflict resolution rule 4 11 Deleted state server A 45 Deletes cascading See Cascading deletes Deleting Enterprise Replication objects 2 9 participants from replicates 6 15 A 4 replicate sets 8 8 A 26 replicates from global catalog 7 10 A 24 replicates from replicate sets 8 9 A 6 replication servers 7 6 A 28 Deluxe mode without replication 4 27 JK L MN OP QRS TU VW X Y Z Demonstration databases Intro 5 Dependencies software Intro 4 Designing databases and tables 2 9 Determining size logical log files 4 10 spooled row data sbspace 4 14 transaction record dbspace 4 13 Directories INFORMIXDIR bin Intro 5 INFORMIXDIR gls cv9 2 18 specifying ATS location 6 6 RIS location 6 6 spooling planning for capacity 4 19 Disconnect status replication servers A 45 Disconnecting server connection A 32 Disk space requirements delete table 4 11 message queue spooling 4 12 planning 4 10 shadow columns 4 12 Disk usage monitoring 9 16 Disk preparing for Enterprise Replication 4 10 Displaying information about replicates A 40 Distributed transactions definition of 2 14 two phase commit 2 14 Distribu
224. lication requirements and does not impose model or methodology restrictions on the enterprise Enterprise Replication supports both primary target and update anywhere replication models For more information see Selecting the Enterprise Replication System on page 3 3 Enterprise Replication supports the following network topologies m Fully connected Continuous connectivity between all participating database servers m Hierarchical tree A parent child configuration that supports continuous and intermit tent connectivity m Forest of trees Multiple hierarchical trees that connect at the root database servers About IBM Informix Enterprise Replication 1 7 Centralized Administration You can add High Availability Data Replication to any of these topologies For more information on topologies see Choosing a Replication Network Topology on page 3 18 Enterprise Replication supports all built in Informix data types as well as extended and user defined data types For more information see Enterprise Replication Data Types on page 2 19 Enterprise Replication operates in a LAN WAN and combined LAN WAN configuration across a range of network transport protocols Enterprise Replication supports the Global Language Support GLS feature which allows IBM Informix products to handle different languages regional conventions and code sets For more information see Using GLS with Enterprise Replication on page 2 18 Centr
225. llowing table describes replname and scope Modifier Description replname The name of a replicate scope One of the following values m servers Print information on servers only m repls Print information on replicates only m full Print expanded information for both replicate servers and replicates onstat g ddr The onstat g ddr command prints the status of the Enterprise Replication database log reader The ddr or ddr snoopy is an internal component of Enterprise Replication that reads the log buffers and passes information to the grouper If log reading is blocked data might not be replicated until the problem is resolved If the block is not resolved the database server might overwrite the read snoopy position of Enterprise Replication which means that data will not be replicated Once this occurs you must manually resyn chronize the source and target databases If dynamic log creation is enable with the CDR MAX DYNAMIC LOGS configuration parameter this command prints the number of dynamic log requests made onstat g dss The onstat g dss command prints detailed statistical information about the activity of individual data sync threads The data sync thread applies the transaction on the target server Statistics include the number of applied transactions and failures and when the last transaction from a source was applied The onstat g dss command has the following formats onstat g dss onstat g dss modifier
226. logies HR Topology Terminology Enterprise Replication uses the terms in the Figure 3 10 to describe Hierar chical Routing topology Figure 3 10 Replication Topology Terms Term Definition Root server An Enterprise Replication server that is the uppermost level in a hierarchically organized set of information The root is the point from which database servers branch into a logical sequence All root database servers within Enter prise Replication must be fully interconnected Nonroot server An Enterprise Replication server that is not a root database server but has a complete global catalog and is connected to its parent and to its children Tree A data structure that contains database servers that are linked in a hierarchical manner The topmost node is called the root The root can have zero or more child database servers the root is the parent database server to its children Parent child A relationship between database servers in a tree data structure in which the parent is one step closer to the root than the child Leaf server A database server that has a limited catalog and no children A root server is fully connected to all other root servers It has information about all other replication servers in its replication environment Figure 3 9 on page 3 19 shows an environment with four root servers A nonroot server is similar to a root server except that it forwards all replicated messages for other root
227. ly burdening the source of the data and by using networks and all other resources efficiently Because Enterprise Replication captures changes from the logical log instead of competing with transactions that access production tables Enterprise Replication minimizes the effect on transaction performance Because the capture mechanism is internal to the database the database server implements this capture mechanism efficiently For more information see Log Based Data Capture on page 1 5 All Enterprise Replication operations are performed in parallel which further extends the performance of Enterprise Replication For more infor mation see Functionality Improvements on page 6 of the Introduction High Availability Because Enterprise Replication implements asynchronous data replication network and target database server outages are tolerated In the event of a database server or network failure the local database server continues to service local users The local database server stores replicated transactions in persistent storage until the remote server becomes available If high availability is critical you can use High Availability Data Replication HDR in conjunction with Enterprise Replication HDR supports synchronous data replication between two database servers a primary server which can participate in Enterprise Replication and a secondary server which is read only and does not participate in Enterprise Replication I
228. m Any action that a routine takes as a result of replication does not replicate m You cannot use an SPL routine to start another transaction m Frequent use of routines might affect performance 3 16 IBM Informix Dynamic Server Enterprise Replication Guide Conflict Resolution In addition you must determine when the SPL routine executes m An optimized SPL routine is called only when a collision is detected and the row to be replicated fails to meet one of the following two conditions a Itis from the same database server that last updated the local row on the target table a Ithas a time stamp greater than or equal to that of the local row m A nonoptimized SPL routine executes every time Enterprise Repli cation detects a collision By default SPL routines are nonoptimized For information on specifying that the SPL routine is optimized see Conflict Options on page A 11 Tip Do not assign a routine that is not optimized as a primary conflict resolution rule for applications that usually insert rows successfully Scope Each conflict resolution rule behaves differently depending on the scope Enterprise Replication uses the following scopes m Row scope When you choose a row scope Enterprise Replication evaluates one row at a time It only applies replicated rows that win the conflict res olution with the target row If an entire replicated transaction receives row by row evaluation some replicated rows are
229. mand Syntax Important If a replicate belongs to an exclusive replicate set you cannot run cdr Cc stop replicate to stop that individual replicate You must use cdr stop replicateset to stop all replicates in the exclusive replicate set Example The following command connects to the database server lake and stops the replicate aRepl on server groups g_server1 and g server2 cdr sto rep c lake aRepl g serverl g server2 See Also cdr change replicate on page A 4 cdr define replicate on page A 10 cdr delete replicate on page A 24 cdr list replicate on page A 38 cdr modify replicate on page A 48 cdr resume replicate on page A 59 cdr start replicate on page A 67 cdr suspend replicate on page A 77 A 74 IBM Informix Dynamic Server Enterprise Replication Guide Command Syntax cdr stop replicateset The cdr stop replicateset or cdr stop replset command stops capture and transmittal transactions for all the replicates in a replicate set Syntax cdr stop replicateset repl set C aa T bu Connect Option a server_group p A 87 Element Purpose Restrictions Syntax repl_set Name of replicate set to stop Long Identifiers on page A 86 server group Name of database server group The database server groups must on which to stop the replicate be defined for Enterprise group Replication The cdr stop replicateset command causes all
230. mary target E 3 replicate sets A 76 A 80 replication E 1 to E 14 replication environment E 1 resuming replicate sets 8 8 Index 7 A BC D EF GH replicates 7 10 replication servers 7 6 RIS filenames 9 10 services file 4 5 SOLHOSTS file 4 6 starting replicate sets 8 7 replicates 7 8 stopping replicate sets 8 7 replicates 7 8 suspending replicate sets 8 7 replicates 7 9 replication 7 6 unloading shadow columns 4 27 update anywhere E 6 updating shadow columns 4 24 using ESQL C 4 24 Exclusive locks 2 15 exclusive option 8 4 A 17 Exclusive replicate sets adding replicates to 8 9 characteristics of 8 4 definition of 8 4 exclusive option 8 4 A 17 managing replicates 7 7 referential constraints 6 11 resuming replicates 7 10 starting replicates 7 8 stopping replicates 7 9 suspending replicates 7 9 Extended data types support for 2 25 Extensible data types support for Intro 6 F Failed transactions and RIS files 6 11 9 9 recorded in ATS files 6 11 9 3 Fail safe replication system 3 8 Feature icons Intro 10 Features extensible data types Intro 6 new Intro 5 to Intro 7 JK L MN OP QRS TU VW X Y Z Files cdrerr h A 37 hosts 4 4 hosts equiv 4 5 logical log 4 11 ONCONFIG 2 12 4 20 services 4 4 4 5 SQLHOSTS 4 5 4 6 4 20 rhosts 4 5 etc hosts 4 4 etc hosts equiv 4 5 etc services 4 4 etc hosts 4 4 etc hosts equiv 4 5 etc services 4 4 finderr utility Intro 16 firetrigger option 6 14 A 14 mo
231. me of the replicate The replicate must be active Long Identifiers on page A 86 Usage The cdr suspend replicate command causes the replicate repl_name to enter the suspend state capture no send for all participants Warning When a replicate is suspended Enterprise Replication holds the replication data in the send queue until the replicate is resumed If a large amount of data is generated for the replicate while it is suspended the send queue space can fill causing data to be lost Warning Enterprise Replication does not synchronize transactions if a replicate is suspended For example a transaction that updates tables X and Y will be split if replication for table X is suspended gt Important If a replicate belongs to an exclusive replicate set you cannot run cdr suspend replicate to stop that individual replicate You must use cdr suspend replicateset to suspend all replicates in the exclusive replicate set Command Line Utility Reference A 77 Command Syntax Example The following example connects to the database server stan and suspends the replicate house cdr sus repl connect stan house See Also cdr change replicate on page A 4 cdr define replicate on page A 10 cdr delete replicate on page A 24 cdr list replicate on page A 38 cdr modify replicate on page A 48 cdr resume replicate on page A 59 cdr start replicate on page A 67 cdr stop replic
232. me stamp on the column on the local row the data for the column is accepted for replication m If there is no SPL conflict resolution rule and the timestamps are equal then the row with the lowest CDR server ID wins Overview of Enterprise Replication Administration 2 21 Enterprise Replication Data Types SPL Conflict Resolution for Simple Large Objects If the replicate is defined with an SPL conflict resolution rule the SPL routine must return the desired action for each BYTE or TEXT column When the routine is invoked information about each BYTE or TEXT column is passed to the routine as five separate fields The following table describes the fields Argument Description Column size INTEGER The size of the column if data exists for this column NULL if the column is NULL BLOB flag CHAR 1 For the local row the field is always NULL For the replicated row m Dindicates BYTE or TEXT data is sent from the source database server m Uindicates BYTE or TEXT data is unchanged on the source database server Column type CHAR 1 m P indicates tablespace data m B indicates blobspace data ID of last update server The ID of the database server that last updated CHAR 18 this column for tablespace data For blobspace data NULL Last update time DATETIME For tablespace data The date and time when the YEAR TO SECOND data was last updated For blobspace data NULL For information on creating stored
233. minutes To specify hours and minutes give the number of hours followed by a colon and then the number of minutes For example e 5 45 indi cates 5 hours and 45 minutes between replications Important If you specify the length of time in hours and minutes the longest interval allowed is 32767 59 A 94 IBM Informix Dynamic Server Enterprise Replication Guide Appendix Configuration Parameter and Environment Variable Reference The database server configuration file SONCONFIG includes the following configuration parameters that affect the behavior of Enterprise Replication CDR DBSPACE CDR DSLOCKWAIT CDR ENV CDR EVALTHREADS CDR MAX DYNAMIC LOGS CDR_NIFCOMPRESS CDR_QDATA_SBSPACE CDR_QHDR_DBSPACE CDR_QUEUEMEM CDR SERIAL ENCRYPT CDR ENCRYPT CIPHERS ENCRYPT MAC ENCRYPT MACFILE ENCRYPT SWITCH Important If you use both DBSERVERNAME and DBSERVERALIASES DBSERVERNAME should refer to the network connection and not to a shared memory connection For information about database server aliases refer to the IBM Informix Dynamic Server Administrator s Guide Usethe CDR ENV configuration parameter to set the following environment variables that affect the behavior of Enterprise Replication CDR LOGDELTA CDR PERFLOG CDR ROUTER CDR RMSCALEFACT B 2 IBM Informix Dynamic Server Enterprise Replication Guide CDR DBSPACE Configuration Parameter uni
234. mix Connnect installation and setup m Fornon U S English locales you might need to explicitly provide the locale and conversion files For information about how to specify a nondefault locale and other consid erations related to GLS locales see the IBM Informix GLS User s Guide IBM Informix Dynamic Server Enterprise Replication Guide L L Enterprise Replication Data Types Enterprise Replication Data Types Enterprise Replication supports built in data types and user defined data types including row types and collection types This section describes how Enterprise Replication handles special data types m Replicating on Heterogeneous Hardware m Replicating Simple and Smart Large Objects m Replicating Opaque User Defined Data Types For general information on data types refer to the IBM Informix Guide to SQL Reference Important Enterprise Replication does not support replication of simple large objects stored on optical devices Important Enterprise Replication does not verify the data types of columns in tables that participate in replication The replicated column in a table on the source database server must have the same data type as the corresponding column on the target server The exception to this rule is cross replication between simple large objects and smart large objects If you use SERIAL or SERIALS data types you must be careful when defining serial columns For
235. mix Dynamic Server Administrators Reference The CDR MAX DYNAMIC LOGS configuration parameter specifies the number of dynamic log file requests that Enterprise Replication can make in one server session For more information see Preventing DDRBLOCK Mode on page 9 14 B 8 IBM Informix Dynamic Server Enterprise Replication Guide CDR NIFCOMPRESS Configuration Parameter default value 0 range of values m 1 specifies no compression m 0 specifies to compress only if the target server expects compression m 1 9 specifies increasing levels of compression takes effect when Enterprise Replication is initialized The CDR_NIFCOMPRESS network interface compression configuration parameter specifies the level of compression that the database server uses before sending data from the source database server to the target database server Network compression saves network bandwidth over slow links but uses more CPU to compress and decompress the data The values have the following meanings Value Meaning zd The source database server never compresses the data regardless of whether or not the target site uses compression 0 The source database server compresses the data only if the target database server expects compressed data 1 The database server performs a minimum amount of compression 9 The database server performs the maximum possible compression When Enterprise Replication is defined between two database servers
236. mmand line interface m Anew brief option for the cdr list replicate command to display a summary of participants for all replicates m The cdr remove command to remove Enterprise Replication from an HDR server For more information see Appendix A Command Line Utility Reference Configuration Parameters and Environment Variable Changes The CDR_QDATA_SBSPACE configuration parameter can now accept up to 32 sbspace names The CDR_QDATA_SBFLAGS configuration parameter is no longer supported Introduction 7 Configuration Parameters and Environment Variable Changes This release includes the following new configuration parameters CDR DBSPACE to specify the dbspace of the syscdr table CDR_ENV to set Enterprise Replication environment variables ENCRYPT CDR to enable and set the level of network encryption ENCRYPT CIPHER to specify the ciphers to use for encryption ENCRYPT MAC to specify the level of message authentication coding to use ENCRYPT_MACFILE to specify MAC key files ENCRYPT SWITCH to define the frequency at which ciphers and secret keys are renegotiated This release includes the following new environment variables m CDR_LOGDELTA to determine when the send and receive queues are spooled to disk m CDR_PERFLOG to enable queue tracing m CDR ROUTER to disables intermediate acknowledgements of trans actions in hierarchical topologies m CDR_RMSCALEFACT to set the number of DataSync threads started for each C
237. mples cdr ats directory init g stan IBM Informix Dynamic Server Enterprise Replication Guide Activates aborted transaction spooling for replicate transactions that fail to be applied to the target database For more information see Chapter 9 Monitoring and Troubleshooting Enterprise Replication Activates row information spooling for replicate row data that fails conflict resolution or encounters replication order problems For more information see Chapter 9 Monitoring and Trouble shooting Enterprise Replication Causes an inactive connection to be terminated after timeout minutes If time outis 0 the connection does not time out The default value is 0 The first example defines the first database server in a replication environment The command connects to the database server stan initializes Enterprise Replication and sets the idle time out to 500 minutes The example also specifies that any files that ATS generates will go into the cdr define server connect stan idle 500 ats cdr ats Command Syntax The following example adds a database server to the replication environment in the first example The command connects to the database server oliver initializes Enterprise Replication synchronizes its catalogs with the catalogs on the existing database server stan and defines the database server oliver with an idle time out of 600 minutes This command also specifies that any files that ATS ge
238. n see cdr resume server on page A 63 Deleting a Replication Server To delete a replication server use the cdr delete server command You must run the cdr delete server command twice For example to remove the server group g papeete from Enterprise Repli cation set INFORMIXSERVER to papeete and run the following commands cdr delete server g papeete cdr delete server connect raratonga g papeete The first command deletes the local server group g papeete from Enter prise Replication and the second connects to another server in the replication environment raratonga and deletes g papeete from that server The change then replicates to the other servers in the replication environment IBM Informix Dynamic Server Enterprise Replication Guide Managing Replicates Warning Avoid deleting an Enterprise Replication server and immediately re creating it with the same name If you re create the objects immediately before the operation finishes propagating to the other Enterprise Replication database servers in the network failures might occur in the Enterprise Replication system at the time of the operation or later For more information see Operational Considerations on page 2 8 For more information see cdr delete server on page A 28 Managing Replicates For more information about the possible replicate states see Displaying Information About Replicates on page A 40 Important Ifa r
239. n describes how to prepare the infor mation in your databases for replication When you define a new replicate on tables with existing data on different database servers the data might not be consistent Similarly if you add a participant to an existing replicate you must ensure that all the databases in the replicate have consistent values For more information see Data Preparation Example on page 4 29 Preparing Consistent Data In most cases preparing consistent data simply requires that you decide which of your databases has the most accurate data and then copy that data onto the target database If the target database already has data for data consistency you must remove that data before adding the copied data For information on loading the data see Loading and Unloading Data on page 4 26 Blocking Replication You might need to put data into a database that you do not want replicated perhaps for a new server or because you had to drop and re create a table To block replication while you prepare a table use the BEGIN WORK WITHOUT REPLICATION statement This starts a transaction that does not replicate to other database servers The following code fragment shows how you might use this statement BEGIN WORK WITHOUT REPLICATION LOCK TABLE office DELETE FROM office WHERE description portlandR D COMMIT WORK 4 22 BM Informix Dynamic Server Enterprise Replication Guide Blocking Replication The followi
240. n topology For more information see Choosing a Replication Network Topology on page 3 18 m Set the idle timeout To specify the time in minutes that you want to allow the connec tion between two Enterprise Replication servers to remain idle before disconnecting use idle timeout Depending on the type of Enterprise Replication system primary target or update anywhere and network topology fully connected or hierarchical that you chose set the following options m Specify the location of the ATS directory To use ATS specify the directory for the Aborted Transaction Spool ing ATS files for the server using ats dir For more information see Creating ATS and RIS Directories on page 4 19 and Chapter 9 Monitoring and Troubleshooting Enter prise Replication m Specify the location of the RIS directory To use RIS specify the directory for the Row Information Spooling RIS files for the server using ris dir For more information see Creating ATS and RIS Directories on page 4 19 and Chapter 9 Monitoring and Troubleshooting Enter prise Replication IBM Informix Dynamic Server Enterprise Replication Guide Defining Replicates Specify the type of server hierarchical replication a To specify the server as a nonroot server use nonroot a To specify the server as a leaf server use leaf If neither leaf nor nonroot is specified the server is defined as a root server For m
241. nactive CONFLICT Ignore FREQUENCY immediate QUEUE SIZE 0 PARTICIPANT g usa informix stock g italy informix manufact Although this output shows that repl2 exists it does not show the participant modifiers the SELECT statements for repl2 Replication Examples E 7 Preparing for an Update Anywhere Replication 3 Display the participant modifiers for repl2 cdr list replicate repl2 This command returns the following information REPLICATE TABLE SELECT repl2 stores g_usa informix stock select from stock repl2 stores g_italy informix stock select from stock 4 Add the japan database server to the replication system already defined in the previous example cdr define server connect japan init sync g usa g japan You can use either g usa or g italy in the sync option Enterprise Replication maintains identical information on all servers that participate in the replication system Therefore when you add the japan database server information about that server is propa gated to all previously defined replication servers usa and italy 5 Display the replication servers so that you can verify that the definition succeeded cdr list server The command returns the following information SERVER ID STATE STATUS QUEUE CONNECTION CHANGED g italy 8 Active Connected 0 JUN 14 14 38 44 2000 g japan 6 Active Connected 0 JUN 14 14 38 44 2000 g usa 1 Active Local 6 Add the participant and participant modi
242. nce B 13 CDR SERIAL Configuration Parameter default value 0 0 units delta offset range of values 0 0 disable control of SERIAL column value generation gt 0 gt 0 enable control of SERIAL column value generation takes effect when Enterprise Replication is initialized The CDR SERIAL configuration parameter enables control over generating values for SERIAL and SERIAL8 columns in tables defined for replication This is useful for generating unique SERIAL column primary keys in an Enterprise Replication environment The format is CDR SERIAL delta offset where delta determines the incremental size of the serial column values offset determines the specific number within the delta that will be generated Example CDR SERIAL Value Resulting Value for the SERIAL Column CDR SERIAL 100 1 1 101 201 301 and so on CDR SERIAL 200 2 2 202 402 602 and so on You should set the de1ta to greater than the expected number of servers within your enterprise and make sure the offset is unique on each server When you set CDR SERIAL only tables that are marked as the source of a replicate use this method of serial column generation By default CDR SERIAL is set to 0 to disable control over generating SERIAL and SERIAL8 values For more information see SERIAL Data Types and Primary Keys on page 2 12 B 14 BM Informix Dynamic Server Enterprise Replication Guide ENCRYPT CDR Configuration Parameter default value 0
243. nd Line Utility Reference Appendix B Configuration Parameter and Environment Variable Reference Appendix C onstat Command Reference Appendix D SMI Table Reference Appendix E Replication Examples Appendix F SQLHOSTS Registry Key Appendix G Notices Index Table of Contents ix Introduction In This Introduction About This Manual Types of Users Software Dependencies Assumptions About Your Locale Demonstration Databases New Features in Dynamic Server Version 9 4 Extensibility Enhancements Functionality Improvements Security Enhancements Command Line Changes Configuration Parameters and E Vasidiis kange Documentation Conventions Typographical Conventions Icon Conventions Comment Icons Feature Product and Platform cones Command Line Conventions How to Read a Command Line Dicam Sample Code Conventions Additional Documentation Related Reading Compliance with Industry Standards IBM Welcomes Your Comments No o NNN DD o UG oF A WwW Q 2 BM Informix Dynamic Server Enterprise Replication Guide In This Introduction This introduction provides an overview of the information in this manual and describes the conventions it uses About This Manual This manual describes IBM Informix Enterprise Replication and the concepts of data replication This manual explains how to design your replication system as well as administer and manage data replication throughout y
244. nds user defined routine UDR environments G Prints grouper general statistics Prints grouper global list Lx Prints grouper global list expands open transactions M Prints grouper compression statistics Mz Clears grouper compression statistics P Prints grouper table partition statistics pager Prints grouper paging statistics R Prints grouper replicate statistics S Prints grouper serial list head Sl Prints grouper serial list Sx Prints grouper serial list expands open transactions T Prints grouper transaction statistics UDR Prints summary information about any UDR invocations by the grouper threads UDRx Prints expanded information including a summary of error infor mation about any UDR invocations by the grouper threads The Procid column lists the UDR procedure ID onstat Command Reference C 7 onstat g nif onstat g nif The onstat g nif command prints statistics about the network interface including a summary of the number of buffers sent and received for each site Because this command reports the status of the various network connections and traffic between the various servers it can be useful to determine why data is not replicating The g nif option is used primarily as a debugging tool and by Technical Support The onstat g nif command has the following formats onstat g nif onstat g nif modifier The following table describes the values for modifier Modifier Action all Prints
245. nerates will go into the cdr ats directory cdr define server c oliver i 600 A cdr ats I S g stan g oliver See Also cdr connect server on page A 9 cdr delete server on page A 28 cdr disconnect server on page A 32 cdr list server on page A 44 cdr modify server on page A 55 cdr resume server on page A 63 cdr suspend server on page A 81 Command Line Utility Reference A 23 Command Syntax cdr delete replicate The cdr delete replicate command deletes a replicate from the global catalog Syntax f repl_ mer cdr delete replicate 2 Connect Option f p A 87 Element Purpose Restrictions Syntax repl name Name of the replicate to delete The replicate must exist Long Identifiers on page A 86 Usage The cdr delete replicate command deletes the replicate repl name from the global catalog All replication data for the replicate is purged from the send queue at all participating database servers Warning Avoid deleting a replicate and immediately re creating it with the same name If you re create the objects immediately before the operation finishes propa gating to the other Enterprise Replication database servers in the network failures might occur in the Enterprise Replication system at the time of the operation or later For more information see Operational Considerations on page 2 8 Example The following command connects to the default data
246. nfiguring encryption 4 21 setting DBSERVERALIASES 4 7 DBSERVERNAME 4 7 parameters 2 12 4 20 ONCONFIG parameters See Parameters One to many replication definition of 3 4 oninit command initializing database servers 6 4 oninit D command 5 12 Online help Intro 14 Online manuals Intro 14 Online transaction processing See OLTP onload utility 4 28 See also IBM Informix Migration Guide onmode command 6 4 onmode d standard command 5 11 onspaces command adding chunks 9 16 creating row data sbspace 4 15 transaction record dbspace 4 13 onstat command 9 3 C 1 to C 11 monitoring dbspaces 9 16 sbspaces 9 16 onstat g ath command C 3 onstat g cat command C 4 onstat g ddr command C 5 onstat g dss command C 5 onstat g dtc command C 6 onstat g grp command C 6 onstat g nif command C 8 onstat g que command C 8 onstat g rcv command C 9 onstat g rep command C 10 onstat g rqm command C 10 onunload utility 4 26 4 28 See also IBM Informix Migration Guide Operating system times synchronizing 2 17 9 18 Optical devices not supported 2 19 optimize option 6 10 A 12 Optimized SPL routine definition of 3 17 Options abbreviations A 84 add 6 15 8 9 A 4 A 6 all A 35 at 6 10 A 93 ats 6 6 6 11 9 4 A 13 A222 A 50 A 56 cdr define replicate A 13 cdr define server A 21 to A 22 cdr error A 35 cdr modify replicate A 50 cdr modify server A 56 conflict 6 10 A 12 conflict resolution A 11 connect 6 5 7 4
247. ng list indicates actions that occur when a transaction starts with BEGIN WORK WITHOUT REPLICATION SQL does not generate any values for the shadow columns cdrserver and cdrtime for the rows that are inserted or updated within the transaction You must supply values for these columns with the explicit column list You must supply these values even if you want the column values to be NULL To modify a table with shadow columns that is already defined in Enterprise Replication you must explicitly list the columns to be modified The following two examples show an SQL statement and the correct changes to the statement to modify columns a If table namel1 is a table defined for replication you must change the following statement LOAD FROM filename INSERT INTO table namel to LOAD FROM filename INSERT INTO table namel list of columns The list of columns must match the order and the number of fields in the load file If table name3 and table named are tables defined for repli cation with the same schema you must change the following statement INSERT INTO table name3 SELECT FROM table name4 to an explicit statement where col1 col2 colN are the columns of the table INSERT INTO table name3 VALUES cdrserver cdrtime coll colN cdrserver cdrtime FROM table name4 The shadow columns cdrserver and cdrtime are not included in an list For more information about these statements refer to the IBM In
248. nment Variables Setting Configuration Parameters 4 3 4 3 4 4 4 4 4 5 4 5 4 5 4 8 4 9 4 10 4 10 4 10 4 11 4 11 4 12 4 12 4 13 4 14 4 18 4 19 4 19 4 20 4 20 Preparing Data for Replication 2 Preparing Consistent Data 422 Blocking Replication 42 Using DB Access to Begin Work Without Replication 4 24 Using ESQL C to Begin Work Without Replication 424 Preparing to Replicate User Defined Types 425 Preparing to Replicate User Defined Routines 425 Preparing Tables for Conflict Resolution 425 Preparing Logging Databases 426 Loading and Unloading Data 426 High Performance Loader 427 onunload and onload Utilities 428 dbexport and dbimport Utilities 428 UNLOAD and LOAD Statements 428 Data Preparation Example 429 4 2 BM Informix Dynamic Server Enterprise Replication Guide In This Chapter This chapter covers the steps to take to prepare your environment for repli cating data with Enterprise Replication preparing the network environment the disk the server environment and the data Preparing the Network Environment For more information on preparing the network environment see the cha
249. nnect server A 9 cdr define replicate A 10 cdr define replicateset A 16 cdr define server A 19 cdr delete replicate A 24 cdr delete replicateset A 26 cdr delete server A 28 cdr disconnect server A 32 cdr error A 34 cdr finderr A 37 cdr list replicate A 38 cdr list replicateset A 42 cdr list server A 44 cdr modify replicate A 48 cdr modify replicateset A 53 cdr modify server A 55 cdr remove A 58 cdr resume replicate A 59 1 of 2 A 2 BM Informix Dynamic Server Enterprise Replication Guide Command Page cdr resume replicateset A 61 cdr resume server A 63 cdr start A 65 cdr start replicate A 67 cdr start replicateset A 69 cdr stop A 71 cdr stop replicate A 73 cdr stop replicateset A 75 cdr suspend replicate A 77 cdr suspend replicateset A 79 cdr suspend server A 81 2 of 2 Command Syntax Command Syntax The next sections show the syntax for all the variations of the cdr commands Command Line Utility Reference A 3 Command Syntax cdr change replicate The cdr change replicate command allows you to modify an existing replicate by adding or deleting one or more participants Syntax p A 87 cdr change replicate add replicate Ed participant modifier Y Connect Option n delete replicate participant Element Purpose Restrictions Syntax modifier Specifies the rows and columns See Considerations for the Participant to replicate
250. nt The leaf server must be a terminal point in a replication hierarchy syscdrsend buf The syscdrsend buf table contains buffers that give information about the send queue When a user performs transactions on the source database server Enterprise Replication queues the data on the send queue for delivery to the target servers For information on the columns of the syscdrsend buf table refer to Columns of the Buffer Tables on page D 17 syscdrsend txn The syscdrsend txn table contains information about the send queue When a user performs transactions on the source database server Enterprise Repli cation queues the data on the send queue for delivery to the target servers For information on the columns of the syscdrsync txn table refer to Columns of the Transaction Tables on page D 16 SMI Table Reference D 11 syscdrserver syscdrserver The syscdrserver table contains information about database servers declared to Enterprise Replication Column Type Description servid integer Replication server ID servername char 128 Database server group name connstate char 1 Status of connection to this database server C Connected D Connection disconnected will be retried T Idle time out caused connection to terminate X Connection closed by user command Connection unavailable until reset by user connstate integer Time that connection state was last changed change servstate char 50 Status
251. ntifies information that is specific to the Windows environments 10 BM Informix Dynamic Server Enterprise Replication Guide Command Line Conventions These icons can apply to an entire section or to one or more paragraphs within a section If an icon appears next to a section heading the information that applies ends at the next heading at the same or higher level A symbol indicates the end of information that appears in one or more paragraphs within a section Command Line Conventions This section defines and illustrates the format of commands that are available in IBM Informix products These commands have their own conventions which might include alternative forms of a command required and optional parts of the command and so forth Each diagram displays the sequences of required and optional elements that are valid in a command A diagram begins at the upper left corner with a command It ends at the upper right corner with a vertical line Between these points you can trace any path that does not stop or back up Each path describes a valid form of the command You must supply a value for words that are in italics You might encounter one or more of the following elements on a command line path Element Description command This required element is usually the product name or other short word that invokes the product or calls the compiler or preprocessor script for a compiled IBM Informix product It might app
252. ntil you explicitly change its state to active When a replicate is active Enterprise Replication captures data from the logical log and transmits it to the participants Important You cannot start replicates that have no participants To change the replicate state to active use the cdr start replicate command For example to start the replicate sales data on the servers server1 and server23 enter cdr start replicate sales data serverl server23 This command causes serverl1 and server23 to start sending data for the sales data replicate If you omit the server names this command starts the replicate on all servers that are included in that replicate Warning Run the cdr start replicate command on an idle system no transactions are occurring or use the BEGIN WORK WITHOUT REPLICATION statement until after you successfully start the replicate Important If a replicate belongs to an exclusive replicate set you must start the replicate set to which the replicate belongs For more information see Exclusive Replicate Sets on page 8 4 and Starting a Replicate Set on page 8 7 For more information see cdr start replicate on page A 67 Stopping a Replicate To stop the replicate use the cdr stop replicate command This command changes the replicate state to inactive and deletes any data in the send queue for that replicate When a replicate is inactive Enterprise Replication does not capture transmit or proces
253. ntirely coincidental COPYRIGHT LICENSE This information contains sample application programs in source language which illustrate programming techniques on various operating platforms You may copy modify and distribute these sample programs in any form without payment to IBM for the purposes of developing using marketing or distributing application programs conforming to the application programming interface for the operating platform for which the sample programs are written These examples have not been thoroughly tested under all conditions IBM therefore cannot guarantee or imply reliability serviceability or function of these programs You may copy modify and distribute these sample programs in any form without payment to IBM for the purposes of developing using marketing or distributing application programs conforming to IBM s application programming interfaces Notices G 3 Trademarks Each copy or any portion of these sample programs or any derivative work must include a copyright notice as follows O your company name year Portions of this code are derived from IBM Corp Sample Programs Copyright IBM Corp enter the year or years All rights reserved If you are viewing this information softcopy the photographs and color illus trations may not appear Trademarks AIX DB2 DB2 Universal Database Distributed Relational Database Architecture NUMA Q OS 2 OS 390 and OS 400 IBM Informix C I
254. o that the data elements eventually have the same value at every site For more information see Conflict Resolution on page 3 10 Log Based Data Capture Enterprise Replication uses log based data capture to gather data for repli cation Enterprise Replication reads the logical log to obtain the row images for tables that participate in replication and then evaluates the row images Log based data capture takes changes from the logical log and does not compete with transactions for access to production tables Log based data capture systems operate as part of the normal database logging process and thus add minimal overhead to the system Two additional methods of data capture which Enterprise Replication does not support include m Trigger based data capture A trigger is code in the database that is associated with a piece of data When the data changes the trigger activates the replication process m Trigger based transaction capture A trigger is associated with a table Data changes are grouped into transactions and a single transaction might trigger several replica tions if it modifies several tables The trigger receives the whole transaction but the procedure that captures the data runs as a part of the original transaction thus slowing down the original transaction About IBM Informix Enterprise Replication 1 5 High Performance High Performance Enterprise Replication provides high performance by not over
255. odifier on page A 90 Important You cannot start and stop replicates that have no participants You must include the server group database table owner and table name when defining a participant and enclose the entire participant definition in quote marks database Q server group owner table R l Element Purpose Restrictions Syntax database server group A 88 Name of the database that The database server must be Long Identifiers includes the table to be replicated registered with Enterprise on page A 86 Replication User ID of the owner of the table Long Identifiers to be replicated on page A 86 Name of the database server The database server group name Long Identifiers group that includes the server to must be the name of an existing on page A 86 connect to Enterprise Replication server group in SOLHOSTS Name of the table to be replicated The table must be an actual table Long Identifiers It cannot be a synonym or a view on page A 86 IBM Informix Dynamic Server Enterprise Replication Guide UNIX Participant Important Do not create more than one replicate definition for each row and column set of data to replicate If the participant overlaps Enterprise Replication attempts to insert duplicate values during replication You can define participants with the following commands m cdr define replicate m cdr modify replicate m cdr ch
256. on IBM may make improvements and or changes in the product s and or the program s described in this publication at any time without notice Any references in this information to non IBM Web sites are provided for convenience only and do not in any manner serve as an endorsement of those Web sites The materials at those Web sites are not part of the materials for this IBM product and use of those Web sites is at your own risk IBM may use or distribute any of the information you supply in any way it believes appropriate without incurring any obligation to you Licensees of this program who wish to have information about it for the purpose of enabling 1 the exchange of information between independently created programs and other programs including this one and ii the mutual use of the information which has been exchanged should contact IBM Corporation J46A G4 555 Bailey Avenue San Jose CA 95141 1003 U S A Such information may be available subject to appropriate terms and condi tions including in some cases payment of a fee The licensed program described in this information and all licensed material available for it are provided by IBM under terms of the IBM Customer Agreement IBM International Program License Agreement or any equiv alent agreement between us IBM Informix Dynamic Server Enterprise Replication Guide Any performance data contained herein was determined in a controlled environment Therefore th
257. on System on page 3 3 and Participant Type on page A 89 For example in the following participant definition the P indicates that in this replicate hawaii is a primary server P dbl g hawaii informix mfct select from mfct If any data in the selected columns changes that changed data is to be sent to the secondary servers In the following example the R indicates that in this replicate maui is a secondary server R db28g maui informix mfct select from mfct The specified table and columns receive information sent from the primary server Changes to those columns on maui are not replicated Important The R in the participant definition indicates that the table is receive only mode not that the table is in read only mode If you do not specify the participant type Enterprise Replication defines the participant as update anywhere by default For example dbl g hawaii informix mfct select from mfct db20g maui informix mfct select from mfct For more information see Participant on page A 88 Defining Replicates on Table Hierarchies When you define replicates on inherited table hierarchies use the following guidelines to replicate operations m For both the parent and child tables define a replicate on each table m Foronly the parent table not the child table define a replicate on the parent table only m Foronly the child table not the parent table define a replicate on the
258. onment Considerations Time Synchronization Using GLS with Enterprise Replication Enterprise Replication Data Types Replicating on Heterogeneous Hardware Replicating Simple and Smart Large Objects Replicating Opaque User Defined Data Types IBM Informix Dynamic Server Enterprise Replication Guide 2 17 2 17 2 18 2 19 2 19 2 20 2 25 In This Chapter This chapter introduces you to Enterprise Replication administration and describes the Enterprise Replication server administrator Enterprise Repli cation terminology and considerations for using Enterprise Replication Overview of Enterprise Replication Administration To set up Enterprise Replication 1 Select the Enterprise Replication system and network topology to use for your replication environment For information see Chapter 3 Selecting the Enterprise Replication System and Network Topology Prepare the replication environment For information see Chapter 4 Preparing the Replication Environment Initialize the database server For information see Chapter 6 Defining and Modifying Replica tion Servers Replicates and Participants Define database servers for replication For information see Chapter 6 Define replicates and participants For information see Chapter 7 Managing Replication Servers and Replicates Overview of Enterprise Replication Administration 2 3 Enterprise Replication Server Administrator 6 Create re
259. onnection not the shared memory connection entry should appear immediately after the database server group defini tion If the network connection does not appear immediately after the database server group definition you might see the following error when you run cdr define server command failed unable to connect to server specified 5 You might also see a message like the following in the message log for the target server Reason ASF connect error 25592 m Make sure that the unique identifier for each database server i in the options field of the SOLHOSTS information is consistent across all nodes in the enterprise For more information see Database Server Groups on UNIX on page 4 6 and Appendix F SOLHOSTS Registry Key m Verify that the operating system times of the database servers that participate in the replicate are synchronized For more information see Time Synchronization on page 2 17 m Make sure that the database server has adequate logical log disk space If the database server does not have enough logical log space at initialization you will see the following error command failed fatal server error 100 m Check the INFORMIXDIR etc buildsmi xxx files to see if a problem occurred when the databases server built the SMI tables m Make sure that the databases on all database server instances involved in replication are set to logging unbuffered logging is recommended For more information
260. onsistent for the database server across all nodes in the enterprise Important The network connection entry should appear immediately after the database server group definition Important If you use both DBSERVERNAME and DBSERVERALIASES DBSERVERNAME should refer to the network connection and not to a shared memory connection For information about database server aliases refer to the IBM Informix Dynamic Server Administrators Guide Foran example of an SOLHOSTS file when combining Enterprise Replication and High Availability Data Replication see Managing Enterprise Repli cation with High Availability Data Replication on page 5 11 For more information about database server groups and setting up SOLHOSTS see the chapter on client server communications in the IBM Informix Dynamic Server Administrators Guide Database Server Groups on Windows For information about preparing the SOLHOSTS connectivity information on Windows see Appendix F SQLHOSTS Registry Key Preparing the Replication Environment 4 7 Verifying SQLHOSTS Important It is strongly recommended that you use IBM Informix Server Adminis Cc trator ISA rather than regedt32 to set up the SQLHOSTS registry key and database server group registry key on your Windows system In addition ISA allows you to administer your replication system from a web browser For more information see the Documentation Notes described in Additional Documentation on page
261. ool to disk Receiving server is down or suspended Network connection is down If the receiving server or network connection is down or suspended Enterprise Replication might spool transaction buffers to disk To check for a down server or network connection run cdr list server on a root server This command shows all servers and their connec tion status and state For more information see Viewing Replication Server Attributes on page 7 4 and cdr list server on page A 44 m Replicate is suspended If a replicate is suspended Enterprise Replication might spool transaction buffers to disk To check for a suspended replicate run cdr list replicate This com mand shows all replicates and their state For more information see Viewing Replicate Properties on page 7 7 and cdr list replicate on page A 38 m Enterprise Replication is replicating large transactions Enterprise Replication is optimized to handle small transactions efficiently Very large transactions or batch jobs force Enterprise Rep lication into an exceptional processing path that results in spooling For best results avoid replicating these types of transactions For more information see Large Transactions on page 2 15 m Logical log files are too small or too few If the logical log files are too small or the number of logical log files is too few Enterprise Replication is more likely to spool transaction buffers to disk To increase the si
262. or dialog box type the value for the field that you selected and click OK Repeat steps 8 and 9 for each field of the sqlhosts information IBM Informix Dynamic Server Enterprise Replication Guide Setting Up the Database Server Group Registry Key Figure F 1 illustrates the location and contents of the SOLHOSTS registry key Figure F 1 sglhosts Information in the Windows Registry H Registry Editor HKEY LOCAL MACHINE on Local Machine mm Registry Edit Tree View Security Options Window Help G Hummingbird HOST REG SZ iris 3 Informix OPTIONS REG SZ gzg iris DBMS PROTOCOL REG SZ olsoctcp C3 ESQL C SERVICE REG SZ techpubs2 Informix Client Configuration Informix ORDBMS Informix Connect Fa IS xj OnLine OnSnmpSubagent xj Replication Manager Setup Setup Framework j SQLHOSTS C3 g_ds GJ g iris G3 g irisl Ca iris1_92 iris 93 P iris 92 Setting Up the Database Server Group Registry Key After you create the registry key for the database server you must make a registry key for the database server group that includes the database server For more information refer to Verifying SOLHOSTS on page 4 5 Tip In this manual and in Figure F 1 on page F 5 each of the names of the database server groups are the database server names prefixed by g The g_ prefix is not a requirement it is just the convention that this manual uses SQLHOSTS Registry K
263. or read only analysis Pay close attention to the configuration of the tables from which data is replicated to ensure that each primary key is unique among the multiple primary database servers Workload Partitioning Workload partitioning gives businesses the flexibility of assigning data ownership at the table partition level rather than within an application Figure 3 3 illustrates workload partitioning Figure 3 3 Asia Pacific U S A Europe Workload Partitioning in a Replication System ee ee o A P Partition A P Partition A P Partition emp empname emp empname emp empname 2994 N Night 5783 A Alder 5761 B Barry 4402 R River 1235 M Markar 6642 Z Zachary U S A Partition U S A Partition U S A Partition emp empname e empf empname 6398 D Davis 9681 J gt sec Cowpar 9456 E Eldridge 4951 H Height 7333 K Kristen Europe Partition urope Partition Europe Partition emp empname emp empname empf empname 6520 P Peters 8002 F Fire 4 7 Llame 3798 G Gladys 9966 S Smith 5540 T Thomas EE cee c Owner of partition Read write Read only privileges 3 6 IBM Informix Dynamic Server Enterprise Replication Guide Order entry custno custname 1234 XYZLTD 1235 XSPORTS Order processing Primary larget Replication System In Figure 3 3 the replication
264. ore information see Hierarchical Replication Topologies on page 3 19 For more information on network topology see Chapter 3 Selecting the Enterprise Replication System and Network Topology For more information see cdr define server on page A 19 Defining Replicates To define a replicate use the cdr define replicate command You must provide the following information in the replicate definition Participants For more information see Defining Participants on page 6 8 Conflict resolution rules and scope For more information see Specifying Conflict Resolution Rules and Scope on page 6 10 Replication frequency For more information see Specifying Replication Frequency on page 6 10 Error logging For more information see Setting Up Error Logging on page 6 11 Replicate full rows or only changed columns For more information see Replicating Only Changed Columns on page 6 11 Defining and Modifying Replication Servers Replicates and Participants 6 7 Defining Participants m IEEE or canonical message formats For more information see Using the IEEE Floating Point or Canon ical Format on page 6 13 m Database triggers For more information see Enabling Triggers on page 14 Once you define the replicate and participants you must manually start the replicate using the cdr start replicate command See Starting a Replicate on page 7 8 Defining Participants You must define p
265. our enterprise This section discusses the intended audience and the associated software products that you must have to use Enterprise Replication Types of Users This manual is for database server administrators and assumes that you have the following background m Aworking knowledge of your computer your operating system and the utilities that your operating system provides m Some experience working with relational databases or exposure to database concepts m Some experience with database server administration operating system administration and network administration If you have limited experience with relational databases SOL or your operating system refer to your Getting Started Guide for a list of supple mentary titles Introduction 3 Software Dependencies 4 Software Dependencies To use Enterprise Replication you must use IBM Informix Dynamic Server as your database server Check the release notes for specific version compatibility This manual assumes that you are using Dynamic Server Version 9 4 as your database server Assumptions About Your Locale IBM Informix products can support many languages cultures and code sets All the information related to character set collation and representation of numeric data currency date and time is brought together in a single environment called a GLS Global Language Support locale The examples in this manual are written with the assumption that
266. our table use the following statements m For new tables use CREATE TABLE table name WITH CRCOLS m For existing tables use ALTER TABLE table name ADD CRCOLS Preparing the Replication Environment 4 25 Preparing Logging Databases Important If a table already participates in Enterprise Replication you must stop Cc replication before altering it with the ADD CRCOLS clause For more information see Stopping a Replicate on page 7 8 To drop the cdrserver and cdrtime shadow columns use ALTER TABLE table name DROP CRCOLS Tip The ADD CRCOLS and DROP CRCOLS clauses to the ALTER TABLE statement are now processed as in place alters in most cases For more information see Functionality Improvements on page 6 of the Introduction and the section on in place alters in the Performance Guide For more information on CREATE TABLE and ALTER TABLE see the sections in the IBM Informix Guide to SQL Syntax Preparing Logging Databases Databases on all server instances involved in replication must be created with logging For best results use unbuffered logging For more information see Unbuffered Logging on page 2 10 Loading and Unloading Data For loading data you can use the following tools High Performance Loader onunload and onload Utilities dbexport and dbimport Utilities UNLOAD and LOAD Statements When you unload and load data you must use the same type of utility for both
267. ow Contains the server id and the time when the row is columns updated on the target server This line is printed only if the replicate is defined with a conflict resolution rule LRD Local row data Contains the list of replicated columns extracted from the local row and displayed in the same order as the replicated row data Similar to the replicated row data each column is separated by a and written in ASCII format When the spooling program encounters severe errors for example cannot retrieve replicate id for the replicated row unable to determine the repli cated column s type size or length or the table includes UDT columns whether defined for repli cation or not it displays the replicated row data in hexadecimal format In this case the local row data is not spooled BYTE and TEXT Information in RIS Files When the information recorded in the RIS file includes BYTE or TEXT data the RRD information is reported as the following examples show Example 1 1200 TEXT PB 877 necromsv 840338515 00 08 17 20 21 55 In this example m 1200 is the size of the TEXT data m TEXT is the data type it is either BYTE or TEXT Monitoring and Troubleshooting Enterprise Replication 9 11 Changed Column Information in RIS Files m Bis the storage type PB for storage in the tablespace BB for blobspace storage m The next two fields are the server identifier and the time stamp for the column if the conflict resolution
268. p sync seroer Name of a database server group Must be the name of an existing to declare for Enterprise database server group in Replication SOLHOSTS See Setting up Database Server Groups on page 4 5 Name of server to use for Mustbeaserverthatisregistered Long Identifiers synchronization for all subse with Enterprise Replication The on page A 86 quent server definitions to an server must be online existing replication system Command Line Utility Reference A 19 Command Syntax A 20 Options Long Form Short Form The following table describes the long forms shown in the syntax diagram Meaning connect C init I leaf L nonroot N Sync sync_server S sync_server Usage IBM Informix Dynamic Server Enterprise Replication Guide Connects to the database server that is being defined If this option is omitted INFORMIXSERVER must be set to server_group Adds server_group to the replication system The server_group must be the same as the connection server Defines the server as a leaf server If neither leaf nor nonroot is specified the server is defined as a root server Defines the server as a nonroot server If neither leaf nor nonroot is specified the server is defined as a root server Uses the global catalog on sync_server as the template for the global catalog on the new replication server server_group Use this option for adding subsequent server_grou
269. p key selected in step 7 If you are combining Enterprise Replication with HDR create keys for primary and secondary HDR servers under the same database server group IBM Informix Dynamic Server Enterprise Replication Guide Setting Up the Database Server Group Registry Key 9 Repeat steps 1 to 8 for each field of the sqlhosts information Figure F 2 illustrates the contents of the database server group regis try key after you add the values to the keys Figure F 2 Database Server Group Information in the Windows Registry Registry Editor HKEY LOCAL MACHINE on Local Machine E Registry Edit Tree View Security Options Window Help InfoExpress 4 IHOST REG SZ Informix OPTIONS REG SZ i 5327 DBMS PROTOCOL REG SZ group C3 ESQL C SERVICE REG SZ Informix Client Configuration GJ Informix ORDBMS G3 Informix Connect fi ISA OnLine OnSnmpSubagent Replication Manager Setup SQLHOSTS Ga ds 10 Exit from the Registry Editor SQLHOSTS Registry Key F 7 Setting up the Registry Keys on All Computers Setting up the Registry Keys on All Computers Now update the registry keys on all computers that participate in replication To update the registry keys on all computers 1 Set up the SOLHOSTS registry key on all computers that participate in replication See Setting up the SOLHOSTS Registry Key with regedt32 on page F 3 2 Set up the database server group registry key
270. pdate the same row simultaneously the time stamp for both updates is the same GMT time a collision exists For more information see Applying Replicated Data on page 1 18 Enterprise Replication must determine which new data to replicate To solve conflict resolution you must specify the following for each replicate m Aconflict resolution rule m The scope of the rule 3 10 IBM Informix Dynamic Server Enterprise Replication Guide Conflict Resolution Conflict Resolution Rule Enterprise Replication supports the following conflict resolution rules Conflict Resolution Rule Effect Reference Ignore Enterprise Replication does not page 3 12 attempt to resolve conflicts Time stamp The row or transaction with the page 3 13 most recent time stamp is applied SPL routine Enterprise Replication uses a page 3 14 routine written in SPL Stored Procedure Language that you provide to determine which data should be applied Time stamp with SPL If the time stamps are identical page 3 13 routine Enterprise Replicationinvokesan page 3 14 SPL routine that you provide to resolve the conflict For all conflict resolution rules except ignore you must create shadow columns in the tables on both the source and target servers involved in repli cation For more information see Shadow Columns on page 2 11 Enterprise Replication supports up to two conflict resolution rules for each replicate a primary rule and
271. pecifies that no database changes are captured for the replicate or participant Suspended Specifies that the replicate captures and accumulates database changes but does not transmit any of the captured data The CONFLICT field can include the following values Value Description Ignore Specifies that the replicate uses the ignore conflict resolution rule Timestamp Specifies that the replicate uses the time stamp conflict resolution rule Procedure Specifies that the replicate uses an SPL routine as the conflict resolution rule A 40 IBM Informix Dynamic Server Enterprise Replication Guide Command Syntax The FREQUENCY field can include the following values Value Description immediate Specifies that replication occurs immediately every hh mm Specifies that replications occur at intervals for example 13 20 specifies every thirteen hours and 20 minutes at day hh mm Specifies that replications occur at a particular time on a particular day for example 15 18 30 specifies on the 15th day of the month at 6 30 P M The following example specifies the names of replicate cdr list repl Repll The following output might result from the previous command REPLICATE TABLE SELECT Repli bankeg newyork joe teller Select from joe teller Repli bankeg sanfrancisco joe teller Select from joe teller Repli bankeg portland joe teller Select from joe teller See Also cdr change replicate on page A 4 cd
272. ple Environment on page E 1 Defining a Hierarchy The following example defines a replication hierarchy that includes denver boston and miami and whose root is usa To define a hierarchy 1 Add boston to the replication hierarchy as a nonroot server attached to the root server usa cdr define server connect boston nonroot init sync g usa g boston The backslash indicates that the command continues on the next line 2 Add denver to the replication hierarchy as a nonroot server attached to the root server usa cdr define server c denver I N ats ix myats S g usa g denver This command uses short forms for the connect init and sync options For information about the short forms refer to Option Abbreviations on page A 84 The command also specifies a direc tory for collecting information about failed replication transactions ix myats 3 List the replication servers as seen by the usa replication server cdr list server The root server usa is fully connected to all the other root servers Therefore usa knows the connection status of all other root servers and of its two child servers denver and boston The command returns the following information SERVER ID STATE STATUS QUEUE CONNECTION CHANGED g boston 3 Active Connected 0 Aug 19 14 20 03 2000 g denver 27 Active Connected 0 Aug 19 14 20 03 2000 E 12 BM Informix Dynamic Server Enterprise Replication Guide Defining a Hierarchy g italy 8 Ac
273. plicate sets optional For information see Chapter 8 Creating and Managing Replicate Sets 7 Start the replicate For information see Chapter 7 Once you configure Enterprise Replication use this information to manage your replication environment Managing Replication Servers on page 7 3 Managing Replicates on page 7 7 Managing Replicate Sets on page 8 6 Monitoring and Troubleshooting Enterprise Replication on page 9 1 Enterprise Replication Server Administrator The Enterprise Replication server administrator must have Informix admin istrator privileges to configure and manage Enterprise Replication Operating System Privileges UNIX user informix Windows member of the Informix Admin group 2 4 BM Informix Dynamic Server Enterprise Replication Guide Enterprise Replication Terminology Enterprise Replication Terminology The following terms define the data in an Enterprise Replication system and how it is treated Enterprise Replication Server Replicate Participant Replicate Set Global Catalog Enterprise Replication Server An Enterprise Replication server or replication server is an Informix database server that participates in data replication The replication server maintains information about the replication environment which columns should be replicated and the conditions under which the data should be replicated This information is stored in a database
274. plication Servers 6 16 6 2 IBM Informix Dynamic Server Enterprise Replication Guide In This Chapter This chapter describes the steps for declaring a database server for Enterprise Replication To define a replication server 1 Initialize the database server For information see Initializing Database Servers on page 6 4 Declare the database server to Enterprise Replication For information see Defining Replication Servers on page 6 5 Once you define the server for replication the server is known as a replication server Define replicates The replicate definition includes information about the participants replication options frequency and conflict resolution rules and scope For information see Defining Replicates on page 6 7 Define participants A participant definition specifies the data database table and col umns that should be replicated Although you can define a replicate with fewer a replicate should contain two or more participants to be useful For information see Defining Participants on page 6 8 Important You must be the Enterprise Replication server administrator Enter prise Replication Server Administrator on page 2 4 to define the replication server Defining and Modifying Replication Servers Replicates and Participants 6 3 Initializing Database Servers This chapter also covers the following topics m Modifyin
275. portant Once you create an exclusive replicate set you cannot change it to non exclusive and vice versa Command Line Utility Reference A 17 Command Syntax Example The following example connects to the default server and defines the non exclusive replicate set accounts set with replicate participants repl1 repl2 and repl3 cdr def replset accounts set repll repl2 repl3 The following example connects to the server olive and defines the exclusive replicate set market set with replicate participants basil and thyme cdr def replset connect olive exclusive market set basil thyme See Also cdr change replicateset on page A 6 cdr delete replicateset on page A 26 cdr list replicateset on page A 42 cdr modify replicateset on page A 53 cdr resume replicateset on page A 61 cdr start replicateset on page A 69 cdr stop replicateset on page A 75 cdr suspend replicateset on page A 79 A 18 IBM Informix Dynamic Server Enterprise Replication Guide cdr define server X f p A 21 connect server group Element Command Syntax cdr define server The cdr define server command defines a database server group and all its members that is all database servers that are members of the database server group for Enterprise Replication Syntax Options PA init server group M non M sync sync server leaf Purpose Restrictions Syntax server grou
276. primary zal receive only fe ats ats dir F ris ris_dir Element Purpose Restrictions server group Name of a database server group The database server group must to modify be defined in Enterprise Replication interval Idle time out for this server The value must be an integer Integer number of 2 0 minutes 0 no timeout ats dir Name of Aborted Transaction The directory must be a full Directory name on Spooling directory pathname your operating system ris dir Name of the Row Information The directory must be a full Directory name on Spooling directory pathname your operating system Command Line Utility Reference A 55 Command Syntax Usage seroer group Options Long Form Short Form The cdr modify server command modifies the replication server The following table describes the options to cdr modify server idle i mode m ats A ris R Examples directory cdr atsdir A 56 IBM Informix Dynamic Server Enterprise Replication Guide Causes an inactive connection to be terminated after idle time Changes the mode of all replicates using this server to primary p or to receive only r Activates aborted transaction spooling for replicate transactions that fail to be applied to the target database For more information see Chapter 9 Monitoring and Troubleshooting Enterprise Replication Activates row information spooling for repl
277. prise Replication Guide SMI Table Reference The system monitoring interface SMI tables in the sysmaster database provide information about the state of the database server Enterprise Replication uses the SMI tables listed in SMI Table Summary to access information about database servers declared to Enterprise Replication SMI Table Summary Table Description Reference syscdrack buf Buffers for the acknowledge queue page D 3 syscdrack txn Transactions in the acknowledge page D 3 queue syscdrctrl buf Buffers for the control queue page D 3 syscdrctrl txn Transactions in the control queue page D 4 syscdrerror Enterprise Replication error page D 4 information syscdrpart Participant information page D 5 syscdrprog Contents of the Enterprise Repli page D 5 cation progress tables syscdrq Queued data information brief page D 6 syscdrqueued Queued data information detailed page D 7 1 of 2 D 2 SMI Table Summary IBM Informix Dynamic Server Enterprise Replication Guide Table Description Reference syscdrrecv buf Buffers in the receive queue page D 7 syscdrrecv txn Transactions in the receive queue page D 7 syscdrrepl Replicate information page D 8 syscdrreplset Replicate set information page D 9 syscdrs Server information page D 10 syscdrsend buf Buffers in the send queue page D 11 syscdrsend txn Transactions in the send queue page D 11 syscdrserver Database server information page D 12 sys
278. ps to an existing replication system For Hierarchical Routing HR topologies Enterprise Replication also uses the sync_server as the new server s parent in the current topology The cdr define server command creates the Enterprise Replication global catalog and adds the database server from the server_group Element Options Options Command Syntax The options allow you to modify the default behavior of cdr define server Back to cdr define server p A 19 Purpose ats ats dir is ris dir idlez timeout Restrictions Syntax ats dir ris dir timeout Name of the directory for Aborted Transaction Spooling Name of the directory for Row Information Spooling Idle timeout for this replication server Must be a full pathname The path for the directory can be no longer than 256 bytes Must be a full pathname The path for the directory can be no longer than 256 characters Must be an integer number of minutes 0 indicates no timeout The maximum value is 32 767 Follows naming conventions on your operating system Follows naming conventions on your operating system Integer Command Line Utility Reference A 21 Command Syntax A 22 Options Long Form Short Form The following table describes the options to cdr define server ats ats dir A ats dir ris ris dir R ris dir idle timeout i timeout Exa
279. pter on client server connectivity in the IBM Informix Dynamic Server Adminis trator s Guide See Appendix E Replication Examples for a sample setup To prepare your network environment 1 Set up the hosts file For information see Setting Up the Hosts File on page 4 4 Set up the services file For information see Setting Up the Services File on page 4 4 Set up the trusted environment For information see Setting Up the Trusted Environment on page 4 5 Verify the SOLHOSTS information For information see Verifying SOLHOSTS on page 4 5 Test the network environment For information see Testing the Network Environment on page 4 9 Preparing the Replication Environment 4 3 Setting Up the Hosts File Setting Up the Hosts File First make sure the hosts file includes the IP addresses and system names for all database servers involved in Enterprise Replication Important 1f you are using Domain Name Service DNS to identify IP addresses and system names you do not need to configure the hosts file The hosts file is in the following location Operating System File UNIX etc hosts Windows WINDIR system32 drivers etc hosts Important Leave a blank line at the end of the hosts file on Windows For example your hosts file might look like the following 123 456 789 1 sydney 123 456 789 2 melbourne Setting Up the Services
280. pter 3 Chapter 4 setting Up and Managing Enterprise Replication Selecting the Enterprise Replication System and Network Topology In This Chapter Selecting the Enterprise Replication Sa Primary Target Replication System Update Anywhere Replication System Conflict Resolution Choosing a Replication Networ pulsars Fully Connected Topology Hierarchical Replication Topologies Preparing the Replication Environment In This Chapter Preparing the Network EN Setting Up the Hosts File Setting Up the Services File Setting Up the Trusted Environment Verifying SQLHOSTS Testing the Network Environment Preparing the Disk Planning for Disk Space Requirements Setting Up Send and Receive Queue Spool Areas Setting Up the Grouper Paging File Creating ATS and RIS Directories Preparing the Database Server Environment Setting Environment Variables Setting Configuration Parameters Preparing Data for Replication Preparing Consistent Data Blocking Replication Preparing to Replicate scEDefndd dvpes Preparing to Replicate User Defined Routines Preparing Tables for Conflict Resolution Preparing Logging Databases Loading and Unloading Data Data Preparation Example 3 3 3 3 3 3 3 8 3 10 3 18 3 19 3 19 4 3 4 4 4 4 4 5 4 5 4 9 4 10 4 10 4 12 4 18 4 19 4 19 4 20 4 20 4 22 4 22 4 22 4 25 4 25 4 25 4 26 4 26 4 29 Table of Contents w Chapter 5 Using Hi
281. ptions The following commands allow you to specify the interval between replica tions or the time of day when an action should occur If you do not specify a time the action occurs immediately cdr define replicate cdr define replicateset cdr modify replicate cdr modify replicateset Frequency Options p immed everyz interval at time Element Purpose Restrictions Syntax interval Time interval for replication The smallest interval in minutes Intervals on page A 94 time Specific time for replication Time is given with respect toa 24 Time of Day on hour clock page A 93 A 92 IBM Informix Dynamic Server Enterprise Replication Guide Frequency Options The following table describes the frequency options Time Options Long Form Short Form Meaning immed i Action occurs immediately every e Action occurs immediately and repeats at the frequency specified by interval at a Action occurs at the specified day and time Time of Day Enterprise Replication always gives the time of day in 24 hour time For example 19 30 is 7 30 P M Enterprise Replication always gives times with respect to the local time unless the TZ environment variable is set However Enterprise Replication stores times in the global catalog in Greenwich Mean Time GMT The a time option lets you specify the day on which an action should occur The string time can have the following formats
282. quency For the Replicate Set Adding or Deleting Replicates From a Replicate Set To add a replicate to an existing replicate set use the command cdr change replicateset add For example to add two replicates to sales_set enter cdr change replicateset add sales set sales kauai V Sales moorea When you add a replicate to m A non exclusive replicate set the state of the new replicate remains as it was when you added it to the set To bring all the replicates in the non exclusive set to the same state use one of the commands described in Managing Replicate Sets on page 8 6 m An exclusive replicate set Enterprise Replication changes the existing state and replication frequency settings of the replicate to the current properties of the exclusive replicate set To delete a replicate from the replicate set use cdr change replicate delete For example to delete the two replicates sales Kauai and sales moorea from the replicate set enter cdr change replicateset delete sales set sales kauaiWN Sales moorea When you add or remove a replicate from an exclusive replicate set that is suspended or that is defined with a frequency interval Enterprise Repli cation transmits all the data in the queue for the replicates in the replicate set up to the point when you added or removed the replicate For more infor mation see Suspending a Replicate Set on page 8 7 and Frequency Options on page A 92 For more information se
283. r To change the default logging mode of a row data shspace 1 Shutdown the database server 2 Remove the sbspace from the CDR ODATA SBSPACE configuration parameter value list 3 Start the database server in recovery mode 4 Waitfor all the smart large objects to get deleted from the sbspace Use the onstat g smb lod command to check for smart large objects stored in an sbspace 5 Change the default logging mode for the sbspace 6 Add the sbspace name to the CDR ODATA SBSPACE configuration parameter value list 7 Shutdown and restart the database server using the onmode ky and oninit commands Dropping a Spooled Row Data sbspace You can drop a row data sbspace if you have more than one sbspace specified by the CDR_QDATA_SBSPACE configuration parameter Dropping a row data sbspace 1 Shutdown the database server 2 Remove the sbspace from the CDR ODATA SBSPACE configuration parameter value list 3 Start the database server in recovery mode Preparing the Replication Environment 4 17 Setting Up the Grouper Paging File 4 Waitfor all the smart large objects to get deleted from the sbspace Use the onstat g smb lod command to check for smart large objects stored in a sbspace 5 Drop the sbspace Warning Do not drop an Enterprise Replication row data sbspace using the onspaces d f force command Setting Up the Grouper Paging File Enterprise Replication uses a grouper paging mechanism for eval
284. r change replicate on page A 4 cdr define replicate on page A 10 cdr delete replicate on page A 24 cdr list replicate on page A 38 cdr modify replicate on page A 48 cdr start replicate on page A 67 cdr stop replicate on page A 73 cdr suspend replicate on page A 77 A 60 IBM Informix Dynamic Server Enterprise Replication Guide Command Syntax cdr resume replicateset The cdr resume replicateset or cdr resume replset command resumes delivery of replication data for all the replicates in a replicate set Syntax cdr resume replicateset br Connect Option n 87 p A Element Purpose Restrictions Syntax repl set Name of replicate set to resume None Long Identifiers on page A 86 The cdr resume replicateset command causes all replicates contained in the replicate set repl set to enter the active state for all participants Important If not all the replicates in a non exclusive replicate set are suspended the cdr resume replicateset command displays a warning and only resumes the repli cates that are currently suspended For more information on replicate states refer to The STATE Column on page A 45 Example The following example connects to the default database server INFORMIXSERVER and resumes the replicate set accounts set cdr res replset accounts set Command Line Utility Reference A 61 Command Syntax See Also
285. r define replicate on page A 10 cdr delete replicate on page A 24 cdr modify replicate on page A 48 cdr resume replicate on page A 59 cdr start replicate on page A 67 cdr stop replicate on page A 73 cdr suspend replicate on page A 77 Command Line Utility Reference A 41 Command Syntax cdr list replicateset The cdr list replicateset or cdr list replset command displays information about the replication sets defined on the current server Syntax cdr list replicateset n Connect Option p A 87 repl set Element Purpose Restrictions Syntax repl set Name of the replicates The replicates must exist Long Identifiers on page A 86 Usage The cdr list replicateset command displays a list of the replicate sets that are currently defined To list the information about each of the replicates within the replicate set use cdr list replicateset repl_set For more information see Displaying Information About Replicates on page A 40 In hierarchical topology leaf servers have limited information about other database servers in the Enterprise Replication domain Therefore when cdr list replicateset is executed against a leaf server it displays incomplete infor mation about the other database servers You do not need to be user informix to use this command Examples The following example displays a list of the replicate sets on the current server cd
286. r g italy This command removes connections between the italy replication server and all other servers in the replication system usa and japan and removes any queued data Run cdr delete server c italy g italy This command removes all replication information including the syscdr database from the italy database server Run cdr delete server g japan cdr delete server c g japan These commands remove the japan replication server Run cdr delete server g usa This command removes the replication information from the usa replication server itself A 30 IBM Informix Dynamic Server Enterprise Replication Guide Command Syntax See Also cdr connect server on page A 9 cdr define server on page A 19 cdr disconnect server on page A 32 cdr list server on page A 44 cdr modify server on page A 55 cdr resume server on page A 63 cdr suspend server on page A 81 Command Line Utility Reference A 31 Command Syntax cdr disconnect server The cdr disconnect server command stops a server connection Syntax cdr disconnect server server group Y Connect Option f p A 87 Element Purpose Restrictions Syntax server group Name of the database server The database server group must group to disconnect be currently active in Enterprise Replication Usage The cdr disconnect server command drops the connection for example for a dialup line between server
287. r list replicateset A 42 IBM Informix Dynamic Server Enterprise Replication Guide Command Syntax The following output might result from the previous command REPLSET PARTICIPANTS gi Exclusive Repll Repl4 g2 Rep12 g3 Rep13 This example displays information for all the replicates in the replicate set sales_set cdr list replset gl The following output might result from the previous command REPLICATE SET g1 Exclusive CURRENTLY DEFINED REPLICATES REPLICATE Repli STATE Inactive CONFLICT Ignore FREQUENCY immediate QUEUE SIZE 0 PARTICIPANT bank arthur account OPTIONS row ris ats REPLICATE Repl4 STATE Inactive CONFLICT Ignore FREQUENCY immediate QUEUE SIZE 0 PARTICIPANT bank arthur teller OPTIONS row ris ats See Also cdr change replicateset on page A 6 cdr define replicate on page A 10 cdr delete replicateset on page A 26 cdr modify replicateset on page A 53 cdr resume replicateset on page A 61 cdr start replicateset on page A 69 cdr stop replicateset on page A 75 cdr suspend replicateset on page A 79 Command Line Utility Reference A 43 Command Syntax cdr list server The cdr list server command displays a list of the Enterprise Replication servers that are visible to the current server Syntax cdr list server RG Connect Option p A 87 server grou Element Purpose Restrictions Syntax server group Name of the s
288. reate those references on the target database server Instead Enterprise Replication creates multiple smart large objects on the target database server 2 24 IBM Informix Dynamic Server Enterprise Replication Guide Enterprise Replication Data Types Replicating Opaque User Defined Data Types Enterprise Replication supports built in data types and extended data types including opaque data types and user defined types UDTs For a list of supported extensible data types see Extensibility Enhancements on page 6 of the Introduction Installing and Registering UDTs You must install and register UDTs and their associated support routines on all database servers participating in Enterprise Replication prior to starting replication If you combine Enterprise Replication with High Availability Data Repli cation HDR you must install UDTs on both HDR database servers but only register them on the primary HDR database server see IBM Informix Dynamic Server Administrator s Guide UDT Support Functions If you plan to replicate opaque user defined types UDTs the UDT designer must provide two support functions streamwrite and streamread This also applies to UDTs embedded in complex types The purpose of these functions is similar to the existing send and receive functions provided for client server transmissions For information on writing these support functions see the section on Enter prise Replication s
289. reating and Managing Replicate Sets 8 7 Resuming a Replicate Set Resuming a Replicate Set To return the suspended replicates in the replicate set to active use the cdr resume replicateset command For example cdr resume replicateset sales set For more information see cdr resume replicateset on page A 61 and cdr resume replicate on page A 59 Deleting a Replicate Set To delete the replicate set use the cdr delete replicateset command Tip When you delete a replicate set Enterprise Replication does not delete the repli cates that are members of the replicate set The replicates remain in the state they were in when the set was deleted For example to delete sales_set enter cdr delete replicateset sales set Warning Avoid deleting a replicate set and immediately re creating it with the same name If you re create the objects immediately before the operation finishes propa gating to the other Enterprise Replication database servers in the network failures might occur in the Enterprise Replication system at the time of the operation or later For more information see Operational Considerations on page 2 8 For more information see cdr delete replicateset on page A 26 IBM Informix Dynamic Server Enterprise Replication Guide Modifying Replicate Sets Modifying Replicate Sets You can modify replicate sets in two ways m Adding or Deleting Replicates From a Replicate Set m Changing Replication Fre
290. referential constraints placed on columns you must create an exclusive replicate set and add the replicate to it An exclusive replicate set has the following characteristics m All replicates in an exclusive replicate set have the same state and frequency settings For more information see Displaying Infor mation About Replicates on page A 40 m When you create the replicate set Enterprise Replication sets the initial state of the replicate set to active m You can manage the replicates in an exclusive replicate set only as part of the set Enterprise Replication does not support the following actions for the individual replicates in an exclusive replicate set a Starting a Replicate a Stopping a Replicate a Suspending a Replicate a Resuming a Suspended Replicate m Replicates that belong to an exclusive replicate set cannot belong to any other replicate sets To create an exclusive replicate set use the exclusive X option with cdr define replicateset Important Once you create an exclusive replicate set you cannot change it to non exclusive and vice versa IBM Informix Dynamic Server Enterprise Replication Guide Non Exclusive Replicate Sets Non Exclusive Replicate Sets By default cdr define replicateset creates non exclusive replicate sets A non exclusive replicate set has the following characteristics m You can manage replicates that belong to a non exclusive replicate set both ind
291. release notes Documentation notes which contain additions and corrections to the manuals and release notes are located in the directory where the product is installed Please examine these files because they contain vital information about application and performance issues IBM Informix Dynamic Server Enterprise Replication Guide UNIX Additional Documentation On UNIX platforms the following online files appear in the INFORMIXDIR release en us 0333 directory Online File Purpose ids erep docnotes 9 40 html ids unix release notes 9 40 html ids unix release notes 9 40 txt ids machine notes 9 40 txt The documentation notes file describes features that are not covered in the manual or that were modified since publication The release notes file describes feature differences from earlier versions of IBM Informix products and how these differences might affect current products This file also contains information about any known problems and their workarounds The machine notes file describes any special actions that you must take to configure and use IBM Informix products on your computer Machine notes are named for the product described Introduction 15 Related Reading UNIX 16 or Release Notes from the task bar Program Group Item Description The following items appear in the Informix folder To display this folder choose Start gt Programs Informix Documentation Notes
292. rent transactions currently being applied from this Source server MaxPnd Maximum number of transactions in the pending list queue MaxAct Maximum number of transaction in the active list queue AvgPnd Average depth of the pending list queue AvgAct Average depth of the active list queue CommitRt Commit rate of transaction from this source server based on trans actions per second The g rcv option is used primarily as a debugging tool and by Technical Support onstat Command Reference C 9 onstat g rep onstat g rep The onstat g rep command prints events that are in the queue for the schedule manager The g rep option is used primarily as a debugging tool and by Technical Support The onstat g rep command has the following formats onstat g rep onstat g rep replname The repl name modifier limits the output to those events originated by the replicate named repl name onstat g rqm The onstat g rqm command prints statistics and contents of the low level queues send queue receive queue ack send queue sync send queue and control send queue managed by the Reliable Queue Manager ROM The ROM manages the insertion and removal of items to and from the various queues The ROM also manages spooling of the in memory portions of the queue to and from disk The g rqm option displays the contents of the queue size of the transactions in the queue how much of the queue is in memory and on disk the lo
293. replicates in the replicate set repl_set to enter the inactive state no capture no send on the database servers in the server_group list If the server group list is omitted the replicate set repl set enters the inactive state for all database servers participating in the replicate set Important If not all the replicates in the non exclusive replicate set are active the cdr stop replicateset command displays a warning and only stops the replicates that are currently active Command Line Utility Reference A 75 Command Syntax Example The following example connects to the database server paris and stops the replicate set accounts set on server groups g_utah and g iowa cdr sto replset connect paris accounts set g utah g iowa See Also cdr change replicateset on page A 6 cdr define replicate on page A 10 cdr delete replicateset on page A 26 cdr list replicateset on page A 42 cdr modify replicateset on page A 53 cdr resume replicateset on page A 61 cdr start replicateset on page A 69 cdr suspend replicateset on page A 79 A 76 IBM Informix Dynamic Server Enterprise Replication Guide Command Syntax cdr suspend replicate The cdr suspend replicate command suspends delivery of replication data Syntax repl name DEF cdr suspend replicate U Connect Option J p A 87 Element Purpose Restrictions Syntax repl_name Na
294. replication server To determine the size of your transaction record dbspace you must determine the estimated number of transactions in a given period You should allocate 110 bytes per transaction to the dbspace and allocate enough disk space to store 24 hours of transaction records For example if your network is down for 24 hours and you estimate that you will log 1000 trans actions each day the size of the transaction record dbspace should be at least 108 kilobytes 110 bytes 1000 transactions 1024 To create the transaction record dbspace use onspaces c For example to create a 110 kilobyte dbspace called er dbspace using raw disk space on UNIX with an offset of 0 enter onspaces c d er dbspace p dev raw devil o 0 s 110 The pathname for the dbspace cannot be longer than 256 bytes Set the CDR OHDR DBSPACE configuration parameter CDR OHDR DBSPACE Configuration Parameter on page B 12 in the ONCONFIG file to the location of the transaction record dbspace er dbspace in this example Warning Do not change the value of CDR QHDR DBSPACE after you initialize Enterprise Replication on a server Preparing the Replication Environment 4 13 Setting Up Send and Receive Queue Spool Areas For information on creating dbspaces see the chapter on managing disk space in the IBM Informix Dynamic Server Administrator s Guide and the utilities chapter in the IBM Informix Administrator s Reference Row Data sbspaces Repl
295. rk connection between the current replication server and the server g papeete enter cdr disconnect server g papeete Warning When you disconnect a server from Enterprise Replication you must ensure that the send queues on all other Enterprise Replication servers participating in replication do not fill For more information see cdr disconnect server on page A 32 Managing Replication Servers and Replicates 7 11 Reestablishing the Network Connection Reestablishing the Network Connection To reestablish a dropped network connection use the cdr connect server command For example to reestablish the network connection between the current repli cation server and the server g papeete enter cdr connect server g papeete For more information see cdr connect server on page A 9 7 12 BM Informix Dynamic Server Enterprise Replication Guide Creating and Managing Replicate Sets In This Chapter Creating Replicate Sets Exclusive Replicate Sets Non Exclusive Replicate Sets Customizing the Replicate Set Definition Viewing Replicate Set Properties Managing Replicate Sets Starting a Replicate Set Stopping a Replicate Set Suspending a Replicate Set Resuming a Replicate Set Deleting a Replicate Set Modifying Replicate Sets Adding or Deleting Replicates From a Replicate Set Changing Replication Frequency For the Replicate Set 8 3 8 4 8 4 8 5 8 6 8 7 8 7 8 7
296. roduct Pa gt 4325 crystal 4367 silverware INV Product p 998 pottery 6520 ceramic tile Thread Fan out Thread AN Thread The CDR_EVALTHREADS configuration parameter specifies the number of grouper evaluator threads to create when Enterprise Replication starts and enables parallelism The format is per cpu vp additional IBM Informix Dynamic Server Enterprise Replication Guide The following table provides four examples of CDR EVALTHREADS Number of Threads Explanation Example 12 2 2 0 0A 1 evaluator thread per CPU VP plus 2 For a3 CPU VP server 3 1 2 5 2 evaluator threads per CPU VP For a3 CPU VP server 3 2 6 2 evaluator threads per CPU VP For a 3 CPU VP server 3 2 0 6 4 evaluator threads for any database For a 3 CPU VP server 3 0 44 2 4 server Warning Do not configure the total number of evaluator threads to be smaller than the number of CPU VPs in the system Configuration Parameter and Environment Variable Reference B 7 CDR MAX DYNAMIC LOGS Configuration Parameter default value 0 range of values m 1add dynamic log files indefinitely m 0 disable dynamic log addition m gt 0 number of dynamic logs that can be added takes effect when shared memory is initialized and the DYNAMIC LOGS configuration parameter is set to 2 For more information on the DYNAMIC LOGS configuration parameter see the IBM Infor
297. ronment Variables To configure the database server environment verify that the following environment variables are set correctly m INFORMIXDIR is set to the full path of the Informix directory m INFORMIXSERVER is set to the name of the default database server For more information see also Connect Option on page A 87 m INFORMIXSQLHOSTS is set to the full path to the SOLHOSTS file UNIX or the SOLHOSTS registry host machine Windows For more information see the IBM Informix Administrator s Reference Setting Configuration Parameters In the ONCONFIG file for each database server make sure that the following configuration parameters are set m DBSERVERNAME is set to the correct database server If you use both DBSERVERNAME and DBSERVERALIASES DBSERVERNAME should refer to the TCP connection and not to a shared memory connection For information about database server aliases refer to the IBM Informix Dynamic Server Administrator s Guide m CDR_DBSPACE is set to the dbspace for the syscdr database If not set the root dbspace is used m CDR_QUEUEMEM is set to the maximum amount of memory to be used for the send and receive queues m CDR OHDR DBSPACE is set to the location of the transaction record dbspace For more information see Transaction Record dbspace on page 4 13 4 20 IBM Informix Dynamic Server Enterprise Replication Guide Setting Configuration Parameters CDR ODATA SBSPACE is set to the location of
298. ronous propagation 2 9 connect option and database server name 6 5 and replicate sets 8 3 connecting to another replication server 7 4 description of A 20 Connected status replication servers A 45 Connecting status replication servers A 45 Connecting to a database server A 9 CONNECTION CHANGED column cdr list server output A 46 Connections testing network 4 9 Considerations distributed transactions 2 14 large transactions 2 15 memory use C 3 planning to use Enterprise Replication 2 8 primary target replication systems 3 8 replicating changed columns only 6 12 extensible data types 2 26 replication environment 2 17 volume 2 14 SELECT statement A 91 SPL routines for conflict resolution 3 16 transaction processing 2 14 Consistency ensuring 4 22 Consolidation replication See Many to one replication Constraints checking 3 18 primary key 2 11 referential 6 11 A BC D EF GH Contact information Intro 17 Conventions ATS files 9 5 code samples Intro 13 command line utility A 83 database server groups 4 6 documentation Intro 9 CRCOLS See Shadow columns CREATE TABLE statement 4 26 See also IBM Informix Guide to SQL Syntax Creating clustered indexes 2 16 databases with unbuffered logging 2 10 demonstration databases Intro 5 replicate sets 8 4 row data sbspace 4 14 4 15 Cross replication between simple large objects and smart large objects 2 21 Customizing replicate sets 8 5 replicates 6 7 replication
299. rs in the network failures might occur in the Enterprise Replication system at the time of the operation or later For more information see Operational Considerations on page 2 8 Examples This example removes the server g italy from the replication environment assume that you issue the commands from the replication server g usa cdr delete server g italy cdr delete server c italy g italy The first command performs the following actions Removes g italy from the usa global catalog Drops the connection from g usa to g italy Removes g italy from all participating replicates Purges the replication data destined for g italy from send queues Broadcasts this delete server command to all other servers other than g italy so that they can perform the same actions The second command connects to server italy and removes Enterprise Repli cation from italy That is it removes the syscdr database and removes or stops other components of Enterprise Replication Command Line Utility Reference A 29 Command Syntax Figure A 1 shows a replication environment with three replication servers g usa g italy and g japan Figure A 1 Three Replication Servers g japan To remove Enterprise Replication from this environment issue the following commands from the computer where the usa replication server resides To remove Enterprise Replication from this environment 1 Run cdr delete serve
300. rserver and cdrtime columns in your map when you load the data m Use express mode to load data that contains the cdrserver and cdrtime columns You must perform a level 0 archive after completion You can also use deluxe mode without replication to load data After a deluxe mode load you do not need to perform a level 0 archive Deluxe mode also allows you to load TEXT and BYTE data and opaque user defined types For information about HPL refer to the IBM Informix High Performance Loader User s Guide Preparing the Replication Environment 4 27 Loading and Unloading Data onunload and onload Utilities You can use the onunload and onload utilities only to unload and load an entire table If you want to unload selected columns of a table you must use either unload or the HPL Important You can only use onunload and onload in identical homogeneous environments For more information about onunload and onload see the IBM Informix Migration Guide dbexport and dbimport Utilities If you need to copy an entire database for replication you can use the dbexport and dbimport utilities These utilities unload an entire database including its schema and then re create the database If you want to move selected tables or selected columns of a table you must use some other utility For more information about dbexport and dbimport see the IBM Informix Migration Guide UNLOAD and LOAD Statements The UNL
301. ructure of the table In addition you cannot exclusively lock a database that is involved in replication or perform operations that require an exclusive lock However you can exclusively lock a table in a database Overview of Enterprise Replication Administration 2 15 Transaction Processing Considerations Forbidden SQL Statements You cannot use the following SOL statements against a table that is included in a replicate m DROP TABLE m RENAME TABLE m ALTER FRAGMENT Limited SQL Statements The following additional limitations also apply to tables defined for replication Do not remove or disable the primary key constraint Do not rename add or drop columns Do not modify a column type Do not add or drop rowids Do not add or drop CRCOLS shadow columns Q ALTER TABLE ADD CRCOLS Q ALTER TABLE DROP CRCOLS For more information about CRCOLS see Preparing Tables for Con flict Resolution on page 4 25 m Do not modify the primary key columns For example do not alter the column to add default values or other constraints Important Because primary key updates are sent as DELETE INSERT statement pairs avoid changing the primary key and updating data in the same transaction m Do not create or alter clustered indexes Important Creating or altering a clustered index on a replicated table is not allowed To use the forbidden and limited SQL statements against a
302. rule is defined for this replicate and the column is stored in a blobspace Example 2 500 NoChange TEXT PB 877 necromsv 840338478 0000 08 17 20 21 18 gt In this example NoChange after 500 indicates the TEXT data has size of 500 but the data has not been changed on the source server Therefore the data is not sent from the source server Changed Column Information in RIS Files See Changed Column Information in ATS Files on page 9 8 BLOB and CLOB Information in RIS Files See BLOB and CLOB Information in ATS Files on page 9 8 UDT Information in RIS Files See UDT Information in ATS Files on page 9 8 Preventing Memory Queues from Overflowing In a well tuned Enterprise Replication system the send queue and receive queue should not regularly overflow from memory to disk However if the queues in memory fill the transaction buffers are written spooled to disk Spooled transactions consist of transaction records replicate information and row data Spooled transaction records and replicate information are stored in the transaction tables and the replicate information tables in a single dbspace Spooled row data is stored in one or more sbspaces 9 12 IBM Informix Dynamic Server Enterprise Replication Guide Preventing Memory Queues from Overflowing For more information see Setting Up Send and Receive Queue Spool Areas on page 4 12 The following situations can cause Enterprise Replication to sp
303. s again when you restart the database server Under rare conditions you might want to temporarily stop the Enterprise Replication processing without stopping the database server The cdr stop command shuts down all Enterprise Replication threads in an orderly manner however no data to be replicated is captured When the shutdown of Enterprise Replication is complete the message CDR shutdown complete appears in the database server log file After issuing the cdr stop command replication threads remain stopped even if the database server is stopped and restarted until you issue a cdr start command You cannot delete a server from the enterprise if it is stopped To delete a server with cdr delete server you must issue a cdr start command first Warning If you issue cdr stop and database activity continues the database server from which the command is issued and the other database servers participating in replicates will become inconsistent To ensure consistency verify that no database update activity occurs while Enterprise Replication is stopped Command Line Utility Reference A 71 Command Syntax Example The following example stops Enterprise Replication processing on database server paris Processing does not resume until a cdr start command restarts it cdr stop c paris See Also m cdr start on page A 65 A 72 BM Informix Dynamic Server Enterprise Replication Guide cdr stop replicate Command Synt
304. s any database changes Important You cannot stop replicates that have no participants For example to stop the sales data replicate on the servers server1 and server23 enter cdr stop replicate sales data serverl server23 IBM Informix Dynamic Server Enterprise Replication Guide Suspending a Replicate This command causes server and server23 to purge any data in the send queue for the sales data replicate and stops sending data for that replicate Any servers not listed on the command line continue to capture and send data for the sales data replicate even to server1 and server23 If you omit the server names this command stops the replicate on all servers that are included in that replicate Important If a replicate belongs to an exclusive replicate set you must stop the replicate set to which the replicate belongs For more information see Exclusive Replicate Sets on page 8 4 and Stopping a Replicate Set on page 8 7 For more information see cdr stop replicate on page A 73 Suspending a Replicate If you do not want to completely halt all processing for a replicate you can suspend a replicate using the cdr suspend replicate command When a replicate is suspended the replicate captures and accumulates changes to the source database but does not transmit the captured data to the target database Warning Enterprise Replication does not support referential integri
305. s only 6 11 6 12 extensible data types considerations 2 26 floating point values 6 13 large objects 6 12 multiple references to a smart large object 2 24 simple large objects 2 20 to 2 24 smart large objects 2 20 to 2 24 table hierarchies 2 26 UDTs 2 25 Replicating data capturing transactions 1 10 evaluating data 1 10 row images 1 10 process 1 9 Replication blocking 4 22 choosing network topology 3 18 environment considerations 2 17 managing 2 4 examples E 1 to E 14 frequency changing 6 15 8 10 replicate sets 8 5 specifying 6 10 models primary target 1 4 update anywhere 1 4 order error definition of 1 19 restarting 7 5 stopping 7 4 suspending 7 5 Index 13 A BC D EF GH tree illustrated 3 21 volume 2 14 Replication servers 2 5 connecting to 7 4 customizing 6 6 defining 6 3 6 5 A 19 definition of 2 5 6 3 deleting 7 6 A 28 listing A 44 managing 7 3 to 7 7 modifying 6 14 to 6 16 A 55 recreating 7 7 resuming 7 6 resynchronizing 6 16 state definition of 7 3 suspending A 81 synchronizing 6 6 troubleshooting 9 13 viewing attributes 7 4 Replication systems high availability 5 3 primary target 3 3 3 8 supported by Enterprise Replication 3 3 update anywhere 3 8 3 9 Replication topologies forest of trees 3 22 fully connected 3 19 hierarchical 3 19 hierarchical tree 3 21 terminology 3 20 Requirements disk space delete tables 4 11 logicallog files 4 10 message queue spooling 4 12 planning for 4 10 sh
306. s tahiti Creating and Managing Replicate Sets 8 5 Viewing Replicate Set Properties To define the exclusive replicate set dev set with the replicates dev pdx and dev lenexa and specify that the members of dev set replicate at 5 00 P M every day enter cdr define replicateset X at 17 00 dev set dev_pdx dev lenexa Important For replicates that belong to an exclusive replicate set you cannot specify the frequency for the individual replicates in the set For more information see cdr define replicateset on page A 16 Viewing Replicate Set Properties To view the properties of the replicate set use the cdr list replicateset command The cdr list replicateset command displays the replicate set name and a list of the replicates that are members of the set To find out more about each replicate in the replicate set see Viewing Replicate Properties on page 7 7 For more information see cdr list replicateset on page A 42 Managing Replicate Sets When you create a replicate set you can manage the replicates that belong to that set together or individually If the replicate set is exclusive you can only manage the individual replicates as part of the set Important Performing an operation on a replicate set except cdr delete replica teset is equivalent to performing the operation on each replicate in the replicate set individually For more information see Man
307. s this value to calculate the metadata size The minimum value for AVG LO SIZE is 2 kilobytes which is appropriate for Enterprise Replication in most cases The default value of AVG LO SIZE is 32 kilobytes If you set AVG LO SIZE to larger than the expected transaction size you might run out of meta data space If you set AVG LO SIZE too small you might waste space on metadata m LOGGING Set this parameter to OFF to create an sbspace without logging Set this parameter to ON to create an sbspace with logging It is recom mended that you use a combination of logging and non logging sbspaces for Enterprise Replication For more information see Log ging Mode for sbspaces on page 4 16 Preparing the Replication Environment 4 15 Setting Up Send and Receive Queue Spool Areas Set the CDR_QDATA_SBSPACE configuration parameter in the ONCONFIG file to the location of the row data sbspace er sbspace in this example For more information see CDR ODATA SBSPACE Configuration Parameter on page B 11 A Warning Do not change the value of CDR_QDATA_SBSPACE after you initialize Enterprise Replication Logging Mode for sbspaces Enterprise Replication uses the default log mode that the sbspace was created with for spooling row data Create sbspaces with a default logging mode of ON or OFF according to the types of transactions Enterprise Replication replicates m LOGGING ON Create sbspaces with LOGGING set to ON to support these s
308. scriptions of the databases and their contents see the IBM Informix Guide to SQL Reference The scripts that you use to install the demonstration databases reside in the INFORMIXDIR bin directory on UNIX platforms and in the INFORMIXDIR bin directory in Windows environments New Features in Dynamic Server Version 9 4 This section describes new Enterprise Replication features These features fall into the following areas Extensibility Enhancements Functionality Improvements Security Enhancements Command Line Changes Configuration Parameters and Environment Variable Changes For a description of all new features see the Getting Started Guide Introduction 5 Extensibility Enhancements Extensibility Enhancements Enterprise Replication in Version 9 4 of Dynamic Server adds support for replicating the following extended data types m Row data types m Collection data types a Lists a Sets a Multisets For information on which user defined types are not supported see the release notes Functionality Improvements Enterprise Replication for Dynamic Server Version 9 4 includes the following functionality enhancements m Faster queue recovery The addition of a table with replicate information to the transaction records and row data tables reduces transaction processing time m Replication during queue recovery Users can connect to a database server during queue recovery trans actions are added to th
309. servers and their children through its parent All nonroot servers are known to all root and other nonroot servers A nonroot server might or might not have children All root and nonroot servers are aware of all other servers in the replication environment 3 20 IBM Informix Dynamic Server Enterprise Replication Guide Hierarchical Replication Topologies Important In Hierarchical Routing topologies Enterprise Replication specifies the synchronization server as the new server s parent in the current topology For more information see Customizing the Replication Server Definition on page 6 6 and cdr define server on page A 19 Hierarchical Tree A hierarchical tree consists of a root database server and one or more database servers organized into a tree topology The tree contains only one root which has no parent Each database server within the tree references its parent A database server that is not a parent is a leaf Figure 3 11 illustrates a repli cation tree Figure 3 11 Hierarchical Tree Topology Hong Kong D L J Shanghai In Figure 3 11 the parent child relationship within the tree is as follows m Asia is the parent of China and Japan m China is the child of Asia and the parent of Beijing Shanghai and Guangzhou m Guangzhou is the child of China and the parent of Hong Kong Selecting the Enterprise Replication System and Network Topology 3 21 Hierar
310. sistency within the Enterprise Replication domain during an HDR switch over to a secondary server Consequently there is a slight increase in replication latency when Enterprise Replication is used with HDR You can control this latency increase by setting the DRINTERVAL configuration parameter to a low value Using High Availability Data Replication with Enterprise Replication 5 13 Chapter Defining and Modifying Replication Servers Replicates and Participants In This Chapter 4 o mobs ee ewe 415 8 wow eos 6 3 Initializing Database Servers a 6 4 Defining Replication Servers Z tono ox 6 5 Customizing the Replication Server Definition Dui ws ance 6 6 Defining Replicates s ll sl s s 6 7 Defining Participants ias Me rd deep RM 6 8 Defining Replicates on Table Hierarchies A E orat E 6 9 Specifying Conflict Resolution Rules and Scope 610 Specifying Replication Frequency 6 0 Setting Up Error Logging X Aog Sal 6e cu Nec Replicating Only Changed Goles Ee 2 64d Using the IEEE Floating Point or Canonical Formal 2 s 643 Enabling Triggers wee ee ee 644 Modifying Replication Servers 644 Modifying Replicates go The i oh Ae Gba ow Baek i65 Adding or Deleting Participants Eo oh mous Wo d ou cb ou 35215 Changing Replicate Attributes 645 Resynchronizing Re
311. sitive integers takes effect when Enterprise Replication is initialized The ENCRYPT SWITCH configuration parameter defines the frequency at which ciphers or secret keys are renegotiated The longer the secret key and encryption cipher remains in use the more likely the encryption rules might be broken by an attacker To avoid this cryptologists recommend changing the secret keys on long term connections The default time that this renegoti ation occurs is once an hour B 20 IBM Informix Dynamic Server Enterprise Replication Guide CDR LOGDELTA Environment Variable default value 30 range of values positive numbers takes effect when Enterprise Replication is initialized The CDR LOGDELTA environment variable determines when the send and receive queues are spooled to disk as a percentage of the logical log size Use the CDR ENV configuration parameter to set this environment variable For more information see CDR ENV Configuration Parameter on page B 5 Important Do not use the CDR LOGDELTA environment variable unless instructed to do so by Technical Support Configuration Parameter and Environment Variable Reference B 21 B 22 CDR PERFLOG Environment Variable default value 0 range of values positive number takes effect when Enterprise Replication is initialized The CDR_PERFLOG environment variable enables queue tracing which can be displayed with the onstat g qu
312. specific You must provide the number of Integer error an error in the error table A 34 IBM Informix Dynamic Server Enterprise Replication Guide Command Syntax The following table describes the options to cdr error Options Long Form Short Form no options specified all a follow f nomark n prune p seq S zap Z Usage Print the current list of errors After the errors have been printed mark them as reviewed Enterprise Replication does not display errors marked as reviewed When used with the move option move the error table to dbspace on all defined servers Otherwise print all errors including those already reviewed Continuously monitor the error table Do not mark errors as reviewed Prune the error table to those times in the range from first to last If first is omitted then all errors earlier than last are removed Remove the single error specified by server seqno from the error table Remove all errors from the error table The cdr error command allows you to examine replication errors on any replication server Sometimes a command succeeds on the server on which it is executed but fails on one of the remote servers For example if you execute cdr define replicate on server1 but the table name is misspelled on server2 the command succeeds on server1 and appears to have completed success fully You can use cdr error c server2 to see why replication is failing The cdr
313. st of up to 32 names of sbspaces that Enterprise Replication uses to store spooled trans action row data Enterprise Replication creates one smart large object per transaction If CDR ODATA SBSPACE is configured for multiple sbspaces then Enterprise Replication uses all appropriate sbspaces in round robin order Important You must set the CDR QDATA SBSPACE configuration parameter and create the sbspaces specified by CDR_QDATA_SBSPACE before defining a server for replication If the configuration parameter is not set in ONCONFIG or the sbspace names specified by CDR QDATA SBSPACE are invalid Enterprise Replication fails to define the server For more information see Row Data sbspaces on page 4 14 and Defining Repli cation Servers on page 6 5 Warning Do not change the value of CDR QDATA SBSPACE while Enterprise Replication is running Configuration Parameter and Environment Variable Reference B 11 CDR QHDR DBSPACE Configuration Parameter default value the name of the dbspace specified by the ROOTNAME configu ration parameter For more information see the IBM Informix Administrator s Reference takes effect when Enterprise Replication is initialized The CDR_QHDR_DBSPACE configuration parameter specifies the location of the dbspace that Enterprise Replication uses to store the transaction record headers spooled from the send and receive queues By default Enterprise Replication stores the transaction record headers in
314. steps to replicate data 1 Capturing Transactions 2 Evaluating Data for Replication 3 Distributing Data 4 Applying Replicated Data About IBM Informix Enterprise Replication 1 9 Capturing Transactions Capturing Transactions As the database server writes rows to the logical log it marks rows that should be replicated Later Enterprise Replication reads the logical log to obtain the row images for tables that participate in replication Informix database servers manage the logical log in a circular fashion the most recent logical log entries write over the oldest entries Enterprise Repli cation must read the logical log quickly enough to prevent new logical log entries from overwriting the logs Enterprise Replication has not yet processed If the database server comes close to overwriting a logical log that Enterprise Replication has not yet processed user transactions are blocked until Enterprise Replication can advance This situation is called DDRBLOCK mode and occurs only if the system is severely misconfigured The row images that participate in replication are passed to Enterprise Repli cation for further evaluation Evaluating Data for Replication Enterprise Replication evaluates transactions based on a change to a final image of a row Row Images Enterprise Replication evaluates the initial and final images of a row and any changes that occur between the two row images to determine which rows to replicate E
315. support functions 2 25 Unbuffered logging 2 10 4 26 UNIX database server groups 4 6 oninit command 6 4 onmode command 6 4 SOLHOSTS file 4 6 4 20 UNLOAD statement 4 28 See also IBM Informix Guide to SQL Syntax unload utility 4 28 Unloading data 4 26 4 27 Unsupported table types 2 10 Update anywhere examples E 6 participants 6 9 replication system combining with HDR 5 5 replication systems description of 3 8 Updates multiple row images 1 13 primary key 1 13 WHERE clause column 1 13 Updating shadow columns 4 24 UPSERTs definition of 6 12 replicating only changed columns 6 12 User defined data types See UDTs User defined routines See UDRs Users informix 2 4 Using canonical format 6 13 IEEE floating point format 6 13 Utilities dbexport 4 28 dbimport 4 28 onload 4 28 onunload 4 26 4 28 unload 4 28 V Values sending floating point 6 13 JK LM NOPQR STU VW X Y Z Variables See Environment variables Viewing network connection status 7 11 replicate attributes 7 7 replicate set attributes 8 6 replication server attributes 7 4 Views and Enterprise Replication 2 8 Virtual columns support for 2 26 w Warning icons Intro 10 WHERE clause column updates 1 13 Windows database server groups 4 7 Informix Admin group 2 4 onmode command 6 4 SOLHOSTS registry host 4 20 starts command 6 4 WITH CRCOLS statement defining shadow columns 4 25 Workflow replication business model 3 7 Workload partitioning
316. t If any changes are made to the manufact table the changes will be replicated to the other participants in the replicate Replication Examples E 5 Cause a Replication Cause a Replication Now you can modify the manufact table on the usa database server and see the change reflected in the manufact table on the italy database server To cause a replication 1 Use DB Access to insert a value into the manufact table on usa INSERT INTO stores usa manufact VALUES AWN Allwyn 8 2 Observe the changes on usa and on italy SELECT from stores usa manufact SELECT from stores italy manufact Do Not Cause a Replication In repl1 usa is the primary database server and italy is the target Changes made to the manufact table on italy do not replicate to usa To not cause a replication 1 Use DB Access to insert a value into the manufact table on italy INSERT INTO stores italy manufact VALUES ZZZ Zip 9 2 Verify that the change occurred on italy but did not replicate to the manufact table on usa SELECT from storesQGusa manufact SELECT from stores italy manufact Update Anywhere Example This example builds on the previous example and creates a simple update anywhere replication In update anywhere replication changes to any table in the replicate are replicated to all other tables in the replicate In this example any change to the stock table of the stores database on any database server
317. t because of the large amounts of data read write capabilities at all sites would cripple the perfor mance of the application Figure 3 1 on page 3 5 illustrates data dissemination IBM Informix Dynamic Server Enterprise Replication Guide Primary Target Replication System Target Target Figure 3 1 5 Daish Data Dissemination in a Primary Target sever 7 peur A Replication System Read only bs Bids PA Read only server Target 4a Target Read write Database server server Read only Read only Data Consolidation As businesses reorganize to become more competitive many choose to consolidate data into one central database server Data consolidation allows the migration of data from several database servers to one central database server In Figure 3 2 the remote locations have read write capabilities while the central database server is read only Pri Figure 3 2 Primary VHS Data Consolidation in a Primary Target Database Database Eu server Replication System Read write TR Target P d Read write Server Primary Primary P di Read only NM Database ener y sever Read write Read write Selecting the Enterprise Replication System and Network Topology 3 5 Primary Target Replication System Businesses can also use data consolidation to off load OLTP data for decision support DSS analysis For example data from several OLTP systems can be replicated to a DSS system f
318. ta If Enterprise Replication processes a row and discovers undeliverable BYTE or TEXT columns the following actions can occur Any undeliverable columns are set to NULL if the replication operation is an INSERT and the row does not already exist at the target The old value of the local row is retained if the replication operation is an UPDATE or if the row already exists on the target Considerations for Replicating Smart Large Objects The following conditions apply to replicating smart large objects Enterprise Replication does not support replication of smart large object updates performed outside of a row update After you update a smart large object that is referenced explicitly in the table schema you must update the referencing row before Enter prise Replication can replicate the updated smart large object For example UPDATE table name SET smart large object column x For more information see the IBM Informix Guide to SQL Syntax Enterprise Replication replicates updates to in place smart large objects by sending a new copy of the entire smart large object Enter prise Replication does not send only the logged changes to update smart large objects Enterprise Replication does not support sharing out of row data multiple references to a smart large object during replication If you try to replicate multiple references to the same smart large object on the source database server Enterprise Replication does not re c
319. tatement that is used as a partic ipant modifier The statement cannot include a join or a subquery The FROM clause of the SELECT statement can reference only a single table The table in the FROM clause must be the table specified by the participant The columns selected must include the primary key The columns selected can include any columns in the table including those that contain smart large objects and TEXT and BYTE data The statement cannot perform operations on the selected columns The statement can include an optional WHERE clause The WHERE clause of the SELECT statement of the participant modi fier can reference an opaque UDT as long as the UDT is always stored in row For more information see Considerations for Replicating Opaque Data Types on page 2 26 For detailed information about the SELECT statement and WHERE clause refer to the IBM Informix Guide to SQL Syntax It is recommended that except for replicating between SERIAL and INT and between BYTE TEXT and BLOB CLOB you only replicate between like data types For example do not replicate between the following CHAR 40 to CHAR 20 INT to FLOAT Command Line Utility Reference A 91 Return Codes Return Codes If the command encounters an error the database server returns an error message and a return code value The message briefly describes the error For information on interpreting the return code use the cdr finderr command Frequency O
320. te that you will log 4 megabytes of replicated data each day the size of the sbspaces you identify for the spooled row data must be a total of at least 4 megabytes 4 14 IBM Informix Dynamic Server Enterprise Replication Guide Setting Up Send and Receive Queue Spool Areas On Windows increase the resulting size of the sbspace by approxi mately a factor of two The default page size the way that data maps onto a page and the number of pages written to disk differs on Windows Warning When the row data sbspaces fill Enterprise Replication hangs until you either resolve the problem that is causing Enterprise Replication to spool or allocate additional disk space to the sbspaces For more information see Preventing Memory Queues from Overflowing on page 9 12 To create row data sbspaces use the onspaces c utility For example to create a 4 megabyte sbspace called er sbspace using raw disk space on UNIX with an offset of 0 enter onspaces c S er sbspace p dev rdsk c0t1d0s4 o 0 s 4000 m dev rdsk2 cOtidOs4 0 Df AVG LO SIZE 2 LOGGING OFF The pathname for an sbspace cannot be longer than 256 bytes The m option specifies the location and offset of the sbspace mirror The Df option specifies default behavior of the smart large objects stored in the sbspace m AVG LO SIZE average large object size Set this parameter to the expected average transaction size in kilo bytes The database server use
321. te is defined with a conflict resolution rule RRD Replicated row data This line contains the list of replicated columns in the same order as in the SELECT statement in the define replicate command Each column is separated by a and displayed in ASCII format When the spooling program encounters severe errors for example cannot retrieve replicate id for the replicated row unable to determine the replicated column s type size or length it displays this row data in hexadecimal format The spooling program also displays the row data in hexidecimal format if a row includes replicated UDT columns IBM Informix Dynamic Server Enterprise Replication Guide BYTE and TEXT Information in ATS Files BYTE and TEXT Information in ATS Files When the information recorded in the ATS file includes BYTE or TEXT data the replicated row data RRD information is reported as the following examples show Example 1 1200 TEXT PB 877 necromsv 840338515 00 08 17 20 21 55 In this example m 1200 is the size of the data m TEXT is the data type it is either BYTE or TEXT m Bis the storage type PB when the BYTE or TEXT is stored in the tablespace BB for blobspace storage m The next two fields are the server identifier and the time stamp for the column if the conflict resolution rule is defined for this replicate and the column is stored in a tablespace Example 2 500 NoChange TEXT PB 877 necromsv 84
322. that they were committed on the source database server If consistency can be preserved Enterprise Replication might commit transactions out of order on the target database When Enterprise Replication applies replication data it checks to make sure that no collisions exist A collision occurs when two database servers update the same data simultaneously Enterprise Replication reviews the data one row at a time to detect a collision If Enterprise Replication finds a collision it must resolve the conflict before applying the replication data to the target database server 1 18 BM Informix Dynamic Server Enterprise Replication Guide Applying Replicated Data f Figure 1 8 Pakistan Collision Example Products in inventory Tii eases EE a India Column Column Z Pakistan m 7 js field value field value K Bangkok field value N field value Bangkok u Time 12 29 27 Figure 1 8 shows a situation that yields a conflict Pakistan updates the row two seconds before Bangkok updates the same row The Bangkok update arrives at the India site first and the Pakistan update follows The Pakistan time is earlier than the Bangkok time Because both updates involve the same data and a time discrepancy exists Enterprise Replication detects a collision For more information see Conflict Resolution on page 3 10 Enterprise Replication scans to see if the same primary key already exists in the target table
323. ting BYTE and TEXT data 2 24 data process for 1 18 Distribution replication See One to many replication DNS 4 4 Documentation notes Intro 15 Documentation notes program item Intro 16 Documentation types of Intro 14 documentation notes Intro 15 machine notes Intro 15 release notes Intro 15 Domain Name Service See DNS DRINTERVAL parameter 5 13 DROP CRCOLS statement 4 26 DROP TABLE statement 2 16 6 IBM Informix Dynamic Server Enterprise Replication Guide Dropped network connections reestablishing 7 12 Dropped status replication servers A 45 Dropping columns from a table 2 16 network connection 7 11 rowids 2 16 shadow columns 4 26 DSS and data consolidation business model 3 6 Dynamic logs setting CDR MAX DYNAMIC LOGS B 8 Enabling triggers 6 14 Encryption cipher renegotiation B 20 combining with client server in SOLHOSTS 4 8 configuration parameters for 4 21 enabling with ENCRYPT CDR B 15 HDR not supported with 5 8 MAC files specifying B 19 message authentication code generation B 18 overview 1 8 specifying ciphers and modes B 16 ENCRYPT CDR parameter 4 8 4 21 B 15 ENCRYPT CIPHER parameter 4 21 B 16 ENCRYPT MAC parameter 4 21 B 18 ENCRYPT MACFILE parameter 4 21 B 19 ENCRYPT SWITCH parameter 4 21 B 20 English locale 2 18 Enterprise Replication administering 1 8 administration overview 2 3 and cascading deletes 2 12 and triggers 2 13 A BC D EF GH batch jobs 2 15 consistency 1 7 d
324. tion enters blockout mode if the CDR MAX DYNAMIC LOGS configuration parameter is set to a non zero integer For more information see Preventing DDRBLOCK Mode on page 9 14 Delete Table Disk Space If you use the time stamp or time stamp and SPL routine conflict resolution rules Enterprise Replication creates delete tables to keep track of modified rows for conflict resolution Enterprise Replication creates delete tables only for tables that have replicates defined with a conflict resolution rule other than ignore Delete tables handle conflicts such as when a DELETE or UPDATE finds no corresponding row on the target The DTCleaner thread removes a row from the delete tables after all the servers have progressed beyond that row For more information see Conflict Resolution Rule on page 3 11 Delete tables are created on the database server where the data originates and on all the database servers to which data gets replicated Delete tables are stored in the same dbspaces using the same fragmentation strategy as their base tables Preparing the Replication Environment 4 11 Setting Up Send and Receive Queue Spool Areas To determine the disk space requirements to accommodate delete tables estimate how many rows will be deleted or modified For example if the base table has 100 megabytes of data but only half the rows might be deleted or modified then 50 megabytes is a reasonable estimate for the size of the delete table
325. tion see the IBM Informix Guide to SQL Syntax Transaction Processing Considerations Many variables affect the impact that replicating data has on your transaction processing This section discusses some of these variables Replication Volume Distributed Transactions Large Transactions Supported SQL Statements Replication Volume To determine replication volume you must estimate how many data rows change per day For example an application issues a simple INSERT statement that inserts 100 rows If this table is replicated Enterprise Repli cation must propagate and analyze these 100 rows before applying them to the targets Distributed Transactions A distributed transaction is a transaction that commits data in a single transaction over two or more database servers Outside of the replication environment Dynamic Server uses a two phase commit protocol to ensure that the transaction is either committed completely across all servers involved or is not committed on any server For more information about the two phase commit protocol see the IBM Informix Dynamic Seroer Administrator s Guide 2 14 BM Informix Dynamic Server Enterprise Replication Guide Transaction Processing Considerations In a replication environment when a distributed transaction is committed across the source servers each part of the transaction that applies to the local server is written to the local logical logs When Enterprise Replication re
326. tion of data to the server using the cdr suspend server command When replication is suspended to the server the source server queues replicated data but suspends delivery of replicated data to the target server Note that this command does not affect the network connection to the suspended server The source server continues to send other messages such as acknowledgement and control messages Managing Replication Servers and Replicates 7 5 Resuming a Suspended Replication Server 7 6 For example to suspend replication of data to the server group g_papeete from the server group g raratonga enter cdr suspend server g papeete g raratonga To suspend replication to g_papeete from all servers in the enterprise enter cdr suspend server g papeete Warning When you suspend replication on a server you must ensure that the send queues on the other Enterprise Replication servers participating in replication do not fill For more information see cdr suspend server on page A 81 Resuming a Suspended Replication Server To resume replication to a suspended server use the cdr resume server command When you resume the server the queued data is delivered For example to resume replication to the g papeete server group enter cdr resume server g papeete If you do not specify the server group g papeete in the example cdr resume server resumes replication from all servers participating in replication For more informatio
327. tions D Command Line Conventions Sample Code Conventions Additional Documentation Related Reading i Compliance with Industry Sistidadi IBM Welcomes Your Comments OODNNN DIAG TF SP WW Q Bee Pe pe NN DBP We section Introducing Enterprise Replication Chapter 1 About IBM Informix Enterprise Replication In This Chapter IBM Informix Enterprise Replication Asynchronous Data Replication Log Based Data Capture High Performance High Availability Consistent Information Delivery Flexible Architecture Centralized Administration Network Encryption How Enterprise Replication Replicas Data Capturing Transactions Evaluating Data for Replication Distributing Data Applying Replicated Data Chapter 2 Overview of Enterprise Replication Administration In This Chapter M sm die Ses EM G Overview of Enterprise Replication ha esata Enterprise Replication Server Administrator Enterprise Replication Terminology Enterprise Replication Server Replicate Participant Replicate Set Global Catalog Enterprise Replication Considius Operational Considerations Backup and Restore Considerations Database and Table Design Considerations Transaction Processing Considerations Replication Environment Considerations Enterprise Replication Data Types iv IBM Informix Dynamic Server Enterprise Replication Guide 1 6 1 7 1 10 1 10 1 18 1 18 2 3 2 3 2 4 2 5 Section II Cha
328. tive Connected 0 Aug 19 14 20 03 2000 g japan 6 Active Connected 0 Aug 19 14 20 03 2000 g usa t Active Local 0 4 Listthe replication servers as seen by the denver replication server cdr list server connect denver The nonroot server denver has a complete global catalog of replica tion information so it knows all the other servers in its replication system However denver knows the connection status only of itself and its parent usa The command returns the following information SERVER ID STATE STATUS QUEUE CONNECTION CHANGED g boston 3 Active 0 g denver 27 Active Local 0 g italy 8 Active 0 g japan 6 Active 0 g usa 1 Active Connected 0 Aug 19 14 20 03 2000 5 Define miami as a leaf server whose parent is boston cdr define server c miami I leaf S g boston g miami 6 Listthe replication servers as seen by miami cdr list server c miami As a leaf replication server miami has a limited catalog of replication information It knows only about itself and its parent The command returns the following information SERVER ID STATE STATUS QUEUE CONNECTION CHANGED g boston 3 Active Connected 0 Augl9 14 35 17 2000 g miami 4 Active Local 0 Replication Examples E 13 Defining a Hierarchy 7 List details about the usa replication server cdr list server g usa The server is a hub that is it forwards replication information to and from other servers It uses the default values for idle timeout send queue receive
329. tor of the desired database operation Same as the replicate action codes with the following to be performed CHAR 1 additional codes m A Accept the replicated row and apply the column values returned by the SPL routine For example if Enterprise Replication receives an insert and the row already exists locally the insert is converted to an update m S Accept the replicated row and apply the column values as received from the other site For example if Enterprise Replication receives an insert and the row already exists locally the insert fails at the time Enterprise Replication tries to apply the transaction to the database and the transaction aborts with an SOL error m O Discard the replicated row m X Abort the transaction A non zero integer value to request logging of Logging value takes effect only if logging is configured the resolution and the integer value in the for this replicate spooling files INTEGER The columns of the row to be applied to the This list of column values is not parsed if the replicate target table replicate action type in regular action type that the routine returns is S O or X SOL format You can use the arguments to develop application specific routines For example you can create a routine in which a database server always wins a conflict regardless of the time stamp The following list includes some items to consider when you use an SPL routine for conflict resolution
330. tream support functions in the IBM Informix DataBlade API Programmer s Guide When preparing a row that includes any UDT columns to queue to the target system Enterprise Replication calls the streamwrite function on each UDT column The function converts the UDT column data from the in server repre sentation to a representation that can be shipped over the network This allows Enterprise Replication to replicate the column without understanding the internal representation of the UDT On the target server Enterprise Replication calls the streamread function for each UDT column that it transmitted using the streamwrite function Overview of Enterprise Replication Administration 2 25 Enterprise Replication Data Types 2 26 Considerations for Replicating Opaque Data Types The following conditions apply to replicating opaque data types The WHERE clause of the SELECT statement of the participant modifier can reference an opaque UDT as long as the UDT is always stored in row Any UDRs in a WHERE clause can use only parameters whose values can be extracted fully from the logged row images plus any optional constants All of the columns in the SELECT statement of each participant definition must be actual columns in that table Enterprise Repli cation does not support virtual columns results of UDRs on table columns See Participant Modifier on page A 90 for information on the WHERE clause in participant definitions
331. trieves the transaction from the logical logs and forms its transaction data it is unable to identify the separate transaction data as the original single transaction This situation could result in Enterprise Replication applying one transaction successfully while aborting another Another result might be a time lapse between when Enterprise Replication applies the two transactions depending on the number of transaction data in each server s send queue and the state of the server Large Transactions While Enterprise Replication is able to handle large transactions it is optimized for small transactions For best performance avoid replicating large transactions Large transactions are handled with a grouper paging file located in temporary smart large objects Enterprise Replication can process transac tions up to 4 TB in size For more information see Setting Up the Grouper Paging File on page 4 18 You can view Enterprise Replication grouper paging statistics with the onstat g grp pager command see onstat g grp on page C 6 Instead of using Enterprise Replication to perform a batch job use the BEGIN WORK WITHOUT REPLICATION to run the batch job locally on each database server For more information see Blocking Replication on page 4 22 Supported SQL Statements After you define Enterprise Replication on a table by including that table as a participant in a replicate you cannot execute any operation that changes the st
332. try key and database server group registry key on your Windows system In addition ISA allows you to administer your replication system from a web browser See the online help for ISA for details on setting up the SQLHOSTS registry key and database server group registry key Setting up the SQLHOSTS Registry Key with regedt32 It is recommended that you use ISA to set up the SQLHOSTS registry key Important Use extreme caution with regedt32 If you make mistakes when editing the registry you can destroy the configuration not only of your IBM Informix products but of your other applications SQLHOSTS Registry Key F 3 Setting up the SQLHOSTS Registry Key with regedt32 F 4 1 2 10 To set up SQLHOSTS with regedt32 Run the Windows program regedt32 In the Registry Editor window select the window for the HKEY_LOCAL_MACHINE subtree Click the folder icons to select the SOFTWARE INFORMIX SQLHOSTS branch With the SOLHOSTS key selected choose Edit gt Add Key In the Add Key dialog box type the name of the database server in the Key Name dialog box Leave the Class dialog box blank Click OK Select the new key that you just made the key with the database server name Choose Edit gt Add Value In the Add Value dialog box type one of the fields of the sqlhosts information HOST OPTIONS PROTOCOL SERVICE in the Value Name dialog box Do not change the Data Type box Click OK In the String Edit
333. ts any valid dbspace takes effect when Enterprise Replication is initialized The CDR_DBSPACE configuration parameter specifies the dbspace where the syscdr database is created If it is not set then syscdr is created in the root dbspace Configuration Parameter and Environment Variable Reference B 3 B 4 CDR DSLOCKWAIT Configuration Parameter default value 5 units seconds takes effect when shared memory is initialized The CDR_DSLOCKWAIT configuration parameter specifies the number of seconds the Datasync data synchronization component waits for database locks to be released The CDR DSLOCKWAIT parameter behaves similarly to the SET LOCK MODE statement Although the SET LOCK MODE is set by the end user application CDR DSLOCKWAIT is used by Enterprise Replication while applying data at the target database This parameter is useful in condi tions where different sources require locks on the replicated table These sources could be a replicated transaction from another server or a local appli cation operating on that table Transactions that receive updates and deletes from another server in the replicate can abort because of locking problems If you experience transaction aborts in the Datasync due to lock timeouts like this you might want to increase the value of this parameter IBM Informix Dynamic Server Enterprise Replication Guide CDR ENV Configuration Parameter takes effect when Ent
334. ty if a replicate is suspended Instead you should suspend a server For more information see Suspending Replication for a Server on page 7 5 For example to suspend the sales data replicate enter cdr suspend replicate sales data Important If a replicate belongs to an exclusive replicate set you must suspend the replicate set to which the replicate belongs For more information see Exclusive Replicate Sets on page 8 4 and Suspending a Replicate Set on page 8 7 For more information see cdr suspend replicate on page A 77 Managing Replication Servers and Replicates 7 9 Resuming a Suspended Replicate Resuming a Suspended Replicate To return the state of a suspended replicate to active use the cdr resume replicate command For example cdr resume replicate sales data Important If a replicate belongs to an exclusive replicate set you must resume the replicate set to which the replicate belongs For more information see Exclusive Replicate Sets on page 8 4 and Resuming a Replicate Set on page 8 8 For more information see cdr resume replicate on page A 59 Deleting a Replicate To delete the replicate from the global catalog use the cdr delete replicate command When you delete a replicate Enterprise Replication purges all replication data for the replicate from the send queue at all participating database servers For example to delete sales_data from the globa
335. u must manually start Enterprise Replication by executing the cdr start command on that server This is necessary to prevent Enterprise Replication from starting on both servers in an HDR pair Figure 5 8 shows how to switch the secondary server to standard mode Figure 5 8 Switching the Secondary Server to Standard Mode Step On the Primary On the Secondary 1 The server becomes unavailable 2 onmode command onmode d standard 3 cdr command cdr start Using High Availability Data Replication with Enterprise Replication 5 11 HDR Failure If you need to start the primary server while Enterprise Replication is running on the secondary server use the oninit D command to prevent Enterprise Replication and HDR from starting on the primary server If the problem has been resolved on the primary server and you wish to reestablish it as the primary server then first stop Enterprise Replication on the secondary server Otherwise Enterprise Replication attempts to restart on the primary server while it is still active on the secondary server Figure 5 9 shows how to reestablish the primary server Figure 5 9 Reestablishing the Primary Server Step On the Primary On the Secondary 1 cdr command cdr stop 2 onmode command onmode s 3 onmode command onmode d secondary 4 oninit 5 cdr command cdr start If you want to split an active HDR pair into two stand alone servers then you must be careful
336. uating large transactions A transaction is large if the portion to be replicated meets at least one of the following conditions It has greater than 5 000 log records It exceeds one fifth the size of the value of the CDR QUEUEMEM onconfig variable m It exceeds one tenth the size of the value of the SHMVIRTSIZE config uration variable The location of the sbspace used for the paging file is determined by the first of the following ONCONFIG configuration parameters that is set m SBSPACETEMP m SBSPACENAME m CDR ODATA SBSPACE The best solution is to set up an unlogged sbspace as specified by the SBSPACETEMP configuration parameter All updates to the paging files are unlogged The size of the paging sbspace should be at least three time the size of the largest transaction to be processed This sbspace is also used by the database server for other tasks consider its overall usage when determining size requirements A Warning Ifthe paging sbspace fills Enterprise Replication hangs until you allocate additional disk space to the sbspace If additional space is unavailable use the cdr stop command to stop replication 4 18 IBM Informix Dynamic Server Enterprise Replication Guide Creating ATS and RIS Directories Creating ATS and RIS Directories The Aborted Transactions Spooling ATS and Row Information Spooling RIS files contain information about failed transactions and aborted rows If you set up ATS and RIS
337. ude the ats option with the cdr define server command If you do not specify an ATS directory Enterprise Replication stores the ATS files in the following directory UNIX tmp Windows tmp directory of the drive that contains INFORMIXDIR For more information see Creating ATS and RIS Directories on page 4 19 9 4 BM Informix Dynamic Server Enterprise Replication Guide About ATS Filenames 3 When you define a replicate specify that ATS is active To do this include the ats option with the cdr define replicate command For more information see Setting Up Error Logging on page 6 11 About ATS Filenames When ATS is active each aborted transaction is written to a file in the specified directory The following table provides the naming convention for ATS files ats target source threadId timestamp sequence Name Description target The name of the database server receiving this replicate transaction source The name of the database server that originated the transaction threadId The identifier of the thread that processed this transaction timestamp The value of the internal time stamp at the time that this ATS instance was started sequence A unique integer incremented by ATS each time a transaction is spooled The naming convention ensures that all filenames that ATS generates are unique and therefore name collision is unlikely However when ATS opens a file for writing any
338. utine is invoked only if Enterprise Replication evaluates rows and discovers equal time stamps If no secondary conflict resolution rule is defined and the timestamps are equal the transaction from the database server with the lower value in the cdrserver shadow column wins the conflict Figure 3 8 on page 3 14 shows how a conflict is resolved based on the latest time stamp with row scope The time stamp Tlast_update the time of the last update represents the row on the target database server with the last most recent update The time stamp Tep the time when replication occurs repre sents the time stamp on the incoming row Enterprise Replication first checks to see if a row with the same primary key exists in either the target table or its corresponding delete table Selecting the Enterprise Replication System and Network Topology 3 13 Conflict Resolution Important Do not remove the delete tables created by Enterprise Replication The delete table is automatically removed when the last replicate defined with conflict resolution is deleted If the row exists Enterprise Replication uses the latest time stamp to resolve the conflict Figure 3 8 Conflict Resolution Based on the Time Stamp Database Operation Row Exists on Target Time Stamp Insert Update Delete No n a Apply row Apply row Apply row Convert UPDATE to INSERT into Enterprise INSERT Replication delete table Yes Tiast up
339. ution or from SPL routine resolution to time stamp m The ats ris firetrigger and fullrow options require a yes y or no n argument Command Line Utility Reference A 49 Command Syntax A 50 Special Options Special Options Back to cdr modify replicate p A 48 TUM ats is ris 9n 9j A M MN firetrigger OX y T n Md fullrow X F Z The following table describes the special options to cdr modify replicate For more information on these options see Special Options on page A 13 IBM Informix Dynamic Server Enterprise Replication Guide Options Long Form Short Form Meaning atsy n Ayln Activate y or deactivate n aborted trans action spooling for replicate transactions that fail to be applied to the target database ris y n Ryln Activate y or deactivate n row information spooling for replicate row data that fails conflict resolution or encounters replication order problems 10f2 Command Syntax Options Long Form Short Form Meaning firetriggery n Ty n Cause the rows inserted by this replicate to fire y or not fire n triggers at the destination fullrow y n fyln Specifies to y replicate the full row and enable upserts default or n replicate only changed columns and disable upserts 2 of 2 Examples The following example modifies the frequency attributes of replicat
340. valuating data for replication 1 10 data examples of 1 15 rows 1 10 1 13 Evaluation logic 1 10 Event alarms 9 20 every option 6 10 A 93 Examples adding replicates to replicate sets 8 9 ATS filenames 9 5 BEGIN WORK WITHOUT REPLICATION 4 24 BYTE and TEXT data in ATS files 9 7 in RIS files 9 11 to 9 12 cdr change replicate A 5 cdr change replicateset A 7 cdr define replicate A 14 cdr define replicateset A 18 cdr define server A 22 cdr delete replicate A 24 cdr delete replicateset A 27 cdr delete server A 29 to A 30 cdr disconnect server A 32 cdr error A 36 cdr list replicate A 39 A 41 cdr list replicate brief A 39 cdr list replicateset A 42 cdr list server A 44 A 46 cdr modify replicate A 51 cdr modify replicateset A 54 cdr modify server A 56 cdr resume replicate A 59 cdr resume replicateset A 61 cdr start A 65 cdr start replicate A 68 cdr start replicateset A 70 cdr stop A 72 cdr stop replicate A 74 cdr stop replicateset A 76 cdr suspend replicate A 78 cdr suspend replicateset A 80 cdr suspend server A 64 A 82 changing frequency for replicate sets 8 10 collision 1 18 connecting to global catalog 7 4 DB Access 4 24 defining replicate sets 8 5 deleting replicate sets 8 8 replicates 7 10 replicates from replicate sets 8 9 replication servers 7 6 evaluating data 1 15 hierarchy E 11 hosts equiv 4 5 non exclusive replicate sets 8 5 participant definition 6 9 preparing data for replication 4 29 to 4 30 pri
341. valuating the logical log when cdr stop is executed If the evaluation process is running and the logical log ID for the replay position no longer exists when Enterprise Replication is started then the restart partially fails the database server log contains an error message stating that the replay position is invalid If the restart partially fails no database updates performed on the local database server are replicated Warning Issue cdr start and cdr stop with extreme caution Example The following example restarts Enterprise Replication processing on database server utah cdr sta c utah Command Line Utility Reference A 65 Command Syntax See Also m cdr stop on page A 71 A 66 IBM Informix Dynamic Server Enterprise Replication Guide Command Syntax cdr start replicate The cdr start replicate command starts the capture and transmittal of repli cation transactions Syntax repl name C i Vii 2 server group cdr start replicate 3 Connect Option Hf p A 87 Element Purpose Restrictions Syntax repl name Name of the replicate to start The replicate must exist Long Identifiers on page A 86 server group Name of database server groups The database server groups must on which to start the replicate be defined for Enterprise Replication The cdr start replicate command causes the replicate repl name to enter the active state capture send on the database servers
342. ver Enterprise Replication Guide In This Chapter This chapter covers how to manage your Enterprise Replication system including managing replication servers replicates and participants in Enter prise Replication replication server network connections and Enterprise Replication with High Availability Data Replication Managing Replication Servers The state of the server refers to the relationship between the source server and the target server To determine the current state of the server use cdr list server server name For more information about the possible server states see The STATE Column on page A 45 This section contains information on performing the following tasks Viewing Replication Server Attributes Connecting to Another Replication Server Stopping Replication on a Server Restarting Replication on a Stopped Server Suspending Replication for a Server Resuming a Suspended Replication Server Deleting a Replication Server Managing Replication Servers and Replicates 7 3 Viewing Replication Server Attributes Viewing Replication Server Attributes Once you define a server for replication Defining Replication Servers on page 6 5 you can view information about the server using the cdr list server command If you do not specify the name of a defined server on the command line Enterprise Replication lists all the servers that are visible to the current server If you specify a server name Enterprise Repl
343. vers participating in replication be members of database server groups Each server in the enter prise must have a unique identifier the database server group uniquely identifies a server Preparing the Replication Environment 4 5 Verifying SQLHOSTS If you are combining Enterprise Replication with HDR both the primary and secondary HDR servers must be members of the same database server group For more information see Managing Enterprise Replication with High Availability Data Replication on page 5 11 Typically a server group includes only one database server However if the computer has multiple network protocols or network interface cards the server group includes all aliases for the database server Enterprise Repli cation treats the server group as one object whether it includes one or several database server names All Enterprise Replication commands and options use the name of the database server group of the more familiar database server name that is the name specified by the INFORMIXSERVER environment variable for all refer ences to database servers The exception is the connect option which can use both server name or group name This manual also refers to a database server group as a server group This manual uses the convention that the name of a database server group is g followed by the name of a database server that is in the group This use of g_is only a convention g is not required syntax Database
344. weak it is only included if specifically requested It is not included in the all or the allbut list Configuration Parameter and Environment Variable Reference B 17 ENCRYPT MAC Configuration Parameter default value medium range of values One or more of the following options separated by commas m off doesnot use MAC generation m low uses XOR folding on all messages m medium uses SHA1 MAC generation for all messages greater than 20 bytes long and XOR folding on smaller messages m high uses SHA1 MAC generation on all messages For example ENCRYPT MAC medium high takes effect when Enterprise Replication is initialized The ENCRYPT MAC configuration parameter controls the level of message authentication code MAC generation The level is prioritized to the highest value For example if one node has a level of high and medium enabled and the other node has only low enabled then the connection attempt fails Use the off entry between servers only when a secure network connection is guaranteed B 18 IBM Informix Dynamic Server Enterprise Replication Guide ENCRYPT MACFILE Configuration Parameter default value builtin units pathnames up to 1536 bytes in length range of values One or more full path and filenames separated by commas and the optional builtin keyword For example ENCRYPT MACKFILE usr local bin macl dat usr local bin mac2 dat builtin takes effect when Enterprise Replication is initialized
345. wn in the syntax diagrams For example in the Conflict Options on page A 11 the option conflict can be abbreviated but the keyword ignore cannot be abbre viated Both of the following forms are correct conflict ignore C ignore Option Order You can specify the options of the CLU commands in any order Some of the syntax diagrams in this chapter show the options in a specific order because it makes the diagram easier to read Do not repeat any options The following fragment is incorrect because c appears twice In most cases the CLU will catch this inconsistency and flag it as an error However if no error is given the database server uses the last instance of the option In the following example the database server uses the value c utah c ohio i 500 c utah Tip For ease of maintenance always use the same order for your options Command Line Utility Reference A 85 Long Command Line Examples Long Command Line Examples The examples in this guide use the convention of a backslash to indicate that a long command line continues on the next line The following two commands are equivalent The first command is too long to fit on a single line so itis continued on the next line The second example which uses short forms for the options fits on one line cdr define server connect katmandu idle 500 ats cdrfiles ats cdr def ser c katmandu i 500 A cdrfiles ats On Windows these command lin
346. writing 9 14 reading of 1 10 role in Enterprise Replication 2 10 size 4 11 switching 4 10 See also IBM Informix Dynamic Server Administrator s Guide IBM Informix Dynamic Server Administrator s Reference Logical Log Record reduction option and Enterprise Replication 4 10 Long identifiers A 86 LRD label RIS files 9 11 LRH label RIS files 9 11 LRS label RIS files 9 11 LTXEHWM parameter 4 11 LTXHWM parameter 4 11 Machine notes Intro 15 Machine independent format 6 13 A 14 Maintaining consistency 1 7 Managing database servers See IBM Informix Dynamic Server Administrator s Guide Enterprise Replication overview 2 4 replicate sets 8 6 to 8 8 replicates 7 7 to 7 10 in exclusive replicate sets 7 7 replication server network connections 7 11 to 7 12 replication servers 7 3 to 7 7 Many to one replication definition of 3 4 10 IBM Informix Dynamic Server Enterprise Replication Guide Maximum transaction size and logicallog files 4 11 Memory queues preventing overflows 9 12 Memory use considerations C 3 Message authentication code B 18 Message authentication code files B 19 Message file for error messages Intro 16 Message formats canonical 6 13 IEEE 6 13 Message queues CDR QUEUEMEM parameter 4 12 definition of 4 12 planning disk space 4 12 mode option cdr modify server A 56 Modes changing participant A 48 Modes encryption B 16 Modifying column types 2 16 primary key constraint 2 16 replicate attributes
347. x Dynamic Server only m Replication is restricted to base tables That is you cannot define a replicate on a view or synonym A view is a synthetic table a synthesis of data that exists in real tables and other views A synonym is an alternative name for a table or a view For more information on views and synonyms see the IBM Informix Database Design and Imple mentation Guide m Replication is not inherited by any child tables in a typed hierarchy Enterprise Replication asynchronously propagates many control operations through the Enterprise Replication network When you perform adminis trative functions using Enterprise Replication the status that returns from those operations is indicative only of the success or failure of the operation at the database server to which you are directly connected The operation might still be propagating through the other Enterprise Replication database servers in the network at that time 2 8 BM Informix Dynamic Server Enterprise Replication Guide Backup and Restore Considerations Due to this asynchronous propagation avoid performing control operations in quick succession that might directly conflict with one another without verifying that the first operation has successfully propagated through the entire enterprise network Specifically avoid deleting Enterprise Replication objects such as replicates replicate sets and Enterprise Replication servers and immediately re creating those obj
348. x office Selected BEGIN WORK BEGIN WORK INSERT INTO employee UPDATE employee VALUES 927 Jones SET EXEMPT N WHERE emp_id 927 COMMIT WORK COMMIT WORK Figure 1 7 Update Not Selected to Selected Evaluation Logic Replicate Replicate Primary Key Send to Destination Database Initial Image Evaluates Final image Evaluates Changed Server UPDATE F UPDATE T Yes or no INSERT with final row image About IBM Informix Enterprise Replication 1 17 Distributing Data The example shows a replicate WHERE clause column update A row that does not meet the WHERE clause selection criteria is updated to meet the criteria Enterprise Replication replicates the updated row image and converts the update to an insert Distributing Data Enterprise Replication ensures that all data reaches the appropriate server regardless of a network or system failure In the event of a failure Enterprise Replication stores data until the network or system is operational Enterprise Replication replicates data efficiently with a minimum of data copying and sending Applying Replicated Data Enterprise Replication uses a data synchronization process to apply the repli cated data to target database servers The target database servers acknowledge receipt of data when the data is applied to the target database The data synchronization process ensures that transactions are applied at the target database servers in an order equivalent to the order
349. xample you can replicate a simple large object on the source database server to a smart large object on the target server or vice versa Conflict Resolution for Simple and Smart Large Objects By default Enterprise Replication performs all conflict detection and resolution at the row level However in some cases simple large object data that is stored in a tblspace rather than in a blobspace is accepted by the target server even if the row is rejected This does not apply to simple large object data that is stored in blobspaces or smart large object data that is stored in sbspaces Time Stamp Conflict Resolution for Simple Large Objects When a replicated BYTE or TEXT column is modified on the source database server Enterprise Replication records the value of cdrserver and cdrtime for that column For more information on cdrserver and cdrtime see Preparing Tables for Conflict Resolution on page 4 25 If the column on the target database server is also stored in a tablespace rather than in a blobspace Enterprise Replication evaluates the cdrserver and cdrtime values in the source and target columns and uses the following logic to determine if the data is to be applied m Ifthe column of the replicated data has a time stamp that is greater than the time stamp of the column on the local row the data for the column is accepted for replication m Ifthe server ID and time stamp of the replicated column are equal to the server IDand ti
350. y 2 2 2 2 1 6 Consistent Information Delivery 17 Flexible Architecture 1 7 Centralized Administration 1 8 Network Encryption s s 8 How Enterprise Replication Replicates Data 1 9 Capturing Transactions 140 Evaluating Data for Replication 140 Row Images Lo GOR uer St deut us fu 210 Evaluating Rows for Updates nes wow 13 Send Data Queues and Receive Data Queues S etu L Data Evaluation Examples 145 Distributing Data 148 Applying Replicated Data 148 1 2 IBM Informix Dynamic Server Enterprise Replication Guide In This Chapter Data replication generates and manages multiple copies of data at one or more sites which allows an enterprise to share corporate data throughout its organization This chapter introduces IBM Informix Enterprise Replication and explains how this product replicates data IBM Informix Enterprise Replication IBM Informix Enterprise Replication is an asynchronous log based tool for replicating data between IBM Informix Dynamic Server database servers Enterprise Replication on the source server captures transactions to be repli cated by reading the logical log storing the transactions and reliably transmitting
351. y Update Anywhere Replication System u ND Backup server HDR Secondary LJ Using HDR with Enterprise Replication is particularly effective when you use a hierarchical or a forest of trees topology Using High Availability Data Replication with Enterprise Replication 5 5 Using HDR in a Hierarchical Tree Topology Using HDR in a Hierarchical Tree Topology With a hierarchical tree topology parent servers are good candidates for using HDR to provide backup servers The following example is based on the example in Figure 3 11 on page 3 21 If China fails then Beijing and Shanghai can no longer replicate with other servers in the replication system Guagnzhou and Hong Kong can only replicate with each other However if China participated in HDR when it failed the secondary server would replace it and replication could continue as illustrated in Figure 5 4 Figure 5 4 Hierarchical Tree China Topology with HDR p e China offline secondary X primary Beijing Guangzhou RO N Hong Kong L9 Shanghai In this example Asia and Guangzhou which are also parent servers could also benefit from using HDR to ensure high availability 5 6 IBM Informix Dynamic Server Enterprise Replication Guide Using HDR in a Forest of Trees Topology Using HDR in a Forest of Trees Topology Use HDR to ensure that all servers retain access to the replication system in a forest of trees topology
352. you are using the default locale en_us 8859 1 This locale supports U S English format conventions for date time and currency In addition this locale supports the ISO 8859 1 code set which includes the ASCII code set plus many 8 bit characters such as and fi If you plan to use nondefault characters in your data or your SQL identifiers or if you want to conform to the nondefault collation rules of character data you need to specify the appropriate nondefault locale For instructions on how to specify a nondefault locale additional syntax and other considerations related to GLS locales see the IBM Informix GLS User s Guide IBM Informix Dynamic Server Enterprise Replication Guide Demonstration Databases Demonstration Databases The DB Access utility which is provided with your IBM Informix database server products includes one or more of the following demonstration databases m Thestores demo database illustrates a relational schema with infor mation about a fictitious wholesale sporting goods distributor Many examples in IBM Informix manuals are based on the stores demo database m The superstores_demo database illustrates an object relational schema The superstores demo database contains examples of extended data types type and table inheritance and user defined routines For information about how to create and populate the demonstration databases see the IBM Informix DB Access User s Guide For de
353. you might want to temporarily stop the Enterprise Replication threads without stopping the server To stop replication use the cdr stop command When you use cdr stop Enterprise Replication stops capturing data to be replicated To ensure consistency verify that no database update activity occurs while Enterprise Replication is stopped Replication threads remain stopped even if the database server is stopped and restarted until you issue a cdr start command Warning When you stop replication on a server you must ensure that the send queues on the other Enterprise Replication servers participating in replication do not fill For more information see cdr stop on page A 71 Restarting Replication on a Stopped Server To restart replication for a stopped server use the cdr start command When you restart the server the Enterprise Replication threads start and continue Enterprise Replication resumes evaluating the logical logs at the replay position where Enterprise Replication stopped evaluating the logical log when the server was stopped Warning If the logical log corresponding to the replay position no longer exists then the restart partially fails and no database updates performed on the local database server are replicated For more information see cdr start on page A 65 Suspending Replication for a Server If you do not want to completely shut down the Enterprise Replication threads you can suspend replica
354. ze of the logical logs see the chapter on logical logs in the IBM Informix Dynamic Server Administrator s Guide For more information on configuring your logical log files for use with Enter prise Replication see Logical Log Configuration Guidelines on page 4 11 Monitoring and Troubleshooting Enterprise Replication 9 13 Preventing DDRBLOCK Mode 9 14 m Server is overloaded If a server is low on resources Enterprise Replication might not be able to hold all transactions replicating from a source server in mem ory during processing and the transactions spool to disk If this happens check the system resources in particular check disk speed RAM and CPU resources Preventing DDRBLOCK Mode If the database server comes close to overwriting a logical log that Enterprise Replication has not yet processed log wrap Enterprise Replication enters DDRBLOCK mode In DDRBLOCK mode user transactions are blocked and you see the following error in the message log DDR Log Snooping DDRBLOCK phase started userthreads blocked Although user transactions are blocked while the server is in DDRBLOCK mode Enterprise Replication activity is allowed to continue During this time Enterprise Replication attempts process transactions to advance the replay position and remove the risk of a log overrun Enterprise Replication can usually resolve the cause of the DDRBLOCK state However in more extreme cases the replay position can be ov

Download Pdf Manuals

image

Related Search

Related Contents

User Manual  取扱説明書  Manual - Cascade Corporation  ヴォルフビジョン製品の標準保証条件約款  EVGA UV Plus+ 39  Samsung YP-Z5FAB/XFO Инструкция по использованию  USER`S MANUAL  フランフォーレ・しらさぎ/立体駐車場マニュアル  Targus TSS125EU    

Copyright © All rights reserved.
Failed to retrieve file