+ All Categories
Home > Documents > UniData Data Replication - Rocket Softwaredocs.rocketsoftware.com/nxt/gateway.dll/RKBnew20... ·...

UniData Data Replication - Rocket Softwaredocs.rocketsoftware.com/nxt/gateway.dll/RKBnew20... ·...

Date post: 04-Jun-2020
Category:
Upload: others
View: 4 times
Download: 0 times
Share this document with a friend
133
C:\Program Files\Adobe\FrameMaker8\UniData 7.2\7.2rebranded\REPLICATION\REPTITLE.fm March 8, 2010 4:09 pm Beta Beta Beta Beta Beta Beta Beta Beta Beta Beta Beta Beta Beta Beta Beta Beta UniData UniData Data Replication UDT-720-UREP-1
Transcript
Page 1: UniData Data Replication - Rocket Softwaredocs.rocketsoftware.com/nxt/gateway.dll/RKBnew20... · UniData Data replication provides an automatic way to deliver read-only copies of

C:\Program Files\Adobe\FrameMaker8\UniData 7.2\7.2rebranded\REPLICATION\REPTITLE.fmMarch 8, 2010 4:09 pm

Beta Beta Beta Beta Beta Beta Beta Beta Beta Beta Beta Beta Beta Beta Beta Beta

UniData

UniData Data Replication

UDT-720-UREP-1

Page 2: UniData Data Replication - Rocket Softwaredocs.rocketsoftware.com/nxt/gateway.dll/RKBnew20... · UniData Data replication provides an automatic way to deliver read-only copies of

ii UniData Data Rep

C:\Program Files\Adobe\FrameMaker8\UniData 7.2\7.2rebranded\REPLICATION\REPTITLE.fmMarch 8, 2010 4:09 pm

Beta Beta Beta Beta Beta Beta Beta Beta Beta Beta Beta Beta Beta

Notices

EditionPublication date: June 2008Book number: UDT-720-UREP-1Product version: UniData 7.2

Copyright© Rocket Software, Inc. 1988-2008. All Rights Reserved.

TrademarksThe following trademarks appear in this publication:

Trademark Trademark Owner

Rocket Software™ Rocket Software, Inc.

Dynamic Connect® Rocket Software, Inc.

RedBack® Rocket Software, Inc.

SystemBuilder™ Rocket Software, Inc.

UniData® Rocket Software, Inc.

UniVerse™ Rocket Software, Inc.

U2™ Rocket Software, Inc.

U2.NET™ Rocket Software, Inc.

U2 Web Development Environment™ Rocket Software, Inc.

wIntegrate® Rocket Software, Inc.

Microsoft® .NET Microsoft Corporation

Microsoft® Office Excel®, Outlook®, Word Microsoft Corporation

Windows® Microsoft Corporation

Windows® 7 Microsoft Corporation

Windows Vista® Microsoft Corporation

Java™ and all Java-based trademarks and logos Sun Microsystems, Inc.

UNIX® X/Open Company Limited

lication

Page 3: UniData Data Replication - Rocket Softwaredocs.rocketsoftware.com/nxt/gateway.dll/RKBnew20... · UniData Data replication provides an automatic way to deliver read-only copies of

The above trademarks are property of the specified companies in the United States, other countries, or both. All other products or services mentioned in this document may be covered by the trademarks, service marks, or product names as designated by the companies who own or market them.

License agreementThis software and the associated documentation are proprietary and confidential to Rocket Software, Inc., are furnished under license, and may be used and copied only in accordance with the terms of such license and with the inclusion of the copyright notice. This software and any copies thereof may not be provided or otherwise made available to any other person. No title to or ownership of the software and associated documentation is hereby transferred. Any unauthorized use or reproduction of this software or documentation may be subject to civil or criminal liability. The information in the software and documentation is subject to change and should not be construed as a commitment by Rocket Software, Inc.

Restricted rights notice for license to the U.S. Government: Use, reproduction, or disclosure is subject to restrictions as stated in the “Rights in Technical Data-General” clause (alternate III), in FAR section 52.222-14. All title and ownership in this computer software remain with Rocket Software, Inc.

NoteThis product may contain encryption technology. Many countries prohibit or restrict the use, import, or export of encryption technologies, and current use, import, and export regulations should be followed when exporting this product.

Please be aware: Any images or indications reflecting ownership or branding of the product(s) documented herein may or may not reflect the current legal ownership of the intellectual property rights associated with such product(s). All right and title to the product(s) documented herein belong solely to Rocket Software, Inc. and its subsidiaries, notwithstanding any notices (including screen captures) or any other indications to the contrary.

Contact informationRocket Software275 Grove Street Suite 3-410Newton, MA 02466-2272 USA Tel: (617) 614-4321 Fax: (617) 630-7100Web Site: www.rocketsoftware.com

UniData Data Replication iii

Page 4: UniData Data Replication - Rocket Softwaredocs.rocketsoftware.com/nxt/gateway.dll/RKBnew20... · UniData Data replication provides an automatic way to deliver read-only copies of

Table of Contents

:\ProgMarch

Table of Contents

Beta Beta Beta Beta Beta Beta Beta Beta Beta Beta Beta Beta Beta Beta Beta Beta

Chapter 1 Introduction and TerminologyReplication and the Recoverable File System . . . . . . . . . 1-2

Terminology. . . . . . . . . . . . . . . . . . . . . 1-3Replication Objects . . . . . . . . . . . . . . . . . 1-3Replication System . . . . . . . . . . . . . . . . . 1-3Replication Group . . . . . . . . . . . . . . . . . 1-4Replication . . . . . . . . . . . . . . . . . . . 1-4Types of Replication . . . . . . . . . . . . . . . . 1-5Replication Log . . . . . . . . . . . . . . . . . . 1-5Replication Messages . . . . . . . . . . . . . . . . 1-7Replication Buffer . . . . . . . . . . . . . . . . . 1-7Replication Log Reserve File . . . . . . . . . . . . . . 1-8Transaction Control Record . . . . . . . . . . . . . . 1-9Transaction Control Area . . . . . . . . . . . . . . . 1-9Publisher Process . . . . . . . . . . . . . . . . . 1-9Publisher-syncing Tool . . . . . . . . . . . . . . . . 1-10Publisher Listener Process . . . . . . . . . . . . . . . 1-10Subscriber Process . . . . . . . . . . . . . . . . . 1-10Replication Writer Process . . . . . . . . . . . . . . 1-10Replication Manager Daemon . . . . . . . . . . . . . 1-10Replication System Definition . . . . . . . . . . . . . 1-11Replication Configuration File . . . . . . . . . . . . . 1-11

Chapter 2 Installing and Configuring UniData Data ReplicationCompatibility with Previous UniData Releases . . . . . . . . . . 2-3

Upgrading to UniData 7.2 . . . . . . . . . . . . . . . 2-3Installing UniData Data Replication . . . . . . . . . . . . . 2-4

Files Created by the Installation Process . . . . . . . . . . 2-4Configuring UniData Data Replication . . . . . . . . . . . . 2-5

udtconfig Parameters . . . . . . . . . . . . . . . . 2-5

ram Files\Adobe\FrameMaker8\UniData 7.2\7.2rebranded\REPLICATION\REPTOC.fm (bookTOC.template)8 2010 4:07 pm

Page 5: UniData Data Replication - Rocket Softwaredocs.rocketsoftware.com/nxt/gateway.dll/RKBnew20... · UniData Data replication provides an automatic way to deliver read-only copies of

Replication System Definition (repsys) . . . . . . . . . . . 2-7Replication Configuration File . . . . . . . . . . . . . 2-12

Defining Replication on a Publishing System . . . . . . . . . . 2-22Defining Publishing Groups from UniAdmin . . . . . . . . . 2-26Defining Publishing Groups from the Command Line . . . . . . 2-32

Defining Replication on a Subscribing System . . . . . . . . . . 2-34Defining Subscribing Groups from the Command Line . . . . . . 2-41

Changing a Replication Group Definition. . . . . . . . . . . . 2-43Change Replication Group Definition from UniAdmin . . . . . . 2-44Change Replication Group Definition from the Command Line . . . 2-45

Chapter 3 How Replication WorksData Propagation Procedure . . . . . . . . . . . . . . . . 3-3Suspending Live Replication. . . . . . . . . . . . . . . . 3-5

Data Synchronization of Suspended Live Replication . . . . . . 3-6Deferred Replication . . . . . . . . . . . . . . . . . . 3-10Transaction Handling . . . . . . . . . . . . . . . . . . 3-12RFS Checkpoint Handling . . . . . . . . . . . . . . . . 3-14Indexed Virtual Attributes . . . . . . . . . . . . . . . . 3-15File Triggers . . . . . . . . . . . . . . . . . . . . . 3-16File-level Operations . . . . . . . . . . . . . . . . . . 3-17

File-level Commands . . . . . . . . . . . . . . . . 3-18

Chapter 4 Failover and RecoveryFailing Over a System . . . . . . . . . . . . . . . . . . 4-3

Step-by-Step Instructions . . . . . . . . . . . . . . . 4-3Data Recovery . . . . . . . . . . . . . . . . . . . . 4-5

Recovering the Publishing System Running RFS. . . . . . . . 4-5Recovering the Publishing System Not Running RFS . . . . . . 4-6Recovery of a Subscribing System . . . . . . . . . . . . 4-7

Data Resynchronization . . . . . . . . . . . . . . . . . 4-8Resynchronization After Restarting Publishing System . . . . . . 4-8Resynchronization After Failover Using Real-Time Replication . . . 4-8Resynchronization After Failover Using Immediate Replication . . . 4-9Resynchronization After Recovery from Subscribing System or Network

Failure . . . . . . . . . . . . . . . . . . 4-10

Chapter 5 Administering UniData Data ReplicationAdministering UniData Data Replication through UniAdmin . . . . . 5-3ud_repadmin Tool . . . . . . . . . . . . . . . . . . . 5-6

Table of Contents v

Page 6: UniData Data Replication - Rocket Softwaredocs.rocketsoftware.com/nxt/gateway.dll/RKBnew20... · UniData Data replication provides an automatic way to deliver read-only copies of

vi UniD

suspend Command . . . . . . . . . . . . . . . . . 5-7sync Command . . . . . . . . . . . . . . . . . . 5-8failover Command . . . . . . . . . . . . . . . . . 5-10reconfig Command. . . . . . . . . . . . . . . . . 5-11reset Command . . . . . . . . . . . . . . . . . . 5-12report Command . . . . . . . . . . . . . . . . . 5-12

Replication Recovery Log . . . . . . . . . . . . . . . . 5-16REP_RECV_LOG . . . . . . . . . . . . . . . . . 5-16

Diagnosis Utility . . . . . . . . . . . . . . . . . . . 5-18Monitoring Replication . . . . . . . . . . . . . . . . . 5-19

Starting the Replication Monitor . . . . . . . . . . . . 5-21Replication Group Status Table . . . . . . . . . . . . . 5-24

Replication Action Trigger . . . . . . . . . . . . . . . . 5-28Replication Action Trigger Example . . . . . . . . . . . 5-30

Listing Replication Files . . . . . . . . . . . . . . . . 5-32Replication Files with Multiple VOC Pointers . . . . . . . . . . 5-34

Chapter 6 RestrictionsFile Types . . . . . . . . . . . . . . . . . . . 6-2Changing Inode or Device Numbers . . . . . . . . . . . 6-2One Replication Object Can Only Belong to One Group . . . . . 6-2System Files Not Supported as Replication Objects . . . . . . 6-3No Cascading Replication . . . . . . . . . . . . . . 6-3Writeable Subscriber Files . . . . . . . . . . . . . . 6-3Other Command Replication . . . . . . . . . . . . . 6-4Virtual Field Definitions . . . . . . . . . . . . . . . 6-4Sequence of Updates . . . . . . . . . . . . . . . . 6-4Transaction Limitations . . . . . . . . . . . . . . . 6-4System Crashes During Failover . . . . . . . . . . . . 6-5Dictionary and Data Portions of a File. . . . . . . . . . . 6-5Running the Recoverable File Systme on the Publishing System . . 6-6Multiple Locks . . . . . . . . . . . . . . . . . . 6-6Other Limitations . . . . . . . . . . . . . . . . . 6-6

ata Data Replication

Page 7: UniData Data Replication - Rocket Softwaredocs.rocketsoftware.com/nxt/gateway.dll/RKBnew20... · UniData Data replication provides an automatic way to deliver read-only copies of

1Chapter

Introduction and Terminology

Replication and the Recoverable File System . . . . . . . . 1-2Terminology . . . . . . . . . . . . . . . . . . . . 1-3 Replication Objects . . . . . . . . . . . . . . . . 1-3 Replication System. . . . . . . . . . . . . . . . . 1-3 Replication Group . . . . . . . . . . . . . . . . . 1-4 Replication . . . . . . . . . . . . . . . . . . . 1-4 Types of Replication . . . . . . . . . . . . . . . . 1-5 Replication Log. . . . . . . . . . . . . . . . . . 1-5 Replication Messages . . . . . . . . . . . . . . . . 1-7 Replication Buffer . . . . . . . . . . . . . . . . . 1-7 Replication Log Reserve File . . . . . . . . . . . . . 1-8 Transaction Control Record . . . . . . . . . . . . . . 1-9 Transaction Control Area . . . . . . . . . . . . . . . 1-9 Publisher Process . . . . . . . . . . . . . . . . . 1-10 Publisher-syncing Tool . . . . . . . . . . . . . . . 1-10 Publisher Listener Process . . . . . . . . . . . . . . 1-10 Subscriber Process . . . . . . . . . . . . . . . . . 1-10 Replication Writer Process . . . . . . . . . . . . . . 1-10 Replication Manager Daemon . . . . . . . . . . . . . 1-11 Replication System Definition . . . . . . . . . . . . . 1-11 Replication Configuration File . . . . . . . . . . . . . 1-12

Page 8: UniData Data Replication - Rocket Softwaredocs.rocketsoftware.com/nxt/gateway.dll/RKBnew20... · UniData Data replication provides an automatic way to deliver read-only copies of

UniData Data replication provides an automatic way to deliver read-only copies of UniData files to other UniData systems. You can use the replicated data as a standby system in case of system failure, or as a reporting system.

The system where the source data resides is called the publisher. A system requesting copies of file updates from the publisher is called a subscriber.

Replication and the Recoverable File SystemYou can use UniData Data Replication with or without the Recoverable File System (RFS). However, when used with RFS, the replication failover process makes immediate recovery possible when the primary system fails. UniData Data Repli-cation relies on the RFS crash and media recovery processes to ensure physical and logical consistency of the database. In addition, failover of immediate replication relies on the RFS crash recovery process to generate replication recovery logs to restore possible missing transactions during the failover process.

1-2 UniData Replication

Page 9: UniData Data Replication - Rocket Softwaredocs.rocketsoftware.com/nxt/gateway.dll/RKBnew20... · UniData Data replication provides an automatic way to deliver read-only copies of

TerminologyThis section describes terminology used throughout this manual.

Replication ObjectsThe following objects are used in the UniData Data Replication system:

Replication Object

A UniData Data Replication Object can be any UniData database file, including static files, dynamic files, sequentially hashed files, directory files, or multilevel files. Each replication object has a unique object name and an account in which it is defined. The object name is the VOC name in the account.

Publishing Object

A Publishing Object is the replication object being replicated. One publishing object may have multiple corresponding subscribing objects on multiple replication sites.

Subscribing ObjectA Subscribing Object is a replica of the publishing object. The subscribing object does not have to have the same physical structure as the publishing object. For example, a subscribing object could be a sequentially hashed file, while its publishing object is a static hashed file. A subscribing object must have the same object name as the publishing object.

Replication SystemA Replication System is a UniData system in a replication environment. The repli-cation system replicates data from one system (Publishing System), to other systems (Subscribing Systems), or both.

Terminology 1-3

Page 10: UniData Data Replication - Rocket Softwaredocs.rocketsoftware.com/nxt/gateway.dll/RKBnew20... · UniData Data replication provides an automatic way to deliver read-only copies of

Replication GroupIn a replication environment, a Replication Group is a group of replication objects belonging to one UniData account. The replication group is the basic unit of repli-cation. Organizing related database objects into a replication group makes it easier to administer many objects together.

You can create and use a replication group to organize the database objects necessary to support a particular database application. You can define multiple replication groups in the same account, but one replication object can belong to only one repli-cation group.

You can replicate one replication group from one publishing account to multiple subscribing accounts.

On a publishing system, a Publishing Group is the replication group defined in a publishing account of a local system and replicated to remote replication systems.

On a subscribing system, a Subscribing Group is a replication group defined on a remote replication system and replicated to a local subscribing account.

ReplicationIn a replication environment, a Replication is the data replication from a publishing system to a subscribing system. You may have multiple replication groups in one replication.

On a specific system, you usually use a remote system name to represent the repli-cation from a local system to the remote system, or from the remote system to the local system.

Standby ReplicationA standby replication is a replication used to support a standby failover system.

Non-standby Replication

A non-standby replication is a replication used to support report applications only.

1-4 UniData Replication

Page 11: UniData Data Replication - Rocket Softwaredocs.rocketsoftware.com/nxt/gateway.dll/RKBnew20... · UniData Data replication provides an automatic way to deliver read-only copies of

Types of ReplicationThe following types of replication are available:

Real-time Replication

Real-time Replication is a type of UniData Data Replication where transactions on the publishing server do not commit until all logs of the transaction arrive at the subscriber. With this type of replication, should the publishing server failover to the real-time subscribing system, all committed transactions on the publishing system are guaranteed to apply to the standby system.

Immediate Replication

Immediate Replication is a type of UniData Data Replication where UniData sends a transaction log to the subscribing system immediately after it is ready to commit. The publishing system does not wait for the log to arrive on the subscriber before committing the transaction. Should the publishing server failover to the immediate subscribing system, there is a slight chance that some committed transaction on the publisher did not arrive on the failover system. Administrator intervention may be necessary to recover the system.

Note: Immediate Replication has better performance than real-time replication.

Deferred Replication

Deferred Replication saves transaction logs in a file rather than sending them to the subscriber. At a predefined period of time. the subscribing system connects to the publishing server, retrieves all of the logs, and synchronizes its database to the publishing database. Deferred replication can only be used in non-standby replication.

Replication LogA replication log is a log representing a transaction or update on a publishing object. UniData transfers this log to the subscribing system to propagate data.

In a replication group, each replication log has a unique Replication Log Sequence Number (RepLSN).

Terminology 1-5

Page 12: UniData Data Replication - Rocket Softwaredocs.rocketsoftware.com/nxt/gateway.dll/RKBnew20... · UniData Data replication provides an automatic way to deliver read-only copies of

Data Update Log

A Data Update log is a log representing a data update, and contains the following information:

Log Header:

RepLSNLength of logTransaction IDOperation flagPub-Commit flagSub-Commit flag

Log Body

File IDRecord IDRecord as well as indexed virtual attribute values

Transaction Log

A transaction log is a special log representing a transaction other than data updates. Each transaction generates a pair of transaction logs in the replication group, a Transaction Begin Log and a Transaction End Log.

Replication Failover LogA Replication Failover Log is a replication log generated by the subscriber process when it is failing over to a standby system. UniData then sends these logs to the original primary system as part of the resynchronization process.

The Failover End Log is a special failover log that marks the end of replication failover logs in the replication log reserve file.

1-6 UniData Replication

Page 13: UniData Data Replication - Rocket Softwaredocs.rocketsoftware.com/nxt/gateway.dll/RKBnew20... · UniData Data replication provides an automatic way to deliver read-only copies of

Replication Recovery Log

The Replication Recovery Log is a replication log generated from the Recoverable File System (RFS) crash recovery process in order to recover missing transactions during the crash.

Replication MessagesThe following types of messages are used with UniData Data Replication:

Pub-Commit Notification

Pub-Commit Notification is a notification message sent from the publisher to the subscriber to notify the subscriber that a specific transaction has been committed on the publishing system.

Sub-Got Notification

A Sub-Got Notification is a notification message sent from the subscriber to the publisher verifying that it received the replication logs of a specific transaction.

Sub-Commit Notification

A Sub-Commit Notification is a notification message sent from the subscriber to the publisher verifying that a specific transaction was committed on the subscribing system.

Replication BufferWhen UniData starts, the replication system allocates replication buffers for all replication groups. A replication buffer is a buffer in shared memory that transfers replications logs between the “reader” and “writer” processes. For a publishing group, the writers are the udt and tm processes, and the reader is the publisher process. For subscribing groups, the writer is a subscriber process and readers are replication writer processes.

Terminology 1-7

Page 14: UniData Data Replication - Rocket Softwaredocs.rocketsoftware.com/nxt/gateway.dll/RKBnew20... · UniData Data replication provides an automatic way to deliver read-only copies of

Replication Buffer Extension File

The Replication Buffer Extension file is an extension of the replication buffer, used to store very large logs and other log files when the replication buffer is full.

The Replication Buffer Extension file is a directory with part files.

Replication Log Reserve FileThe Replication Log Reserve File is a log file residing on the publishing system to save replication logs when replication is suspended because of a network failure, a subscribing system crash, or when an administrator issues the SUSPEND command.

UniData sends reserved logs to the subscribing system at a later time to synchronize the data between the publishing and subscribing systems. For deferred replication, UniData uses the Replication Log Reserve File to save replication logs on the publishing system. These logs are sent to the subscribing system periodically, or manually, for synchronization.

When replication is suspended on a subscribing system, the subscriber process saves the logs without Pub-Commit notification from the publisher and writes them to the Replication Log Reserve File. UniData then reloads these logs in the Replication Buffer when the subscribing group fails over.

The Replication Log Reserve file is a directory with a control file and part files.

Replication Sub Packet StoreThe Replication Sub Packet Store storess data packets sent from the publisher before the udsub process loads and processes the data. The Replication Sub Packet Store consists of the Sub Packet File and the Sub Packet Buffer.

UniData creates or truncates the Sub Packet File each time the udsub process starts a sync operation. This file has the same format as the Replication Log Reserve file, with a .spf file extension.

The Sub Packet Buffer consists of two parts to store the log info and log body, respec-tively. The log info portion of the buffer has a fixed size of 2300 bytes, while the body buffer size is 128K.

1-8 UniData Replication

Page 15: UniData Data Replication - Rocket Softwaredocs.rocketsoftware.com/nxt/gateway.dll/RKBnew20... · UniData Data replication provides an automatic way to deliver read-only copies of

While Replication is running, the Sublistener thread saves data packets to the Sub Packet Buffer first. If this buffer is full, it saves the data packets in the Sub Packet File.

If you suspend Replication, the udsub process dumps all unsaved replication logs from the Sub Packet Buffer to the Sub Packet file in case of a failover. If a failover command is issued, UniData loads all data logs from the Sub Packet file to the Repli-cation buffer and processes them during the failover process. If no failover command is issued, UniData discards the unloaded data logs in the next sync operation.

Transaction Control RecordA Transaction Control Record is a record in a shared memory buffer used to control a cross-group transaction. A cross-group transaction is a transaction involved in multiple replication groups.

For each cross-group transaction that occurs on the publishing system, UniData creates a transaction control record on the subscribing system to synchronize the multiple processes dealing with the transaction to enforce the consistency of the transaction. The transaction control record contains the following information:

Transaction IDTotal number of replication groups involved in the transactionNumber of groups that have received all log filesNumber of groups that have committed the transactionNumber of groups that have aborted the transactionA list of Replication Writers waiting on the transaction

Transaction Control AreaThe Transaction Control Area is a shared memory buffer used for Transaction Control Records. Each subscribing system contains one transaction control area.

Publisher ProcessA Publisher Process is a process running on the publishing system that reads logs of a specific replication group from the replication buffer and sends them to the subscribing system.

Terminology 1-9

Page 16: UniData Data Replication - Rocket Softwaredocs.rocketsoftware.com/nxt/gateway.dll/RKBnew20... · UniData Data replication provides an automatic way to deliver read-only copies of

Publisher-syncing ToolThe Publisher-syncing Tool is an executable the publisher process creates to send synchronizing data logs from the Replication Log Reserve File to the subscribing system to synchronize subscriptions to their publishers.

Publisher Listener ProcessThe Publisher Listener Process is a process the publisher process creates to listen to a remote subscriber process for a feedback control package.

Subscriber ProcessA Subscriber is a process running on the subscribing system that receives logs of a replication group from the publishing system and writes them to replication buffer.

The Subscriber Process consists of two major threads. The sublistener thread receives data packets from the publishing system through a socket connection, then stores the data packets in the Sub Packet Store and sends an acknowledgement back to the publishing system. The Sub Main thread loads the replication logs from the Sub Packet Store to the replication buffer and coordinates with replication writer processes to apply the logs on the subscribing database.

Replication Writer ProcessThe Replication Writer Process runs on the subscribing system. This process reads data logs from the replication buffer and applies the updates to the subscribing objects. More than one replication writer can exist for one subscribing group.

UniData also uses replication writer processes when recovering a publishing group on a publishing system to apply replication recovery logs to the database, and to load replication objects at system start up.

Replication Manager DaemonThe Replication Manager is a UniData daemon that must be running on the repli-cation system. The publishing system and the subscribing system each have one replication manager. The replication manager performs the following tasks:

1-10 UniData Replication

Page 17: UniData Data Replication - Rocket Softwaredocs.rocketsoftware.com/nxt/gateway.dll/RKBnew20... · UniData Data replication provides an automatic way to deliver read-only copies of

Reads and loads replication configuration information when UniData startsCreates replication processes for each replication groupMonitors and controls the replication processesHandles commands from Replication Admin and UniAdminDynamically reconfigures the replication environmentHandles failover replication, recovery, and synchronization of replication data

Replication System DefinitionThe Replication System Definition file, located in /usr/ud72/include on UniData for UNIX or udthome\include on UniData for Windows Platforms, defines all replication systems in a replication environment. This file contains definitions for the local system and all remote replication systems that replicate data from or to the local system. Each system definition contains the user-defined system name, network address, UniData version, and other information related to the system and replication from or to the system.

Replication Configuration FileThe Replication Configuration File, located in /usr/ud72/include on UniData for UNIX or udthome\include on UniData for Windows Platforms, is maintained by an administrator on each system, and defines all replication groups on the system and their distributions. Each replication group has a unique global name, a list of objects in the group, a local account location, a publishing system from which it replicates, and all subscribing systems to which it replicates.

The Replication Configuration File contains a section for each replication group, and contains the following information:

Group NameReplication LevelAll replication objects belonging to the groupLocal account locationPublishing system from which it replicates and all subscribing systems to which it replicates

Terminology 1-11

Page 18: UniData Data Replication - Rocket Softwaredocs.rocketsoftware.com/nxt/gateway.dll/RKBnew20... · UniData Data replication provides an automatic way to deliver read-only copies of

System tunable parameters for the replication group

1-12 UniData Replication

Page 19: UniData Data Replication - Rocket Softwaredocs.rocketsoftware.com/nxt/gateway.dll/RKBnew20... · UniData Data replication provides an automatic way to deliver read-only copies of

2Chapter

Installing and Configuring UniData Data Replication

Compatibility with Previous UniData Releases . . . . . . . . . 2-3 Upgrading to UniData 7.2 . . . . . . . . . . . . . . 2-3Installing UniData Data Replication . . . . . . . . . . . . . 2-4 Files Created by the Installation Process . . . . . . . . . . 2-4Configuring UniData Data Replication . . . . . . . . . . . . 2-5 udtconfig Parameters . . . . . . . . . . . . . . . . 2-5 Replication System Definition (repsys) . . . . . . . . . . 2-7 Replication Configuration File . . . . . . . . . . . . . 2-12Defining Replication on a Publishing System . . . . . . . . . . 2-22 Defining Publishing Groups from UniAdmin . . . . . . . . 2-27 Defining Publishing Groups from the Command Line . . . . . . 2-33Defining Replication on a Subscribing System . . . . . . . . . 2-35 Defining Subscribing Groups from the Command Line . . . . . 2-42Changing a Replication Group Definition . . . . . . . . . . . 2-44 Change Replication Group Definition from UniAdmin . . . . . 2-45 Change Replication Group Definition from the Command Line. . . 2-46

Page 20: UniData Data Replication - Rocket Softwaredocs.rocketsoftware.com/nxt/gateway.dll/RKBnew20... · UniData Data replication provides an automatic way to deliver read-only copies of

This chapter describes how to install and configure UniData Data Replication.

2-2 UniData Data Replication

Page 21: UniData Data Replication - Rocket Softwaredocs.rocketsoftware.com/nxt/gateway.dll/RKBnew20... · UniData Data replication provides an automatic way to deliver read-only copies of

Compatibility with Previous UniData ReleasesThis section describes changes made to UniData Data Replication at this release.

Upgrading to UniData 7.2After upgrading to UniData 7.2, you must clear the replication log directory.

You must upgrade both the publishing system and the subscribing system for repli-cation to run correctly.

These changes are required due to the new Protocol=10004.

Compatibility with Previous UniData Releases 2-3

Page 22: UniData Data Replication - Rocket Softwaredocs.rocketsoftware.com/nxt/gateway.dll/RKBnew20... · UniData Data replication provides an automatic way to deliver read-only copies of

Installing UniData Data ReplicationThe UniData installation process prompts whether you want to install UniData Data Replication as part of the standard udtinstall script. The following example illustrates this installation prompt:

Turn on the Replication SubSystem? [No]:

If you want to install UniData Data Replication at this time, enter Yes.

If you answer yes to this prompt, the installation script then prompts for the name of the Replication System ID, as shown in the following example:

Replication System ID? [liz_72]

The default response to this prompt is the hostname, followed by the version of UniData you are installing.

For detailed information about the UniData installation process, see Installing and Licensing UniData 7.2 Products.

You can install replication at a later time by creating the repsys file, repconfig file, adding the replication rpc services to the rpcservices table, and setting the REP_FLAG parameter in udtconfig to 1.

Files Created by the Installation ProcessUniData performs the following tasks if you choose to install the UniData Data Replication system during the installation process:

Creates the Replication System Definition File, located in /usr/ud72/include on UniData for UNIX or udthome\include on UniData for Windows Platforms.Creates the Replication Configuration File (repconfig), located in /usr/ud72/include on UniData for UNIX or udthome\include on UniData for Windows Platforms.Inserts the local system definition in the Replication System Definition FileAdds the Replication rpc services to the rpcservices table.Sets the REP_FLAG parameter in udtconfig to 1.

2-4 UniData Data Replication

Page 23: UniData Data Replication - Rocket Softwaredocs.rocketsoftware.com/nxt/gateway.dll/RKBnew20... · UniData Data replication provides an automatic way to deliver read-only copies of

Configuring UniData Data ReplicationUniData supports dynamic configuration of UniData Data Replication. A system administrator can edit the Replication System Definition file (repsys) and the Repli-cation Configuration File (repconfig), to define and configure the replication groups. UniData loads the new configuration parameters when you execute the RECONFIG command.

udtconfig ParametersThe following udtconfig parameters pertain to UniData Data Replication:

REP_FLAG (Replication Flag)

The REP_FLAG parameter turns UniData Data Replication on or off. If you choose the install UniData with the Replication System, UniData sets the REP_FLAG to 1. The following table describes the REP_FLAG options:

REP_FLAG Values

Value Description

0 (zero) The UniData Data Replication System is off.

Any positive integer The UniData Data Replication System is on.

TCA_SIZE

The maximum number of entries in the Transaction Control Area (TCA). TCA is only used when there is more than one replication group configured, and there are transactions across replication groups. The default value is 2048.

If you are not using transaction processing, this parameter is irrelevant. If you are using transaction processing, set the value of TCA_SIZE to at least the number of users on the system.

Configuring UniData Data Replication 2-5

Page 24: UniData Data Replication - Rocket Softwaredocs.rocketsoftware.com/nxt/gateway.dll/RKBnew20... · UniData Data replication provides an automatic way to deliver read-only copies of

MAX_LRF_FILESIZE

The maximum Log Reserve File Size, in bytes. The default value is 1,073,741,824 (1 GB). The maximum value is 2,147,483,136.

N_REP_OPEN_FILE

The maximum number of open replication log files for a udt or tm process. The default value is 8.

MAX_REP_DISTRIB

Reserved for internal use.

MAX_REP_SHMSZ

The maximum shared memory buffer segment size. The default value is 67,108,864 (64 MB).

REP_LOG_PATH

The full path to the location of the replog file.

UDR_CONVERT_CHARWhen this value is set to 1, if the publishing system and the subscribing system have a different I18N group, UniData converts marks and SQLNULL marks to those on the local machine on the data passed between the two systems. The default value is 0.

REP_CP_TIMEOUT

Specifies the cm daemon timeout interval for replication at checkpoint. The default value is 200 seconds. If this value is set to 0 the cm daemon will not time out.

2-6 UniData Data Replication

Page 25: UniData Data Replication - Rocket Softwaredocs.rocketsoftware.com/nxt/gateway.dll/RKBnew20... · UniData Data replication provides an automatic way to deliver read-only copies of

Replication System Definition (repsys)The Replication System Definition defines local and all remote host system locations in a replication environment. This file, called repsys, resides in /usr/ud72/include on UniData for UNIX, or udthome\include on UniData for Windows Platforms.

Each line of the repsys file is either a definition phrase or a comment. A definition phrase defines a component of replication systems in the replication environment, such as replication system names or host names. A definition phrase starts with the phrase name that indicates the type of phrase.

UniData Data Replication can include the following types of phrases:

System Phrase

A system phrase starts a system definition section. The system definition section defines a replication system in the replication environment. One system section ends when another system phrase is defined, or at the end of the repsys file.

You must specify a user-defined name for the local system in the repsys file. Normally, UniData adds the local definition to the repsys file if you install UniData Data Replication during the UniData installation, as shown in the following example:

# pg repsysSYSTEM=liz_72HOSTNAME=lizVERSION=72

You must define a system phrase for each system location in the replication environment. When defining a remote system location, you also define the repli-cation from the local system.

The system phrase has the following syntax:

SYSTEM=<system_name>

where system_name is the name you define for the replication system. This name should be unique on a system. system_name can contain a combination of alphabetic characters, number, and any of the following character: ~ ! @ $ % ^ & * - + . / \.

Hostname Phrase

The hostname phrase is a required entry in the repsys file to define the host name of the replication system location. A system can have only one host name.

Configuring UniData Data Replication 2-7

Page 26: UniData Data Replication - Rocket Softwaredocs.rocketsoftware.com/nxt/gateway.dll/RKBnew20... · UniData Data replication provides an automatic way to deliver read-only copies of

The hostname phrase has the following syntax:

HOSTNAME=<host_name or network_address>

Version Phrase

The version phrase defines the version of UniData on the system location. The version number must be 60 or higher.

The version phrase has the following syntax:

VERSION=<version_no>

DHCP Phrase

The DHCP phrase specifies that a remote or local system has a dynamic IP address. If you define a remote system as a DHCP system, UniData Data Replication automat-ically updates the IP address of the remote system when it receives a SYNC request from that system. If you define a local system as a DHCP system, UniData Data Replication automatically sends the current IP address in the SYNC request to the remote server.

The DHCP phrase has the following format:

DHCP=1

If the remote system is a DHCP system, you should always set AUTORESOME to false to avoid a SYNC request failure.

AUTORESUME PhraseThe AUTORESUME phrase determines if replication from the remote system you specify will be synchronized and resume automatically when UniData starts, or after a reconfiguration.

The AUTORESUME phrase has the following syntax:

AUTORESUME=<flag>

where flag is 1 for true, or 0 for false.

2-8 UniData Data Replication

Page 27: UniData Data Replication - Rocket Softwaredocs.rocketsoftware.com/nxt/gateway.dll/RKBnew20... · UniData Data replication provides an automatic way to deliver read-only copies of

SYNCINTVAL Phrase

The SYNCINTVAL phrase defines the time interval, in minutes, in which the repli-cation system automatically synchronizes replication to the remote system.

The SYNCINTVAL phrase has the following syntax:

SYNCINTVAL=<sync_interval>

UniData Data Replication automatically synchronizes subscribing systems with their publisher every period defined by sync_interval. A sync_interval of 0 indicates a manual synchronization system, where the system does not automatically synchronize the systems.

The SYNCINTVAL phrase applies only to those subscribing groups that have deferred replication on the remote system. It does not apply to publishing groups.

TIMEOUT Phrase

The TIMEOUT phrase defines the the number of seconds to wait if no packets are received from the remote system before suspending replication.

The publishing system sends a packet to the subscribing system approximately every 4 seconds when replication is idle. The subscribing system then sends a packet back to the publishing system. If the subscribing system location has the TIMEOUT phrase defined, the publistener process counts the time that has elapsed between packets being received. If the amount exceeds the value of the TIMEOUT phrase, replication is suspended.

In the value of TIMEOUT is 0, no timeout occurs.

IBM recommends that you not set the value of the TIMEOUT phrase to less than 2 minutes.

EXCEPTION_ACTION Phrase

The replication exception action is a shell script on UNIX platforms, or a batch program on Windows platforms. Define the full path to the exception action using the EXCEPTION_ACTION clause in the repsys file. For example, if you define a repli-cation exception action as UDRepExceptionAction.sh in the /usr/ud72 directory, set the EXCEPTION_ACTION clause as:

EXCEPTION_ACTION=/usr/ud72/UDRepExceptionAction.sh

Configuring UniData Data Replication 2-9

Page 28: UniData Data Replication - Rocket Softwaredocs.rocketsoftware.com/nxt/gateway.dll/RKBnew20... · UniData Data replication provides an automatic way to deliver read-only copies of

For more information about replication action triggers, see Replication Action Trigger in Chapter 5, “Administering UniData Data Replication.”

AUTHORIZATION Phrase

For remote systems with a static IP address, the publishing system can always trust the subscribing system because the IP address is defined in the repsys file. However, if the remote system is a DHCP system, the pub lishing system cannot verify the IP address.

In order to verify the subscribing system, set the AUTHORIZATION phrase value to 1 on the subscribing system location. UniData Data Replication performs an autho-rization check when a SYNC request is received from that subscribing system.

If you define a subscribing system location with an AUTHORIZATION phrase, you must define a connection user name and password on the remote subscribing system in order for the SYNC request to succeed. You can define or change the connection user and password through UniAdmin or the repadmin tool with the following command:

ud_repadmin setconnect <replication>

where replication is the remote system location defined in the repsys file.

The repadmin tool prompts for the connection user name and password.

ExampleThe following examples show a replication system involving three systems, Server 1, Server 2, and Server 3. Each platform is running one UniData system.

2-10 UniData Data Replication

Page 29: UniData Data Replication - Rocket Softwaredocs.rocketsoftware.com/nxt/gateway.dll/RKBnew20... · UniData Data replication provides an automatic way to deliver read-only copies of

repsys File for Local System

#Define local systemSYSTEM=System_A HOSTNAME=Server1 VERSION=72#Define Remote System B SYSTEM=System_B HOSTNAME=Server2 VERSION=72 AUTORESUME=1 TIMEOUT=300#Define Remote System C SYSTEM=System_C HOSTNAME=Server3 VERSION=72

repsys File for Server2

#Define local system SYSTEM=System_B HOSTNAME=Server2 VERSION=72#Define Remote System A SYSTEM=System_A HOSTNAME=Server1 VERSION=72 AUTORESUME=1 TIMEOUT=300#Define Remote System_C SYSTEM=System_C HOSTNAME=Server3 VERSION=72

Configuring UniData Data Replication 2-11

Page 30: UniData Data Replication - Rocket Softwaredocs.rocketsoftware.com/nxt/gateway.dll/RKBnew20... · UniData Data replication provides an automatic way to deliver read-only copies of

repsys File for Server 3

#Define local system SYSTEM=System_C HOSTNAME=Server3 VERSION=72#Define Remote System A SYSTEM=System_A HOSTNAME=Server1 VERSION=72 SYNCINTVAL=3#Define Remote System_B SYSTEM=System_B HOSTNAME=Server2 VERSION=72 SYNCINTVAL=3

Replication Configuration FileThe Replication Configuration File (repconfig), located in /usr/ud72/include on UniData for UNIX and udthome\include on UniData for Windows Platforms, defines all replication groups and their configuration parameters.

Each line of the repconfig file is either a definition phrase or a comment. A phrase defines a component of replication, such as a replication group or a replication object.

A phrase entry begins with the phrase name that indicates the type of phrase. UniData supports the following ten types of phrases:

GROUP phrase – defines a replication group nameLEVEL phrase – defines the replication level of a replication groupl ACCOUNT phrase – defines a local replication accountFILE phrase – defines a replication objectEXCLUDED_FILE phrase – defines an excluded file for a replication accountDISTRIBUTION phrase – defines distribution of a replication groupRFS Failover phrase – defines UniData’s behavior when recovering a publishing group, and to which distribution and publishing group to failover

2-12 UniData Data Replication

Page 31: UniData Data Replication - Rocket Softwaredocs.rocketsoftware.com/nxt/gateway.dll/RKBnew20... · UniData Data replication provides an automatic way to deliver read-only copies of

Configuration phrases – define configurable parameters for a replication groupRW configuration phrases – define configurable parameters for replication writer processes

GROUP Phrase

A GROUP phrase starts a group definition section. The group definition section defines contents, distributions, and configurable parameters of a replication group. One group section ends when another group phrase is defined, or at the end of the repconfig file.

The group phrase has the following syntax:

GROUP=<group_name>

where group_name is the user-defined name for the group.

LEVEL Phrase

The LEVEL phrase defines the replication level of a replication group. By default, a replication group is a file-level group.

LEVEL=[ACCOUNT | FILE]

Account-level replication replicates updates to all files in an account, except those defined in the Excluded File phrase. You can define multiple file-level groups in an account, and one account-level group. If a file is defined in a file-level group, UniData replicates updates through the replication group where the file is defined. If you do not explicitly define the file in a group, UniData replicates the updates through the account-level group.

ACCOUNT Phrase

Each replication group section must contain an ACCOUNT phrase, which defines the local account where the replication group resides.

The account phrase has the following syntax:

ACCOUNT=<account_path>

Configuring UniData Data Replication 2-13

Page 32: UniData Data Replication - Rocket Softwaredocs.rocketsoftware.com/nxt/gateway.dll/RKBnew20... · UniData Data replication provides an automatic way to deliver read-only copies of

where account_path is the full path to the directory where the account resides.

FILE Phrase

Each group section can contain multiple file sections. A file section defines a repli-cation object in a replication group, and a FILE phrase defines the file name.

The file phrase has the following syntax:

File=[SUB_WRITEABLE] [DICT | DATA] <filename> [,subfile]

If you specify SUB_WRITEABLE, you can write to the file you specify on the subscribing system. On the publishing system, this does not take effect until system failover.

If you specify DICT, only the dictionary portion of the file is replicated. If you specify DATA, only the DATA portion of the file is replicated. Otherwise, UniData replicates both the dictionary and data portion of the file. This behavior is new at UniData 7.2.

If the filename you specify is a multilevel file and you do not specify a subfile name, UniData replicates the multilevel file and all its part files. It does not include newly created part files after UniData starts. This behavior is new at UniData 7.2.

An account-level group can also have file sections. You may want to define a file explicitly in an account-level group if the file has a symbolic link or VOC pointer and you want to clearly define the primary replication file, or you want to define the file with special options.

By default, UniData automatically adds the VOC file to the account-level group.

Warning: If you define a file in more than one replication group, UniData will use and only one, file definition. The file UniData chooses is arbitrary.

EXCLUDED_FILE PhraseThe EXCLUDED_FILE phrase defines an excluded file for a replication account.

EXCLUDED_FILE=[DICT | DATA] filename[,subfile]

2-14 UniData Data Replication

Page 33: UniData Data Replication - Rocket Softwaredocs.rocketsoftware.com/nxt/gateway.dll/RKBnew20... · UniData Data replication provides an automatic way to deliver read-only copies of

DISTRIBUTION Phrase

Each group section can contain multiple distribution phrases. A DISTRIBUTION phrase defines a distribution of a replication group. A distribution of a replication group is either the publishing system from which it replicates, or a subscribing system to which it replicates.

The distributions of a replication define all replications in which the group is involved. Each group section must contain one distribution phrase defining the publishing system, and at least one distribution phrase defining a subscribing system.

The distribution phrase has the following syntax:

DISTRIBUTION=<replication_type>:<system_name>

<replication_type> defines the distribution and replication type. The following table describes the valid replication types:

Replication Types

Type Description

P Publishing system.

R[B] Real-time replication subscribing system. If you specify B, it is also a standby subscribing system.

I[B] Immediate subscribing system. If you specify B, it is also a standby subscribing system.

D Deferred subscribing system.

system_name is one of the systems previously defined in the repsys file. One repli-cation group must have one, and only one, local system distribution. Optionally, you can use the LOCAL keyword to represent the local system name.

RFSFailover Phrase

The RFSFAILOVER phrase defines the behavior of UniData Data Replication when a publishing group starts. If you are running RFS, when UniData starts it checks to see if the system was properly shutdown when UniData stopped. If it was not, UniData runs crash recovery to recover the database. When a publishing group starts after crash recovery finishes, it must determine if the group failed over to a standby system.

Configuring UniData Data Replication 2-15

Page 34: UniData Data Replication - Rocket Softwaredocs.rocketsoftware.com/nxt/gateway.dll/RKBnew20... · UniData Data replication provides an automatic way to deliver read-only copies of

UniData Data Replication first tries to locate the failover system by connecting to its standby subscribing systems. If one standby system failed over to become the new publishing system for the group, the system that was recovered becomes a subscriber of the group. If UniData Data Replication does not locate a standby system that failed over, it relies on the failover phrase to determine if the group needs to failover, and to which failover system. If you do not define the failover phrase, UniData Data Replication restarts the replication group as a publishing group.

The failover phrase has the following syntax:

RFSFAILOVER=<system_name>

Note: If you define a failover phrase, you can still failover to a different standby system than the one defined by the failover phrase using the FAILOVER command to change the publishing system.

Configuration Phrases

Configuration phrases define configurable parameters for the replication group. The following table describes the configurable parameters.

Configuration Phrase Parameters

Parameter Description

N_LOGINFO The maximum number of replication logs that can be loaded in the shared memory buffer. If the number of logs in the replication buffer exceeds this value, UniData stores the logs in the Replication Buffer Extended File. The default value is 4096.

REP_BUFSZ The shared memory buffer size used to hold the log body for the replication group. The default value is 1048576.

LARGE_RECSZ When a record is larger than the value of LARGE_RECSZ, UniData stores it in the LEF instead of the Replication buffer. The default value is 64K.

RESERVED_FILE_SPACE Defines the amount of file slots to reserve for an account-level group. The default value is 500.

2-16 UniData Data Replication

Page 35: UniData Data Replication - Rocket Softwaredocs.rocketsoftware.com/nxt/gateway.dll/RKBnew20... · UniData Data replication provides an automatic way to deliver read-only copies of

Note: If the RESERVED_FILE_SPACE is full, the CREATE.FILE command will fail with an error similar to the following example:

Replication object table is full: Enable Replication object TEST3 failed.Creating file TEST3 failed.

============>>>> NOTE: CREATE.FILE failed! <<<<<<==============Not - file created but cannot be replicated. Table full = fatal error.

You can reload the Replication File Table and provide fresh reserve slots without stopping UniData by running the ud_repadmin reconfig command.

Replication Writer Configuration Phrases

Replication writer configuration phrases define configurable parameters for repli-cation writers. These parameters are used only by a subscribing group. IBM recommends that you define this for the publishing group if you want to failover the publishing group to a standby subscribing system. The group is treated as a subscribing group after the failover.

The following table describes the replication writer configurable parameters.

Parameter Description

N_REPWRITER The number of replication writer processes for the replication group.

RW_UID=<user_ID> The user ID of the replication writer process. By default, UniData starts the replication writers as root. If you define RW_UID, the replication writer process changes the user ID to the one you specify. UniData only supports this parameter on UNIX systems.

RW_GID=<group_ID> The group ID of the replication writer process. If you define RW_GID, the replication writer process changes the group ID to the one you specify. UniData only supports this parameter on UNIX systems.

Replication Writer Configurable Parameters

Configuring UniData Data Replication 2-17

Page 36: UniData Data Replication - Rocket Softwaredocs.rocketsoftware.com/nxt/gateway.dll/RKBnew20... · UniData Data replication provides an automatic way to deliver read-only copies of

Examples

The following example illustrates a repconfig file for account-level replication. In these examples, the CUSTOMER and\IBM\ud72\demo on System A to \IBM\ud72\test on System B in real-time, standby replication mode, and to /disk1/demo on System C in deferred replication. Also assume that a STUDENT2 VOC pointer exists in /usr/ud72/demo2 pointing to the STUDENT file in f/usr/ud72/demo.

RW_REEVALUATE_VF UniData evaluates indexed virtual fields on the publishing system before writing the results to the database, then transfers these values to the subscribers along with the record. You can choose to use these values directly from the publisher, or have the replication writer processes reevaluate these values. By default, the replication writer process reeval-uates the virtual field on the subscribing system. If you want to use the values without reevaluating them, set this parameter to 0.

RW_SKIP_TRIGGER If this value is set to 1, the default, the replication writer process ignores a trigger, even if a trigger exists on the subscribing file. If you do not want to ignore the trigger, set this value to 0.

RW_IGNORE_ERROR If a replication writer process encounters inconsistency in a replication log, it writes an error message to the rm.errlog, but continues processing. If you set this value to 0, UniData will suspend replication if it finds inconsistency in a replication log.

Parameter Description

Replication Writer Configurable Parameters (continued)

2-18 UniData Data Replication

Page 37: UniData Data Replication - Rocket Softwaredocs.rocketsoftware.com/nxt/gateway.dll/RKBnew20... · UniData Data replication provides an automatic way to deliver read-only copies of

The following example illustrates the rep config file on System A:

GROUP=SAMPLE_ACCT LEVEL=ACCOUNTACCOUNT=\IBM\ud72\test FILE=SUB_WRITEABLE VOCFILE=CUSTOMER FILE=STUDENT EXCLUDED_FILE=_XML_ EXCLUDED_FILE=_EDA.MAP_ EXCLUDED_FILE=ENGLISH.MSG DISTRIBUTION=P:SystemA DISTRIBUTION=IB:SystemB DISTRIBUTION=D:SystemC#Define failover distribution RFSFAILOVER=SystemB#Define tunable parameters RESERVED_FILE_SPACE=500 N_LOGINFO=5120 REP_BUFSZ=163840 N_REPWRITER=2 RW_IGNORE_ERROR=1 RW_REEVALUATE_VF=0 RW_SKIP_TRIGGER=1

Configuring UniData Data Replication 2-19

Page 38: UniData Data Replication - Rocket Softwaredocs.rocketsoftware.com/nxt/gateway.dll/RKBnew20... · UniData Data replication provides an automatic way to deliver read-only copies of

The next example illustrates the repconfig file on System B:

GROUP=SAMPLE_ACCT LEVEL=ACCOUNTACCOUNT=\IBM\ud72\demo FILE=SUB_WRITEABLE VOCFILE=CUSTOMER FILE=STUDENT EXCLUDED_FILE=_XML_ EXCLUDED_FILE=_EDA.MAP_ EXCLUDED_FILE=ENGLISH.MSG DISTRIBUTION=RB:SystemB DISTRIBUTION=P:SystemA DISTRIBUTION=D:SystemC#Define failover distribution RFSFAILOVER=SystemB#Define tunable parameters RESERVED_FILE_SPACE=500 N_LOGINFO=5120 REP_BUFSZ=163840 N_REPWRITER=2 RW_IGNORE_ERROR=1 RW_REEVALUATE_VF=0 RW_SKIP_TRIGGER=1

2-20 UniData Data Replication

Page 39: UniData Data Replication - Rocket Softwaredocs.rocketsoftware.com/nxt/gateway.dll/RKBnew20... · UniData Data replication provides an automatic way to deliver read-only copies of

The next example illustrates the repconfig file on System C:

#Define the group name GROUP=SampleGroup #Define Local Account Path ACCOUNT=/disk1/demo#Define replication objects FILE=SUB_WRITEABLE VOCFILE=CUSTOMER FILE=STUDENT EXCLUDED_FILE=_XML_ EXCLUDED_FILE=_EDA.MAP_ EXCLUDED_FILE=ENGLISH.MSG #Define distributions from System A to LOCAL DISTRIBUTION=D:SystemC DISTRIBUTION=P:SystemA#Define configurable parameters #Log info buffer size N_LOGINFO=512 #Log buffer size REP_BUFSZ=16384 #Define number of replication writer processes N_REPWRITER=2

Configuring UniData Data Replication 2-21

Page 40: UniData Data Replication - Rocket Softwaredocs.rocketsoftware.com/nxt/gateway.dll/RKBnew20... · UniData Data replication provides an automatic way to deliver read-only copies of

Defining Replication on a Publishing System You must define each subscribing system location and each of the replication groups on the publishing system before you can start UniData Data Replication.

You can define publishing systems from the command line, or from UniAdmin.

Select one of the following methods to access the UniData Data Replication Admin dialog box:

From the UniAdmin window, double-click Replication.From the UniAdmin menu, click Admin, then click ReplicationFrom the UniAdmin toolbar, click the Replication icon, as shown in the following example:

Replication Admin Icon

2-22 UniData Data Replication

Page 41: UniData Data Replication - Rocket Softwaredocs.rocketsoftware.com/nxt/gateway.dll/RKBnew20... · UniData Data replication provides an automatic way to deliver read-only copies of

A dialog box similar to the following example appears:

Defining Replication on a Publishing System 2-23

Page 42: UniData Data Replication - Rocket Softwaredocs.rocketsoftware.com/nxt/gateway.dll/RKBnew20... · UniData Data replication provides an automatic way to deliver read-only copies of

Define Subscribing SystemsTo define remote replication systems, from the UniData Replication Admin dialog box, click System Definition. A dialog box similar to the following example appears:

To add a subscribing system location, click Add. A dialog box similar to the following example appears:

2-24 UniData Data Replication

Page 43: UniData Data Replication - Rocket Softwaredocs.rocketsoftware.com/nxt/gateway.dll/RKBnew20... · UniData Data replication provides an automatic way to deliver read-only copies of

Enter System ID

In the System ID box, enter the name of the subscribing system. The name of the subscribing system is the name given when you installed UniData Data Replication on your system. By default, this name is <hostname>_version.

Enter Host Name

In the Host Name box, enter the host network name or network address of the repli-cation system.

Enter UniData Version

In the Version box, enter the UniData version running on the system. The version must be 60 or higher.

Define DHCP System

Select the DHCP check box if the remote system has a dynamic IP address. For more information, see “DHCP Phrase” on page 2-8.

Choose to Auto Resume

Auto Resume determines if replication to the system you specify will be synchro-nized and resume automatically when UniData starts, or after a reconfiguration. Select Yes if you want UniData to automatically resume processing, or No if you want to manually synchronize data and resume processing.

Define Sync Interval

In the Sync Interval box, select the time interval, in minutes, in which the replication system automatically synchronizes replication.

UniData Data Replication automatically synchronizes subscribing systems with their publisher every period defined by sync_interval. A sync_interval of 0 indicates a manual synchronization system, where UniData does not automatically synchronize the systems.

The synchronization interval is only valid when using deferred replication.

Defining Replication on a Publishing System 2-25

Page 44: UniData Data Replication - Rocket Softwaredocs.rocketsoftware.com/nxt/gateway.dll/RKBnew20... · UniData Data replication provides an automatic way to deliver read-only copies of

Choose Connect Authorization

If you select the Connect Authorization check box for a subscribing system, UniData Data Replication verifies the login name and password when the subscribing system issues a SYNC request.

Define Timeout Interval

The timeout interval defines the number of seconds to wait if no packets are received before suspending replication.

The publishing system sends a packet to the subscribing system approximately every 4 seconds when replication is idle. The subscribing system then sends a packet back to the publishing system. If you define a timeout interval on the subscribing system, the publistener process counts the time that has elapsed between packets being received. If the amount exceeds the timeout interval, replication is suspended.

If you set the timeout value to 0, UniData Data Replication does not time out.

IBM recommends that you not set the timeout interval to less than 2 minutes.

Define Exception Action

The Exception Action is a shell script on UNIX platforms, or a batch program on Windows platforms. Enter the full path to the trigger in the EXCEPTION_ACTION box. For example, if you define an exception action trigger as UDRepExceptionAction.sh in the /usr/ud72 directory, set the full path as:

EXCEPTION_ACTION=/usr/ud72/UDRepExceptionAction.sh

If you define an Exception Action on a subscribing system, whenever an exception occurs and suspends replication, UniData Data Replication invokes the Exception Action script.

When you finish defining the subscribing system requirements, click OK to return to the UniData Replication Admin dialog box.

Defining Publishing Groups from UniAdminComplete the following steps to define a publishing replication group from UniAdmin.

2-26 UniData Data Replication

Page 45: UniData Data Replication - Rocket Softwaredocs.rocketsoftware.com/nxt/gateway.dll/RKBnew20... · UniData Data replication provides an automatic way to deliver read-only copies of

Adding a Publishing Group

To add a publishing group, in the Publishing Groups area of the UniData Data Replication Admin dialog box, click Add. A dialog box similar to the following example appears:

Defining Replication on a Publishing System 2-27

Page 46: UniData Data Replication - Rocket Softwaredocs.rocketsoftware.com/nxt/gateway.dll/RKBnew20... · UniData Data replication provides an automatic way to deliver read-only copies of

If you select ACCOUNT in the Level box, the following dialog box appears:

Defining Group Name

In the Group ID box, enter a unique name for the publishing group.

2-28 UniData Data Replication

Page 47: UniData Data Replication - Rocket Softwaredocs.rocketsoftware.com/nxt/gateway.dll/RKBnew20... · UniData Data replication provides an automatic way to deliver read-only copies of

Defining Replication Level

In the Level box, select the level of replication. Valid values are FILE or ACCOUNT.

Specifying Publishing Account

In the Account box, select the local account where the replication group resides. UniAdmin automatically populates the Account Path box.

Select Files to Publish

In the Files area of the Publishing Group Details dialog box, click Add to select the files you want to publish. A dialog box similar to the following example appears:

Click the file you want to publish. You can select multiple files by clicking the file while holding down the CTRL key.

Defining Replication on a Publishing System 2-29

Page 48: UniData Data Replication - Rocket Softwaredocs.rocketsoftware.com/nxt/gateway.dll/RKBnew20... · UniData Data replication provides an automatic way to deliver read-only copies of

When you have selected all the files you want to publish, click OK, or click Cancel to exit without saving changes. A dialog box similar to the following example appears:

By default, both the data portion and the dictionary portion of the file are selected. If you do not want to publish the data portion of the file, clear the Data check box. If you do not want to pu blish the dictionary portion of the file, clear the Dict check box. If you to be able to update the file on the subscribing system, select the Sub Writable check box.

When you finish selecting all the files you want to publish, click OK to return to the UniData Replication Admin dialog box.

2-30 UniData Data Replication

Page 49: UniData Data Replication - Rocket Softwaredocs.rocketsoftware.com/nxt/gateway.dll/RKBnew20... · UniData Data replication provides an automatic way to deliver read-only copies of

Select Files to Exclude

If you are using account-level replication, you can select files to exclude fromU-niData Data Replication. In the Excluded Files area of the Publishing Group Details dialog box, click Add. A dialog box similar to the following example appears:

Click the file you want to exclude. You can select multiple files by clicking the file while holding down the CTRL key.

When you finish selecting all the files you want to exclude, click OK to return to the Publishing Group Details dialog box.

Enter RFS Failover System

If you want this publishing group to automatically failover to a standby system, select the standby system in the RFS Failover System box.

Defining Replication on a Publishing System 2-31

Page 50: UniData Data Replication - Rocket Softwaredocs.rocketsoftware.com/nxt/gateway.dll/RKBnew20... · UniData Data replication provides an automatic way to deliver read-only copies of

Set Configuration Parameters

Set any of the configuration parameters necessary for your environment in the Configuration area of the Publishing Group Details dialog box, as shown in the following example:

For detailed information about these configuration parameters, see “Configuration Phrases” on page 2-16.

Defining Publishing Groups from the Command LineComplete the following steps to define a publishing replication group from the command line:

1. Log on to the publishing system.2. Edit the repconfig file, located in /usr/ud72/include on UniData for UNIX

or udthome\include on UniData for Windows Platforms. Define all repli-cation systems in the replication environment to which UniData Data Replication may connect.

2-32 UniData Data Replication

Page 51: UniData Data Replication - Rocket Softwaredocs.rocketsoftware.com/nxt/gateway.dll/RKBnew20... · UniData Data replication provides an automatic way to deliver read-only copies of

3. Edit the repconfig file, located in /usr/ud72/include on UniData for UNIX or udthome\include on UniData for Windows Pl.atforms. For each repli-cation group, define the following information:

Assign a unique replication group name.Define the replication level.Define the location of the publishing account.Define excluded files for account-level replication.Define all files belonging to the replication group.Define the distribution for the group, including the publishing system and all subscribing systems to which it replicates.Define the replication type for each of the distribution systems.Set the replication group configurable parameters.

Restart UniData, or execute the RECONFIG command.

Defining Replication on a Publishing System 2-33

Page 52: UniData Data Replication - Rocket Softwaredocs.rocketsoftware.com/nxt/gateway.dll/RKBnew20... · UniData Data replication provides an automatic way to deliver read-only copies of

Defining Replication on a Subscribing SystemYou must define the publishing system location and import the replication group definitions from that location. If the subscribing system you are defining is a standby system, you also need to define other subscribing systems, if any.

Complete the following steps to define a subscribing replication group from UniAdmin.

Select one of the following methods to access the UniData Replication Admin dialog box on the subscribing system:

From the UniAdmin window, double-click Replication.From the UniAdmin menu, click Admin, then click ReplicationFrom the UniAdmin toolbar, click the Replication icon, as shown in the following example:

Replication Admin Icon

2-34 UniData Data Replication

Page 53: UniData Data Replication - Rocket Softwaredocs.rocketsoftware.com/nxt/gateway.dll/RKBnew20... · UniData Data replication provides an automatic way to deliver read-only copies of

A dialog box similar to the following example appears:

Defining Replication on a Subscribing System 2-35

Page 54: UniData Data Replication - Rocket Softwaredocs.rocketsoftware.com/nxt/gateway.dll/RKBnew20... · UniData Data replication provides an automatic way to deliver read-only copies of

Define the Publishing System Location on Subscribing System

To define remote publishing system on the subscribing system, from the UniData Replication Admin dialog box, click System Definition. A dialog box similar to the following example appears:

To add another system, click Add. A dialog box similar to the following example appears:

2-36 UniData Data Replication

Page 55: UniData Data Replication - Rocket Softwaredocs.rocketsoftware.com/nxt/gateway.dll/RKBnew20... · UniData Data replication provides an automatic way to deliver read-only copies of

Enter System ID

In the System ID box, enter the publishing system name.

Enter Host Name

In the Host Name box, enter the host network name or network address of the publishing system.

Enter UniData Version

In the Version box, enter the UniData version running on the system. The version must be 60 or higher.

Choose to Auto Resume

Auto Resume determines if replication from the publishing system you specify will be synchronized and resume automatically when UniData starts, or after a reconfig-uration. Select Yes if you want UniData to automatically resume processing, or No if you want to manually synchronize data and resume processing.

Define Sync Interval

In the Sync Interval box, select the time interval, in minutes, in which the replication system automatically synchronizes replication.

UniData Data Replication automatically issues a SYNC request to the publishing system every period defined by sync_interval. A sync_interval of 0 indicates a manual synchronization system, where UniData does not automatically synchronize the systems.

Define Timeout Interval

The timeout interval defines the number of seconds to wait if no packets are received before suspending replication.

The publishing system sends a packet to the subscribing system approximately every 4 seconds when replication is idle. If the publishing system has the a timeout interval defined, the udsub process counts the time that has elapsed between packets being received. If the amount exceeds the timeout interval, replication is suspended.

Defining Replication on a Subscribing System 2-37

Page 56: UniData Data Replication - Rocket Softwaredocs.rocketsoftware.com/nxt/gateway.dll/RKBnew20... · UniData Data replication provides an automatic way to deliver read-only copies of

IBM recommends that you not set the timeout interval to less than 2 minutes.

Define Exception Action

The Exception Action is a shell script on UNIX platforms, or a batch program on Windows platforms. Enter the full path to the trigger in the EXCEPTION_ACTION box. For example, if you define an exception action trigger as UDRepExceptionAction.sh in the /usr/ud72 directory, set the full path as:

EXCEPTION_ACTION=/usr/ud72/UDRepExceptionAction.sh

Define Connection User Name and Password to Publishing System

If you select Connect Authorization on the subscribing system location definition on the publishing system, you must define the connection user name and password to the publishing system location. To define the connection user name and password to the publishing system, select the publishing system in the Replication System Definition dialog box, then click Set Connection. The Set Rep System Connection dialog box appears, as shown in the following example:

Enter the login name and the corresponding password. Re-enter the password. Click OK to return to the Replication System Definition dialog box.

2-38 UniData Data Replication

Page 57: UniData Data Replication - Rocket Softwaredocs.rocketsoftware.com/nxt/gateway.dll/RKBnew20... · UniData Data replication provides an automatic way to deliver read-only copies of

Define Subscribing GroupsIn the Subscribing Groups area of the UniData Replication Admin dialog box, click Add. The Subscribe Group Details dialog box appears, as shown in the following example:

Defining Replication on a Subscribing System 2-39

Page 58: UniData Data Replication - Rocket Softwaredocs.rocketsoftware.com/nxt/gateway.dll/RKBnew20... · UniData Data replication provides an automatic way to deliver read-only copies of

Select Publishing System

In the From System box, select the publishing system from which this subscribing system is receiving data.

Select Group ID

Select the Group ID from the publishing system in the Group ID list.

When you select the Group ID, UniAdmin populates the file list and configuration parameters from the same Group ID on the publisher.

Select Into Account

Select the account to which you want to replicate data in the Into Account dialog box. UniAdmin automatically populates the Account Path box.

Define Type of Replication

In the Distributions area of the Subscription Group Details dialog box, click the value in the Type box. The following list of replication types appears:

Select the type of replication you want for the subscriber.

Select Hot Standby

If the subscribing system will be used as a standby system, select the Hot Standby check box.

2-40 UniData Data Replication

Page 59: UniData Data Replication - Rocket Softwaredocs.rocketsoftware.com/nxt/gateway.dll/RKBnew20... · UniData Data replication provides an automatic way to deliver read-only copies of

The following example illustrates a completed definition for a subscribing system:

Click OK to save the subscribing group definition, or click Cancel to exit without saving changes.

Verify Distribution Information

In the UniData Replication Admin dialog box, select a subscribed group, then click Detail.

UniAdmin displays the distribution information for the publishing group in the Distributions area of the Publishing Group Details dialog box, as shown in the following example:

For information about distribution types, see “DISTRIBUTION Phrase” on page 2-15.

Defining Subscribing Groups from the Command LineComplete the following steps to define a subscribing replication group from the command line:

1. Log on to the subscribing system.

Defining Replication on a Subscribing System 2-41

Page 60: UniData Data Replication - Rocket Softwaredocs.rocketsoftware.com/nxt/gateway.dll/RKBnew20... · UniData Data replication provides an automatic way to deliver read-only copies of

2. Edit the repsys file, located in /usr/ud72/include on UniData for UNIX or udthome\include on UniData for Windows Platforms. In this file, define all host systems to which the replication may connect.

3. Edit the repconfig file located in /usr/ud72/include on UniData for UNIX or udthome\include on UniData for Windows Platforms. Define all the repli-cation groups you want to replicate from the publisher. Make sure you use the same group name used on the publisher.

Copy the file list of the group from the publisher.Define the publishing system according to the definition on the publisher.Define the local system as the subscribing system, and define the repli-cation type.If you are going to use this system as a standby subscriber, define all other distributions of the group and their replication types, according to the definition on the publisher.Set the replication group configurable parameters.Define the subscribing account path in Replication

4. Create the subscribing account, then copy all files from the publishing account to the subscribing account.

5. Restart UniData, or execute the RECONFIG command to load the repli-cation group definition and allocate system resources.

2-42 UniData Data Replication

Page 61: UniData Data Replication - Rocket Softwaredocs.rocketsoftware.com/nxt/gateway.dll/RKBnew20... · UniData Data replication provides an automatic way to deliver read-only copies of

Changing a Replication Group DefinitionYou can change a replication group definition without having to stop and restart UniData.

Changing a Replication Group Definition 2-43

Page 62: UniData Data Replication - Rocket Softwaredocs.rocketsoftware.com/nxt/gateway.dll/RKBnew20... · UniData Data replication provides an automatic way to deliver read-only copies of

Change Replication Group Definition from UniAdminTo change a replication group definition, from the UniData Replication Admin menu, click the publishing group you want to update, then click Detail. A dialog box similar to the following example appears:

Make the appropriate changes, then click Update.

2-44 UniData Data Replication

Page 63: UniData Data Replication - Rocket Softwaredocs.rocketsoftware.com/nxt/gateway.dll/RKBnew20... · UniData Data replication provides an automatic way to deliver read-only copies of

You must synchronize the reconfigured group from its publisher or to its subscriber after making your changes.

Change Replication Group Definition from the Command LineThe following steps describe reconfiguring UniData Data Replication from the command line:

1. Log on to the replication system you want to reconfigure.2. Make your changes in the repsys and repconfig files. 3. Synchronize the reconfigured group from its publisher or to its subscriber.4. Execute the RECONFIG command to request that the Replication Manager

reconfigure the replication group.5. The Replication Manager executes the dbpause command to block writes to

the database. If you are running RFS, the dbpause command also forces a checkpoint.

6. The Replication Manager requests that all replication groups suspend replication.

7. The Replication Manager reads the new repconfig and repsys files, and compares them to the original file.

8. The Replication Manager checks the consistency of the definition, and checks each of the groups that are changing to see if there are any replication logs not synchronized to its subscribers.

9. The Replication Manager reallocates shared memory segments, reloads the replication configurations, and the Inode and device number of each repli-cation object.

10. The Replication Manager executes the dbresume command to resume processing.

11. If you selected the AUTORESUME option, the Replication Manager synchronizes and resumes all real-time and immediate replication groups to its publishers and subscribers. If you did not select the AUTORESUME option, you should synchronize manually.

Changing a Replication Group Definition 2-45

Page 64: UniData Data Replication - Rocket Softwaredocs.rocketsoftware.com/nxt/gateway.dll/RKBnew20... · UniData Data replication provides an automatic way to deliver read-only copies of

3Chapter

How Replication Works

Data Propagation Procedure . . . . . . . . . . . . . . . 3-3Suspending Live Replication . . . . . . . . . . . . . . . 3-5 Data Synchronization of Suspended Live Replication . . . . . . 3-6Deferred Replication . . . . . . . . . . . . . . . . . 3-10Transaction Handling . . . . . . . . . . . . . . . . . 3-12RFS Checkpoint Handling . . . . . . . . . . . . . . . . 3-14Indexed Virtual Attributes . . . . . . . . . . . . . . . . 3-15File Triggers . . . . . . . . . . . . . . . . . . . . 3-16File-level Operations . . . . . . . . . . . . . . . . . 3-17 File-level Commands . . . . . . . . . . . . . . . . 3-18

Page 65: UniData Data Replication - Rocket Softwaredocs.rocketsoftware.com/nxt/gateway.dll/RKBnew20... · UniData Data replication provides an automatic way to deliver read-only copies of

UniData provides the following two types of live replication:

Real-time Replication is a type of UniData Data Replication where transactions on the publishing server do not commit until all logs of the transaction arrive at the subscriber. With this type of replication, should the publishing system failover to the real-time subscribing system, all committed transactions at the publishing system are guaranteed to apply to the standby system.Immediate Replication is a type of UniData Data Replication where UniData sends a transaction log to the subscribing system immediately after it is ready to commit. The publishing system does not wait for the log to arrive on the subscriber before committing the transaction. Should the publishing server failover to the immediate subscribing system, there is a slight chance that some committed transactions on the publisher did not arrive on the failover system. Administrator intervention may be necessary to recover the system.

Note: Immediate Replication has better performance than real-time replication.

For both types of live replication, the publishing system maintains network connec-tions to its subscribers while it is running. UniData sends data updates on the publishing object to its subscribers through this connection immediately.

3-2

Page 66: UniData Data Replication - Rocket Softwaredocs.rocketsoftware.com/nxt/gateway.dll/RKBnew20... · UniData Data replication provides an automatic way to deliver read-only copies of

Data Propagation ProcedureThe following steps describe the data propagation procedure for live replication.

1. Before UniData commits and updates, the udt or tm process generates a replication log for the update and writes it to the replication buffer.

2. In real-time replication, the udt or tm process waits for the response from the publisher process.

3. The publisher process reads the logs from the replication buffer and sends a package, through the network, to all subscribers.

4. When a subscriber receives a package, the subscriber process converts the data record, if necessary, and copies the logs to the replication buffer. It then sends a Sub-Got notification message to the publisher.

5. In real-time replication, the publisher process wakes up the waiting udt or tm process after receiving the Sub-Got notification message.

6. The udt or tm process commits the update to the database.7. If RFS is not running, the udt process writes a Pub-Commit notification to

the replication buffer. If RFS is running, the aimglog process writes the Pub-Commit notification to the replication buffer when UniData writes the redo log to disk.

8. The publisher process sends the Pub-Commit notification to the subscribers in the next data package.

9. When the subscriber receives a Pub-Commit notification, it marks the Pub-Commit flag in the log in the replication buffer and wakes up the Repli-cation Writer processes waiting for the log.

10. A Replication Writer process reads the log from the replication buffers once, and applies a logical lock for the record it is about to update. It then checks the Pub-Commit flag on the log and waits for the flag to be set by the subscriber. For the log of an update involved in a transaction, the Repli-cation Writer process also has to wait for the arrival of the Transaction-end log.

11. Next, the Replication Writer process updates the subscribing objects according to the contents of the replication log.

12. The Replication Writer process then updates the Sub-Commit flag in the log to indicate that the log has been committed on the subscribing system, and releases the logical lock for the record.

3-3 UniData Data Replication

Page 67: UniData Data Replication - Rocket Softwaredocs.rocketsoftware.com/nxt/gateway.dll/RKBnew20... · UniData Data replication provides an automatic way to deliver read-only copies of

13. The subscriber sends back a Sub-Commit notification to the publishing system confirming that the update has been committed on the subscribing system.

14. When the publishing process receives the Sub-Commit notification message, it removes the logs from the replication buffer.

Data Propagation Procedure 3-4

Page 68: UniData Data Replication - Rocket Softwaredocs.rocketsoftware.com/nxt/gateway.dll/RKBnew20... · UniData Data replication provides an automatic way to deliver read-only copies of

Suspending Live ReplicationSystem administrators can suspend live replication when subscribing systems shut down, crash, network failures occur, or for their own reason.

You can suspend replication by issuing the suspend command.

Note: You can execute the suspend command from UniAdmin, or from the command line. For information about executing the suspend command from UniAdmin, see the suspend Command in Chapter 5, “Administering UniData Data Replication.”

Syntax:suspend <targets>

If you specify targets as ALL, UniData suspends all replications on the system. If you specify a replication, UniData suspends the replication from or to the system you specify. If you specify target as a replication group, UniData suspends all distribu-tions of the group you specify.

You typically use the suspend command before shutting down the publishing or subscribing system.

Note: After UniData starts, the replications to all systems are suspended. You can choose to set the AUTORESUME Phrase in the repsys file to automatically resume live replication.

The suspend command has no effect with deferred replication.

Example

In the following example, the suspend command is issued on SystemA to suspend replication on SystemB:

ud_repadmin suspend SystemB

To suspend a replication, the publishing system saves all replication logs without Sub-Commit notification to the Replication Log Reserve File. If the subscriber did not crash, it saves all logs without Pub-Commit notification to the Replication Log Reserve File. UniData then disrupts the connection between the publisher and the subscriber, and the subscriber process stops running.

3-5 UniData Data Replication

Page 69: UniData Data Replication - Rocket Softwaredocs.rocketsoftware.com/nxt/gateway.dll/RKBnew20... · UniData Data replication provides an automatic way to deliver read-only copies of

When you suspend a replication, the publishing system runs in suspension mode. The udt or tm process can read from or write to the database as usual. Instead of sending replication logs to the subscriber, the publisher saves them in the Replication Log Reserve File.

The following section describes how UniData Data Replication behaves in suspension mode:

1. Before committing an update, the udt or tm process generates replication logs for the update, and writes them to the replication buffer.

2. For real-time replication, the udt or tm process waits for the response from the publisher process.

3. The publisher process reads the logs from the replication buffer and saves them to the Replication Log Reserve File.

4. For real-time replication, the publisher process wakes up the waiting udt or tm process.

5. The udt or tm process commits the update to the database.6. If you are not using RFS, the udt process writes the Pub-Commit notifi-

cation to the replication buffer. If you are using RFS, the aimglog process writes the Pub-Commit notification to the replication buffer when it writes the RFS redo log to disk.

7. The publisher process removes the logs from the replication buffer.

Data Synchronization of Suspended Live ReplicationYou must synchronize suspended replication to resume replication to the running mode.

To synchronize the replication, use the SYNC command on the publishing or subscribing system. Your system administrator can configure a replication to automatically synchronize when UniData starts by defining AUTORESUME in the system definition.

Note: You can execute the sync command from UniAdmin, or from the command line. For information about executing the suspend command from UniAdmin, see the sync Command in Chapter 5, “Administering UniData Data Replication.”

Suspending Live Replication 3-6

Page 70: UniData Data Replication - Rocket Softwaredocs.rocketsoftware.com/nxt/gateway.dll/RKBnew20... · UniData Data replication provides an automatic way to deliver read-only copies of

Syntaxsync [-noresume | -wait | -force] <targets>

If you specify targets as ALL, UniData synchronizes replications on all systems. If you specify target as a replication system, UniData synchronizes replications from and/or to the replication system you specify. If you specify target as a group, UniData synchronizes all replications of the group you specify.

The speed of the synchronization process depends on how many pending logs UniData must synchronize, and the speed of the network connection. The sync command normally returns when all targets are in the synchronization mode.

By default, the sync command resumes a live replication. The following table describes the options available with the sync command.

SYNC Command Options

Option Description

noresume UniData suspends a live replication when it finishes synchronizing the repli-cation systems.

wait If you specify this option, the SYNC command does not return until all synchronizations you specify succeed or fail.

force The Replication Writer processes ignore the errors encountered during the synchronization process, if any. If you do not specify this option, the synchro-nization process fails if an error is encountered.

Note: After UniData starts, the replications to all systems are suspended. You can choose to set the AUTORESUME Phrase in the repsys file to automatically resume live replication.

The sync command may fail if the network connection fails, or if the distribution of a replication conflicts between the publishing system and the subscribing system. UniData returns an error code to indicate the failure. You can use the REPORT command to check the details of the error.

Note: If you issue the sync command when a live replication is running, the command has no effect.

When to Issue the sync Command

You should issue the sync command in the following circumstances:

3-7 UniData Data Replication

Page 71: UniData Data Replication - Rocket Softwaredocs.rocketsoftware.com/nxt/gateway.dll/RKBnew20... · UniData Data replication provides an automatic way to deliver read-only copies of

After UniData starts on the subscribing system if you do not set the AUTORESUME Phrase in the repsys file.After you suspend live replication from or to a system and you want to resume replication.After failing over or reconfiguring a replication if you do not set the AUTORESUME Phrase in the repsys file.After UniData starts on the publishing system while some of the subscribing systems are running if you do not set the AUTORESUME Phrase in the repsys file.

Example

In the following example, UniData resumes replication from SystemA to SystemB:

ud_repadmin sync -force SystemB

How Synchronization Works

UniData completes the following steps when synchronizing suspended replication:

1. The publishing system establishes a connection to the subscribing system and invokes the subscriber process.

2. The subscriber process creates the Replication Writer processes to read the logs from the replication buffer. The subscriber then begins listening for a data package.

3. The publishing system creates the Publisher Listener Process to listen to the return package from the subscriber process.

4. The publishing system creates the Publisher-syncing Tool process.5. The Publisher-syncing Tool process reads the logs from the Replication Log

Reserve File and sends them to the subscriber.6. When a package of replication log files arrive at the subscriber, the

subscriber process converts the data record, if necessary, and copies the logs to the replication buffer. It then sends a Sub-Got notification message to the publisher.

7. A replication writer process reads the log from the replication buffers once, and applies a logical lock for the record it is about to update. For the log of an update involved in a transaction, the Replication Writer process also has to wait for the arrival of the Transaction-end log.

Suspending Live Replication 3-8

Page 72: UniData Data Replication - Rocket Softwaredocs.rocketsoftware.com/nxt/gateway.dll/RKBnew20... · UniData Data replication provides an automatic way to deliver read-only copies of

8. The replication writer process updates the database according to the contents of the replication log, and marks the Sub-Commit flag of the log to indicate the log has been committed on the subscribing system. It then releases the logical lock for the record.

9. The subscriber process sends back the Sub-Commit notification message to the publishing system.

10. For every notification package received, the Publisher Listener Process marks the Sub-Got and Sub-Commit flags of the logs.

11. When the Publisher-syncing Tool finishes sending all of the logs in the Replication Log Reserve File, it terminates.

12. After the Publisher-syncing Tool terminates, the publisher process checks to see if any new replication logs were generated during the synchronization process. If new replication logs exist, it begins at step 4 and repeats the synchronization process.

13. The publishing system now resumes replication in running mode.

3-9 UniData Data Replication

Page 73: UniData Data Replication - Rocket Softwaredocs.rocketsoftware.com/nxt/gateway.dll/RKBnew20... · UniData Data replication provides an automatic way to deliver read-only copies of

Deferred ReplicationIn deferred replication, the publishing system does not keep connections to the subscribers active. UniData saves the data in the Replication Log Reserve File instead of sending the data to the subscribers. Data synchronization is the only means of data propagation.

Deferred Replication has two types:

Periodic Replication has a predefined period of time when the replication system will automatically synchronize its data.Manual-Sync Replication does not have a predefined synchronization period. Data propagation is achieved by the sync command.

Deferred replication is similar to the suspension mode of immediate replication. Following are the steps for data synchronization with deferred replication:

1. The publishing system establishes a connection to the subscribing system and invokes the subscriber process.

2. The subscriber process creates the Replication Writer processes to read the logs from the replication buffer. The subscriber then begins listening for a data package.

3. The publishing system creates the Publisher Listener Process to listen to the return package from the subscriber process.

4. The publishing system creates the Publisher-syncing Tool process.5. The Publisher-syncing Tool process reads the logs from the Replication Log

Reserve File and sends them to the subscriber.6. When a package of replication log files arrive at the subscriber, the

subscriber process converts the data record, if necessary, and copies the logs to the replication buffer. It then sends a Sub-Got notification message to the publisher.

7. A replication writer process reads the log from the replication buffers once, and applies a logical lock for the record it is about to update. For the log of an update involved in a transaction, the Replication Writer process also has to wait for the arrival of the Transaction-end log.

Deferred Replication 3-10

Page 74: UniData Data Replication - Rocket Softwaredocs.rocketsoftware.com/nxt/gateway.dll/RKBnew20... · UniData Data replication provides an automatic way to deliver read-only copies of

8. The replication writer process updates the database according to the contents of the replication log, and marks the Sub-Commit flag of the log to indicate the log has been committed on the subscribing system. It then releases the logical lock for the record.

9. The subscriber process sends back the Sub-Commit notification message to the publishing system.

10. For every notification package received, the Publisher Listener Process marks the Sub-Got and Sub-Commit flags of the logs.

11. When the Publisher-syncing Tool finishes sending all of the logs in the Replication Log Reserve File, it terminates.

12. After the Publisher-syncing Tool terminates, the publisher process checks to see if any new replication logs were generated during the synchronization process. If new replication logs exist, it begins at step 4 and repeats the synchronization process.

13. The publishing system disconnects from the subscriber and returns repli-cation to suspension mode.

3-11 UniData Data Replication

Page 75: UniData Data Replication - Rocket Softwaredocs.rocketsoftware.com/nxt/gateway.dll/RKBnew20... · UniData Data replication provides an automatic way to deliver read-only copies of

Transaction HandlingThe following section describes how UniData Data Replication handles transaction processing:

1. At the beginning of the commit phase of a transaction, the tm process generates all replication logs for the updates of a replication object in the transaction. This process also generates a Transaction-Begin and Trans-action-End log for each of the transactions involved in the replication group. A Transaction-Begin log contains the transaction ID, the number of repli-cation groups involved in the transaction, and the number of updates within the replication group.

2. For each of the replication groups, the tm process writes the Transaction-Begin log, the replication logs of all updates in the replication group, and the Transaction-End log to the replication buffer of the replication group. If you are using Real-time Replication, the tm process waits for the Transaction-End log to ensure all logs of the transaction arrive at the subscribing system.

3. The publishing process sends the logs to the subscriber. In the case of deferred replication, UniData writes the logs to the Replication Log Reserve File. When the publisher receives the Sub-Got notification message from the subscriber, it wakes up the tm process that is waiting.

4. The tm process writes the RFS redo logs, and commits the transaction to the database.

5. After the aimglog process flushes the redo logs to disk, it marks the Pub-Commit flag of the Transaction-Begin log.

6. The publishing process sends the Pub-Commit notification to the subscriber process.

7. When the subscriber process receives a Transaction-Begin log, it copies the log to the replication buffer. If the transaction is part of a multi-group trans-action, it checks the Transaction Control Area for the Transaction Control Record for this transaction. If the Transaction Control Record does not exist, it creates a new Transaction Control Record and adds it to the Transaction Control Area.

8. When the subscriber process receives the data update logs of a transaction, it copies the logs to the replication buffer.

Transaction Handling 3-12

Page 76: UniData Data Replication - Rocket Softwaredocs.rocketsoftware.com/nxt/gateway.dll/RKBnew20... · UniData Data replication provides an automatic way to deliver read-only copies of

9. When the subscriber process receives a Transaction-End log, it sets the Sub-Got flag in the Transaction-Begin log. If the transaction is part of a multi-group transaction, it increases the number of Sub-Got groups in the Trans-action Control Record. If the number of Sub-Got groups is equal to the number of groups involved in the transaction, it then sets the Sub-Got flag in the Transaction Control Record and wakes all Replication Writer processes waiting for the Transaction Control Record, then sends a Sub-Got notification message to the publishing system.

10. The Replication Writer process reads one data update log from the Repli-cation Buffer, applies a logical lock on the record it is about to update, then waits for the arrival of all of the replication logs involved in the transaction. It also waits for the Pub-Commit notification message from the publishing system.

11. The Replication Writer process updates the database according to the contents of the log files.

12. The Replication Writer process sets the Sub-Commit flag in the log, and increases the number of Sub-Commit logs in the Transaction-Begin log. If the number of Sub-Commit logs equals the number of logs in the group for the transaction, it increases the number of Sub-Commit groups involved in the transaction. If the number of Sub-Commit groups equals the number of groups in the transaction, it sets the Sub-Commit flag in the Transaction Control Record to indicate the transaction has been committed on the subscribing system.

13. The subscriber process sends back a Sub-Commit notification message to the publishing system, and removes the Transaction Control Record from the Transaction Control area.

14. The publishing system removes all logs related to the transaction from the replication buffer.

3-13 UniData Data Replication

Page 77: UniData Data Replication - Rocket Softwaredocs.rocketsoftware.com/nxt/gateway.dll/RKBnew20... · UniData Data replication provides an automatic way to deliver read-only copies of

RFS Checkpoint HandlingWhen running RFS, the Checkpoint Manager (CM) process coordinates with the publisher processes to ensure that all replication logs of the current redo log set are either transferred to the immediate replication subscriber, or saved to the Replication Log Reserve File before the CM switches the redo log sets. If the system crashes after this checkpoint, the restart process generates replication logs from the current redo log set.

RFS Checkpoint Handling 3-14

Page 78: UniData Data Replication - Rocket Softwaredocs.rocketsoftware.com/nxt/gateway.dll/RKBnew20... · UniData Data replication provides an automatic way to deliver read-only copies of

Indexed Virtual AttributesUniData Data Replication propagates the indexed virtual attribute values, as well as the record. The following two methods are available to propagate virtual attribute values:

Use the values evaluated on the publishing system. If the index is enabled, the udt or tm process evaluates all indexed virtual attribute values before updating the record in the database. These values are also passed as a record to the subscribing systems. The Replication Writer process then writes the values directly to the index file. This method requires that the subscribing system have the same dictionary and index definition as the publishing system. It also requires that the indexes of the publishing system and the subscribing system be consistent. If one is enabled, the other must also be enabled. Reevaluate indexed virtual attributes on the subscribing system. This is the default setting. Before the Replication Writer process applies the repli-cation log to the database, it evaluates all indexed virtual attribute values and saves them in the index file, if the index is enabled. If the index is disabled, it saves the record to the index log file, then the UPDATE.INDEX command evaluates the values.

3-15 UniData Data Replication

Page 79: UniData Data Replication - Rocket Softwaredocs.rocketsoftware.com/nxt/gateway.dll/RKBnew20... · UniData Data replication provides an automatic way to deliver read-only copies of

File TriggersBy default, if a subscribing object has triggers defined, the Replication Writer process will not execute the trigger when applying the replication log. Your database admin-istrator can configure the replication group to execute the trigger.

File Triggers 3-16

Page 80: UniData Data Replication - Rocket Softwaredocs.rocketsoftware.com/nxt/gateway.dll/RKBnew20... · UniData Data replication provides an automatic way to deliver read-only copies of

File-level Operations UniData supports the following file-level operations:

DIR file operations:EDCOPYCLEAR.FILE

File-level commandsCREATE.FILEDELETE.FILECLEAR.FILECNAMESETFILE

Other commands:BASICCATALOGDELETE.CATALOG

UniData does not support the following commands for replication at this release:

CREATE.INDEXDELETE.INDEXBUILD.INDEXDISABLE.INDEXENABLE.INDEXUPDATE.INDEXRESIZECLEAR.ACCOUNTSAVE.LISTCOPY.LISTMERGE.LISTDELETE.LIST

3-17 UniData Data Replication

Page 81: UniData Data Replication - Rocket Softwaredocs.rocketsoftware.com/nxt/gateway.dll/RKBnew20... · UniData Data replication provides an automatic way to deliver read-only copies of

CREATE.TRIGGERDELETE.TRIGGER

Note: The commands UniData does not support for replication can be executed on the subscribing system, they are not blocked.

File-level CommandsTo replicate file-level commands, you must publish the target file. If the excluded file list contains that file, or if the file is disabled, UniData does not replicate the file-level command.

If a file-level command creates a new file, and UniData successfully enables the file for publication, UniData replicates the command to the subscriber.

If a file-level command automatically updates a VOC or dictionary file. UniData replicates these updates, whether or not the VOC or dictionary file is published. These updates are also performed on the subscribing system when reexecuting the command.

CREATE.FILE

When you execute the CREATE.FILE command, UniData enables the file for repli-cation. If UniData successfully enables the file as a publishing file, it sends the command itself to the subscribing system for replication. When the subscribing system receives the CREATE.FILE log, the replication writer process applies an exclusive lock to the VOC entry for the file and reexecutes the command.

After the replication writer process creates the file on the subscribing system, it enables the file for subscription. Updates on the file will also be replicated.

If you specify the PARTTBL option with the CREATE.FILE command, UniData does not replicate this option to the subscriber, but uses the default PARTTBL on the subscribing system. DELETE.FILE

File-level Operations 3-18

Page 82: UniData Data Replication - Rocket Softwaredocs.rocketsoftware.com/nxt/gateway.dll/RKBnew20... · UniData Data replication provides an automatic way to deliver read-only copies of

DELETE.FILE

When you execute the DELETE.FILE command, UniData checks if the file is published. If so, UniData sends the command to the subscribing system for replication.

The DELETE.FILE command automatically disables the publication and subscription of the file.

Note: If UDT.OPTIONS 87 is ON on the publishing system, this also will be ON on the subscribing system with the DELETE.FILE log. The replication writer process will delete the remote file.

CNAME

The CNAME command changes both the physical name and VOC entry name for both the data file and its dictionary. The old file name must be an enabled publishing file or the CNAME command will not replicate on the subscribing system.

If you enable the new file as a replication file in a different replication group than the old file, UniData replicates the CNAME command in the group of the original file and does not synchronize it with other operations on the new file.

SETFILE

The SETFILE command creates a file pointer in the VOC for a UniData file. UniData replicates the SETFILE command by reexecuting the command on the subscribing system.

Miscellaneous

If replication is between a UNIX platform and a Windows platform, UniData does not convert slashes contained in the path.

The replication of file-level operations may result in creation of a new operating-sytem level file on the subscribing system. UniData determines the owner of the file based on the following rules:

1. If the replication writer process is impersonated by the RW_UID clause in the repconfig file, the owner of the new file is RW_UID.

3-19 UniData Data Replication

Page 83: UniData Data Replication - Rocket Softwaredocs.rocketsoftware.com/nxt/gateway.dll/RKBnew20... · UniData Data replication provides an automatic way to deliver read-only copies of

2. If there is no RW_UID clause in the repconfig file, UniData carries the user login name from the publishing to the subscriber. UniData uses this login name as the owner of the new file if the login name exists on the subscribing system.

3. If there is no RW_UID clause in the repconfig file or the user login name does not exist on the subscribing system, UniData uses root for the owner of the file.

Account-Level Replication Restrictions

Account-level replication does not replicate the following operations:

CONFIGURE.FILEREBUILD.FILEshfbuildmemresizeconvhashconvmarkconvcodeconvtapeconvdataconvidxconvsecuudfileSETLANG

File-level Operations 3-20

Page 84: UniData Data Replication - Rocket Softwaredocs.rocketsoftware.com/nxt/gateway.dll/RKBnew20... · UniData Data replication provides an automatic way to deliver read-only copies of

4Chapter

Failover and Recovery

Failing Over a System . . . . . . . . . . . . . . . . . 4-3 Step-by-Step Instructions . . . . . . . . . . . . . . . 4-3Data Recovery . . . . . . . . . . . . . . . . . . . 4-5 Recovering the Publishing System Running RFS . . . . . . . 4-5 Recovering the Publishing System Not Running RFS . . . . . . 4-6 Recovery of a Subscribing System . . . . . . . . . . . . 4-7Data Resynchronization . . . . . . . . . . . . . . . . 4-8 Resynchronization After Restarting Publishing System . . . . . 4-8 Resynchronization After Failover Using Real-Time Replication . . 4-8 Resynchronization After Failover Using Immediate Replication . . 4-9 Resynchronization After Recovery from Subscribing System or

Network Failure. . . . . . . . . . . . . . . . . . 4-10

Page 85: UniData Data Replication - Rocket Softwaredocs.rocketsoftware.com/nxt/gateway.dll/RKBnew20... · UniData Data replication provides an automatic way to deliver read-only copies of

UniData Replication includes failover capabilities. Failover is a mechanism to convert a secondary standby subscribing system into a publishing system should the primary publishing system crash, supporting high availability of the database.

You can configure a subscribing system of a live replication as a standby system. Should the primary publishing system crash, your database administrator can choose to failover immediately to one of the standby systems. This system then becomes a publishing system after the failover. Other subscribing systems must then subscribe from this system.

When the primary system restarts, the system should become a subscriber from the new publishing system.

Failover of real-time replication guarantees that all committed updates on the primary system commit on the standby system as well. For immediate replication, there is a chance that some updates committed on the primary system, but their logs may not have arrived on the standby system. These updates will be missing on the standby system after failover, but may be recovered after recovery and resynchronization of the primary system.

4-2

Page 86: UniData Data Replication - Rocket Softwaredocs.rocketsoftware.com/nxt/gateway.dll/RKBnew20... · UniData Data replication provides an automatic way to deliver read-only copies of

Failing Over a SystemA database administrator can failover a system using the failover command. This command converts a subscribing system to a publishing system, or a publishing system to a subscribing system. You can configure a system running RFS to automat-ically failover a publishing group to a subscribing distribution after recovery.

Note: You can execute the failover command from UniAdmin, or from the command line. For information about executing the suspend command from UniAdmin, see the failover Command in Chapter 5, “Administering UniData Data Replication.”

Syntax

failover {-pub | -subto <system_name> | -back} <targets>

The following table describes the failover options.

FAILOVER Options

Option Description

-pub The failover command changes the replication to a publishing system on the local system. The local distribution of the replication must be a standby backup system.

-subto If you specify the -subto option, UniData either changes a replication from a publishing system to a subscribing system, or changes the subscribing source to the system you specify with system_name.

-back UniData changes the replication back to the original configuration setting.

If the failover process itself fails, it has to wait for the primary publishing system to recover before it can resume database functions. It may have to copy database files to the failed standby subscribing system to make its database consistent and synchronized.

Step-by-Step InstructionsComplete the following steps to failover a system:

4-3 UniData Data Replication

Page 87: UniData Data Replication - Rocket Softwaredocs.rocketsoftware.com/nxt/gateway.dll/RKBnew20... · UniData Data replication provides an automatic way to deliver read-only copies of

1. When the primary publishing system crashes, UniData disrupts the connection between the publishing system and the subscribing system. The application running the publishing system stops, and the remote client appli-cation is disrupted.

2. The subscribing system wakes up all Replication Writer processes. The Replication Writer processes finish the logs they are currently processing, then quit.

3. The subscriber process saves the unfinished replication logs to the Repli-cation Log Reserve File.

4. As an administrator, issue the FAILOVER command to fail over the current replication to become a publisher.

5. The Replication Manager now starts a new subscriber process in failover mode.

6. The new subscriber system reloads the logs from the Replication Log Reserve Files, then creates Replication Writer processes to apply the logs to the database. When the Replication Writer processes finish, the subscriber system writes the logs to the Replication Log Reserve File, and ends them with a failover ending log.

7. The Replication Manager changes the status of all subscribing groups and saves them.

8. The Replication Manager creates the publisher process.9. The publisher process starts running in suspension mode. Applications can

now start running on the failed over system, and remote client applications can connect to this system and resume operations.

10. As a database administrator, you should issue the failover command on other subscribing systems to have them subscribe from the failed over system, if necessary.

11. Perform recovery steps on the primary system, and resynchronize the data.

Failing Over a System 4-4

Page 88: UniData Data Replication - Rocket Softwaredocs.rocketsoftware.com/nxt/gateway.dll/RKBnew20... · UniData Data replication provides an automatic way to deliver read-only copies of

Data RecoveryData recovery relies on crash recovery and media recovery available with RFS. With RFS, UniData is able to recover both the physical structure and logical content of the database. Without RFS, your database administrator must manually recover the physical structure of the database by executing file diagnostic tools, such as guide, followed by file repair tools, if necessary.

Recovering the Publishing System Running RFSIf the primary publishing system crashes, you decide whether to recover the system as a primary publishing system or failover to a standby system. After successful failover, the original primary system should be recovered as a subscribing system of the new, failed over standby system.

When updating a publishing object, the RFS recovery process creates a replication recovery log and leaves it for the replication recovery process, rather than applying the update directly to the database. The replication recovery process determines each of the replication groups that must be failed over to a subscribing group, or starts the replication group as a publishing group.

If you start the replication group as a publishing group, the replication recovery process applies the replication recovery logs to the database. If a replication group is failed over as a subscribing group, UniData applies the missing updates that occurred during the period of the system crash in the data synchronization process.

The following steps describe the procedure for recovering a publishing system running RFS:

1. Recover the operating system, if necessary.2. Restart UniData.3. UniData determines if crash recovery is necessary. 4. If crash recovery is necessary, the restart process applies the bimg logs to

make the database physically consistent. 5. The restart process applies the aimg logs. If a log for a publishing object

exists, UniData generates a replication recovery log rather than applying the update to the database.

6. When the restart process finished, UniData starts the Replication Manager.

4-5 UniData Data Replication

Page 89: UniData Data Replication - Rocket Softwaredocs.rocketsoftware.com/nxt/gateway.dll/RKBnew20... · UniData Data replication provides an automatic way to deliver read-only copies of

7. The Replication Manager determines whether the replication group recovers as a publishing group or a subscribing group, based on the following:

If the replication group does not configure any standby subscribing systems, it starts as a publishing group. Otherwise,The Replication Manager tries to contact each of the remote Repli-cation Managers of the standby subscribing systems to see if the replication group failed over to that system. If so, the Replication Manager starts the group as a subscriber group subscribing to that system. Otherwise,The Replication Manager follows the failover definition in the repli-cation group configuration to determine if it should start the group as a publishing group or a subscribing group to the specified system.

8. If UniData starts the group as a publishing group, the Replication Manager creates Replication Writer processes to apply replication recovery logs generated by the Restart process to the database, and saves the logs to the Replication Log Reserve File.

9. For real-time replication, if UniData starts the group as a subscribing group, the Replication Manager removes the recovery replication logs. For immediate replication, the Replication Manager leaves the recovery repli-cation logs for synchronization.

Recovering the Publishing System Not Running RFSIf you are not running RFS, you should run UniData’s file diagnostic and fixing tools to recover the physical structure of the database. Since there is no crash recovery process without RFS, there is no effective way to recover possibly lost transactions during the system failure. Failover to a real-time standby system is the only way to guarantee all committed transactions contain their full updates, and thus the consis-tency of the database.

When you restart UniData without RFS, a publishing group always restarts as a publishing group, even if a failover occurred on the standby system. In this case, the database administrator must manually failover the replication group to a subscribing group using the failover command after UniData restarts.

Data Recovery 4-6

Page 90: UniData Data Replication - Rocket Softwaredocs.rocketsoftware.com/nxt/gateway.dll/RKBnew20... · UniData Data replication provides an automatic way to deliver read-only copies of

Recovery of a Subscribing SystemRecovery of a subscribing system is the same as normal recovery of a UniData system. With RFS, starting UniData runs the crash recovery process to make the database physically and logically consistent. Without RFS, the database adminis-trator must manually start the system and run UniData’s file diagnostic and fixing tools to recover the physical structure of the database.

4-7 UniData Data Replication

Page 91: UniData Data Replication - Rocket Softwaredocs.rocketsoftware.com/nxt/gateway.dll/RKBnew20... · UniData Data replication provides an automatic way to deliver read-only copies of

Data ResynchronizationResynchronization is the first data synchronization after crash recovery. Synchro-nizing the data recovers possible missing updates that may have occurred during the crash, and makes the database consistent.

Resynchronization After Restarting Publishing SystemWhen a publishing group restarts as a publishing group, the replication recovery process applies and saves replication recovery logs to the Replication Log Reserve File. The resynchronization process sends all replication recovery logs, as well as other logs in the Replication Log Reserve File, to synchronize the subscribing database to the publishing database.

Complete the steps described in Chapter 2, “Installing and Configuring UniData Data Replication,” for your type of replication to resynchronize your data.

Resynchronization After Failover Using Real-Time ReplicationReal-time replication guarantees that any committed update on the primary system delivered its logs to the standby system. After failover to a real-time standby subscribing system, UniData applies all committed updates and saves them as repli-cation failover logs on the standby system. After recovery of the primary system is complete, the resynchronization process sends the replication failover logs to the primary system to synchronize it with the failed over standby system. This process also sends all follow-up replication logs to the primary system to ensure the system is up-to-date.

The resynchronization process is same described in Chapter 2, “Installing and Configuring UniData Data Replication.”

Data Resynchronization 4-8

Page 92: UniData Data Replication - Rocket Softwaredocs.rocketsoftware.com/nxt/gateway.dll/RKBnew20... · UniData Data replication provides an automatic way to deliver read-only copies of

Resynchronization After Failover Using Immediate ReplicationAs described in “Recovering the Publishing System Running RFS” on page 4-5, the RFS crash recovery process generates replication recovery logs for possible missing updates from the RFS crash recovery procedure. After you failover to an immediate standby subscribing system, applications resume running on the standby system. Resynchronization of the primary system to the failed over standby system not only synchronizes the database on the previous primary system to the failed over database, but also generates a crash log record, which contains the lost updates that occurred during the primary system crash.

The following steps describe the resynchronization process when using Immediate Replication.

1. The Replication Manager requests that the Replication Manager on the remote failed over system return the failover logs generated from the failover process.

2. The remote Replication Manager sends the request to the publisher processes.

3. The remote publishing system invokes the subscriber on the local system, and creates a connection between them.

4. The remote publishing system creates the Publisher-syncing Tool on the remote system. The Publisher-syncing Tool reads the failover logs from the Replication Log Reserve File and sends them to the subscriber.

5. The subscriber process invokes the Replication Writer process to apply the failover logs to the database. This process also saves the failover logs to the failover log file.

6. The Replication Manager invokes the replication log recovery tool to compare replication recovery logs generated by the RFS restart process to the failover logs. This process generates a crash log record, including those replication recovery logs that do not exist in the failover log file.

7. The Replication Manager synchronizes the primary system to the failed over system, making its database current.

8. If the REP_RECV_LOG contains recovery logs representing missing trans-actions during the crash, the database administrator must determine if the logs need to be applied to the failed over database. You can copy these logs using UniAdmin, or write a program to accomplish this task.

4-9 UniData Data Replication

Page 93: UniData Data Replication - Rocket Softwaredocs.rocketsoftware.com/nxt/gateway.dll/RKBnew20... · UniData Data replication provides an automatic way to deliver read-only copies of

Resynchronization After Recovery from Subscribing System or Network FailureIf a subscribing system crashes or a network failure occurs, the publishing system saves replication logs that do not contain Sub-Commit notification logs to the Repli-cation Log Reserve File. After recovery from this type of failure, the resynchronization process need only apply those saved logs to the subscribing system to make the subscribing database consistent with the publishing database.

The resynchronization process is same described in Chapter 2, “Installing and Configuring UniData Data Replication.”

Data Resynchronization 4-10

Page 94: UniData Data Replication - Rocket Softwaredocs.rocketsoftware.com/nxt/gateway.dll/RKBnew20... · UniData Data replication provides an automatic way to deliver read-only copies of

5Chapter

Administering UniData Data Replication

Administering UniData Data Replication through UniAdmin . . . . . 5-3ud_repadmin Tool . . . . . . . . . . . . . . . . . . 5-6 suspend Command . . . . . . . . . . . . . . . . . 5-7 sync Command . . . . . . . . . . . . . . . . . . 5-8 failover Command . . . . . . . . . . . . . . . . . 5-10 reconfig Command. . . . . . . . . . . . . . . . . 5-12 reset Command . . . . . . . . . . . . . . . . . . 5-12 report Command . . . . . . . . . . . . . . . . . 5-13Replication Recovery Log . . . . . . . . . . . . . . . . 5-16 REP_RECV_LOG . . . . . . . . . . . . . . . . . 5-16Diagnosis Utility . . . . . . . . . . . . . . . . . . . 5-18Monitoring Replication . . . . . . . . . . . . . . . . . 5-19 Starting the Replication Monitor . . . . . . . . . . . . 5-21 Replication Group Status Table . . . . . . . . . . . . . 5-24Replication Action Trigger. . . . . . . . . . . . . . . . 5-28 Replication Action Trigger Example . . . . . . . . . . . 5-30Listing Replication Files . . . . . . . . . . . . . . . . 5-32Replication Files with Multiple VOC Pointers . . . . . . . . . 5-34

Page 95: UniData Data Replication - Rocket Softwaredocs.rocketsoftware.com/nxt/gateway.dll/RKBnew20... · UniData Data replication provides an automatic way to deliver read-only copies of

This chapter describes administration tools for UniData Data Replication.

5-2

Page 96: UniData Data Replication - Rocket Softwaredocs.rocketsoftware.com/nxt/gateway.dll/RKBnew20... · UniData Data replication provides an automatic way to deliver read-only copies of

Administering UniData Data Replication through UniAdminComplete the following steps to access the Replication Admin Tool dialog box from UniAdmin.

Select one of the following methods to access the dialog box:

From the UniAdmin window, double-click Replication.From the UniAdmin menu, click Admin, then click ReplicationFrom the UniAdmin toolbar, click the Replication icon, as shown in the following example:

Replication Admin Icon

From the UniData Replication Admin dialog box, click Replication Tool. A dialog box similar to the following example appears:

5-3 UniData Data Replication

Page 97: UniData Data Replication - Rocket Softwaredocs.rocketsoftware.com/nxt/gateway.dll/RKBnew20... · UniData Data replication provides an automatic way to deliver read-only copies of

You can execute the following administration options from the Replication Admin Tool:

Report – Reports the current status of a replication. This command is useful after a failure or failover occurs. For detailed information about this command, see “report Command.”Sync – Synchronizes subscribing systems to their publishing systems. The publishing system establishes a connection to the subscribing system and invokes the subscribing process. UniData reads and transfers replication logs from the publishing system to the subscribing system. The subscribing system then applies the updates to the database. For detailed information about this commands, see “sync Command.”Reconfig – Reconfigures the replication configuration while UniData is running. For detailed information about this command, see “reconfig Command.”Suspend – Suspends a live replication. In a suspended mode, UniData inter-rupts the connection between the publisher and the subscriber. The publishing system saves the replication log files to the Replication Logs rather than transferring them to the subscribing systems. The subscribing system and all replication writer processes stop after they finish updating existing logs in the replication buffer. For detailed information about this command, see “suspend Command.”Failover – Changes the replication direction on a local system, either from the local system to the publishing system or subscribing system, or changes the subscribing source distribution. For detailed information about this command, see “failover Command.”Reset – The reset command clears saved replication logs in the Replication Log Reserve File. Use the reset command after you copy or store database files, since the remaining replication logs are no longer useful. For detailed information about this command, see “reset Command.”

Select Targets

A target is a replication, a replication group, or a distribution of a replication group. A replication is all data replicated from a remote system to the local system, or from a local system to a remote system. A target definition of ALL represents all replica-tions on the system. One command can have multiple targets.

Administering UniData Data Replication through UniAdmin 5-4

Page 98: UniData Data Replication - Rocket Softwaredocs.rocketsoftware.com/nxt/gateway.dll/RKBnew20... · UniData Data replication provides an automatic way to deliver read-only copies of

If you want to execute the command against all targets, select All in the Targets area of the Replication Admin Tool dialog box.

If you want to select the replication to execute the command against, select the Selected option in the Targets area of the Replication Admin Tool dialog box, then click Add. A dialog box similar to the following example appears:

Enter the target information, then click OK, or click Cancel to exit without saving changes.

To execute a command, click the command you want to run, then click Execute. Any output from the command appears in the Status box.

5-5 UniData Data Replication

Page 99: UniData Data Replication - Rocket Softwaredocs.rocketsoftware.com/nxt/gateway.dll/RKBnew20... · UniData Data replication provides an automatic way to deliver read-only copies of

ud_repadmin ToolThe ud_repadmin tool is an interface between the database administrator and the Replication Manager daemon. This tool sends commands to the Replication Manager and receives feedback. Issue the ud_repadmin command from the operating system-level.

Syntax:

ud_repadmin <command> [<options>] [<targets>]

The following table describes each parameter of the syntax.

ud_repadmin Parameters

Parameter Description

command The command to send to the replication manager. Each command is documented later in this chapter.

options The options you want to send with the command. One command can have multiple options, separated by a space. Details of each option are documented with the command later in this chapter.

targets See “ud_repadmin Targets” on page 5-6.

ud_repadmin TargetsA target of the ud_repadmin tool is a replication, a replication group, or a distribution of a replication group. A replication is all data replicated from a remote system to the local system, or from a local system to a remote system. A target definition of ALL represents all replications on the system. One ud_repadmin command can have multiple targets.

Targets are separated by commas, and have the following syntax:

ALL | {<replication> | <group>} [,<replication> | <group>...]

ud_repadmin Tool 5-6

Page 100: UniData Data Replication - Rocket Softwaredocs.rocketsoftware.com/nxt/gateway.dll/RKBnew20... · UniData Data replication provides an automatic way to deliver read-only copies of

The following table describes each parameter of the targets syntax.

targets Syntax Parameters

Parameter Value

replication The replication to or from the system you specify.

PUBLISHING <system_name>

The replication from the system you specify to the local system.

SUBSCRIBING <system_name>

The replication from the local system to the system you specify.

none Replication to and from the system you specify.

system_name The name of the remote system as defined in the repsys file.

group The group that is the target of the command.

GROUP <group_name>

The name of the replication group.

DISTRIB <system_name>

The distribution of the group you specify.

If the command you issue through the ud_repadmin tool is successful, ud_repadmin returns 0. If the command is not successful, ud_repadmin returns an error code.

You can specify the -verbose option with any ud_repadmin command you issue to provide more detailed information about the results or errors associated with the command.

suspend CommandThe suspend command suspends a live replication. In a suspended mode, UniData interrupts the connection between the publisher and the subscriber. The publishing system saves the replication log files to the Replication Logs rather than transferring them to the subscribing systems. The subscribing system and all replication writer processes stop after they finish updating existing logs in the replication buffer.

Syntax:

suspend <targets>

5-7 UniData Data Replication

Page 101: UniData Data Replication - Rocket Softwaredocs.rocketsoftware.com/nxt/gateway.dll/RKBnew20... · UniData Data replication provides an automatic way to deliver read-only copies of

If you specify targets as ALL, UniData suspends all replications on the system. If you specify a replication, UniData suspends the replication from or to the system you specify. If you specify target as a replication group, UniData suspends all distribu-tions of the group you specify.

You typically use the suspend command before shutting down the publishing or subscribing system.

Note: After UniData starts, the replications to all systems are suspended. You can choose to set the AUTORESUME Phrase in the repsys file to automatically resume live replication.

The suspend command has no effect with deferred replication.

Example

In the following example, the suspend command is issued on SystemA to suspend replication on SystemB:

ud_repadmin suspend SystemB

sync CommandThe sync command synchronizes subscribing systems to their publishing systems. The publishing system establishes a connection to the subscribing system and invokes the subscribing process. UniData reads and transfers replication logs from the publishing system to the subscribing system. The subscribing system then applies the updates to the database.

Syntaxsync [-noresume | -wait | -force] <targets>

If you specify targets as ALL, UniData synchronizes replications on all systems. If you specify target as a replication system, UniData synchronizes replications from and/or to the replication system you specify. If you specify target as a group, UniData synchronizes all replications of the group you specify.

The speed of the synchronization process depends on how many pending logs UniData must synchronize, and the speed of the network connection. The sync command normally returns when all targets are in the synchronization mode.

ud_repadmin Tool 5-8

Page 102: UniData Data Replication - Rocket Softwaredocs.rocketsoftware.com/nxt/gateway.dll/RKBnew20... · UniData Data replication provides an automatic way to deliver read-only copies of

By default, the sync command resumes a live replication. The following table describes the options available with the sync command.

SYNC Command Options

Option Description

noresume UniData suspends a live replication when it finishes synchronizing the repli-cation systems.

wait If you specify this option, the SYNC command does not return until all synchronizations you specify succeed or fail.

force The Replication Writer processes ignore the errors encountered during the synchronization process, if any. If you do not specify this option, the synchro-nization process fails if an error is encountered.

Note: After UniData starts, the replications to all systems are suspended. You can choose to set the AUTORESUME Phrase in the repsys file to automatically resume live replication.

The sync command may fail if the network connection fails, or if the distribution of a replication conflicts between the publishing system and the subscribing system. UniData returns an error code to indicate the failure. You can use the REPORT command to check the details of the error.

Note: If you issue the sync command when a live replication is running, the command has no effect.

When to Issue the sync Command

You should issue the sync command in the following circumstances:

After UniData starts on the subscribing system if you do not set the AUTORESUME Phrase in the repsys file.After you suspend live replication from or to a system and you want to resume replication.After failing over or reconfiguring a replication if you do not set the AUTORESUME Phrase in the repsys file.After UniData starts on the publishing system while some of the subscribing systems are running and you do not set the AUTORESUME phrase in the repsys file.

5-9 UniData Data Replication

Page 103: UniData Data Replication - Rocket Softwaredocs.rocketsoftware.com/nxt/gateway.dll/RKBnew20... · UniData Data replication provides an automatic way to deliver read-only copies of

Example

In the following example, UniData resumes replication from SystemA to SystemB:

ud_repadmin sync -force SystemB

failover CommandThe failover command changes the replication direction on a local system, either from the local system to the publishing system or subscribing system, or changes the subscribing source distribution.

Syntax

failover {-pub | -subto <system_name> | -back} <targets>

The following table describes the failover options.

FAILOVER Options

Option Description

-pub The failover command changes the replication to a publishing system on the local system. The local distribution of the replication must be a standby backup system.

-subto If you specify the -subto option, UniData either changes a replication from a publishing system to a subscribing system, or changes the subscribing source to the system you specify with system_name.

-back UniData changes the replication back to the original configuration setting.

Example

Suppose that SystemA crashes, and you want to failover to SystemB. On System B, execute the following command:

ud_repadmin failover -pub

On SystemC, change the subscribing source from SystemA to SystemB with the following command:

ud_repadmin failover -subto SystemB

ud_repadmin Tool 5-10

Page 104: UniData Data Replication - Rocket Softwaredocs.rocketsoftware.com/nxt/gateway.dll/RKBnew20... · UniData Data replication provides an automatic way to deliver read-only copies of

If you are running RFS on SystemA, after UniData completes crash recovery, UniData Data Replication automatically reverses the replication to SystemB. If SystemA is not running RFS, you should change the replication from a publishing system to a subscribing system on SystemB using the following command:

ud_repadmin failover -subto SystemB

If you want to revert to the original replication directions, execute the following command on SystemA and on SystemB:

ud_repadmin failover -back

In this case, SystemB represents all replication groups replicating data from SystemB to a local system (SystemA or SystemC).

On SystemB, you should execute the following command to change all groups currently publishing to SystemA to their original distribution setting:

ud_repadmin failover -back SystemA

Note: The failover command does not change the distribution definition in the repconfig file. Instead, it records the failover status in an internal group status file for all replication groups involved. Even after you stop and restart UniData, UniData Data Replication maintains this failover status. Issue another failover command, or issue the reconfig command to change the failover status.

After UniData starts, the replications to all systems are suspended. You can choose to set the AUTORESUME Phrase in the repsys file to automatically resume live replication.

reconfig CommandThe reconfig command reconfigures the replication configuration while UniData is running.

Syntax

reconfig

When you issue the reconfig command, the Replication Manager completes the following tasks:

Issues the dbpause command to block any writes to the database

5-11 UniData Data Replication

Page 105: UniData Data Replication - Rocket Softwaredocs.rocketsoftware.com/nxt/gateway.dll/RKBnew20... · UniData Data replication provides an automatic way to deliver read-only copies of

Stops all replicationsReloads the repconfig fileReallocates system resourcesRestarts the publishing system for each publishing groupIssues the dbresume command to continue processing on the database

Note: After UniData resumes processing, the replications to all systems are suspended. You can choose to set the AUTORESUME Phrase in the repsys file to automatically resume live replication.

reset CommandThe reset command clears saved replication logs in the Replication Log Reserve File.

Syntax

reset [-noresume] <targets>

Use the reset command after you copy or store database files, since the remaining replication logs are no longer useful.

Use the reset command with a deferred replication, or a live replication in suspension mode. If the target you specify is running, the reset command has no effect.

Unless you specify the -noresume option, a live replication returns to running mode from suspension mode when the reset command finishes processing.

report CommandThe report command reports the current status of a replication you specify. This command is useful after a failure or failover occurs.

Syntax

report [-detail | -xml] <targets>

ud_repadmin Tool 5-12

Page 106: UniData Data Replication - Rocket Softwaredocs.rocketsoftware.com/nxt/gateway.dll/RKBnew20... · UniData Data replication provides an automatic way to deliver read-only copies of

Each line of the report represents the status of a replication. Each line has the following format:

[PUBLISHING | SUBSCRIBING] <system_name>=<Status>[:<Reason>]

The system_name is the name you specify in the repsys file.

Status is the current status of the replication. The following table describes valid statuses.

Replication Statuses

Status Description

RUNNING The replication is running.

SUSPEND The replication is in suspension mode.

SUSPENDING The replication is in the process of suspending processing.

SYNCING The replication is synchronizing data.

RECONFIGURING The replication is in the process of reconfiguring.

SHUTDOWN The replication is shutting down.

STOPPED The replication has stopped normally.

EXIT The replication has exited abnormally.

If the replication status is SUSPEND, the report command also displays the reason that the replication is in suspension mode. The following table describes valid SUSPEND reasons.

Reason Description

STARTUP The local system is just starting or restarting.

DBA_ORDERED The administrator suspended replication.

REMOTE_REQUEST A remote system requested that replication be suspended.

SYS_RECONFIG The system is in suspension mode after a reconfiguration.

REMOTE_SYS_DOWN The remote system has shut down.

RPC_FAILURE The connection is lost and cannot be reestablished.

SUSPEND Reasons

5-13 UniData Data Replication

Page 107: UniData Data Replication - Rocket Softwaredocs.rocketsoftware.com/nxt/gateway.dll/RKBnew20... · UniData Data replication provides an automatic way to deliver read-only copies of

If the replication status is EXIT, UniData also displays the reason for the publishing system exit. The following table describes the valid reasons.

EXIT Reasons

Reason Description

HAS_FAILOVER The subscribing system failed over to the publishing system.

DISTRIBUTION_MISMATCH A mismatch exists between the distribution on the publishing system and the subscribing system.

FATAL_ERROR A internal or fatal error occurred from which the system is unable to recover.

If you specify the -detail option, UniData reports the status of all replication groups after the replication status lines. The syntax of the replication group status is:

<group_name>=<status>:<reason>

where group_name is the replication group name defined in the repconfig file. The <status> and <reason> are the same as those for the replication status.

The -xml option reports detailed replication status information in XML format, regardless if you specify -detail.

RPC_TIMEOUT The sending or receiving process has timed out.

SUBSCRIBER_FAILURE The subscriber failed to write a replication log. The detailed error message appears in the rm.errlog.

TRANSACTION_ABORT A transaction aborted on the subscribing system. The detailed error message appears in the rm.errlog.

FATAL_ERROR A internal or fatal error occurred from which the system is unable to recover.

Reason Description

SUSPEND Reasons (continued)

ud_repadmin Tool 5-14

Page 108: UniData Data Replication - Rocket Softwaredocs.rocketsoftware.com/nxt/gateway.dll/RKBnew20... · UniData Data replication provides an automatic way to deliver read-only copies of

The following example illustrates a replication status report in XML format:

<? Xml version=”1.0”?><REP_REPORT LOCAL_SYSTEM=“Trigger_71” DATE=“Thu Oct 5 16:02:46 2006”>

<REPLICATION REMOTE_SYSTEM = “Juneau_71”REPTYPE = “STANDBY IMMEDIATE PUBLISHING” SATUS = “REP_RUNNING” REASON = “Sync Succeeded” ><GROUP NAME = “reptest1” SATUS = “REP_RUNNING” REASON = “Sync Succeeded” /><GROUP NAME = “reptest2” SATUS = “REP_RUNNING” REASON = “Sync Succeeded” /><GROUP NAME = “reptest3” SATUS = “REP_RUNNING” REASON = “Sync Succeeded” />

</REPLICATION><REPLICATION REMOTE_SYSTEM = “Pinto_71” REPTYPE = “FAILOVER IMMEDIATE

PUBLISHING” SATUS = “REP_RUNNING” REASON = “Sync Succeeded” ><GROUP NAME = “reptest1” SATUS = “REP_RUNNING” REASON = “Sync Succeeded” /><GROUP NAME = “reptest2” SATUS = “REP_RUNNING” REASON = “Sync Succeeded” />

</REPLICATION></REP_REPORT>

The following example shows the DTD for the XML report shown above:

<!—REP_REPORT.DTD --><! ELEMENT REP_REPORT (REPLICATION*)><! ATTLIST REP_REPORT

LOCAL_SYSTEM CDATA #REQUIREDDATE CDATA #REQUIRED>

<! ELEMENT REPLICATION (GROUP*)><! ATTLIST REPLICATION

REMOTE_SYSTEM CDATA #REQUIREDREPTYPE CDATA #REQUIREDSTATUS CDATA #IMPLIEDREASON CDATA # IMPLIED >

<! ELEMENT GROUP EMPTY>

<! ATTLIST GROUPNAME CDATA #REQUIREDSTATUS CDATA #IMPLIEDREASON CDATA #IMPLIED>

5-15 UniData Data Replication

Page 109: UniData Data Replication - Rocket Softwaredocs.rocketsoftware.com/nxt/gateway.dll/RKBnew20... · UniData Data replication provides an automatic way to deliver read-only copies of

Replication Recovery LogThe replication recovery log is a UniData file located in $UDTHOME/sys. This file records replication recovery. The resynchronization of a publishing group on a system running RFS generates a record in the Replication Recovery Log that records the publishing group recovery. UniData also writes the logs representing missing transactions during recovery when resyncronizing after failing over to a system running immediate replication to this file.

The Replication Recovery Log has two associated files:

REP_RECV_LOG – records the recovery of publishing groups and the keys of missing transaction.REP_RECV_REC – records the records and virtual attribute values of the missing transaction.

REP_RECV_LOGThe REP_RECV_LOG contains the following information:

Replication group name that was recoveredTimestamp of the recoveryMissing logs:

Insert/Delete/UpdateReplication accountReplication object nameKey of the record@ID of the record in REP_RECV_REC representing the old record of the missing log.@ID of the record in REP_RECV_REC representing the new record of the missing log. @ID of the record in REP_RECV_REC representing virtual attribute values of the old record.@ID of the record in REP_RECV_REC representing virtual attribute values of the new record.

Replication Recovery Log 5-16

Page 110: UniData Data Replication - Rocket Softwaredocs.rocketsoftware.com/nxt/gateway.dll/RKBnew20... · UniData Data replication provides an automatic way to deliver read-only copies of

You can execute any UniData commands against these files to query the information they contain.

To view the logs from UniAdmin, from the UniData Replication Admin dialog box, click Recovery Logs. A dialog box similar to the following example appears:

Select the time stamp for which you want to view the logs in the Time Stamp box, then select the replication group in the Group ID box. UniAdmin displays the recovery status.

If you want to use this log to apply the update, select the system to which you want to resynchronize in the System box of the Re-synchronize to area of the dialog box, then select the appropriate account in the Account box. If you want to ignore errors that occur during the synchronization process, select Ignore Error. Click Re-Sync to begin the synchronization process.

5-17 UniData Data Replication

Page 111: UniData Data Replication - Rocket Softwaredocs.rocketsoftware.com/nxt/gateway.dll/RKBnew20... · UniData Data replication provides an automatic way to deliver read-only copies of

Diagnosis UtilityThe Diagnosis Utility available from UniAdmin is used by IBM Engineering for diagnosing problems encountered with UniData Data Replication.

Diagnosis Utility 5-18

Page 112: UniData Data Replication - Rocket Softwaredocs.rocketsoftware.com/nxt/gateway.dll/RKBnew20... · UniData Data replication provides an automatic way to deliver read-only copies of

Monitoring ReplicationUniData provides a tool to monitor UniData Data Replication.

The Replication Monitoring tool monitors connection status, data transferring, and whether or not the publisher and subscriber systems are synchronized.

To access the Replication Monitoring tool, from UniAdmin, double-click Repli-cation, then click Monitor Replications. The Replication Monitoring window appears, as shown in the following example:

5-19 UniData Data Replication

Page 113: UniData Data Replication - Rocket Softwaredocs.rocketsoftware.com/nxt/gateway.dll/RKBnew20... · UniData Data replication provides an automatic way to deliver read-only copies of

The Replication Monitor can monitor two types of replications:

Publishing Replication – the data replication from the local system to a remote subscribing system, including all replication groups involved. A publishing system can have more than one Publishing Replication defined. Subscribing Replication – the data replication from a remote publishing system to the local system, including all replication groups involved. A subscribing system can have more than one Subscribing Replication defined.

Replication Name

Each UniData Replication is assigned a unique name on one system, consisting of the replication type and the remote system name. A replication type can be one of the following:

ImmediateStandby ImmediateRealtimeStandby RealtimeDeferred

Choose the name of the replication you want to monitor from the Replications box.

Note: If a replication has failed over, it still belongs to the same Replication as it did before the failover, but the name changes.

Refreshing IntervalYou can define how often to refresh the Replication Monitor. The defaul interval is 3 seconds. Choose the number of seconds to refresh the monitor in the Interval in seconds box.

Monitoring Replication 5-20

Page 114: UniData Data Replication - Rocket Softwaredocs.rocketsoftware.com/nxt/gateway.dll/RKBnew20... · UniData Data replication provides an automatic way to deliver read-only copies of

Starting the Replication MonitorTo start the Replication Monitor, click Start. A window similar to the following example appears:

Replication Status

The Replication Status indicates whether the publisher and subscriber are connected. The status can be one of the following:

Green – The Publisher and subscriber are connected for all groups involved in the Replication.Yellow – At least one of the replication groups has been suspended by an administrator.Red – At least one the replication groups has terminated abnormally.

5-21 UniData Data Replication

Page 115: UniData Data Replication - Rocket Softwaredocs.rocketsoftware.com/nxt/gateway.dll/RKBnew20... · UniData Data replication provides an automatic way to deliver read-only copies of

Sync Status

The Sync status indicates whether the subscribing database is synchronized with the publishing database. The status can be one of the following:

Green – The pubishing and subscribing databases are synchronized.Yellow – There are pending updates that have not been applied to the subscribing database.

Packet Received

The number of packets received from the other party of the Replication. Types of packets include data packets, confirmation packets, heartbeat packets and other control packets. Monitoring this information indicates whether the physical connection between the publishing database and the subscribing database is satisfactory. This number is cumulative from the last time UniData was started or UniData Replication was reconfigured.

Packet Sent

The number of packets that have been sent to the other party of the Replication. Types of packets include data packets, confirmation packets, heartbeat packets and other control packets. Monitoring this information indicates whether the physical connection between the publishing database and the subscribing database is satis-factory. This number is cumulative from the last time UniData was started or UniData Replication was reconfigured.

Subscriber Received

The number of data records that have been received from the other party of the repli-cation. This number is cumulative from the last time UniData was started or UniData Replication was reconfigured.

Note: When monitoring a publishing replication this number may be out of date if the Replication Status is not green.

Monitoring Replication 5-22

Page 116: UniData Data Replication - Rocket Softwaredocs.rocketsoftware.com/nxt/gateway.dll/RKBnew20... · UniData Data replication provides an automatic way to deliver read-only copies of

Subscriber Committed

The number of data records that have been committed on the subscribing database. This number is cumulative from the last time UniData was started or UniData Repli-cation was reconfigured.

Note: When monitoring a publishing replication this number may be out of date if the Replication Status is not green.

Publisher Committed

The number of data records that have been committed on the publishing database. This number is cumulative from the last time UniData was started or UniData Replication was reconfigured.

TP Total

The sum of all transactions committed in the replication groups on the local system. This number is cumulative from the last time UniData was started or UniData Replication was reconfigured.

CGTPs Resolved

The sum of all transactions committed across more than one replication group on the local system. This number is cumulative from the last time UniData was started or UniData Replication was reconfigured.

5-23 UniData Data Replication

Page 117: UniData Data Replication - Rocket Softwaredocs.rocketsoftware.com/nxt/gateway.dll/RKBnew20... · UniData Data replication provides an automatic way to deliver read-only copies of

Replication Group Status TableThe Replication Group Status table displays the current status of each

replication group belonging to the Replication you specify.

The following information is displayed in the Replication Group Status table:

Group Name – The name of the replication group.Conn. Status – The connection status between the publishing system and the subscribing system in the group. The status can be one of the following:

Green – The publisher and subscriber are connected in this group.Yellow – The Replication group has been suspended by an administrator.Red – The Replication group has terminated abnormally.

Replication Group Status Table

Monitoring Replication 5-24

Page 118: UniData Data Replication - Rocket Softwaredocs.rocketsoftware.com/nxt/gateway.dll/RKBnew20... · UniData Data replication provides an automatic way to deliver read-only copies of

In-Sync – Inicates whether the subscribing files are synchronized with the publishing files in the group. The In-Sync status can be one of the following:

Green – The publishing and subscribing databases are synchronized.Yellow – There are pending updates in this Replication Group that have not been applied to the subscribing database.

Rep. Status – The current Replication Group status. The status can be one of the following on the publishing system:

REP_RUNNING – The replication is running.REP_SYNCING – The replication is performing synchronization.REP_SUSPENDED – The replication is suspended.REP_DO_SUSPEND – The replication is in the process of suspending.REP_EXIT – The replication is suspended due to an abnormal termination.

The status can be one of the following on the subscribing system:SUB_STOP – The replication is stopped.SUB_EXIT – The subscribing system has exited abnormally.SUB_SHUTDOWN – Replication on the subscribing system has been shut down.SUB_RUNNING – Replication on the subscribing system is running.SUB_DO_RECONFIG – A reconfiguration process is occurring on the subscribing system.SUB_DO_SUSPEND – Replication is suspended on the subscribing system.SUB_SYNCING – Replication is performing synchronization on the subscribing system.SUB_RESYNCING – Replication is performing resynchronization on the subscribing system.SUB_DO_FAILOVER – The subscribing system is performing a failover.

5-25 UniData Data Replication

Page 119: UniData Data Replication - Rocket Softwaredocs.rocketsoftware.com/nxt/gateway.dll/RKBnew20... · UniData Data replication provides an automatic way to deliver read-only copies of

Changed By – The event or reason that caused the Replication status to change. If the status changed due to an exception, this column displays the error category and error code. A detailed error string is available in the tooltips. The following list describes the valid events or reasons can cause a change in the Replication status:

PUB_STARTUP – The publishing system started.SYS_STARTUP – The UniData system started.AUTO_SYNC – Replication is automatically resuming.PUB_REQUEST – A request was sent from the publishing system, or an event occurred on the publishing system resulting in a change of status. SUB_REQUEST – A request was sent from the subscribing system, or an event occurred on the subscribing system resulting in a change of status.DBA_ORDER – The system administrator issued a request resulting in a change of status.RECONFIG – Replication is reconfiguring. FAILOVER – A failover has occurred.CM_REQUEST – When running the Recoverable File System, the CM daemon is unable to finish a checkpoint until all standby subscribing systems have received the replication log generated before a checkpoint begins. If this does not happen in the configurable timeframe, the CM daemon requests the repmanager process to suspend the replication.SCHEDULED – The repmanager process can only schedule a SYNC command for DEFERRED replication.SYNCDONE – A sychronization process succeeded.REMOTE_REQ – A subsribing system can request to execute a SYNC command on the publishing system. CGTP_SUSPEND – Cross-group transaction processing is suspended.

#Recv’d – The number of packets received in the group. Monitoring this number indicates if the physical connection between the publishing system and subscribing system is satisfactory.

Monitoring Replication 5-26

Page 120: UniData Data Replication - Rocket Softwaredocs.rocketsoftware.com/nxt/gateway.dll/RKBnew20... · UniData Data replication provides an automatic way to deliver read-only copies of

#Sent – The number of packets sent in the group. Monitoring this number indicates if the physical connection between the publishing system and subscribing system is satisfactory. This number is cumulative from the last time UniData was started or UniData Replication was reconfigured.Data Replicated – The total amount of data, in bytes, replicated in the group. On a publishing system this field represents the total amount of data sent out. On a subscribing system, this field represents the total amount of data received from the publishing system.This number is cumulative from the last time UniData was started or UniData Replication was reconfigured. SubGot – The Log Sequential Number of the latest replication log received by the subscribing system. This number is cumulative from the last time UniData was started or UniData Replication was reconfigured.SubDone – The Log Sequential Number of the latest replication log committed to the subscribing database. This number is cumulative from the last time UniData was started or UniData Replication was reconfigured.PubDone – The Log Sequential Number of the latest replication log committed to the publishing database. This number is cumulative from the last time UniData was started or UniData Replication was reconfigured.#TP – The number of transactions resolved in this group, including cross-group transactions. This number is cumulative from the last time UniData was started or UniData Replication was reconfigured.

.

5-27 UniData Data Replication

Page 121: UniData Data Replication - Rocket Softwaredocs.rocketsoftware.com/nxt/gateway.dll/RKBnew20... · UniData Data replication provides an automatic way to deliver read-only copies of

Replication Action TriggerA replication action trigger allows you to define an action to take should replication abnormally terminate, making the Replication Status Indicator Red. The repmanager process initializes the action defined in the trigger whenever it receives a replication exception notice.

The replication action trigger is a shell script on UNIX platforms, or a batch program on Windows platforms. Define the full path to the trigger using the EXCEPTION_ACTION clause in the repsys file. For example, if you define a repli-cation action trigger as UDRepExceptionAction.sh in the /usr/ud72 directory, set the EXCEPTION_ACTION clause as:

EXCEPTION_ACTION=/usr/ud72/UDRepExceptionAction.sh

UniData Data Replication passes parameters to the replication action trigger through environment variables. You can use the following environment variables in the repli-cation action trigger program:

UNIREP_REMOTESYS – the remote system name of the Replication. UNIREP_REPTYPE defines the type of Replication. UNIREP_GRPNAME – the replication group name where the exception occurred.UNIREP_ERRCODE – the exception error code.UNIREP_ERRSTRING – the exception error string.

If a Replication contains multiple replication groups, UniData Data Replication treats the interruption of each group as a separate event, and executes the trigger for that group. If a single group belongs to multiple Replications, each interruption of the Replication triggers the replicaton action trigger to run. UNIREP_REMOTESYS and UNIREP_REPTYPE define the Replication where the exception occurred.

IBM recommends using the replication action trigger to automatically ping or email the system administrator to advise that an exception occurred. We do not recommend using it to automatically failover to a standby system.

Note that the replication action trigger only executes if an unexpected event that suspends UniData Data Replication occurs. If a system administrator executes a command that suspends UniData Data Replication, the replication action trigger is not invoked.

Replication Action Trigger 5-28

Page 122: UniData Data Replication - Rocket Softwaredocs.rocketsoftware.com/nxt/gateway.dll/RKBnew20... · UniData Data replication provides an automatic way to deliver read-only copies of

When the replication action trigger is executed, the repmanager process writes a message similar to the following example in the rm.log:

Execute Replication Exception Action program <program_path>

5-29 UniData Data Replication

Page 123: UniData Data Replication - Rocket Softwaredocs.rocketsoftware.com/nxt/gateway.dll/RKBnew20... · UniData Data replication provides an automatic way to deliver read-only copies of

Replication Action Trigger ExampleThe following example illustrations a replication action trigger shell script:

#!/bin/sh

## Define Replication Status Code that returned by ud_repadmin report command## Publishing group Status CodesPUB_STOP=1 #/* group is normally stopped */PUB_EXIT=2 #/* group has quit abnormally.*/PUB_SHUTDOWN=3 #/* group is doing shutdown */PUB_RUNNING=4 #/* group is in running mode */PUB_DO_RECONFIG=5 #/* group is doing reconfigure */PUB_DO_FAILOVER=7 #/* group is doing failover */# Publishing Replication Status CodesREP_RUNNING=11 #/* replication is in running mode */REP_SUSPENDED=12 #/* replication is in suspension mode */REP_SYNCING=13 #/* replication is in syncing mode */REP_DO_SUSPEND=14 #/* replication is doing suspend */REP_DO_SYNC=15 #/* replication is doing sync */REP_EXIT=16 #/* replication exit */# Subscribing Replication/group status codes.SUB_STOP=21 #/* group is normally stopped */SUB_EXIT=22 #/* group has quit abnormally.*/SUB_SHUTDOWN=23 #/* group is doing shutdown */SUB_RUNNING=24 #/* replication is in running mode */SUB_DO_RECONFIG=25 #/* group is doing reconfigure */SUB_DO_SUSPEND=27 #/* replication is suspending */SUB_SYNCING=28 #/* replication is doing sync */SUB_DO_FAILOVER=29 #/* group is doing failover */SUB_RESYNCING=30 #/* group is doing re-syncing */

# Defines Replication GroupsREP_GROUPS="rwtest1 rwtest2 rwtest3"

# Show exception time echo dstring=`date`echo "UniData Replication Exception called at:"$dstring echo "UDTBIN=$UDTBIN"

# Show environment variables passed from replication systemecho "UNIREP_REMOTESYS="$UNIREP_REMOTESYS echo "UNIREP_REPTYPE="$UNIREP_REPTYPE echo "UNIREP_GRPNAME="$UNIREP_GRPNAME echo "UNIREP_ERRCODE="$UNIREP_ERRCODE echo "UNIREP_ERRSTRING="$UNIREP_ERRSTRING

# Now Paging to DBA#sendmail ...

# Now Check all groups are suspended.# Using ud_repadmin REPORT command on each of the groups# We will support ud_repadmin REPORT -XML on 7.2. DBA can use this # command to get an formatted report for all groups.all_suspended=0try=0

Replication Action Trigger 5-30

Page 124: UniData Data Replication - Rocket Softwaredocs.rocketsoftware.com/nxt/gateway.dll/RKBnew20... · UniData Data replication provides an automatic way to deliver read-only copies of

while [ $all_suspended = 0 -o $try -gt 10 ]do

sleep 5all_suspended=1for grpname in $REP_GROUPSdo

if [ $all_suspended ] then

# Run ud_repadmin report commandcmd="$UDTBIN/ud_repadmin REPORT GROUP $grpname DISTRIB

$UNIREP_REMOTESYS"echo "Now running:"$cmd $cmd returncode=$?echo "returncode=$returncode"if [ $returncode -gt 30 ]#report command failedthen

echo "Report command failed, exit."exit 2

elif [ $returncode = $REP_SUSPENDED -o $returncode = $SUB_STOP -o $returncode = $SUB_EXIT ]

thenecho "Group $grpname is suspended."

elseall_suspended=0

fifi

donetry = `expr $try + 1`

done

# Try automatically sync and resumesleep 60cmd="$UDTBIN/ud_repadmin sync -wait -verbose $UNIREP_REMOTESYS"echo "Now running:"$cmd $cmd echo "Return code="$?

exit 0

5-31 UniData Data Replication

Page 125: UniData Data Replication - Rocket Softwaredocs.rocketsoftware.com/nxt/gateway.dll/RKBnew20... · UniData Data replication provides an automatic way to deliver read-only copies of

Listing Replication FilesUse the LIST.REPLICATION.FILE to list active replication files in your application. This command lists all replication file entries for an account or file you specify.

LIST.REPLICATION.FILE [ALL |DICT |DATA] filename[,subfile] NO.PAGE

If you specify ALL, UniData displays all active replication files in the current account. If the local account is an account-level replication account, this command displays the account as well.

If you specify a file name, UniData displays all replication files contained in the Replication File Table related to that file. If you do not specify ALL or filename, UniData obtains the file names from an active select list, or prompts for input.

LIST.REPLICATION.FILE displays the following information about replicated files:

FTYPE – The type of file. Valid file types are:LF – LF directoryLD – LD directoryDIR – DIR fileDICT – Dictionary fileDATA – Hashed fileACCT – The account-level replication account

FILE NAME – The VOC file name in the Replication File Table. If the replication file is not located in the local account, the LIST.REPLI-CATION.FILE command also lists the path to the file.REPLICATION – The replication definition for the file.

PUBLISHED – The file is publishedSUBSCRIBED – The file is subscribedEXCLUDED – The file is excluded from replicationINACTIVE – The file is included in replication, but is currently disabled

PRIMARY – Whether the file is considered the primary replication file.

Listing Replication Files 5-32

Page 126: UniData Data Replication - Rocket Softwaredocs.rocketsoftware.com/nxt/gateway.dll/RKBnew20... · UniData Data replication provides an automatic way to deliver read-only copies of

GROUP – The name of the replication group

5-33 UniData Data Replication

Page 127: UniData Data Replication - Rocket Softwaredocs.rocketsoftware.com/nxt/gateway.dll/RKBnew20... · UniData Data replication provides an automatic way to deliver read-only copies of

Replication Files with Multiple VOC PointersIf a file has multiple definitions in the VOC file, in the same or different account, UniData loads each VOC item name in different replication file entries. When a udt or tm process updates a record in the file, the process searches for the primary repli-cation file entry in the Replication File Table by the i-no/d-no, beginning from the static replication file entries. If there is no match, UniData searches the dynamic replication file entries. UniData uses the first match for replication, generating a replication log in the associated replication group, and sending the VOC file name to the subscriber for publication. This VOC name is referred to as the primary repli-cation file.

When you issue a DELETE.FILE command that physically deletes the file, UniData disables all replication file entries with the same i-no/d-no. If you delete a VOC pointer that points to the file, or a symbolic link or physical link, UniData only disables the corresponding replication file entry. UniData does not disable other replication file entries pointing to the file. If you disable the primary replication file, UniData uses the next matched file as the primary replication file.

When you enable a replication file, UniData only enables the corresponding VOC file name and account ID, it does not automatically search and enable other VOC file names that point to the same file.

When you replicate a file-level command, UniData uses the corresponding repli-cation file entry for the target file regardless if it is the primary replication file or a secondary replication file. UniData always replicates record-level commands through the primary replication file.

If you have multiple VOC file entries for a replication file, we recommend that you define only one VOC name in the included file list so UniData knows which file name and which system group to use with replication.

Replication Files with Multiple VOC Pointers 5-34

Page 128: UniData Data Replication - Rocket Softwaredocs.rocketsoftware.com/nxt/gateway.dll/RKBnew20... · UniData Data replication provides an automatic way to deliver read-only copies of

6Chapter

Restrictions

File Types . . . . . . . . . . . . . . . . . . . 6-2 Changing Inode or Device Numbers . . . . . . . . . . . 6-2 One Replication Object Can Only Belong to One Group . . . . . 6-2 System Files Not Supported as Replication Objects . . . . . . 6-3 No Cascading Replication . . . . . . . . . . . . . . 6-3 Writeable Subscriber Files . . . . . . . . . . . . . . 6-3 Other Command Replication. . . . . . . . . . . . . . 6-4 Virtual Field Definitions . . . . . . . . . . . . . . . 6-4 Sequence of Updates . . . . . . . . . . . . . . . . 6-4 Transaction Limitations . . . . . . . . . . . . . . . 6-4 System Crashes During Failover . . . . . . . . . . . . 6-5 Dictionary and Data Portions of a File. . . . . . . . . . . 6-5 Running the Recoverable File Systme on the Publishing System . . 6-6 Multiple Locks . . . . . . . . . . . . . . . . . . 6-6 Other Limitations . . . . . . . . . . . . . . . . . 6-6

Page 129: UniData Data Replication - Rocket Softwaredocs.rocketsoftware.com/nxt/gateway.dll/RKBnew20... · UniData Data replication provides an automatic way to deliver read-only copies of

The chapter describes restrictions when using UniData Replication.

File TypesA UniData replication object can be any UniData database file, including a static hashed file, a dynamic hashed file, a sequentially hashed file, a multilevel file, a dir-type file, and a multi-dir type file. UniData Replication does not support a sequential file and other operating system-level files.

Changing Inode or Device NumbersUniData Replication uses the inode and device number to identify a replication object. The inode and device numbers of the replication objects are loaded when UniData starts, and when you execute the RECONFIG command. If you need to change the inode or device number for a file while UniData is running, you must execute the RECONFIG command to update the replication object.

Note: The UniData RESIZE ECL command may change the inode or device number, but this command reloads the inode and device number when it finishes executing. Therefore, you do not have to execute the RECONFIG command after resizing a file.

One Replication Object Can Only Belong to One GroupReplication objects are sets of objects in replication groups. One replication object can belong to only one replication group. If there are multiple VOC pointers refer-encing a single UniData file, they should be defined only once in one replication group.

If you define one replication object more than once in different groups, only one of them will be used.

6-2

Page 130: UniData Data Replication - Rocket Softwaredocs.rocketsoftware.com/nxt/gateway.dll/RKBnew20... · UniData Data replication provides an automatic way to deliver read-only copies of

System Files Not Supported as Replication ObjectsUniData Data Replication does not support account-level operations on the following files:

_HOLD__PH__DEBUG__REPORT__SCREEN__XML__EDAMAP__EDAXMAP_MENUFILE

Certain ECL commands, such as CATALOG and SAVE.LIST, update system directory files. Replicating these updates may cause the subscribing system to be inconsistent.

No Cascading ReplicationYou cannot use a subscribing object as a publishing object of another replication.

Writeable Subscriber FilesBefore UniData 7.2, files on the subscribing system were read-only. Now, you can update a file on the subscribing system if you explicitly define it as writeable in the repconfig file. Updates made to a writeable file on the subscribing system are not replicated back to the publishing system.

You can update both record-level and file-level operations on a writeable subscriber file. If a file-level operation updates the VOC or dictionary file, you must specify these files as writable in the repconfig file.

6-3 UniData Data Replication

Page 131: UniData Data Replication - Rocket Softwaredocs.rocketsoftware.com/nxt/gateway.dll/RKBnew20... · UniData Data replication provides an automatic way to deliver read-only copies of

Other Command ReplicationUniData replicates the BASIC command, the CATALOG command, and the DELETE.CATALOG command through the account-level group. If you do not define an account-level group, UniData does not replicate these commands, even if the target file is defined as a replicated file. If you define an account-level group. UniData replicates these commands, even if the target file is not defined as a repli-cated file.

Virtual Field DefinitionsUniData Replication supports replication of indexed virtual field values. If you do not want to reevaluate virtual field values on the subscribing system, the subscribing object must have the same virtual field definition as on the publishing object.

Sequence of UpdatesUniData ensures the sequence of updates for the same record on a publishing object as on the subscribing object. However, on a subscribing system, the sequence of updates for different records may not be the same as on the publishing system.

UniData Data Replication only keeps the operation sequence within the same repli-cation group. If you replicate an account-level and a file-level operation that updates a file in different replication groups, we do not guarantee that updates will be processed in the same sequence. To keep subscribing and publishing files consistent, you should define all related files in the same replication group.

Transaction LimitationsOne transaction can update data in files that belong to more than one repli-cation group. However, those replication groups involved in one transaction should have the same subscribing distributions so the transaction is fully replicated to all of the distributions. The replication groups involved should also have the same replication type, either all real-time, all immediate, or all deferred.

6-4

Page 132: UniData Data Replication - Rocket Softwaredocs.rocketsoftware.com/nxt/gateway.dll/RKBnew20... · UniData Data replication provides an automatic way to deliver read-only copies of

System administrators can define or reconfigure UniData Replication while UniData is running. The new configuration is only applies to transactions after the RECONFIG command is executed. UniData writes logs to the Replication Log Reserve File for those transactions that have been committed on the publisher, but not replicated on the subscriber. UniData generates this replication logs using the previous configuration. The data synchronization process transfers these logs to the subscriber using the new configuration information. This may cause a different processing result. For example, if the new configuration definition removes a replication object from a replication group, the saved logs for the removed object, if any, are still sent to the subscriber as part of data synchronization. If you configure the subscriber to remove the replication object as well, the Repli-cation Writer process will either ignore the log if you set the RW_IGNORE_ERROR, or suspend the replication. Make sure all data involved in a transaction is transferred before making changes to a replication group definition.Although transaction consistency will eventually occur on the subscribing system, an application running on the subscribing system may read partial changes of a transaction on the publisher.

System Crashes During FailoverIf the subscribing system crashes during the failover process, you can recover the publishing system if you are running RFS with the crash recovery process. However, the data on the subscribing system may not be synchronized with the publishing system. You may have to recopy the data from the publishing objects to ensure synchronization.

Dictionary and Data Portions of a FileIf you replicate both the data and dictionary portions of a file, they must belong to the same replication group.

6-5 UniData Data Replication

Page 133: UniData Data Replication - Rocket Softwaredocs.rocketsoftware.com/nxt/gateway.dll/RKBnew20... · UniData Data replication provides an automatic way to deliver read-only copies of

Running the Recoverable File Systme on the Publishing SystemIf you are running the Recoverable File System on the publishing system, the CNAME command does not regenerate replication log files for record-level update that occurred prior to executing the CNAME command when restarting UniData after a system crash. The updates to a file before executing the CNAME command may be lost on the subscribing system.

Multiple LocksUniData Data Replication may apply multiple locks on the subscribing system. If your application is running on the subscribing system and you need to apply the same lock, you should follow the same locking sequence to avoid a deadlock.

Other LimitationsMaximum replication systems defined on a system: 32,767Maximum replication groups defined on a system: 32,767Maximum distributions defined in a group: 32,767Maximum replication objects defined on a system: 2,147,483,647Maximum replication accounts defined on a system: 32,767Maximum replication group name length: 127Maximum replication system name length: 127

6-6


Recommended