Вы находитесь на странице: 1из 338

Pervasive DataExchange

User’s Guide
Guide to Using Pervasive DataExchange

Pervasive Software Inc.


12365 Riata Trace Parkway
Building B
Austin, TX 78727 USA

Telephone: 512 231 6000 or 800 287 4383


Fax: 512 231 6010
Email: info@pervasive.com
Web: http://www.pervasive.com
disclaimer PERVASIVE SOFTWARE INC. LICENSES THE SOFTWARE AND
DOCUMENTATION PRODUCT TO YOU OR YOUR COMPANY SOLELY ON AN “AS
IS” BASIS AND SOLELY IN ACCORDANCE WITH THE TERMS AND CONDITIONS
OF THE ACCOMPANYING LICENSE AGREEMENT. PERVASIVE SOFTWARE INC.
MAKES NO OTHER WARRANTIES WHATSOEVER, EITHER EXPRESS OR IMPLIED,
REGARDING THE SOFTWARE OR THE CONTENT OF THE DOCUMENTATION;
PERVASIVE SOFTWARE INC. HEREBY EXPRESSLY STATES AND YOU OR YOUR
COMPANY ACKNOWLEDGES THAT PERVASIVE SOFTWARE INC. DOES NOT
MAKE ANY WARRANTIES, INCLUDING, FOR EXAMPLE, WITH RESPECT TO
MERCHANTABILITY, TITLE, OR FITNESS FOR ANY PARTICULAR PURPOSE OR
ARISING FROM COURSE OF DEALING OR USAGE OF TRADE, AMONG OTHERS.

trademarks Btrieve, Client/Server in a Box, Pervasive, Pervasive Software, Pervasive DataExchange,


and the Pervasive Software and the Pervasive DataExchange logos are trademarks or
registered trademarks of Pervasive Software Inc.
Built on Pervasive Software, Pervasive AuditMaster, “know who’s doing what to your data when,
where and how,” MicroKernel Database Engine, MicroKernel Database Architecture,
Pervasive.SQL, Solution Network, Ultralight, and ZDBA are trademarks of Pervasive Software Inc.
Microsoft, MS-DOS, Windows, Windows 95, Windows 98, Windows NT, Windows Millennium,
Windows 2000, Windows XP, Win32, Win32s, and Visual Basic are registered trademarks of
Microsoft Corporation.
NetWare and Novell are registered trademarks of Novell, Inc. NetWare Loadable Module, NLM,
Novell DOS, Transaction Tracking System, and TTS are trademarks of Novell, Inc.
The Regex++ library is Copyright (c) 1998-2001 by Dr John Maddock.
This product features PeerDirect™ software. Pervasive Software, Inc. is a licensed user
of the trademark "PeerDirect," and that trademark and PeerDirect are owned by
PeerDirect Inc. PeerDirect software © 1993-2001 PeerDirect Inc. All Rights Reserved.

All other company and product names are the trademarks or registered trademarks of their
respective companies.
© Copyright 2008 Pervasive Software Inc. All rights reserved. Reproduction, photocopying, or
transmittal of this publication, or portions of this publication, is prohibited without the express prior
written consent of the publisher.

User’s Guide
July 2008
100-004177-005
Contents

Contents
About This Manual . . . . . . . . . . . . . . . . . . . . . . . . . . . xv
Who Should Read This Manual . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xvi
Manual Organization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xvii
Pervasive DataExchange . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xvii
Real-Time Backup Edition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xvii
Data Synchronization Edition. . . . . . . . . . . . . . . . . . . . . . . . . . . . . xvii
DataExchange Tools and Utilities. . . . . . . . . . . . . . . . . . . . . . . . . . . xvii
Supplemental Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xviii
Conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xix

Pervasive DataExchange
1 Introducing Pervasive DataExchange . . . . . . . . . . . . . . . . 1-1
Understanding Pervasive DataExchange and Its Capabilities
DataExchange Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-2
DataExchange Editions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-3
Real-Time Backup Edition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-3
Data Synchronization Edition. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-3
DataExchange Components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-4
DataExchange Utilities. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-4
DataExchange Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-5

2 Pervasive DataExchange Basics . . . . . . . . . . . . . . . . . . . 2-1


An Overview of DataExchange Basics
Starting and Stopping Replication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-2
As a Service . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-2
As a Console Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-3
From Pervasive Control Center . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-3
Starting and Stopping the DXAgent Service . . . . . . . . . . . . . . . . . . . . . . . . 2-5
As a Service . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-5
From Pervasive Control Center . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-6
ODBC Basic Concepts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-7
Servers and Clients . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-7
Data Source Names . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-7
Pervasive PSQL Security . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-9
Deploying Demodata Under Pervasive PSQL Security . . . . . . . . . . . . . . . 2-9

3 Using Pervasive DataExchange . . . . . . . . . . . . . . . . . . . . 3-1


A Guide to Using DataExchange in Daily Operations

iii
Contents

Activation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-2
Activation and Data Source Names . . . . . . . . . . . . . . . . . . . . . . . . . 3-2
Activating First and Partner Sites . . . . . . . . . . . . . . . . . . . . . . . . . . 3-3
Deactivation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-5
Reactivation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-6
Adding Tables to an Activated Database . . . . . . . . . . . . . . . . . . . . . . . . . . 3-7
Before you Begin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-7
Determine Event Handler DLL Usage . . . . . . . . . . . . . . . . . . . . . . . . 3-8
Deactivate All Sites . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-8
Verify the Table Exists in the Pervasive Database. . . . . . . . . . . . . . . . . . 3-9
Add the New Table to the Replication Template . . . . . . . . . . . . . . . . . . 3-10
Stop Replication Service on Partner Sites . . . . . . . . . . . . . . . . . . . . . . 3-11
Copy Files (DDFs, D- and PDC Tables) . . . . . . . . . . . . . . . . . . . . . . . 3-11
Activate First Site and Synchronize Tables . . . . . . . . . . . . . . . . . . . . . 3-12
Start Replication Service on Partner Sites . . . . . . . . . . . . . . . . . . . . . . 3-13
Activate Partner Sites . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-13
Initiate Replication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-14
Removing Tables From an Activated Database . . . . . . . . . . . . . . . . . . . . . . 3-15
Before you Begin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-15
Deactivate all Sites. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-15
Remove Table From the Replication Template . . . . . . . . . . . . . . . . . . . 3-16
Stop Replication Service on Partner Sites . . . . . . . . . . . . . . . . . . . . . . 3-17
Copy D*.mkd Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-17
Start Replication Service on Partner Sites . . . . . . . . . . . . . . . . . . . . . . 3-18
Activate all Sites . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-18
Initiate Replication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-19
Adding Dynamic Tables to an Activated Database . . . . . . . . . . . . . . . . . . . . 3-20
Before you Begin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-21
Include File Patterns . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-21
Exclude File Patterns . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-22
Setting up Nondatabase File Replication . . . . . . . . . . . . . . . . . . . . . . . . . . 3-24
Before You Begin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-24
Set Log On Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-25
Create New Flat File Database . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-25
Execute the SQL Queries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-26
Create the Design Template . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-27
Copy Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-28
Activate all Sites . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-28
Restart DX Services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-29
Redesign Dxevent Table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-29
Create Site Shares . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-30
Configure Flat File Replication. . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-30
Changing a Table Structure in an Activated Database . . . . . . . . . . . . . . . . . . 3-32
Before you Begin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-32
Clone PDC Table(s). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-33

iv
Contents

Activate the First Site and Synch Tables . . . . . . . . . . . . . . . . . . . . . . . 3-33


Copy Files and Activate the Partner Site . . . . . . . . . . . . . . . . . . . . . . . 3-34
Verify the Replication Session. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-34

Real-Time Backup Edition


4 Real-Time Backup Deployment Models . . . . . . . . . . . . . . . 4-1
A Look at Alternative Deployment Models for Real-Time Backup
Real-Time Backup Configurations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-2
Two-Machine Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-2
Many-to-One Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-3
Replication Deployment using the Deployment Tool . . . . . . . . . . . . . . . . . . . 4-5
Before You Get Started . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-5
Replication Deployment using DXDeploy . . . . . . . . . . . . . . . . . . . . . . . . . 4-6
Replication Deployment Using Designer . . . . . . . . . . . . . . . . . . . . . . . . . . 4-7
Before You Get Started . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-7
Create a Template on the First Site Using Designer . . . . . . . . . . . . . . . . . 4-8
Copy the Template Files to the Partner Site . . . . . . . . . . . . . . . . . . . . . 4-11
Activate the Template on the First Site . . . . . . . . . . . . . . . . . . . . . . . . 4-12
Activate the Template on the Partner Site . . . . . . . . . . . . . . . . . . . . . . 4-12
Make Sample Database Changes . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-13
Initiate Replication. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-14
Verify the Changes Were Replicated . . . . . . . . . . . . . . . . . . . . . . . . . 4-17
Many-to-One Deployment using DXDeploy . . . . . . . . . . . . . . . . . . . . . . . . 4-18
Before You Get Started . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-19
Deploying Using DXDeploy. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-20
Disaster Recovery . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-24
Failover . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-24
No Data Recoverable. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-25
Data Recoverable But Not Current . . . . . . . . . . . . . . . . . . . . . . . . . . 4-26

Data Synchronization Edition


5 Data Synchronization Deployment Models. . . . . . . . . . . . . . 5-1
A Look at Deployment Models Available for Data Synchronization
Data Synchronization Deployment Methods . . . . . . . . . . . . . . . . . . . . . . . 5-2
DataExchange Implementation Options . . . . . . . . . . . . . . . . . . . . . . . . . . 5-3
DataExchange Deployment Tool . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-3
DataExchange DXDeploy Utility . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-3
DataExchange Designer and Utilities . . . . . . . . . . . . . . . . . . . . . . . . . 5-4
Where To Go From Here . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-5
Working with the Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-6
Removing Databases Deployed with DXDeploy. . . . . . . . . . . . . . . . . . . 5-6

v
Contents

Removing Databases Deployed with Designer . . . . . . . . . . . . . . . . . . . 5-8


Replication Deployment Using the Deployment Tool . . . . . . . . . . . . . . . . . . 5-11
Before You Get Started . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-11
1-Way Deployment Using DXDeploy . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-12
Before You Get Started . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-12
Create the XML Descriptor File . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-13
Run DXDeploy on the First Site . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-21
Copy the Template to the Partner Site. . . . . . . . . . . . . . . . . . . . . . . . 5-22
Run DXDeploy on the Partner Site . . . . . . . . . . . . . . . . . . . . . . . . . 5-23
1-Way Deployment Using Designer . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-24
Before You Get Started . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-24
Create a Template on the First Site Using Designer . . . . . . . . . . . . . . . . 5-25
Copy First Site Files to the Partner Site . . . . . . . . . . . . . . . . . . . . . . . 5-28
Activate the First Site Template . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-28
Activate the Partner Site Template. . . . . . . . . . . . . . . . . . . . . . . . . . 5-29
Make Sample Database Changes . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-30
Initiate Replication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-31
Verify the Changes Were Replicated. . . . . . . . . . . . . . . . . . . . . . . . . 5-33
2-Way Deployment Using DXDeploy . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-34
Before You Get Started . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-34
Create the XML Descriptor File . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-35
Run DXDeploy on the First Site . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-44
Copy the Template to the Partner Site. . . . . . . . . . . . . . . . . . . . . . . . 5-45
Run DXDeploy on the Partner Site . . . . . . . . . . . . . . . . . . . . . . . . . 5-46
2-Way Deployment Using Designer . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-47
Before You Get Started . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-47
Create the Template Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-48
Copy First Site Files to the Partner Site . . . . . . . . . . . . . . . . . . . . . . . 5-51
Activate the First Site Template . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-51
Activate the Partner Site Template. . . . . . . . . . . . . . . . . . . . . . . . . . 5-52
Make Sample Database Changes . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-53
Initiate Replication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-54
Verify the Changes Were Replicated. . . . . . . . . . . . . . . . . . . . . . . . . 5-56

6 Example Database Design for Data Synchronization . . . . . . . . 6-1


Understanding Database Design Considerations for Data Synchronization
Data Synchronization Design Considerations . . . . . . . . . . . . . . . . . . . . . . . 6-2
Application Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-2
Basic Data Synchronization Design. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-6
Database Selection. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-6
Database Identification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-7
Replicated Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-8
Security . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-10
Sample Tracker Database . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-11

vi
Contents

DataExchange Tools and Utilities


7 Using the DataExchange Utilities and Services . . . . . . . . . . . 7-1
A Reference for Using the DataExchange Utilities and Services
Utilities and Services Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-2
Replication Stages and the Utilities Used. . . . . . . . . . . . . . . . . . . . . . . 7-2
Accessing the Utilities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-3
Command-line Utilities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-5
dxact. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-6
dxcleanup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-9
dxdeact . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-11
dxdeploy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-13
dxdynpath . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-15
Types of Expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-18
dxregevnt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-21
dxrepl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-23
dxsynctables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-25
ffcopy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-26
GUI-based Utilities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-31
da . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-31
prd. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-32
replmonitor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-32
dpwizard . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-32
trwizard . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-32
Services. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-34
dxagent . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-34
replserv . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-37

8 Using the DataExchange Designer . . . . . . . . . . . . . . . . . . 8-1


A Tour of the DataExchange Designer Features and Functionality
DataExchange Designer Concepts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-2
Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-2
1-Way / 2-Way Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-4
Design Completion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-7
Administration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-9
DataExchange Designer GUI Visual Reference . . . . . . . . . . . . . . . . . . . . . . . 8-14
Main Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-14
Designer Menu and Toolbar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-16
Database Design pane . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-22
DataExchange Designer Tasks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-23
General Tasks. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-23
Basic Design Tasks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-23
Design Completion Tasks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-24
Administrative Tasks. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-24

vii
Contents

9 Using DataExchange Manager . . . . . . . . . . . . . . . . . . . . 9-1


A Tour of DataExchange Manager Utility
DataExchange Manager Concepts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-2
Managing Replication Schedules. . . . . . . . . . . . . . . . . . . . . . . . . . . 9-2
Managing Site Information. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-3
Managing Users . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-5
Managing Permissions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-8
DataExchange Manager GUI Visual Reference . . . . . . . . . . . . . . . . . . . . . . 9-9
Main Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-9
DataExchange Manager Tasks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-12
General Tasks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-12
Schedule Tasks. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-18
Site Information Tasks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-19
User Tasks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-20

10 Using the Replication Progress and Log Viewers . . . . . . . . . . 10-1


A Brief Look at the Replication Progress and Log Viewers
Checking the Replication Engine and Service . . . . . . . . . . . . . . . . . . . . . . . 10-2
Initiating Replication from the Progress and Log Viewers . . . . . . . . . . . . . . . . 10-4
Initiating a Replication Session. . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-4
Reading the Initiate Replication Dialog Box . . . . . . . . . . . . . . . . . . . . 10-6
Recording and Monitoring Replication Activity. . . . . . . . . . . . . . . . . . . . . . 10-7
Setting Log Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-7
DRE Log File. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-8

Supplemental Information
A Basic Troubleshooting. . . . . . . . . . . . . . . . . . . . . . . . . A-1
How to Identify and Solve Common Problems
Troubleshooting Resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-2
Troubleshooting Strategies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-3
Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-4
Multiple DataExchange Designers . . . . . . . . . . . . . . . . . . . . . . . . . . A-4
Terminal Services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-4
Uninstalling. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-5
Network Communications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-6
How to Start PSA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-6
Documentation for PSA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-6
Database Engine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-7
Replication Engine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-8
Log Files. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-9
Log File Size . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-9
Log File Descriptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-10

viii
Contents

Data Replication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-13


List of Sites to Replicate With Seems Inconsistent. . . . . . . . . . . . . . . . . . A-13
Replication Fails for a Deactivated Site . . . . . . . . . . . . . . . . . . . . . . . . A-13
False Alert Because of Schedule Manipulation. . . . . . . . . . . . . . . . . . . . A-14
Correct Alarms but Replication on Wrong Schedule . . . . . . . . . . . . . . . . A-14
Dynamically Created Tables Not Being Replicated . . . . . . . . . . . . . . . . . A-14
SQL Triggers and Replication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-15
Data Conflicts When Activating Partner Sites . . . . . . . . . . . . . . . . . . . . A-15
Index Segments. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-16
Data Conflicts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-17
Conflict Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-17
Resolving Primary Key Conflicts . . . . . . . . . . . . . . . . . . . . . . . . . . . A-20
Notification Agent . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-23
Testing the Mail Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-23
How to Get Additional Help . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-24
Technical Support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-25

B Supported Data Types . . . . . . . . . . . . . . . . . . . . . . . . . B-1


Pervasive DataExchange Data Types
Data Types. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . B-2
Notes on Data Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . B-4
DECIMAL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . B-4
NUMERIC, BIGINT, UBIGINT and CURRENCY . . . . . . . . . . . . . . . . . B-4
CHAR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . B-4
VARCHAR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . B-4
IDENTITY . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . B-4

C Reserved Table Names . . . . . . . . . . . . . . . . . . . . . . . . C-1


Pervasive DataExchange Reserved Words and Table Names
Other Limitations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . C-2

D Advanced Topics. . . . . . . . . . . . . . . . . . . . . . . . . . . . D-1


A Look at Advanced Topics for Pervasive DataExchange
Installing DataExchange as Part of Your Application . . . . . . . . . . . . . . . . . . . D-2
How To Perform a Silent Install . . . . . . . . . . . . . . . . . . . . . . . . . . . D-2

E Glossary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . E-1
Replication Terminology
Accelerated . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . E-1
Activated Database . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . E-1
Activation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . E-1
Change Capture / Change Apply . . . . . . . . . . . . . . . . . . . . . . . . . . . E-1
Control Table. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . E-1

ix
Contents

DataExchange Designer. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . E-2


DataExchange Manager. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . E-2
DNA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . E-2
Encryption . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . E-2
First Site . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . E-2
Globally-Unique IDs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . E-2
Hub and Spoke . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . E-2
In Place Activation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . E-3
Local Table. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . E-3
N-Tiered . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . E-3
Network . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . E-3
ODBC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . E-3
Partner Site . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . E-3
Peer-to-Peer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . E-3
Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . E-3
Refresh . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . E-4
Release . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . E-4
Replication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . E-4
Replication Engine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . E-4
Replication Network . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . E-4
Replication Template . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . E-4
Site . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . E-4
Subscription . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . E-5
Template . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . E-5

x
Figures

4-1 Real-Time Backup with Two Machines . . . . . . . . . . . . . . . . . . . . . . . . 4-3


4-2 Real-Time Backup with Many-to-One Configuration . . . . . . . . . . . . . . . . 4-4
4-3 DataExchange Designer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-9
4-4 DataExchange Designer with All Tables Selected . . . . . . . . . . . . . . . . . . 4-9
4-5 Replicate Table Command in DataExchange Designer . . . . . . . . . . . . . . . 4-10
4-6 View of Replicated Tables in DataExchange Designer . . . . . . . . . . . . . . . . 4-10
4-7 Activated Icon in Pervasive PSQL Explorer . . . . . . . . . . . . . . . . . . . . . 4-13
4-8 Demodata Tables Node . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-14
4-9 Replication - Connected Node . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-15
4-10 Replication Progress and Log Viewers . . . . . . . . . . . . . . . . . . . . . . . . 4-15
4-11 Initiate Replication Dialog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-16
4-12 Example Replication Progress and Log Viewers . . . . . . . . . . . . . . . . . . . 4-17
4-13 Multiple Sites Backing Up Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-18
4-14 Many-to-One Configuration with DataExchange Installed . . . . . . . . . . . . . 4-19
5-1 SalesDB Database Activated on First Site . . . . . . . . . . . . . . . . . . . . . . . 5-22
5-2 Data Location . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-25
5-3 DataExchange Designer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-26
5-4 DataExchange Designer with All Tables Selected . . . . . . . . . . . . . . . . . . 5-26
5-5 Replicate Table Command in DataExchange Designer . . . . . . . . . . . . . . . 5-26
5-6 View of Replicated Tables in DataExchange Designer . . . . . . . . . . . . . . . . 5-27
5-7 Activated Indicator in Pervasive PSQL Explorer . . . . . . . . . . . . . . . . . . . 5-30
5-8 Starting Statistics View Utility . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-31
5-9 Replication Progress and Log Viewers . . . . . . . . . . . . . . . . . . . . . . . . 5-31
5-10 Initiate Replication Dialog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-32
5-11 Example Replication Process in Statistics View Utility . . . . . . . . . . . . . . . 5-33
5-12 TrackerDB Activated on First Site . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-45
5-13 Data Location . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-48
5-14 DataExchange Designer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-49
5-15 DataExchange Designer with All Tables Selected . . . . . . . . . . . . . . . . . . 5-49
5-16 Replicate Table Command in DataExchange Designer . . . . . . . . . . . . . . . 5-49
5-17 View of Replicated Tables in DataExchange Designer . . . . . . . . . . . . . . . . 5-50
5-18 Activated Indicator in Pervasive PSQL Explorer . . . . . . . . . . . . . . . . . . . 5-53
5-19 Starting DataExchange Monitoring Tools . . . . . . . . . . . . . . . . . . . . . . 5-54
5-20 Replication Progress and Log Viewers . . . . . . . . . . . . . . . . . . . . . . . . 5-54
5-21 Initiate Replication Dialog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-55
5-22 Example Replication Process in Statistics View Utility . . . . . . . . . . . . . . . 5-56
6-1 Tracker Schema . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-3
6-2 Data Synchronization Database Selection Dialog . . . . . . . . . . . . . . . . . . 6-6
6-3 Data Synchronization Database Selection Dialog. . . . . . . . . . . . . . . . . . . 6-7
8-1 Data Synchronization Database Selection Dialog. . . . . . . . . . . . . . . . . . . 8-4

xi
Figures

8-2 Real-Time Backup Database Selection Dialog . . . . . . . . . . . . . . . . . . . . 8-5


8-3 Designer Main Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-14
8-4 Designer Menu and Toolbar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-16
8-5 Database Design pane . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-22
9-1 Site Schedule Tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-3
9-2 Site List . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-4
9-3 Site Information Tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-4
9-4 Location of User List and User Tabbed Dialogs . . . . . . . . . . . . . . . . . . . 9-7
9-5 User Information Tab. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-7
9-6 User Membership Tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-8
9-7 Permissions Group List . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-8
9-8 DataExchange Manager Main Window . . . . . . . . . . . . . . . . . . . . . . . . 9-9

xii
Tables

1-1 Overview of Pervasive DataExchange Utilities . . . . . . . . . . . . . . . . . . . . 1-4


2-1 Actions Required to Deploy Demodata Under Database Security or Mixed Security
2-10
4-1 Replication System Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-26
5-1 Data Synchronization Deployment Methods . . . . . . . . . . . . . . . . . . . . 5-2
5-2 DataExchange Implementation Options . . . . . . . . . . . . . . . . . . . . . . . 5-3
8-1 DataExchange Designer Logging Level Options . . . . . . . . . . . . . . . . . . . 8-11
9-1 Permissions Comparison Between Default Groups . . . . . . . . . . . . . . . . . 9-6
10-1 Replication Logging Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-7
10-2 Replication Progress and Log Viewers Logging Level Options . . . . . . . . . . . 10-9
A-1 Resources that Assist with Problem Determination . . . . . . . . . . . . . . . . . A-2
A-2 Pervasive Software Resources and Contact Information . . . . . . . . . . . . . . A-24
C-1 Replication System Table Names . . . . . . . . . . . . . . . . . . . . . . . . . . . C-1

xiii
xiv
About This Manual

This manual contains information about Pervasive DataExchange. It


is intended to help you design, activate, and replicate databases, and
to configure and troubleshoot replication.
The manual focuses on DataExchange replication concepts,
supported by discussions that include step-by-step instructions for
using the features of the product.

xv
About This Manual

Who Should Read This Manual


This manual provides information for users who design databases
for replication, implement the design, replicate data, and monitor
and maintain replication schedules.
Pervasive Software would appreciate your comments and
suggestions about this manual. As a user of our documentation, you
are in a unique position to provide ideas that can have a direct
impact on future releases of this and other manuals. If you have
comments or suggestions for the product documentation, post your
request at http://www.pervasive.com/devtalk.

xvi
Manual Organization

Manual Organization
This manual is divided into the following parts.

Pervasive „ Chapter 1—“Introducing Pervasive DataExchange”


DataExchange This chapter provides an introduction to Pervasive
DataExchange and an overview of the utilities and
DataExchange documentation.
„ Chapter 2—“Pervasive DataExchange Basics”
This chapter discusses the basic concepts needed in order to
work with Pervasive DataExchange.
„ Chapter 3—“Using Pervasive DataExchange”
This chapter discusses the day-to-day operations you can
perform with Pervasive DataExchange.

Real-Time „ Chapter 4—“Real-Time Backup Deployment Models”


Backup Edition This chapter offers sample deployment models for using the
Pervasive DataExchange Real-Time Backup Edition. It also
includes information on recovering your data in the event of a
system failure or data loss.

Data „ Chapter 5—“Data Synchronization Deployment Models”


Synchronization
This chapter provides sample deployment models for using the
Edition
Pervasive DataExchange Data Synchronization Edition.
Deployments using DXDeploy and the DataExchange Designer
are included.
„ Chapter 6—“Example Database Design for Data
Synchronization”
This chapter explains how to design a database for the Data
Synchronization Edition using the sample database, Tracker.

DataExchange „ Chapter 7—“Using the DataExchange Utilities and Services”


Tools and This chapter provides a reference for using the Pervasive
Utilities DataExchange utilities and services.

xvii
About This Manual

„ Chapter 8—“Using the DataExchange Designer”


This chapter details working with the DataExchange Designer
features and functionality.
„ Chapter 9—“Using DataExchange Manager”
This chapter covers the tasks you can perform in order to
administer your replication solutions with the DataExchange
Manager.
„ Chapter 10—“Using the Replication Progress and Log Viewers”
This chapter discusses the tools used for monitoring replication
and configuring Pervasive DataExchange replication sessions
and properties.

Supplemental „ Appendix A—“Basic Troubleshooting”


Information This appendix provides information for troubleshooting and
resolving problems.
„ Appendix B—“Supported Data Types”
This appendix details the data types supported by Pervasive
DataExchange and details any known limitations.
„ Appendix C—“Reserved Table Names”
This appendix details the keywords reserved by DataExchange,
system tables created for replication, and the naming
convention used to create replication user tables.
„ Appendix D—“Advanced Topics”
This appendix explains performing a silent installation of
DataExchange as an advanced operation.
„ Appendix E—“Glossary”
This appendix provides a list of terms and definitions for
Pervasive DataExchange.
The manual also includes an index.

xviii
Conventions

Conventions
Unless otherwise noted, command syntax, code, and examples use
the following conventions:

CASE Commands and reserved words typically appear in uppercase


letters. Unless you are working with Unix or the manual states
otherwise, you can enter these items using uppercase,
lowercase, or both. For example, you can type MYPROG,
myprog, or MYprog.

Bold Words appearing in bold include the following: menu names,


dialog box names, commands, options, buttons, statements,
etc.

Monospaced Monospaced font is reserved for words you enter, such as


font command syntax.

[ ] Square brackets enclose optional information, as in


[log_name]. If information is not enclosed in square brackets,
it is required.

| A vertical bar indicates a choice of information to enter, as in


[file name | @file name].

< > Angle brackets enclose multiple choices for a required item, as
in /D=<5|6|7>.

variable Words appearing in italics are variables that you must replace
with appropriate values, as in file name.

... An ellipsis following information indicates you can repeat the


information more than one time, as in [parameter ...].

::= The symbol ::= means one item is defined in terms of another.
For example, a::=b means the item a is defined in terms of b.

xix
About This Manual

xx
P ERVASIVE D ATA E XCHANGE
chapter

Introducing Pervasive
DataExchange 1
Understanding Pervasive DataExchange and Its Capabilities

This chapter introduces you to Pervasive DataExchange, the


DataExchange Editions, and the components included with
Pervasive DataExchange. This chapter is divided into the following
sections:
„ “DataExchange Overview” on page 1-2
„ “DataExchange Editions” on page 1-3
„ “DataExchange Components” on page 1-4

1-1
Introducing Pervasive DataExchange

DataExchange Overview
Pervasive DataExchange reliably moves data between two or more
Pervasive PSQL databases to maintain warm backup systems, drive
data into reporting servers, or synchronize multiple remote
databases.
The DataExchange technology works by capturing and sharing
changes from one Pervasive PSQL database to other databases in a
DataExchange replication network. The Pervasive PSQL Engine is
augmented with DataExchange, which adds two software
components to a Pervasive PSQL database, the Replication Event
Handler and the Replication Engine.
„ The Replication Event Handler (REH) plugs directly into the
Pervasive PSQL database engine. Specifically, the REH is a set of
DLLs that operate within the database engine, so if the database
is running, the replication event handler is running as well. The
database engine activates the REH when there is a change event
(insert, update, delete). The REH then makes note of the event
in one of its private control tables.
„ The Replication Engine is a separate process that performs the
actual replication task. It reads the control tables to determine
what records have changed since the last replication session. It
then groups these changes into packets and shares them with the
other replication engines participating in a DataExchange
network. These other engines then apply the updates to their
own databases. The replication process occurs either
continuously, at scheduled intervals, or on demand. The
replication engine does not require constant network
connectivity, so DataExchange is suitable for scenarios with
intermittent connectivity, like remote users with dialup
connections.
Pervasive DataExchange focuses on the two types of data replication:
„ Providing continuous access to data (Real-Time Backup)
„ Synchronizing multiple databases (Data Synchronization)
While both capabilities are useful, one typically surfaces as the
primary driver for implementing data replication technology in a
specific environment.

1-2
DataExchange Editions

DataExchange Editions
Pervasive DataExchange is available in two editions—Real-Time
Backup and Data Synchronization.

Real-Time Pervasive DataExchange Real-Time Backup Edition is optimized for


Backup Edition quickly and easily maintaining a backup server. It pairs high
performance with minimal installation and maintenance. This
edition supports one-way replication between a primary server and
a backup server.
Real-Time Backup solutions can be onsite or offsite, depending on
your needs. Onsite backups ensure your data is protected from
hardware failures. Protecting your data means that data recovery
time is reduced and downtime is minimal. Solutions that implement
an offsite backup server gain protection to your data against
catastrophic loss, such as fire, flood or theft.

Data Pervasive DataExchange Data Synchronization Edition is optimized


Synchronization for more complex replication scenarios. This edition supports
Edition multiple participating databases and data flowing in multiple
directions.
The real-time data replication offered in Data Synchronization
ensures all users see the same up-to-the-minute information. The
ability to configure flexible topologies allows data flows to match the
business organization.

1-3
Introducing Pervasive DataExchange

DataExchange Components
Pervasive DataExchange consists of the following primary
components:
„ Replication Engine - used for distributing and applying captured
database changes
„ Replication Event Handler (REH) - used for recording or
monitoring database change events
„ DataExchange Agent - used to provide notification in the event
of a replication failure
„ DataExchange Utilities - used to perform the tasks necessary for
replication, such as design and activation
„ DataExchange Documentation - provides conceptual and
instructional information for using Pervasive DataExchange

DataExchange Pervasive DataExchange comes with a variety of utilities designed to


Utilities help you configure and manage the replication process.
Table 1-1 Overview of Pervasive DataExchange Utilities

Utility Type Utilities Included

GUI-based Utilities Includes the DataExchange Designer,


DataExchange Manager, DataExchange
Monitoring Tools, Template Remover Wizard, and
Deployment Wizard.

Command-line Utilities Includes a suite of utilities for performing all


phases of design, activation, replication, and
deployment.

Services Monitors data replication, configures replication


sessions, and sets logging options. (The set of
tools with which you perform these actions are
referred to as the DataExchange Monitoring
Tools.)

For detailed information on the Pervasive DataExchange Utilities,


see Chapter 7, “Using the DataExchange Utilities and Services”.

1-4
DataExchange Components

DataExchange All Pervasive DataExchange documentation, both printed and


Documentation online, assumes you are familiar with the basics of using a computer,
such as clicking and dragging, opening and saving files. If you need
assistance with these tasks, please consult the documentation that
came with your computer and/or operating system.
You can order printed copies of the documentation from your sales
representative.

Getting Started Guides


Pervasive DataExchange includes a printed manual for installation
and setup of your product. The manual included with your software
is specific to the replication edition you purchased. Depending on
the product you purchased, one of the following titles is included in
your product package:
„ Getting Started with Pervasive DataExchange (Real-Time Backup
Edition)
„ Getting Started with Pervasive DataExchange (Data
Synchronization Edition)
Both Getting Started guides explain how to install Pervasive
DataExchange and guide you through an example replication using
two machines.

User’s Guide
The Pervasive DataExchange User’s Guide includes both conceptual
and procedural information related to design, activation, and
replication. This manual is intended to help you understand the
tools and processes used in the replication process.
Pervasive DataExchange User’s Guide includes information
applicable to both the Real-Time Backup Edition and the Data
Synchronization Edition. It includes reference-based information
and task-based instructions that show step-by-step procedures on
using the Pervasive DataExchange products.

1-5
Introducing Pervasive DataExchange

1-6
chapter

Pervasive DataExchange
Basics 2
An Overview of DataExchange Basics

This chapter explains the core concepts and routine tasks of using
Pervasive DataExchange. Information on working with the engine,
logins and DSNs related to Pervasive DataExchange is included. This
chapter is divided into the following sections:
„ “Starting and Stopping Replication” on page 2-2
„ “Starting and Stopping the DXAgent Service” on page 2-5
„ “ODBC Basic Concepts” on page 2-7
„ “Pervasive PSQL Security” on page 2-9

2-1
Pervasive DataExchange Basics

Starting and Stopping Replication


Depending on the Pervasive PSQL product, the DataExchange
Replication Engine runs as a service or a console application. It can
be accessed from Pervasive Control Center (PCC). This section
covers starting and stopping the engine in all three cases.

As a Service Pervasive DataExchange (REPLSERV.EXE) runs as a service on the


machine where Pervasive PSQL Server is installed. It is a single
executable that runs under the Windows Service Control Manager.
It is configured by default to run when the system starts under the
LocalSystem account, which should be adequate for most systems.
You can, however, change the account in the Startup Parameters
dialog for the service.

³ To start the Replication service


1 Open the Windows Control Panel.
2 Click Administrative Tools, then Services.
3 Select the Pervasive PSQL Replication icon.
4 Do one of the following:
Š Select Action Start.
Š Open the icon and click Start under Service Status.
Š Right-click the icon and select Start.

³ To stop the Replication service


1 Open the Windows Control Panel.
2 Click Administrative Tools, then Services.
3 Select the Pervasive PSQL Replication icon.
4 Do one of the following:
Š Select Action Stop.
Š Double-click the icon and click Stop under Service Status.
Š Right-click the icon and select Stop.

2-2
Starting and Stopping Replication

As a Console Pervasive DataExchange Engine (REPLSERV.EXE) runs as a console


Application application on all platforms if Pervasive PSQL Workgroup engine is
installed. The application appears as an icon in the taskbar system
tray .
By default, Replication Engine starts when the system starts. You can
also start it manually.

³ To start Replication Engine manually


1 Select DataExchange Replication Engine from the Pervasive
group on the Start menu.

³ To stop Replication Engine while running as a console


application
1 Right-click the Pervasive Replication Service icon .
2 Select Stop Engine and Exit.

From Pervasive ³ To start the Replication service


Control Center 1 Start PCC if it is not already running. (Select Control Center &
Documentation from the Pervasive group on the Start menu.)
In the Engines branch, the Replication icon shows a red dot
to indicate the Replication Engine is stopped.
2 In Pervasive PSQL Explorer, expand the Services branch.
3 Right-click Pervasive Replication and select Start Service.
Mapache01

2-3
Pervasive DataExchange Basics

In the Engines branch, the Replication icon shows a green


arrow to indicate the Replication Engine is running.

³ To stop the Replication service


1 Start PCC if it is not already running. (Select Control Center &
Documentation from the Pervasive group on the Start menu.)
In the Engines branch, the Replication icon shows a green
arrow to indicate the Replication Engine is running.
2 In Pervasive PSQL Explorer, expand the Services branch.
3 Right-click Pervasive Replication and select Stop Service.

In the Engines branch, the Replication icon shows a red dot


to indicate the Replication Engine is stopped.

2-4
Starting and Stopping the DXAgent Service

Starting and Stopping the DXAgent Service


Pervasive DataExchange Agent runs as a service. It can be accessed
from Pervasive Control Center (PCC). This section covers stopping
and starting the agent as a service and from PCC.

As a Service Pervasive DataExchange (DXAGENT.EXE) runs as a service on the


machine where Pervasive PSQL Server is installed. It is a single
executable that runs under the Windows Service Control Manager.
It is configured by default to run when the system starts under the
LocalSystem account, which should be adequate for most systems.
You can, however, change the account in the Startup Parameters
dialog for the service.

³ To start the DXAgent service


1 Open the Windows Control Panel.
2 Click Administrative Tools, then Services.
3 Select the Pervasive DataExchange Agent icon.
4 Do one of the following:
Š Select Action Start.
Š Double-click the icon and click Start under Service Status.
Š Right-click the icon and select Start.

³ To stop the DXAgent service


1 Open the Windows Control Panel.
2 Click Administrative Tools, then Services.
3 Select the Pervasive DataExchange Agent icon.
4 Do one of the following:
Š Select Action Stop.
Š Double-click the icon and click Stop under Service Status.
Š Right-click the icon and select Stop.

Note DXAgent.exe is not installed with the Workgroup engine.

2-5
Pervasive DataExchange Basics

From Pervasive ³ To start the DXAgent service


Control Center 1 Start PCC if it is not already running. (Select Control Center &
Documentation from the Pervasive group on the Start menu.)
2 In Pervasive PSQL Explorer, expand the Services branch.
3 Right-click Pervasive DXAgent and select Start Service.

In the Services branch, the service icon shows green to


indicate DXAgent is running.

³ To stop the DXAgent service


1 Start PCC if it is not already running. (Select Control Center &
Documentation from the Pervasive group on the Start menu.)
2 In Pervasive PSQL Explorer, expand the Services branch.
3 Right-click Pervasive Replication and select Stop Service.

In the Services branch, the service icon shows red to indicate


DXAgent is not running.

2-6
ODBC Basic Concepts

ODBC Basic Concepts


Pervasive PSQL follows the Microsoft standard for ODBC database
connections. According to the standard, applications must connect
to databases through Data Source Names (DSNs) defined in the
operating system.
Every Pervasive PSQL database that you expect to access using
ODBC must have a Data Source Name (DSN) available on the same
computer as the database engine, and (if applicable) another DSN on
the client computer. The only exceptions are Pervasive tools, which
can access remote databases without using DSNs on the client
computer. A DSN created on the same machine as the database
engine is called an Engine DSN. A DSN created on the client machine
is called a Client DSN.

Note Pervasive PSQL databases that are accessed only through


Btrieve do not need DSNs. However, in this case, the database is
not visible in PCC nor can it be manipulated using PCC.
Pervasive recommends using Data Dictionary Files (DDFs) and
DSNs with all databases, including ones accessed only through
Btrieve, to make them easier to manipulate.

Servers and Every Pervasive PSQL server engine or workgroup engine includes a
Clients client installation. So you can use your server machine to connect to
other servers as a client.
Pervasive PSQL clients can connect to remote machines where a
Pervasive PSQL server engine is installed.

Data Source In a client-server architecture, each data set must have a well-known
Names name. A DSN is a well-known name for a data set. There are
generally three ways to create DSNs:
„ Create an Engine DSN from the server console. Workgroup
engines require only Engine DSNs.
„ Create an Engine DSN remotely from a client machine.
„ Create a Client DSN on each client machine.

2-7
Pervasive DataExchange Basics

Components of a Database Name


There are two components of a database name. Pervasive PSQL uses
an internal Database Name (DBNAME) to identify the location of
the Data Dictionary Files (DDFs) and the data files for each database.
An ODBC Data Source Name (DSN) entry refers to one DBNAME.
You may set up more than one DSN that refers to the same
DBNAME. If the physical location of the data files on the server is
changed, only the DBNAME needs to be updated. All DSNs remain
unchanged.

2-8
Pervasive PSQL Security

Pervasive PSQL Security


If you are replicating a database with Pervasive PSQL Security
enabled, you will be required to supply a user name and password.
The user name defaults to Master, which cannot be changed. You
enable security in PCC before designing a template for replication.

Note In order to add Pervasive PSQL security to an already


activated database, you must first deactivate the database at all
sites before adding security. Once Pervasive PSQL security has
been added (via PCC) you will then need to reactivate the
database.

Deploying Pervasive PSQL provides security models for Btrieve applications.


Demodata However, the activated databases created by DXdeploy do not
Under contain security, even if the source database does. You may add
Pervasive security to a replication database if you choose. See “Pervasive PSQL
PSQL Security Security” on page 2-9 in Pervasive DataExchange User’s Guide. See
also the chapter on Pervasive PSQL Security in the Pervasive PSQL
Advanced Operations Guide for details.
Getting Started with Pervasive DataExchange (Real-Time Backup
Edition) explains how to deploy the sample database Demodata
under the Classic security model. If you are using either the Database
security model or the Mixed model and you want to retain security,
you must ensure that Demodata can be deployed.
The following table explains the high-level actions required to
deploy Demodata. Perform the appropriate actions on both the First
Site and the Partner Site before attempting the example deployment.
See “Working with the Demodata Sample Database” on page 4-3 in
Getting Started with Pervasive DataExchange (Real-Time Backup
Edition).

2-9
Pervasive DataExchange Basics

Table 2-1 Actions Required to Deploy Demodata Under Database Security or Mixed Security
Replication Database Security Model Mixed Security Model
Site

First ‹ Add the Demodata directory (for ‹ Add the Demodata directory (for
example, <drive>:\Documents and example, <drive>:\Documents
Settings\All Users\Application and Settings\All Users\Application
Data\Pervasive Data\Pervasive
Software\PSQL\Demodata) to the data Software\PSQL\Demodata) to the
file locations for DefaultDB. data file locations for DefaultDB.

‹ Add the templates directory (for ‹ Add the templates directory (for
example, <Installation Directory example, <Installation Directory
>\Replication\Templates to the data file >\Replication\Templates to the
locations for DefaultDB. data file locations for DefaultDB.

‹ In PCC Configuration for Server Access, ‹ In PCC, click Users for


set Prompt for Client Credentials to On. DefaultDB. Right-click the Public
You may accomplish the same thing by user, then click Properties.
using the Pervasive PSQL command-
line utility pvnetpass. See the Pervasive ‹ Click the Permissions tab. Grant
PSQL Pervasive PSQL User's Guide for all permissions for Public, then
details about pvnetpass. click OK.

‹ During the example deployment, a login ‹ After the example deployment


dialog appears from which you must log successfully completes, reset the
in to DefaultDB. Specify the user name permissions for user Public as
and password. On the login dialog, suits your business requirements.
select the option Save User Name and
Password. This prevents your having to
log in for each table replicated.

‹ After the example deployment


successfully completes, remove the
saved user name and password with the
pvnetpass utility. If you retain the saved
user name and password, note that any
Btrieve application on the secured site
has access to all databases associated
with DefaultDB.

Partner ‹ Add the Demodata directory (for ‹ Add the Demodata directory (for
example, C:\Demodata) to the data file example, C:\Demodata) to the
locations for DefaultDB. data file locations for DefaultDB.

For information on the types of security available, see the chapter


“Pervasive PSQL Security” in the Pervasive PSQL documentation.

2-10
chapter

Using Pervasive
DataExchange 3
A Guide to Using DataExchange in Daily Operations

This chapter provides in-depth information for using DataExchange


on a daily basis. It includes discussions about fundamental concepts,
as well as procedural information for dealing with some of the
common scenarios you may encounter during replication. The
topics in this chapter include:
„ “Activation” on page 3-2
„ “Deactivation” on page 3-5
„ “Adding Tables to an Activated Database” on page 3-7
„ “Removing Tables From an Activated Database” on page 3-15
„ “Adding Dynamic Tables to an Activated Database” on page 3-
20
„ “Setting up Nondatabase File Replication” on page 3-24
„ “Changing a Table Structure in an Activated Database” on page
3-32

3-1
Using Pervasive DataExchange

Activation
Activation is the process of creating a new database for replication, or
enabling an existing one, and establishing the database as belonging
to a site within a replication network so that it can replicate.

Note Because activation associates a database with a site,


activating a database and activating a site mean the same thing.

Activation can be done by three methods. The Deployment Tool and


dxdeploy utility activate automatically as part of deployment. The
dxact utility provides a manual method for activation as well as the
flexibility to specify options such as preprocessing of starter data. For
this discussion, we use the command-line utility dxact to activate the
sample database. However, it’s important to first understand some
of the concepts of the activation process.

Activation and When you activate a database, Pervasive DataExchange creates a


Data Source system data source name (DSN) to point to the activated copy. The
Names DSNs with the prefix xPD are created by the design process. The
activation process creates DSNs with names like PDxxxxxxxx.
Another system database is the Database Network Analysis (DNA),
which is the replication database called PDDNA. It is created during
DataExchange installation. The database appears in Pervasive PSQL
Explorer with the DNA icon in its Replication node.

Caution Do not alter or attempt to use the DNA database


(PDDNA). Doing so can corrupt the DataExchange installation.

3-2
Activation

Activating First The First Site is unique and must be activated before you activate any
and Partner of the Partner Sites. When activating the First Site, Pervasive
Sites DataExchange populates its system tables with information needed
to manage the distributed environment. This information is
subsequently replicated to all other sites in the network as they are
activated.
The First Site is special because it contains information about the
replication network and is the only site where DataExchange
Designer is installed. Once the First Site is activated, you may
activate your Partner Sites in any order.

Tip The Replication Engine must be running to activate a


database.

After activation of the First Site is complete, you can activate the
databases at the Partner Sites. Activate Partner Sites from each site
itself. That is, you execute the Deployment Tool, dxdeploy.exe or
dxact.exe on the Partner Site, not on the First Site.
If possible, the machine should have a network connection through
which it can communicate with the First Site so that the initial
replication session can start immediately. This is not mandatory,
however. You can perform the initial replication at a later time if you
prefer. A Partner Site cannot replicate with other Partner Sites until
it performs an initial replication with the First Site.
Once you’ve successfully performed activation, Pervasive Control
Center displays the database as activated, wit the Replication node
icon showing an A.

Once the initial replication has succeeded, the newly installed site is
fully aware of all administrative data in that workgroup, including all
replication schedules.

3-3
Using Pervasive DataExchange

For more information


Specific information about using each of the DataExchange
deployment utilities mentioned in this chapter is available in
Chapter 7, “Using the DataExchange Utilities and Services.” The
following table provides specific reference information.

Activation Method For more information...

Deployment Wizard (Dpwizard.exe) See “dpwizard” on page 7-32

Dxdeploy.exe See “dxdeploy” on page 7-13

Dxact.exe See “dxact” on page 7-6

³ To activate using dxact.exe


1 On the site machine you want to activate, open a command
prompt window to start dxact.exe.
2 At the prompt, type a command similar to the following:
dxact demodata /FI

This example activates the demodata database on the First Site


using the dxact.exe utility. By default, messages from dxact.exe
are written to the dxact.log file, not to the screen. To view the
messages on the screen while dxact.exe runs, use the /LOGFILE=
option. To do so, you would enter a command similar to the
following:
dxact demodata /Logfile= /FI

The /FI option specifies you are activating the First Site, but you
should always run dxact.exe from the site you want to activate—
remote activations are not available in DataExchange. For the
complete list of dxact.exe options available, see “dxact” on page 7-6.
Now that we’ve covered the basics of activation, let’s take a moment
to discuss deactivation and reactivation.

3-4
Deactivation

Deactivation
Deactivation is the disabling of an activated database in a replication
network. Deactivation uses the dxdeact utility as explained in
Chapter 7, “Using the DataExchange Utilities and Services.”
If you deactivate a database on the First Site, Pervasive Control
Center displays the First Site database as a design template, since it
was used to design the database for the replication network. When
the First Site is deactivated, the Replication node icon displays a T.

When a Partner Site is deactivated, in Pervasive Control Center on


that site the Replication node icon for the database no longer
displays an A for activation.

Other sites do not detect a deactivated site until replication occurs,


which fails for the deactivated site. This is normal and generates an
error message similar to the following in the DRE.log file:
E 019f 0301-15:46:25 Partner site Partner_Site_2 (site number:
00LFLU) has been removed from the replication network - it
cannot replicate with any other site.

After the failed replication, the error no longer occurs because all
sites in the replication network have detected the deactivated site.

3-5
Using Pervasive DataExchange

³ To deactivate using dxdeact.exe


1 On the site machine you want to deactivate, open a command
prompt window to start dxdeact.
2 At the prompt, type a command similar to the following:
dxdeact demodata

This example deactivates the demodata database using the


dxdeact utility. By default, messages from dxdeact are written to
the dxdeact.log file, not to the screen. To view the messages on
the screen while dxdeact runs, use the /LOGFILE= option just as
you did earlier with dxact.exe. It’s helpful to note that all the
DataExchange Utilities provide the /LOGFILE= option to
control logging output. For the complete list of dxdeact.exe
options available, see “dxdeact” on page 7-11.

Reactivation Reactivation is the reenabling of a deactivated site for replication. A


database must be deactivated before it can be reactivated.
Reactivation is, in essence, the same as activation in that you use the
dxact utility in the same manner as you did when you activated.
If you deactivate a First Site, you must perform a manual replication
if you reactivate the First Site. After you reactivate the First Site, you
must manually initiate a replication session from each Partner Site to
the First Site. The replication sessions ensure that all available sites
appear on the Initiate Replication dialog.

Note Manually initiating a replication session is not required if


you deactivate/reactivate a Partner Site; it applies only to a First
Site.

3-6
Adding Tables to an Activated Database

Adding Tables to an Activated Database


Once a database has been activated and replication is set up between
two or more database servers, you may find that you need to add a
table to the replication design. This could be a table that did not
previously exist or was not deemed as necessary for replication when
you originally designed your replication database.

Before you You must make certain that the replication schedule associated with
Begin the replication design you are changing is currently disabled and that
no users are working on the system.
One of the steps you must complete is to deactivate the database, and
it is always a good practice to disable any replication schedules before
deactivation.

Caution No user should be using the system during the add


table process because any modification to the database will not
be captured while databases are deactivated.

The following lists the high level steps needed to successfully add a
table to an already activated database. Each of these high level steps
includes detailed instructions required to complete that phase. The
high level steps are as follows:
„ Determine Event Handler DLL Usage
„ Deactivate All Sites
„ Verify the Table Exists in the Pervasive Database
„ Add the New Table to the Replication Template
„ Stop Replication Service on Partner Sites
„ Copy Files (DDFs, D- and PDC Tables)
„ Activate First Site and Synchronize Tables
„ Start Replication Service on Partner Sites
„ Activate Partner Sites
„ Initiate Replication

3-7
Using Pervasive DataExchange

Determine First you need to know if an Event Handler DLL is used in your
Event Handler activated database. Knowing this determines whether you need to
DLL Usage use the /DL=<string> option when using dxact.exe.

³ To determine Event Handler DLL usage


1 Verify if the database has an Event Handler DLL registered by
opening a command prompt and typing the following
command:
dxregevnt show database_DSN

2 A message displays if your database is using an Event Handler


DLL and lists the name of the event handler (dxevent.dll).
If you do not have an Event Handler DLL registered, the
following message displays:
No Event Handler is Registered

3 If you have a DLL registered, you must include the /DL=<string>


option with the dxact command when you activate or reactivate
the database.

Note The /DL=<string> option for dxact.exe enables the


activated database to make use of a event handler, or callback,
DLL. If you use the /DL=<string> option when activating
databases, you must stop and restart the Pervasive PSQL
Replication service in order for the callback DLL to be registered
and take effect.

The activation examples provided in this chapter assume that you do


not require the /DL=<string> option when using dxact.exe.

Deactivate All Before you change your replication design to include the new table,
Sites you must first deactivate all sites.

³ To deactivate all sites


1 On the First Site open a command prompt.
2 At the prompt, type a command similar to the following:
dxdeact database_DSN

database_DSN represents the DSN of the activated database to


which you want to add the table.

3-8
Adding Tables to an Activated Database

3 Repeat these steps at each Partner Site associated with the


replication network until all sites have been deactivated.

Note No additional options are required for dxdeact.exe.

Verify the Table Before you can add a table to a DataExchange replication database,
Exists in the you must first make sure the table you are adding has been added to
Pervasive the Pervasive PSQL database. The physical file must be present in the
Database data directory of the database. Also, the table must have data
dictionary files (DDFs) defined for it. (If you can see the table in the
PCC list of tables then it has DDFs defined.)

Tip It is not necessary to have the contents of the new table


accurately defined, just make sure the path properly points to
the file to replicate.

³ To verify the table exists in the Pervasive Database


1 At the operating system, ensure that the physical table file is
located in the data directory of the database.
For example, suppose that you want to add the table
Campus.mkd to the DEMODATA sample database. You would
ensure that Campus.mkd resides in the DEMODATA data
directory (which, by default, is <drive>:\Documents and
Settings\All Users\Application Data\Pervasive
Software\PSQL\DEMODATA).
2 Open Pervasive Control Center and expand the database list to
display the DSN to which you are adding the table.
3 If the table you want to add is in the list of tables, you are finished
with this task. Continue with the next section, “Add the New
Table to the Replication Template.”
4 If the table you want to add is not in the list of tables, you need
to create a data dictionary file (DDF) for it. Open the database in
PCC and execute the following statement to create the DDF for
the new table:
CREATE TABLE tablename IN DICTIONARY USING 'data file
location' (table element definition(s))

3-9
Using Pervasive DataExchange

For example, if you were adding Campus.mkd to the


DEMODATA database and the Campus.mkd file is stored in the
default data directory, you would a command similar to the
following:
CREATE TABLE Campus IN DICTIONARY USING 'Campus.MKD'
(COL1 CHAR(20))

Add the New The original replication template has to be redesigned to include the
Table to the newly added table.
Replication
Template ³ To add the new table to the replication template
1 On the First Site, start DataExchange Designer (for example,
open Pervasive Control Center and click DataExchange
Designer).
Designer opens, listing all the templates available to modify.
2 In the list, click the database name that you deactivated in
section “Deactivate All Sites,” then click Finish.

Tip If you do not see the deactivated database, check the


dxdeact.log to verify that the site was properly deactivated.

This opens Designer, which lists all the tables being replicated in
the current design.

Note If you have used Dxdeploy.exe or the Deployment Tool to


activate your database, you may have never seen the Designer
before. For detailed information on using the DataExchange
Designer, see Chapter 8, “Using the DataExchange Designer.”

3 In the Database Design pane, click the Not Replicated tab.


4 Select the table that you want to add.
5 Click Actions Replicate Table from the menu bar, or right-
click then click Replicate Table.

3-10
Adding Tables to an Activated Database

Tip If you are adding multiple tables, select all the tables you
want to add.

6 Click the Replicated tab and verify the table was added.
7 Click File Save to save the changes.
8 From the menu bar select Tools Create Replication
Template. A dialog displays asking you if you want to Prepare
Database data for replication to other sites.

9 Clear the check box and click OK.


You do not want to prepare data for the other sites, which is why
you clear the check box.
10 Click OK when the message displays confirming that the
replication template has been created.
11 Click File Exit to close the Designer.
12 Exit PCC if it is running.

Stop Because you need to copy files, including ones used for replication,
Replication from the First Site to the each Partner Site, you need to stop the
Service on replication service on the Partner Sites.
Partner Sites Follow the steps listed in “To stop the Replication service,” on page
2-2 or, if using PCC, in “To stop the Replication service,” on page 2-
4.

Copy Files To make certain the correct data is available to the replication
(DDFs, D- and network, you’ll need to identify the files that you will later need to
PDC Tables) synchronize.

3-11
Using Pervasive DataExchange

³ To identify files
1 On the First Site, find where the replication-specific files are
stored and sort the files by date.
For example, locate the files Dtblchg.mkd and Dcnf.mkd, which
are replication-specific files.
Notice, after sorting the files by date, that a number of D*.mkd
tables have been updated, and a new PDC table has been created
for the new table you just added.
2 Select the following set of files:
Š The D*.mkd files that have been updated based on your
creating DDFs for the new table, or that have been updated
since the time you used Designer to add a new table to the
replication template.
Š The PDC for the data table you just added
(PDCdatafilename).
Š The updated DDFs for the replication database (such as
FILE.DDF, FIELD.DDF, and INDEX.DDF).

Note Not all D-tables may have been updated. Copy only the D-
tables that were updated.

3 Copy the set of files to their corresponding location(s) on a


Partner Site. Click “Yes” to replace existing files.
4 Delete all data from the newly added table and from the PDC file
for the newly added table. (For example, edit the table with PCC,
select all rows then delete them.)
5 After deleting the data from the table and from the PDC file on
one Partner Site, copy the set of files mentioned in Step 2 from
that Partner Site to the other Partner Sites. Click “Yes” to replace
existing files.

Activate First Now that you have copied the new table and the replication-related
Site and files to the Partner Sites, you need to active the First Site and
Synchronize synchronize the files.
Tables
³ To activate the first site and synchronize data
1 Activate the First Site using dxact.exe.

3-12
Adding Tables to an Activated Database

Note You may need to use the /DL<string> option as discussed


in “Determine Event Handler DLL Usage” on page 3-8.

The activation command is the following:


DXACT /FI database_DSN

For example, if you wanted to active the DEMODATA sample


database, the command is DXACT /FI DEMODATA.
2 Next, you run dxsynctables.exe to populate the PDC table with
the initial data from the new user table.
Enter the following command:
DXSYNCTABLES table_name database_DSN

For our example, if you had added a table Campus to the


DEMODATA sample database, you would enter the following:
DXSYNCTABLES Campus DEMODATA

If you are adding multiple tables, repeat this command for each
new table.

Start Now that you have copied files from the First Site to the each Partner
Replication Site, you can start the replication service on the Partner Sites.
Service on Follow the steps listed in “To start the Replication service,” on page
Partner Sites 2-2 or, if using PCC, in “To start the Replication service,” on page 2-
3.

Activate After the First Site is activated and the files synchronized, you can
Partner Sites activate the Partner Sites.
1 Activate each Partner Site using dxact.exe and the
/PA[RTNERADDRESS]=<string> option, to designate the site with
which you will replicate.

Tip The string represents the address of the machine with which
you are going to replicate. If your Partner Site replicates with the
First Site, you will enter the machine address for the First Site.

For example, if the First Site’s address is SiteA, you would enter
a command similar to the following:

3-13
Using Pervasive DataExchange

DXACT /pa=SiteA database_DSN

Note The /DL=<string> option for dxact.exe enables the


activated database to make use of a event handler, or callback,
DLL. If you use the /DL=<string> option when activating
databases, you must stop and restart the Pervasive PSQL
Replication service in order for the callback DLL to be registered
and take effect.

Initiate You now need to initiate replication to ensure that the new table is
Replication recognized throughout the replication network. Refer to the steps in
“To replicate data from First Site to Partner Site” on page 4-14.
After a successful replication to all Partner Sites, you can resume
your replication schedules and allow your users to return working
on the system.

3-14
Removing Tables From an Activated Database

Removing Tables From an Activated Database


You may find yourself in a situation where an already activated
database contains a table that was originally specified for replication
and now needs to be removed from the replication design. This
could be because the table is no longer part of the database schema
or is no longer required for replication and the users doesn't want
the overhead of replicating the table.
Removing tables from an already activated database requires very
similar tasks as were required for adding tables to an activated
database, with the exception of dropping the table as opposed to
adding a new table.

Before you This section discusses the steps required in order to remove a table
Begin to a database that is already activated. The high level steps included
in this process are as follows:
„ Deactivate all Sites
„ Remove Table From the Replication Template
„ Stop Replication Service on Partner Sites
„ Copy D*.mkd Tables
„ Start Replication Service on Partner Sites
„ Activate all Sites
„ Initiate Replication
Make sure that the replication schedules are disabled and that no
users are working on the system. The process of removing a table
includes deactivating the replication database, and it is always a good
practice to disable any replication schedules before deactivation. In
addition, no user should be using the system during this process
because any modification to the database will not be captured while
databases are deactivated.

Deactivate all Removing a table from an activated database uses the DataExchange
Sites Designer to remove the table from the replication design. To do this,
you must first deactivate all sites.

³ Deactivate all sites


1 On the First Site open a command prompt.

3-15
Using Pervasive DataExchange

2 At the prompt, type a command similar to the following:


dxdeact database_DSN

database_DSN represents the DSN of the activated database


from which you want to remove the table.

Note No additional options are required for dxdeact.exe.

3 Repeat this step at each Partner Site associated with the


replication network until all sites have been deactivated.

Remove Table ³ Remove table from the replication template


From the 1 On the First Site, open Pervasive Control Center and start the
Replication Designer by selecting DataExchange Designer.
Template
Designer opens, listing all the templates available for
modification.
2 Select the database that you just deactivated and click Finish.

Tip If you do not see the deactivated database with the T icon in
PCC, check the dxdeact.log to verify that the database was
properly deactivated.

This opens Designer, which lists all the tables being replicated in
the current design.

Note If you have used Dxdeploy.exe or the Deployment Tool to


activate your database, you may have never seen the Designer
before. For detailed information on using the DataExchange
Designer, see Chapter 8, “Using the DataExchange Designer.”

3 In the Database Design pane, click the Replicated tab , then click
the table(s) that you want to remove.
4 Click Actions Don’t Replicate Table from the menu bar, or
right-click and select Don't Replicate Table. Do this for each
table you want to drop, if there is more than one.

3-16
Removing Tables From an Activated Database

5 Click the Not Replicated tab in the Database Design pane and
verify the tables that you just removed are listed here.
6 Click File Save to save the changes.
7 From the menu bar select Tools Create Replication
Template. A dialog displays asking you if you want to Prepare
Database data for replication to other sites.

8 Clear this check box and click OK.


9 Click OK when the message displays confirming that the
replication template has been created.
10 Select File Exit to close the Designer.

Stop Because you need to copy files used for replication from the First Site
Replication to the each Partner Site, you need to stop the replication service on
Service on the Partner Sites.
Partner Sites Follow the steps listed in “To stop the Replication service,” on page
2-2 or, if using PCC, in “To stop the Replication service,” on page 2-
4.

Copy D*.mkd ³ To identify files


Tables 1 On the First Site, find where the replication-specific tables are
stored and sort the records by date.
For example, locate the files Dtblchg.mkd and Dcnf.mkd, which
are replication-specific files.
Notice, after sorting the files by date, that a number of D*.mkd
tables have been updated as a result of redesigning the
replication template.

3-17
Using Pervasive DataExchange

2 Select the D*.mkd files that have been updated based on your
redesigning the replication template.

Note Not all D-tables may have been updated. Copy only the D-
tables that were updated.

3 Copy and paste these tables into each of the Partner Sites
replication data directories overwriting the files there with these
new files.

Start Now that you have copied files from the First Site to each Partner
Replication Site, you can start the replication service on the Partner Sites.
Service on Follow the steps listed in “To start the Replication service,” on page
Partner Sites 2-2 or, if using PCC, in “To start the Replication service,” on page 2-
3.

Activate all ³ To activate all sites


Sites 1 Activate the First Site using dxact.exe. You must activate the
First Site before you activate any Partner Sites. From a command
line, you would run the following:
DXACT /FI demodata

2 Activate each of the Partner Sites using dxact.exe and the


/PA[RTNERADDRESS]=<string> option to designate the site with
which you will replicate.
For example the First Site’s address is SiteA, so you would enter
a command similar to the following:
DXACT /pa=SiteA Demodata

You may need to use the /DL=<string> option as discussed in “Determine


Event Handler DLL Usage” on page 3-8 at the beginning of this chapter.

Note The /DL=<string> option for dxact.exe enables the


activated database to make use of a event handler, or callback,
DLL. If you use the /DL=<string> option when activating
databases, you must stop and restart the Pervasive PSQL
Replication service in order for the callback DLL to be registered
and take effect.

3-18
Removing Tables From an Activated Database

Initiate You now need to initiate replication to ensure that the removed table
Replication is no longer replicated. Refer to the steps in “To replicate data from
First Site to Partner Site” on page 4-14.
After a successful replication to all Partner Sites, you can resume
your replication schedules and allow your users to return working
on the system.

3-19
Using Pervasive DataExchange

Adding Dynamic Tables to an Activated Database


Your database may add new tables dynamically, which is a different
scenario than was discussed in the previous section where we added
a table to our database as part of an updated design. There are
situations where databases are designed to generate tables
automatically, and these tables may need to be included in your
database replication.
DataExchange provides a way to include these new dynamic tables
in—or exclude certain tables from—the set of replicated tables for
an activated database. Only table files should be included because
only tables may be replicated. Any type of file may be excluded if you
want (nontable files are not replicated whether you exclude them or
not).
The new tables are identified by a pattern-matching algorithm,
which uses glob-style patterns in both regular and dir expressions.
You specify which file patterns you want the algorithm to use. The
patterns are the only input required from you. DataExchange does
the rest automatically. By default, the patterns are blank.
DataExchange first compares file names for the include pattern then
compares file names against the exclude pattern. Only files whose
names pass both comparisons are included. For example, suppose
you specify c:\mydata\*.d?? as an include pattern. If you specify an
exclude pattern of c:\mydata\*.ddf, then all files in c:\mydata will be
included except for ones with a file extension of “ddf.”

Tip For a detailed discussion about the types of expressions you


can use as include and exclude patterns with dxdynpath, see
“Types of Expressions” on page 7-18.

The inclusion or exclusion of tables begins when a table is


successfully opened with the database open API. DataExchange then
determines whether the table is identified as one to be replicated
(that is, is the table new to replication). If the table is new and its
name matches only with the exclude pattern, DataExchange takes no
replication action on the table. DataExchange includes a new table if
its name does not match with the exclude pattern but does match
with the include pattern. Initially, after a successful open, the table is

3-20
Adding Dynamic Tables to an Activated Database

simply identified to DataExchange as being new. Data in the new


table is not immediately replicated.
The next replication process (for example, from a scheduled
replication) prepares the new table for replication and synchronizes
the replication information about it on all sites. The second
replication process includes the new table. Note, then, that the actual
replication of data to or from a new table requires two replication
cycles.

Note Inclusion of dynamically created tables applies only to


Real-Time Backup replication. In addition, the dynamically
created tables must be on the machine where the database
application is running. That is, the tables must be on the
machine that serves as the source location from which data is
replicated.

Before you If you’re unfamiliar with expressions or have had little exposure to
Begin working with them, we strongly recommend you first review “Types
of Expressions” on page 7-18 to gain a basic understanding of how
to work with the different types of expressions.

Caution It is critical to note that any file being considered for


use with the dxdynpath utility requires system keys.

Include File In our example database, demodata, we’ll be automatically


Patterns generating a set of tables every day that contain the attendance
records for each campus. This is important data that must be
included in the replication. We’ll add an include pattern using
dxdynpath so these tables get replicated as well. The tablename uses
a naming convention of attend<campusid>.mkd, where
<campusid> is the three letter campus code.

Caution This section only applies if your application


dynamically creates new tables for an activated database. This
process is only recommended as a solution for tables that are
added dynamically.

3-21
Using Pervasive DataExchange

³ To include new tables for replication


1 On the First Site, open a command prompt and type the
command:
dxdynpath /t=include /pa="dir attend*.mkd" append demodata

2 Verify that the include pattern is there by typing the following


command:
dxdynpath /t=both show demodata

A message should display that lists the name and version of the
dynamic table configuration and test utility, and additional
information such as the following:
INCLUDE pattern is "dir attend*.mkd"

EXCLUDE pattern is ""

You may want to manually initiate replication after you specify


new files to include. This completes the first cycle of replication
required to prepare the dynamic tables for replication. The new
tables are then ready for the second cycle (for example, a
scheduled replication) in which data is replicated.

Exclude File Now let’s fine tune our pattern expressions for our example
Patterns database. We’ve included all of the attend*.mkd files, but there is a
cumulative file (attendall.mkd) that gets created too. Since we have
all the individual files that are included in the cumulative one, we
don’t really need that file replicated. So, we’ll exclude it from our
pattern matching.

³ To exclude files from replication


1 On the First Site, open a command prompt and type the
following command:
dxdynpath /t=exclude /pa="dir attendall.mkd" append
demodata

2 Verify that the exclude pattern is there by typing the following


command:
dxdynpath /t=both show demodata

A message should display that lists the name and version of the
dynamic table configuration and test utility, and additional
information such as the following:

3-22
Adding Dynamic Tables to an Activated Database

INCLUDE pattern is "dir attend*.mkd"

EXCLUDE pattern is "dir attendall.mkd"

These are simple examples to illustrate how dxdynpath uses pattern


matching to determine what files are replicated. For a detailed
discussion on using dxdynpath and the different types of expressions
you can use, see “dxdynpath” on page 7-15.

3-23
Using Pervasive DataExchange

Setting up Nondatabase File Replication


Your Pervasive PSQL database application may require ancillary
(nondatabase) files in order to function properly. Typically these
files would be missed by replication, since they are outside of the
database structure and replication design. In this scenario, it is
critical that you associate copying these files with your replication
sessions. Doing this ensures that all the data needed by your
application is replicated.
DataExchange includes a DLL file (dxevent.dll) which enables you to
run independent applications triggered by replication events. This
file is referred to as the Event Handler DLL or Callback DLL. The
replication events supported in this DLL include the following:
„ OnReplicationRequest
„ PreSessionStart
„ PostSessionStart
„ OnSessionEnd
Using this event callback mechanism, a flat-file copying tool such as
ffcopy.exe, can be used to coordinate the copying of nondatabase
files with database replication. This document explains how to
register dxevent.dll with DataExchange so that the Flat File Copy
Utility (ffcopy.exe) performs flat file replication.
There is more information about this feature on the installation
(<Installation Directory >\replication\docs\ffcopy.txt and
<Installation Directory >\replication\docs\dxevent.txt).

Before You You should ensure the following items before beginning this
Begin procedure:
„ You must have administrative rights and DOMAIN
administrative rights on the computers to be configured.
„ Before performing this process, ensure that no replication
sessions are running and disable any replication schedules.
High level steps include the following:
„ Set Log On Properties
„ Create New Flat File Database
„ Execute the SQL Queries

3-24
Setting up Nondatabase File Replication

„ Create the Design Template


„ Copy Files
„ Activate all Sites
„ Restart DX Services
„ Redesign Dxevent Table
„ Create Site Shares
„ Configure Flat File Replication

Set Log On ³ To set the Log On Properties


Properties 1 On the First Site, open the Windows Control Panel and select
Services.
2 From the Services dialog, right-click Pervasive PSQL
Replication and select Properties.
3 Select the Log On tab from the Properties dialog. Change the log
on from a system account to the Domain admin account. This
user must have access to the directory on the remote computer
so that the files may be replicated.
4 Click Apply, then stop and restart the Pervasive PSQL
Replication service.

Create New Flat Next, you’ll need to create a database to store the replication file
File Database information.

³ To create the new flat file database


1 Create a new directory for the replication file information
database.
2 Open Pervasive PSQL Control Center (PCC) and expand the
tree to show the machine that you are on.
3 Right-click Databases and select New Database, using
FlatFileRepl for the name and the path to the directory you
created in step 1.
4 Click Finish.
In the next task, you will run SQL statements to populate the
FlatFileRepl database.

3-25
Using Pervasive DataExchange

Execute the ³ To execute the SQL Queries


SQL Queries 1 Start PCC if it is not already running. (Select Control Center &
Documentation from the Pervasive group on the Start menu.)
2 Select File Open and browse to the directory <Installation
Directory >\Replication\Docs.
3 Open the file dxEvent.sql.
PCC asks you to select a database.
4 Select FlatFileRepl.
SQL Editor opens the file.
5 Click in the SQL Editor.
The SQL query should look similar to the following:
--This SQL script creates a table for use with dxEvent.dll.
--See dxEvent.txt for more information. Some V8 FTF/hotfix
--require the following set statement so that true bits are
--created for the dxEvent table.

SET TRUEBITCREATE = ON #
create table dxEvent (dxEventType char(30) not null,
Command char(128) not null, Wait bit, NeedArgs bit, Ignore
bit) #
create index dxEventTypeIdx on dxEvent(dxEventType) #
insert into dxEvent values ('OnReplicationRequest',
'Example: put command and args here', 0, 0, 1) #
insert into dxEvent values ('PreSessionStart', 'Example:
put command and args here', 0, 0, 1) #
insert into dxEvent values ('PostSessionStart', 'Example:
put command and args here', 0, 0, 1) #

insert into dxEvent values ('OnSessionEnd', 'Example: put


command and args here', 0, 0, 1) #

6 Select SQL Execute All SQL Statements.


7 Click Edit Select All and delete the contents of the Query
Pane. Do not save these changes.
8 Click File Open, but this time select the ffcopy.sql file, also
located in the <Installation Directory >\Replication\Docs
directory.
9 Execute this query in the same way and you should see the query
has executed successfully.

3-26
Setting up Nondatabase File Replication

10 Close the SQL Editor.

Create the ³ To create the design template


Design 1 In PCC, open DataExchange Designer by selecting
Template DataExchange Designer.
2 Enter FlatFileRepl for the location, select 1-way for the
replication method, and click Next.
3 Enter project, network and release names for this replication.
For our example, we will use Flatfilerepl for Project, Flatfile for
Network, and 1.0 for Release.
4 Click Next, confirm your choices, and click Finish.
5 In the Database Design pane, click the Not Replicated tab.
6 Select both table names, holding down shift while clicking.
7 Click Actions Replicate Table from the menu bar, or right-
click and select Replicate Table.
8 You should now see the files are in the Replicated tab. Click File
Save or the save icon from the Designer toolbar.
9 From the menu bar, click Tools Create Replication Template.
The Create Replication Template - Starter Data dialog displays.

10 Select the Prepare database data for replication to other sites


checkbox on this dialog, and click OK. After a few moments, a
message displays saying the template was created successfully.
11 Click OK and then close the Designer window.

3-27
Using Pervasive DataExchange

Copy Files Now we need to copy the database that we just designed over to the
Partner Site.

³ To copy files
1 Copy the FlatFileRepl directory to the Partner Site.

Tip It is not necessary to put the FlatFileRepl directory in the


same place as the First Site, but it may make it easier to find in
the future.

2 Once you copy the files to the Partner Site, open PCC on the
Partner Site, and expand the tree to show the machine that you
are on.
3 Create a database here just like we did on the First Site. (See
“Create New Flat File Database,” on page 3-25.)

Activate all ³ To activate all sites


Sites 1 At the First Site, open a command prompt and execute the
following command:
Dxact /fi /dl=c:\<Installation Directory
>\bin\dxevent.dll flatfilerepl

Note Your installation directory may be on a different drive as


above. Check to make sure that your path to the dxevent.dll is
correct. If there are any problems with the activation, check the
dxact.log file.

2 Go back to the Partner Site and open a command line. Execute


the following command:
Dxact /pa=<name of first site> /su flatfilerepl

3 Back on the First Site open the Statistics and Log View window,
and you should see the replication session running between the
two sites.
4 After the two databases have finished replicating, you will need
to close all the windows associated with PCC and close PCC
itself.

3-28
Setting up Nondatabase File Replication

Restart DX ³ To restart DX services


Services 1 Go to Control Panel Administrative Tools Services and
select the Pervasive PSQL Replication service; stop and restart
this service.
Now when the replication engine starts, the dxevent.dll will be
loaded into memory for the FlatFileRepl database.
2 Resume any schedules that were previously turned off when you
started this process.

Redesign At this point the databases are activated and running. We now need
Dxevent Table to go into each of the tables that we designed previously and supply
the info to replicate the flat files.

³ To redesign the dxevent table


1 On the First Site, open PCC, expand the tree and select the
Tables node in the FlatFileRepl database. The user tables and
tables needed for replication display. The replication tables are
specifically for replication, so don't open or modify any of them.
2 Double-click the dxevent table to open the table in PCC. The
SQL Editor lists four sample entries, as shown in the next
illustration.

Note You may need to scroll to the right to see that the Ignore
column is set to True so that these do not actually run.

3-29
Using Pervasive DataExchange

3 Click the first empty row and type OnSessionEnd in the


dxEventType column. Tab to the Command column and type
ffcopy.exe followed by a space and then the full path to the
Filestocopy.mkd file. For example:
ffcopy.exe c:\temp\flatfilerepl\filestocopy.mkd

The row you enter should look similar to the following in the
Data Manager:

4 Tab through the rest of the columns, do not check any of the
boxes, and close the Pervasive PSQL Data Manager.

Create Site ³ To create site shares


Shares 1 Locate the directory or directories you want to copy flat files
from and share the folder that they are contained in.
2 On the Partner Site locate the directory or directories you want
the files copied to and share them as well.

Configure Flat ³ To configure flat file replication


File Replication 1 Back on the First Site in PCC, double-click the FilesToCopy
table to open it in the SQL Editor.
2 In the LocalFN column, supply the full path to the files you wish
to copy from the First Site. Example:
c:\data\reports\*.doc

Tip To replicate all files in the directory use * not *.* You can
use wild cards, or ?, or supply the exact file names. See the
ffcopy.txt file located in <Installation Directory
>\replication\docs.

3 In the RemoteFN column, supply the full path to the directory


where the files are to be copied on the Partner Site. Example:
\\partnerMachine\sharedDirectory\reports\*

4 Tab to the next column, ReserveInt1, and type 0 (zero). Now,


enter 0 (zero) again in the next column, ReserveInt2.

3-30
Setting up Nondatabase File Replication

5 In the PartnerSideDelete column, type 1 if you want the Partner


Site to delete the file when it is deleted from the First Site,
otherwise enter 0 (zero).
6 Enter 0 (zero) in the remaining columns.
You may enter as many directories in the table as needed.
7 In PCC, right-click the Replication - Connected node in
Pervasive PSQL Explorer, then click Statistics and Log Views.
The Replication Progress and Log Viewers open.
8 In the toolbar, click the Initiate replication icon .
The Initiate Replication dialog appears.
9 Click Replicate.
The actual data replication session will complete in a few
seconds. Recall that we set OnSessionEnd to kick off the flat file
replication, so this is when the files actually start replicating.
10 Confirm that the files are reaching their destination. If you
encounter problems, see the ffcopy.log file located in
<Installation Directory >\replication\logfiles for more
information.

3-31
Using Pervasive DataExchange

Changing a Table Structure in an Activated Database


You may have a situation where a table that is currently part of a
replication design has been changed structurally, or the system keys
were updated, and these changes need to get synchronized with the
remaining sites. You’ll need to make certain that these changes are
properly implemented with your replication design, the changes are
synchronized across the replication network, and that you are able to
successfully replicate with the changes in place.

Before you It is strongly recommended that you ensure the following items
Begin before beginning this procedure:
„ Make sure that the replication schedules are currently disabled
and that no users are working on the system. This procedure
includes deactivating the database, and it is always a good
practice to disable any replication schedules before deactivation.

Caution It is important that no user should be using the system


while tables are being modified because any changes to the
database will not be captured while databases are deactivated.

„ It is critical that the system keys for records in each of the user
tables are accounted for in the user table's corresponding PDC
table. This is the mechanism that replication uses to track which
records need to be sent to the other sites in the network. If there
ever becomes a disconnect between the user and PDC table it
can prevent replication from doing its job.
„ When you add or remove columns from the table at the First
Site, make certain you remember to make the same changes to
the table on the Partner Site so that the DDFs will reflect the
same structure for the tables.
„ The procedures in this document assume that all sites in the
replication network were synchronized prior to new schema
changes.
The high level steps needed to complete this procedure are as
follows:
„ Clone PDC Table(s)
„ Copy Files and Activate the Partner Site

3-32
Changing a Table Structure in an Activated Database

„ Verify the Replication Session

Clone PDC Although it is not required that a blank copy of the PDC table be
Table(s) used, doing so will:
„ Reduce the overall size of the PDC table because it will only
contain the new records, thus reducing transmission time to the
other sites.
„ Speed up the dxsynctables process because dxsynctables will not
have to verify preexisting records in the PDC table.

³ To clone PDC tables


1 Identify the tables that were modified in the user's data. This is
usually on the customer's production site.
2 In the replication data directory, locate the corresponding PDC
table for each of the modified tables.
3 Clone the PDC tables and replace the existing ones with the
cloned ones.

Tip For information on using the BUTIL utility to clone tables,


see the Advanced Operations Guide in the Pervasive PSQL user
documentation.

Activate the 1 Activate the First Site using the dxact.exe command.
First Site and DXACT /FI <Database_DSN>
Synch Tables
For example, if you wanted to active the DEMODATA sample
database, the command is DXACT /FI DEMODATA.
2 For each modified table, run this command from a command
prompt:
DXSYNCTABLES <TableName> <DSN>

3-33
Using Pervasive DataExchange

Note This process may take some time to run, depending on the
number of records contained in the user table. Tests indicate
that in cases where there are several million records or more,
disabling L2 caching can reduce the population times and speed
up this process significantly. Make sure to reenable L2 after the
user is finished with all the tables.

Copy Files and ³ To copy files


Activate the 1 Copy the newly modified user tables and newly populated PDC
Partner Site table(s) to the appropriate directories at each of the other sites in
the replication network. Make certain that you overwrite the
already existing tables there.
2 Activate each Partner Site using dxact.exe and the
/PA[RTNERADDRESS]=<string> option, to designate the site with
which you will replicate.
For example, if the First Site’s address is SiteA, you would enter
a command similar to the following:
DXACT /pa=SiteA <Database_DSN>

Verify the ³ To verify the replication session


Replication 1 On the each site that should have replicated, browse to the
Session LogFiles directory.
This folder is located at <Installation Directory
>\Replication\LogFiles.
2 Open the file dre.log and check for messages indicating success
or errors.
3 Reenable replication schedules.
You may now allow your users to return to the system.

3-34
R EAL -T IME B ACKUP E DITION
chapter

Real-Time Backup
Deployment Models 4
A Look at Alternative Deployment Models for Real-Time Backup

DataExchange provides different deployment methods for Real-


Time Backup replication. This chapter discusses the deployment
methods available for the most common network configurations
and provides you with information in addition to the deployment
method between two machines discussed in Getting Started with
Pervasive DataExchange Real-Time Backup Edition. This chapter also
discusses disaster recovery procedures in the event you need to
restore a replicated database. The sections in this chapter include the
following:
„ “Real-Time Backup Configurations” on page 4-2
„ “Replication Deployment using the Deployment Tool” on page
4-5
„ “Replication Deployment using DXDeploy” on page 4-6
„ “Replication Deployment Using Designer” on page 4-7
„ “Many-to-One Deployment using DXDeploy” on page 4-18
„ “Disaster Recovery” on page 4-24

4-1
Real-Time Backup Deployment Models

Real-Time Backup Configurations


DataExchange offers three options for Real-Time Backup
deployment. An interactive deployment method uses the
Deployment Wizard, which automates the entire deployment
process and enables creating a replication schedule. Another
deployment method uses the DXDeploy utility, which automates
several of the processes necessary for replication. The other
deployment method uses the Designer and the DataExchange
utilities to perform the replication processes. Before you consider
what deployment option to use, you should first consider how you
will want to configure Real-Time Backup.

Two-Machine The most common configuration for Real-Time Backup replicates


Configuration data between two machines in real-time from a Pervasive PSQL
database to a standby server. Upon a system failure, clients can be
directed to the up-to-date standby server. Operating at the database
level, DataExchange captures database changes on the primary
server and applies them to the backup server.
This type of configuration allows DataExchange to avoid errors
common to disk-based replication tools, like replicating corrupt
data, spreading viruses, or deleting desired user data. With Pervasive
DataExchange powering a standby server, data loss, and down time
is greatly lessened in the event of system failures, hardware failures,
or site disasters.
The following figure illustrates a one-way replication backup
network using two machines.

4-2
Real-Time Backup Configurations

Figure 4-1 Real-Time Backup with Two Machines

In this scenario, you have one server, Server A, networked with your
backup server. The server runs its own database, dbA. DataExchange
then maintains a copy of the database on the standby backup server
and replicates with the server at the backup location when changes
are applied.
See “Replication Deployment using the Deployment Tool” on page
4-5 for information on starting the DataExchange Deployment
Wizard.
Refer to Chapter 4, “Replication Deployment,”in your Getting
Started with Pervasive DataExchange Real-Time Backup Edition
manual for instructions on implementing Real-Time Backup on a
two machine configuration using DXDeploy.
See “Replication Deployment Using Designer” on page 4-7 for
instructions on implementing Real-Time Backup on a two machine
configuration using Designer and the DataExchange utilities.

Many-to-One The other configuration commonly used with Real-Time Backup


Configuration consists of several database servers at different locations that
replicate data to a backup standby server hosting multiple backup
databases. This is referred to as a many-to-one configuration. The
following provides an illustration of this type of configuration.

4-3
Real-Time Backup Deployment Models

Figure 4-2 Real-Time Backup with Many-to-One Configuration

In this scenario, you have three servers, Server A, Server B, and


Server C. Each machine is networked with your backup server. Each
server runs its own database, dbA, dbB, and dbC, respectively.
DataExchange then maintains individual copies of each database to
the standby backup server and replicates with the server at the
backup location when changes are applied.
Refer to “Many-to-One Deployment using DXDeploy,” on page 4-
18 for instructions on implementing Real-Time Backup on a many-
to-one configuration using DXDeploy.

Note Currently DataExchange only supports implementing


Real-Time Backup on a many-to-one configuration using
DXDeploy.

4-4
Replication Deployment using the Deployment Tool

Replication Deployment using the Deployment Tool


Real-Time Backup deployment can be implemented using the
DataExchange Deployment Tool. The Deployment Tool is a step-
by-step wizard for deploying replication at First and Partner Sites
and includes a means of creating a replication schedule. The
Deployment Tool provides automation of the procedures for the
DataExchange command-line utility dxdeploy.exe.
Access the Deployment Tool from Pervasive Control Center by
selecting DataExchange Deployment Tool or by selecting
DataExchange Deployment Tool from the Pervasive group on
the Start menu.

Before You Get Before you start the DataExchange Deployment Tool, we
Started recommend that you review the following deployment attributes. It
is a good idea to make note of these items for the database you are
deploying, as they are needed to complete the Deployment Tool
wizard.
„ Project Name – this corresponds to a specific database. If your
goal is to replicate a database named mydatabase, then you may
want to call the project mydatabase project or something similar.
„ Network Name – this refers to the name you have chosen to
represent the grouping of replication sites that participate in
replication.
„ Release Name – this is similar to a version number for the design
of the replication database.
„ DSN – this specifies the data source name (DSN) to be
associated with the data files deployed for replication. The DSN
must be unique on each site.
„ Directories and file names of data – this specifies the directories
and data files to be included in the replication.
For detailed information about these attributes, see “XML Attributes
in Deployment Descriptor File” on page 4-15 in Getting Started with
Pervasive DataExchange.

4-5
Real-Time Backup Deployment Models

Replication Deployment using DXDeploy


Simple replication deployment between two machines is the
standard use case for Real-Time Backup. This scenario involves a
primary server and a backup server, as shown in Figure 4-1.
For detailed instructions on deploying a Real-Time Backup solution
using DXDeploy, refer to Chapter 4, “Replication Deployment,”in
the Getting Started with Pervasive DataExchange Real-Time Backup
Edition.

4-6
Replication Deployment Using Designer

Replication Deployment Using Designer


Real-Time Backup deployment can be implemented using the
Designer and DataExchange utilities instead of the Deployment
Wizard or DXDeploy utility. To perform this type of one-way
deployment in a two-machine configuration, you will use the
following series of tasks:
1 Create a Template on the First Site Using Designer
2 Copy the Template Files to the Partner Site
3 Activate the Template on the First Site
4 Activate the Template on the Partner Site
5 Make Sample Database Changes (optional)
6 Initiate Replication between the First Site and Partner Site
7 Verify the Changes Were Replicated (optional)
This example uses the sample database, Demodata, provided with
the Pervasive PSQL installation.

Before You Get Before performing this task you must install Pervasive
Started DataExchange on a First Site and a Partner Site as explained in
Getting Started with Pervasive DataExchange.
We strongly recommend that you shut down all applications using
the database you are about to deploy before using this deployment
method.

Tip So that you can restore your database to its original state
after this deployment exercise, we recommend saving a copy of
your database files before proceeding with this example.

Note Currently, you must have an ODBC-compliant DSN and


DDFs in order to use the DataExchange Designer for this
deployment method.

4-7
Real-Time Backup Deployment Models

Create a ³ To create a template on the First Site


Template on 1 On the First Site machine, start PCC if it is not already running.
the First Site (Select Control Center & Documentation from the Pervasive
Using Designer group on the Start menu.)
2 In PCC, select DataExchange Designer.
The Designer wizard asks you to specify the data to be replicated.

3 For this example, enter Demodata in the Location field and click
Next.
The wizard asks you to identify the replication project, network,
and release. These names are of your own choosing to help keep
track of what you need to replicate.
4 For this example, enter the following:
Š Project: DX_Test
Š Network: Test
Š Release: 1.0
Project and network names are limited to 20 characters, and the
release name must be 8 characters or less.
5 Click Next.
The wizard provides a summary of your input for the replication
project.
6 Click Finish.
A message informs you that DataExchange Designer is creating
the replication system tables. After the replication system tables
are created, DataExchange Designer opens.
DataExchange Designer lists the ten tables in the Demodata
sample database on the Not Replicated tab,

4-8
Replication Deployment Using Designer

Figure 4-3 DataExchange Designer

7 Select all of the tables by pressing the Shift key and, while
holding it down, click the last table in the list.

Figure 4-4 DataExchange Designer with All Tables Selected

8 Right-click the selected tables, then click Replicate Table.

4-9
Real-Time Backup Deployment Models

Figure 4-5 Replicate Table Command in DataExchange Designer

All of the tables move from the Not Replicated tab to the
Replicated tab. The view on the right shows the information for
the selected table on the Replicated tab.

Figure 4-6 View of Replicated Tables in DataExchange Designer

9 Select File Save to save your work.


10 Select Tools Create Replication Template. A message about
starter data appears.

See “Design Completion,” on page 8-7 for more information


about starter data.

4-10
Replication Deployment Using Designer

11 Leave the selected default option Prepare database data for


replication to other sites and click OK.
Messages inform you that DataExchange Designer is preparing
the database for activation then preprocessing the existing
(starter) data. After the data has been preprocessed, another
message informs you that the template has been created.

12 Click OK to complete the template creation process.


13 Select File Exit to close the Designer wizard.

³ To verify template creation


1 In Pervasive PSQL Explorer, under Engines open the Demodata
database branch.
2 Right-click the Replication node and select Refresh.
Notice that a T icon appears next to the node, which indicates
that a database template has been created.

Copy the ³ To copy the template files to the Partner Site


Template Files You now need to copy all of the template files from the
to the Partner Demodata folder on the First Site to the same folder on the
Site Partner Site.
1 From the First Site, copy the Demodata folder to the same folder
on the Partner Site.

4-11
Real-Time Backup Deployment Models

2 Answer Yes to confirm file replacement.


You will now activate replication on each site.

Note When using DataExchange Designer deployment, the


template includes the actual database files. If your database
contains files in other directories, you must copy them to the
same path on the Partner Site as on the First Site.

Activate the ³ To activate the database on the First Site


Template on The command-line utility dxact activates the databases.
the First Site
1 On the First Site, open a command prompt.
2 At the prompt, type the following:
dxact /FIRSTSITE Demodata

Capitalization is for emphasis. The command is case-insensitive.


3 Press Enter.
By default, messages from Dxact are written to dxact.log, not to
the screen. This log is located in the <Installation Directory
>\Replication\LogFiles folder. If you want to view messages on
the screen while Dxact executes, use the /LOGFILE= option (a
space character follows the equal sign). For example:
dxact /LOGFILE= /FIRSTSITE Demodata

See “dxact” on page 7-6 in Pervasive DataExchange User’s Guide


for more information about the Dxact utility.
The activation process is complete when the command prompt
reappears. You now need to activate Demodata on your Partner
Site database.

Activate the ³ To activate the database on the Partner Site


Template on 1 At a command prompt on the Partner Site machine, type the
the Partner Site following:
dxact /PARTNERNETADDR=address Demodata

where address is the name or IP address of the First Site.

4-12
Replication Deployment Using Designer

For example, if the First Site is a machine named TM, the


command would be
dxact /PARTNERNETADDR=TM Demodata

The /PARTNERNETADDR option indicates the Partner Site address.


Capitalization is for emphasis. The command is case-insensitive.
2 Press Enter.
The activation process is complete when the command prompt
reappears. You have now activated both your First Site and
Partner Site replication databases.
3 Close the command prompt.
4 On the First Site, open PCC and in Pervasive PSQL Explorer
under Engines, open the Demodata database branch.
5 Right-click the Replication node and select Refresh.
Notice that the Replication node beneath Demodata now shows
an A icon, indicating that it is activated.

Figure 4-7 Activated Icon in Pervasive PSQL Explorer

Now that the First and Partner Site databases are activated, you
are ready to replicate data between them. Before you initiate
replication, you may want to perform a sample database change
so you can later verify the changes were replicated.

Make Sample ³ To change the database records


Database You may change records from the First Site. DataExchange replicates
Changes the data on your First Site machine to the Partner Site.
1 Start PCC if it is not already running. (Select Control Center &
Documentation from the Pervasive group on the Start menu.)
2 Open the Tables node for the Demodata database.

4-13
Real-Time Backup Deployment Models

Figure 4-8 Demodata Tables Node

3 Right-click table Billing and select Open, or double-click it.


SQL Editor opens and displays all records in table Billing.
4 Change the Transaction_Number for the first record from “1”
to “2”. Change the Amount_Owed and the Amount_Paid for
the second record from “1500.00” to “2000.00”.
Optionally—if you’re curious—open the PDCBilling table for
Demodata. This is the replication control table for Billing.
Modify the SQL statement to read SELECT * FROM
"PDCBilling" ORDER BY LastChange DESC. Select SQL
Execute in grid or press F9 to execute the statement. Scroll to the
right to see the LastChange column. The date and timestamp for
the top two records reflect the changes you just made.
5 Close SQL Editor.
This saves the changes to the Billing table.

Initiate ³ To replicate data from First Site to Partner Site


Replication You may initiate replication from either site. These steps assume that
you are performing the actions from the First Site.
1 In PCC, right-click the Replication - Connected node in
Pervasive PSQL Explorer, then click Statistics and Log Views.

4-14
Replication Deployment Using Designer

Figure 4-9 Replication - Connected Node

The Replication Progress and Log Viewers open.

Figure 4-10 Replication Progress and Log Viewers

2 In the toolbar, click the Initiate replication icon .


The Initiate Replication dialog appears.

4-15
Real-Time Backup Deployment Models

Figure 4-11 Initiate Replication Dialog

Note that the source database is Demodata on your First Site and
also the database to replicate with on your Partner Site.
3 Click Replicate.
The replication process begins. The Replication Progress Viewer
reports the operation.

4-16
Replication Deployment Using Designer

Figure 4-12 Example Replication Progress and Log Viewers

4 Notice that the Completed column reports “successful.”


5 Select File Exit to close the viewers.
Your next task is to verify that the data changes were replicated
from Demodata on the First Site to Demodata on the Partner
Site.

Verify the ³ To verify that your changes were replicated


Changes Were 1 In PCC on the Partner Site, open the Tables node for the
Replicated Demodata database, right-click the Billing table, and select
Open, or double-click the table.
SQL Editor opens and displays billing data.
2 Note that the changes you made to Demodata on the First Site
have been replicated to the Partner Site.
3 Close the SQL Editor.
You have completed this deployment exercise.

4-17
Real-Time Backup Deployment Models

Many-to-One Deployment using DXDeploy


In a many-to-one configuration, multiple sites back up data to a
single site. A good choice for a First Site in such a configuration is
often the backup location. Consider the following example scenario:

Figure 4-13 Multiple Sites Backing Up Data

Three servers, A, B, and C, each has its own network. Each server
runs its own database, dbA, dbB, and dbC, respectively. You want to
implement a solution in which a replicated copy of each database is
maintained on one backup machine.
Given this scenario, the most reasonable choice for the First Site is
the backup location. Why? Part of the reason is that a replication
network can have only one First Site. In addition, the backup
location meets the following criteria:
„ Contains network connectivity to the Partner Site(s).
„ Provides the physical storage for the entire set of data.
„ Lends itself as the location from which the least amount of file
copying is required. Replication design requires that some files
are copied to the Partner Site(s).

4-18
Many-to-One Deployment using DXDeploy

The following image shows the same configuration after you install
DataExchange. Note that the Partner Sites are the sources of the data
and the First Site is the backup location.

Figure 4-14 Many-to-One Configuration with DataExchange Installed

Note In the reverse of a many-to-one configuration, one First


Site source replicates to two or more Partner Site backups. This
configuration is deployed as a two-way replication.

Before You Get Before performing this task you must install Pervasive
Started DataExchange on a First Site and a Partner Site as explained in
Getting Started with Pervasive DataExchange.

Tip So that you can restore your databases to their original state
after this exercise, we recommend saving a copy of the
Demodata database files before proceeding with this example.

4-19
Real-Time Backup Deployment Models

For discussion purposes, this task assumes the following:


„ You have read the chapter “Replication Deployment” in Getting
Started with Pervasive DataExchange Real-Time Backup Edition.
„ You have three Partner Sites whose names are ServerA, ServerB,
and ServerC, as illustrated in Figure 4-13.
„ Demodata is the application database on all three Partner Sites.

Caution All applications using the database must be shut down


before using this deployment method.

Deploying ³ To deploy databases in a many-to-one configuration


Using
DXDeploy 1 Ensure that the database you want to enable for replication is not
being accessed by your application.
For example, suppose that Demodata is the database used by
Myapp.exe. Ensure that Myapp is not accessing Demodata while
you perform the steps to deploy Demodata.
2 On the backup (first) site, open the XML descriptor file
EXPRESS.XML in a text editor. The file is located in the
\<Installation Directory >\Replication\Docs directory.
3 Edit the XML descriptor file, specifying the appropriate
information for ServerA and the backup (first) site.
Note that you will edit, and use, a different descriptor file for
each Partner Site. Because the backup (first) site is a shared
location, some information in the descriptor file must be unique
each time that you use the file. The following table explains this.

XML Descriptor File Must Be Notes


Attribute Unique for
Each
Partner Site

Project Yes

Network Yes

Release No

4-20
Many-to-One Deployment using DXDeploy

XML Descriptor File Must Be Notes


Attribute Unique for
Each
Partner Site

First ServerName No This is the name of the backup (first)


site, which is common to each
Partner Site.

First Site DSN Yes The DSN must also be unique for the
backup (first) site.

First Site DataDirectory Yes This is the backup location on the


backup (first) site specific to each
Partner Site

Relative Include Path No You could, for example, include


“*.mkd” files from each Partner Site.

Absolute Include Path Yes Absolute paths must not conflict on


the backup (first) site. For example,
suppose that ServerA, ServerB, and
ServerC each use the same absolute
data path, C:\mydata\table1.mkd.
That path can exist only once on the
backup (first) site. This would result in
a conflict because the table1.mkd file
from the different Partner Sites would
get overwritten on the backup (first)
site.

Partner ServerName Yes

Partner DSN No Each partner may use the same DSN


if you want, provided the DSN is
unique on that Partner Site.

Partner DataDirectory No The backup location on the backup


(first) site does not have to be the
same as the location of the data on
the Partner Site.

4 Save EXPRESS.XML as ServerA.xml to a location of your


choice. This task assumes that you save it to C:\.
5 Copy the Demodata directory from ServerA to the desired
backup folder on the backup (first) site.

4-21
Real-Time Backup Deployment Models

The backup location must be unique and must match the


location specified for First Site DataDirectory in the XML
descriptor file. This task assumes that the backup location is
C:\Demodata_Backup_ServerA.
6 On the backup (First) site, open a command prompt and type
the following:
DXDeploy /Site=First C:\ServerA.xml

The command is case-insensitive.


7 Press Enter.
DXDeploy provides high-level status messages on the screen as
it completes its actions. DXDeploy is complete when the
command prompt reappears.
8 After DXDeploy completes, type the following:
DXdeact <First Site DSN>

The command is case-insensitive.


<First Site DSN> is the DSN you specified in ServerA.xml for the
First Site.
9 Press Enter.
10 Copy the contents of the DataExchange directory from
C:\Demodata_Backup_ServerA on the backup (first) site to the
Demodata directory on ServerA.

Note For a many-to-one configuration, ignore the replication


template created on the backup (First) site. Instead, use the files
for the activated database, which are located in the
DataExchange directory.

11 Copy ServerA.xml from the backup (first) site to ServerA.


12 At a command prompt on the backup (first) site, type the
following:
DXact /FIRSTSITE <First Site DSN>

The command is case-insensitive.


<First Site DSN> is the DSN you specified in ServerA.xml for the
First Site.

4-22
Many-to-One Deployment using DXDeploy

13 Press Enter.
14 On ServerA, open a command prompt and type the following:
DXDeploy /Site=Partner C:\ServerA.xml

The command is case-insensitive.


15 Press Enter.
DXDeploy provides high-level status messages on the screen as
it completes its actions. DXDeploy is complete when the
command prompt reappears.
16 On ServerA, set up a replication schedule.
See “Managing Replication Schedules” on page 9-2 for how to
set up a replication schedule.
17 Bring your application back online.
18 Repeat steps 1 through 17 for each of the other Partner Sites.
Substitute “ServerB” for “ServerA” when repeating the steps for
ServerB. Substitute “ServerC” for “ServerA” when repeating the
steps for ServerC.

4-23
Real-Time Backup Deployment Models

Disaster Recovery
This section explains how to recover from the failure of one
replication site. The information assumes that the disaster occurs to
your primary site, requiring that you temporarily switch production
to your backup site. After a primary site is again provided, you then
need to reestablish the primary site/backup site replication network.
A disaster could, of course, occur to the backup site. The
information still applies; just substitute backup for primary. For ease
of discussion, and to remain consistent with terminology commonly
used to discuss disaster recovery, this section refers to primary site
and backup site. Think of them as the First Site and Partner Site,
respectively.
The information in this section applies only to a real-time backup
situation or to a 1-way situation. See the chapter “Deployment
Process” in Getting Started with Pervasive DataExchange Real-Time
Backup Edition for an explanation of real-time backup deployment.
See “DataExchange Implementation Options” on page 5-3 for an
explanation of 1-way deployment.

Failover In the event of a disaster, you must switch your users to access the
backup site. Use whatever methods are in place at your company to
accomplish switching to a different server. Such methods are many
and varied and beyond the scope of this document.
Since the backup site contains current data, your application(s)
should continue to function as before.
Once your users are accessing the backup site, reestablish your First
Site. Two disaster scenarios exist pertaining to the data on the
primary site:
„ The primary site is catastrophically destroyed and no data can be
recovered from it.
„ The primary is brought back into service and its data is still
available, but no longer current.

4-24
Disaster Recovery

No Data Use the following steps to reestablish your primary site.


Recoverable
³ To set up a new primary site
1 Install the Pervasive PSQL database product on the new
machine.
Refer to the Getting Started guides for the product edition.
2 Install Pervasive DataExchange on the new machine.
If the machine was a First Site before, install a First Site setup. If
it was a Partner Site, install the Partner Site setup. Refer to the
Getting Started guides for the product edition (Real-Time
Backup or Data Synchronization).
3 Install your application(s) on the new machine.
This creates a fresh copy of your application database on the new
machine.
4 Create the same data source name (DSN) on the primary as used
for the replication database on the backup.
5 Take your application(s) offline on the backup site.
You must ensure that the database is not being accessed until
you get the primary and backup sites synchronized.
6 Deactivate the replication database on the backup sites.
See “dxdeact” on page 7-11.
7 From the backup machine, copy the following to the same
locations on the primary machine:
Š All user database tables.
Š All data dictionary (DDF) files.
Š All replication control tables. Tables with “PDC” as the first
three characters added to the name of your data tables.
Š All replication system tables. See Table 4-1 on page 4-26.
8 Activate the replication database on the primary site.
See “dxact” on page 7-6.
9 Activate the replication database on the backup site.

4-25
Real-Time Backup Deployment Models

See “dxact” on page 7-6. Note that the activation on the backup
site performs an initial replication with the primary site. An
initial replication is a full replication, in which all data is
synchronized between the two machines.
The primary site and backup site now contain the same data.
10 Recreate any replication schedules from the primary site to the
backup site.
See “Schedule Tasks” on page 9-18.
11 Switch your users to access the primary site and bring your
application(s) back online.

Table 4-1 Replication System Tables

DACTHIST.MKD DACTSITE.MKD DACTTBL.MKD

DCMD.MKD DCMDSITE.MKD DCNF.MKD

DFKEY.MKD DFRAGF.MKD DFRAGI.MKD

DGRP.MKD DIDB.MKD DIDBDEF.MKD

DKEY.MKD DLANG.MKD DMSG.MKD

DMSGLANG.MKD DPKEY.MKD DPRM.MKD

DPRMGRP.MKD DPRMTYP.MKD DQUEUE.MKD

DSCHED.MKD DSCHEMA.MKD DSET.MKD

DSFSITE.MKD DSITE.MKD DSITEEXT.MKD

DSITELNK.MKD DSITESET.MKD DSORT.MKD

DTBLCHG.MKD DTRN.MKD DUSR.MKD

DUSRGRP.MKD DUSRPRF.MKD DVER.MKD

DWSTS.MKD

Data Use the following steps to reestablish your primary site.


Recoverable
But Not Current ³ To place an existing primary site back into replication
1 Bring the primary machine back online.
2 Take your application(s) offline.

4-26
Disaster Recovery

You must ensure that the database is not being accessed until
you get the primary and backup sites synchronized.
3 Delete all replication schedules on the primary site.
See “Schedule Tasks” on page 9-18.
4 Deactivate the replication database on both the primary and the
backup sites.
See “dxdeact” on page 7-11.
5 Activate the replication database on the primary site.
See “dxact” on page 7-6.
6 Activate the replication database on the backup site.
See “dxact” on page 7-6. Note that the activation on the backup
site performs an initial replication with the primary site. An
initial replication is a full replication, in which all data is
synchronized between the two machines.
The primary site and backup site now contain the same data.
7 Recreate any replication schedules from the primary site to the
backup site.
See “Schedule Tasks” on page 9-18.
8 Bring your application(s) back online.

4-27
Real-Time Backup Deployment Models

4-28
D ATA S YNCHRONIZATION
E DITION
chapter

Data Synchronization
Deployment Models 5
A Look at Deployment Models Available for Data Synchronization

This chapter explains conceptual information pertaining to the


various deployment methods and options available in Data
Synchronization. This chapter also provides step-by-step
instructions for each available method.
This chapter includes the following sections:
„ “Data Synchronization Deployment Methods” on page 5-2
„ “DataExchange Implementation Options” on page 5-3
„ “Working with the Examples” on page 5-6
„ “Replication Deployment Using the Deployment Tool” on page
5-11
„ “1-Way Deployment Using DXDeploy” on page 5-12
„ “1-Way Deployment Using Designer” on page 5-24
„ “2-Way Deployment Using DXDeploy” on page 5-34
„ “2-Way Deployment Using Designer” on page 5-47

5-1
Data Synchronization Deployment Models

Data Synchronization Deployment Methods


Data Synchronization offers two methods for deploying replication,
depending on database properties and business needs. The methods
are 1-way and 2-way.
To determine the best deployment method, see the following table.
It lists database properties and the best deployment method to meet
those needs. So, if your database contains the properties listed in the
first column, select the corresponding deployment method in the
second column.
Table 5-1 Data Synchronization Deployment Methods

Your Database Properties Deployment Method

If you need one or both of the following: 1-way

‹ A data replication solution to ensure that you can


restore data from a backup copy. Replication is 1-way
from one machine to another or from multiple
machines to a single backup machine.

‹ A data portal solution to ensure data backup and be


able to run reports on the backup server

If one or both of the following is true: 2-way

‹ You want a data synchronization solution (2-way


replication).

‹ You do not require sophisticated conflict handling.


That is, record conflicts can be handled at the column
level based on the most recent timestamp and other
criteria.

5-2
DataExchange Implementation Options

DataExchange Implementation Options


The deployment methods discussed in the previous section can all be
implemented using a combination of the DataExchange Designer
and the DataExchange utilities to perform the replication processes.
The following table illustrates the implementation options currently
available for each deployment method.
Table 5-2 DataExchange Implementation Options
Deployment Deployment Tool DXDeploy Utility Designer and
Method Utilities

1-Way   
2-Way   

DataExchange The DataExchange Deployment Tool is a wizard used to implement


Deployment 1-way and 2-way deployment methods. It walks you through entry
Tool of necessary information to deploy a replication database and, if
desired, create a replication schedule. The wizard creates a
deployment bundle when you deploy at the First Site. This bundle is
then used at the Partner Sites to complete the deployment. The
wizard automates designing a replication template, activating the
database for replication, synchronizing tables, peforming an initial
replication, and setting a replication schedule.
See “dpwizard” on page 7-32 for more information on the
DataExchange Deployment Tool included in this release.

DataExchange The DataExchange DXDeploy utility can be used to implement


DXDeploy 1-way and 2-way deployment methods. This command-line utility
Utility reads information from an XML descriptor file that you create to
include specific information about your database and replication
environment. You then include this file as an argument when you
execute the utility. DXDeploy uses the XML descriptor file to design
a replication template, activate the database for replication,
synchronize tables, and perform an initial replication.
DataExchange includes two different XML descriptor templates you
can use to create your specific XML descriptor file to use with
DXDeploy. You must edit the template to include necessary
information in order for DXDeploy to successfully replicate your

5-3
Data Synchronization Deployment Models

data; you cannot use the template file as-is and successfully replicate
your data. See “dxdeploy” on page 7-13 for more information on the
XML descriptor templates included in this release and how they are
used with DXDeploy.

DataExchange The DataExchange Designer and Utilities option is available for 1-


Designer and way and 2-way deployment methods. This option uses the
Utilities DataExchange Designer, DataExchange Activation utility (DXact),
and the Statistics and Log Views command to complete the required
replication processes.

Designer
The Designer provides a graphical interface for designing your
replication template. This interface allows you to easily select tables
for replication.

DXact
Activating the design templates at both the First and Partner Sites is
handled by DXact. DXact is a command-line utility included with
DataExchange.

Statistics and Log Views


An initial manual replication can be performed using the Statistics
and Log Views command, which opens the DataExchange
Monitoring Tools. The command to start the viewers is available by
right-clicking the Replication - Connected node in Pervasive
Control Center and selecting Statistics and Log Views. The Initiate
Replication dialog box allows you to choose the type of replication
to view.

Additional Information Resources


The following table lists additional resources where you can find
information about using all of the utilities discussed in this chapter
to perform the replication processes.

5-4
DataExchange Implementation Options

For More Information About Using... See...

DataExchange Designer to create Chapter 8, “Using the DataExchange


replication templates Designer”

DXact to activate your design templates Chapter 7, “Using the DataExchange


Utilities and Services”

DataExchange Monitoring Tools to Chapter 10, “Using the Replication


initiate replication Progress and Log Viewers”

Where To Go By now, you should have a good idea as to the deployment method
From Here and implementation option that is right for you. The sections that
follow provide step-by-step instructions for each of the deployment
methods and implementation options currently available.
The next table lists each deployment method and implementation
option described in this chapter and lists where to find specific
instructions for implementing each specific scenario.

DataExchange Deployment Method For step-by-step instructions


and Implementation Option

1-way using Deployment Wizard See “Replication Deployment Using the


Deployment Tool” on page 5-11

1-way using DXDeploy See “1-Way Deployment Using


DXDeploy” on page 5-12

1-way using DataExchange Designer See “1-Way Deployment Using


Designer” on page 5-24

2-way using Deployment Wizard See “Replication Deployment Using the


Deployment Tool” on page 5-11

2-way using DXDeploy See “2-Way Deployment Using


DXDeploy” on page 5-34

2-way using DataExchange Designer “2-Way Deployment Using Designer” on


page 5-47

5-5
Data Synchronization Deployment Models

Working with the Examples


This section leads you through a number of useful examples of
deployment methods. The steps you need to perform depend on
how your database was deployed. The first set of instructions
describes steps required for deployments performed using
DXDeploy. The second set of instructions describes steps needed for
deployments performed using DataExchange Designer.

Tip When working with the examples in this chapter, you should
always make a copy of your database before performing the
steps, so that you can restore the original database when you are
done. In addition, you do not need to retain the example
deployed database when you are finished. After each
deployment, you will need to perform the steps associated with
your deployment method to remove the replication files and
templates and restore your database. The following examples
explain how to remove an already deployed database from the
First Site and the Partner Site.

Removing Use these tasks to remove a database deployed using DXDeploy:


Databases 1 Deactivate the Example Database on Both Sites
Deployed with
DXDeploy 2 Run Template Remover on the First Site
3 Delete Files on the First Site
4 Delete Database and Files on the Partner Site
5 Restore the Database Copy

Deactivate the Example Database on Both Sites

³ To deactivate the example database on both sites


1 On the First Site machine, open a command prompt.
2 Type the following:
DXdeact DXDatabase

The command is case-insensitive.


3 Press Enter.

5-6
Working with the Examples

When the prompt reappears, the example database on the First


Site is deactivated.
4 Repeat these steps at a command prompt on the Partner Site.

Run Template Remover on the First Site

³ To remove the example database template on the First


Site
1 On the First Site, do one of the following:
Š Select DataExchange Template Remover from the
Pervasive group on the Start menu.
Š In PCC, select DataExchange Template Remover.
The Template Remover wizard displays its welcome dialog.
2 Click Next.
Template Remover asks you to choose a template to remove.
3 In the templates pane, click LOCAL:DXDATABASE.
4 Select Remove DataExchange System Tables and click Yes to
confirm that you wish to continue.
5 Select Remove DSN and database name and click Next.
The wizard removes the template and presents a summary.
6 Click Close.

Delete Files on the First Site

³ To delete example database files on the First Site


1 On the First Site, delete the following:
Š DataExchange directory under <DataDirectory>
Š The folder <Installation Directory
>\Replication\Templates\Dxdatabase.

5-7
Data Synchronization Deployment Models

Delete Database and Files on the Partner Site

³ To delete database files on the Partner Site


1 On the Partner Site, start PCC if it is not already running. (Select
Control Center & Documentation from the Pervasive group on
the Start menu.)
2 Expand the list of databases under Engines.
3 Right-click <DSN>, then click Delete.
The Delete Database Wizard starts.
4 Verify that <DSN> is the database name selected and that the
options Delete database name and Delete system files are
selected.
5 Click Next.
6 Click Finish.
7 Click Close.
8 Delete the DataExchange directory under C:\<DataDirectory>.

Restore the Database Copy

³ To restore the database copy


1 Open the folder to which you saved a copy of your data files
before you copied the replication files from the First Site.
2 Move or copy the files back to the folder where your original
database was located.
In this example, the location to which files restored is
\PVSW\Demodata.

Removing The tasks required to complete the removal of a database deployed


Databases using DataExchange Designer include the following:
Deployed with 1 Deactivate the Example Database on Both Sites
Designer
2 Run Template Remover on the First Site
3 Delete Database and Files on the Partner Site
4 Restore the Database Copy

5-8
Working with the Examples

Deactivate the Example Database on Both Sites

³ To deactivate the example database on both sites


For this example, the value for DSN is Demodata.
1 Run DXdeact DSN at the First Site.
2 Run DXdeact DSN at the Partner Site.

Run Template Remover on the First Site

³ To run the template remover on the First Site


1 On the First Site, Select DataExchange Template Remover
from the Pervasive group on the Start menu.
The Template Remover Wizard displays its welcome dialog.
2 Click Next.
Template Remover asks you to choose a template to remove.
3 In the templates pane, click LOCAL:DSN.
In this example, the value of DSN is Dxdatabase.

4 Select Remove DataExchange System Tables and click Yes in the


warning message to confirm that you wish to continue.
5 Select Remove DSN and database name and click Next.
The wizard removes the template and presents a summary.
6 Click Close.

5-9
Data Synchronization Deployment Models

Delete Database and Files on the Partner Site

³ To delete database files on the Partner Site


1 On the Partner Site machine, delete the contents of the folder to
which you copied the replication replication files from the First
Site.
In this example, the location is <drive>:\Documents and
Settings\All Users\Application Data\Pervasive
Software\PSQL\Demodata.
2 If you need to use the Demodata sample database again, restore
it in the next task.

Restore the Database Copy

³ To restore the database copy


1 Open the temporary folder to which you saved a copy of your
data files before you copied the replication files from the First
Site.
2 Move or copy the files back to the folder where your original
database was located.
In this example, the location to which files are restored is
<drive>:\Documents and Settings\All Users\Application
Data\Pervasive Software\PSQL\Demodata.

5-10
Replication Deployment Using the Deployment Tool

Replication Deployment Using the Deployment Tool


Data Synchronization deployment can be implemented using the
DataExchange Deployment Tool. The Deployment Tool is a step-
by-step wizard for deploying replication at First and Partner Sites
and includes a means of creating a replication schedule. The
Deployment Tool provides automation of the procedures for the
DataExchange command-line utility dxdeploy.exe.
Access the Deployment Tool from Pervasive Control Center by
selecting DataExchange Deployment Tool.

Before You Get Before you start the DataExchange Deployment Tool, we
Started recommend that you review the following deployment attributes. It
is a good idea to make note of these items for the database you are
deploying, as they are needed to complete the Deployment Tool
wizard.
„ Project Name – this corresponds to a specific database. If your
goal is to replicate a database named mydatabase, then you may
want to call the project mydatabase project or something similar.
„ Network Name – this refers to the name you have chosen to
represent the grouping of replication sites that participate in
replication.
„ Release Name – this is similar to a version number for the design
of the replication database.
„ DSN – this specifies the data source name (DSN) to be
associated with the data files deployed for replication. The DSN
must be unique on each site.
„ Directories and file names of data – this specifies the directories
and data files to be included in the replication.
For detailed information about these attributes, see “XML Attributes
in Deployment Descriptor File” on page 4-15 in Getting Started with
Pervasive DataExchange.

5-11
Data Synchronization Deployment Models

1-Way Deployment Using DXDeploy


This section provides a step-by-step discussion on deploying a
replication solution using the DXDeploy utility and the
EXPRESS.XML descriptor template to create your XML descriptor
file.
You need two machines for the example session. One machine must
have DataExchange installed as a First Site. The other machine must
have DataExchange installed as a Partner Site.
This section contains the following tasks:
1 Create the XML Descriptor File
2 Run DXDeploy on the First Site
3 Copy the Template to the Partner Site
4 Run DXDeploy on the Partner Site

Note This section covers only deployment and does not discuss
setting up a replication schedule.

Before You Get Before performing this task you must install Pervasive
Started DataExchange on First Site and a Partner Site as explained in Getting
Started with Pervasive DataExchange.

Tip So that you can restore your database to its original state
after this deployment exercise, we recommend saving a copy of
your database files before proceeding with this example.

In order to complete the changes necessary to the XML descriptor


file, we recommend that you make note of the following items:
„ Name or IP addresses for the two database servers
„ Root path for the source data
„ Directories and file names for the source data
„ Root path for the replicated data

5-12
1-Way Deployment Using DXDeploy

Caution All applications using the database you are about to


deploy must be shut down before using this deployment
method.

Create the XML ³ To create the XML Descriptor file


Descriptor File 1 Open the XML descriptor template file EXPRESS.XML in a text
editor, such as Notepad, or copy and paste the following
EXPRESS.XML text in a new file. The file is located in the
\PVSW\Replication\Docs directory.

Tip The XML Descriptor template file used in the following


example displays items that you need to change in italics. As each
entry is completed in the instructions, they are shown in bold.

Note The <!-- and --> tags indicate comments and are ignored
by DXDeploy. The comments included in the template files are
intended as informational and may be edited or deleted.

You should see something similar to the following.


<?xml version="1.0" ?>
<DXDeployment>
<Configuration Project="DXProj" Network="DXNet"
Release="1.0" Method="1-way">

<!--
The express deployment requires knowing the following:
- the names or IP addresses of the two database servers
- the root path of the source data
- the directories and file names of the source data
- the root path to which the data should be replicated
-->

<Sites>
<First ServerName="this.hostname"
DSN="DXDatabase" DataDirectory="C:\MYDATA">

<!--
In <Files>, enter paths of data files.

5-13
Data Synchronization Deployment Models

Both Include and Exclude paths have the following


properties:
Relative paths are relative to DataDirectory given in
<First>.
Paths can specify files (not directories) individually
or by wildcard.
Subdirectories in paths are not automatically included.

Subdirectories for include and exclude are supported.


For example,
<Include Path="MoreData\dataFile.mkd" />
<Exclude Path="OtherData\*" />
-->

<Files>
<Include Path="*.mkd" />
<Include Path="*.btr" />
<Include Path="*.dat" />

<!--
We recommend replicating DDFs. See the User's Guide for
more info.
-->

<Include Path="*.ddf" />


</Files>
</First>

<Partner ServerName="remote.hostname"
DSN="DXDatabase" DataDirectory="C:\MYDATA" />
</Sites>
</Configuration>

</DXDeployment>

Caution You must edit the XML Descriptor file to include the
required information in order for DXDeploy to successfully
replicate your data.

5-14
1-Way Deployment Using DXDeploy

2 Save EXPRESS.XML as EXP_1WAY.XML.


Saving the template file with a new name retains the
EXPRESS.XML template for you to use again. You may save the
file to the location of your choice on your First Site machine. For
ease of discussion, this task assumes that you saved it to
C:\PVSW\Replication\Docs.

Tip In the event the EXPRESS.XML file is no longer available on


your system, copy the text included in this file to recreate a
template descriptor file.

Configuration Project
You will first enter the information needed by DXDeploy to
configure your replication project. This information includes
your replication project name, network and release.
In your newly created EXP_1WAY.XML file, find the following:
<Configuration Project="DXProj" Network="DXNet"
Release="1.0" Method="1-way">

1 In the Configuration Project entry, specify as project name for


your design. This name is of your own choosing, and we
recommend a name that helps you remember which database is
involved. The project name is limited to 20 characters.
For example, if you are replicating a database named
mydatabase, then you might name the project mydbproject.
Using this as our example, change DXProj to mydbproject. The
line would now read:
<Configuration Project="mydbproject"
Network="DXNet" Release="1.0" Method="1-way">

2 The next entry is your replication network name. This name


represents the group of sites that will participate in your
replication. The network name is limited to 20 characters.
For example, if the sites included in your replication network are
sites in the sales department, then you could name your network
sales dept net. Using this as our example, change DXNet to sales
dept net. The line would now read:

5-15
Data Synchronization Deployment Models

<Configuration Project="mydbproject" Network="sales


dept net" Release="1.0" Method="1-way">

3 Enter a release name for this replication design. The release is


similar to a version number for the replication database design.
Your first design might be release 1.0. You could then make the
next design on this database as 2.0, as so on. The release name is
limited to 8 characters.
For our example, we’ll make this release name 1.0, since it’s our
first design on this replication database. Using this example, the
line would now read:
<Configuration Project="mydbproject" Network="sales
dept net" Release="1.0" Method="1-way">

4 Enter a replication method to use for this design. The method


you select depends on your database. The only choices that
DXDeploy can successfully replicate with are 1-way or 2-way. If
you are uncertain of the method you should use, see “Data
Synchronization Deployment Methods” on page 5-2 for
database properties and corresponding deployment methods.
Because this example illustrates 1-way deployment, you will
retain the 1-way entry. Our example would now read:
<Configuration Project="mydbproject" Network="sales
dept net" Release="1.0" Method="1-way">

Sites - First ServerName


Next, you will enter the First ServerName information needed
by DXDeploy. This information includes the name of your First
Site machine, the DSN you wish to associate with your
replication design, and the data directory location for the data
with which you want to replicate. See “Database Selection” on
page 8-4, for conceptual information about the First
ServerName and DataDirectory entries.
<First ServerName="this.hostname" DSN="DXDatabase"
DataDirectory="C:\MYDATA">

1 In the First ServerName entry, specify the machine name or IP


address of your First Site machine.
For example, if the name of your First Site is SiteA, change
this.hostname to SiteA. The line would now read:

5-16
1-Way Deployment Using DXDeploy

<First ServerName="SiteA" DSN="DXDatabase"


DataDirectory="C:\MYDATA">

Note “Localhost” is not permitted as the machine name.

2 In the DSN entry, specify the Data Source Name (DSN) that you
want DXDeploy to associate with your replication database.
For example, if the database you are replicating contains all the
data for the sales department, you might enter a DSN named
SalesDB. Using this example, change DXDatabase to SalesDB.
The line would now read:
<First ServerName="SiteA" DSN="SalesDB"
DataDirectory="C:\MYDATA">

3 The DataDirectory entry specifies the directory location on the


machine specified as First ServerName where the database
resides. In other words, the path to the root directory of the data
files on the First Site.
For example, the location of your sales database is on your First
Site machine at the C:\CompanyData\SalesData location. Using
this as our example, you would change C:\MYDATA to
C:\CompanyData\SalesData. The line would now read:
<First ServerName="SiteA" DSN="SalesDB"
DataDirectory="C:\CompanyData\SalesData">

Files
Now you need to specify the tables in your database that you
want to include and exclude from your replication design. In
simplest terms, you specify the data you want to replicate and
the data you don’t want to replicate. See “Replicated Tables” on
page 8-7 for conceptual information about selecting tables for
replication.
The Include Path entries listed here are not all required; they
simply illustrate the file formats accepted by DXDeploy. The
template includes the following examples:
<Include Path="*.mkd" />

<Include Path="*.btr" />

5-17
Data Synchronization Deployment Models

<Include Path="*.dat" />

<Include Path="*.ddf" />

1 First, eliminate any references to file types that are not applicable
for your database.
Because the Sales database that we are using was created in
Pervasive Control Center using the Create Database wizard, the
data files have the .mkd or .ddf file extensions. For this example,
delete <Include Path="*.dat" /> and <Include Path="*.btr" />
references. (These entries are shown next with strikethrough
applied.)
<Files>
<Include Path="*.mkd" />
<Include Path="*.btr" />
<Include Path="*.dat" />

<Include Path="*.ddf" />

2 By using the wildcard (*) character, the list of files to include


contains all of the .mkd and .ddf files in the DataDirectory path.
Because the database has data dictionary files (DDFs), retain the
<Include Path="*.ddf" /> line. Typically, you want to replicate
your DDFs to maintain a backup version of them. Note that the
DSN created by DXDeploy will not use the database DDFs.
DXDeploy creates its own DDFs for specific use by replication.
The Files section now looks something like this:
<Files>
<Include Path="*.mkd" />

<Include Path="*.ddf" />

3 The Include Path statements are relative to the DataDirectory


path you specified and not recursive in nature. This means that
only the files under C:\CompanyData\SalesData\ are included.
Subdirectories are excluded automatically, unless you
specifically add them. The comments section of this file provides
you with two examples to include and exclude files outside of the
DataDirectory location.
<Include Path="MoreData\dataFile.mkd" />

<Exclude Path="OtherData\*" />

5-18
1-Way Deployment Using DXDeploy

So as an example, to add a subdirectory named SalesReports,


change the <Include Path="MoreData\dataFile.mkd" /> to
<Include Path="SalesReports\*" /> and add it to the Files
section. Now, the Files section should look similar to the
following:
<Files>
<Include Path="*.mkd" />

<Include Path="*.ddf" />

<Include Path="SalesReports\*" />

4 The Exclude Path statements are relative to the DataDirectory


path you specified, just as the Include Path statements. Use the
example <Exclude Path="OtherData\*" /> statement to omit
files from your replication design.
For example, if you wanted to exclude a file named Q1Rept
located in the SalesReports subdirectory you just added, you
would change the <Exclude Path="OtherData\*" /> to <Exclude
Path="SalesReports\Q1Rept.mkd" />. Now, the files section
should look similar to the following:
<Files>
<Include Path="*.mkd" />

<Include Path="*.ddf" />

<Include Path="SalesReports\*" />

<Include Path="SalesReports\Q1Rept.mkd" />

Another exclude example would be to exclude the leads table


from the Sales Database replication design. Because statements
are relative to the DataDirectory path you specified, you would
add <Exclude Path="leads.mkd" /> to your descriptor file. Now,
the files section should look similar to the following:
<Files>
<Include Path="*.mkd" />

<Include Path="*.ddf" />

<Include Path="SalesReports\*" />

<Include Path="SalesReports\Q1Rept.mkd" />

<Include Path="leads.mkd" />

5-19
Data Synchronization Deployment Models

The next example illustrates how to use an Include Path


statement with an absolute path location. Because
DataExchange supports the use of absolute paths, we can add a
table located outside the DataDirectory location specified. It is
important to note that absolute paths, if specified, must all start
with the same drive letter, which must be the same drive letter
specified by DataDirectory.
For our example, you would add <Include
Path="C:\Employee\SalesRep\sample.mkd" /> to your
descriptor file. This statement includes a table named
sample.mkd located at C:\Employee\SalesRep, which is outside
the DataDirectory location specified. Now, the files section
should look similar to the following:
<Files>
<Include Path="*.mkd" />

<Include Path="*.ddf" />

<Include Path="SalesReports\*" />

<Include Path="SalesReports\Q1Rept.mkd" />

<Include Path="leads.mkd" />

<Include Path="C:\Employee\SalesRep\sample.mkd" />

Sites - Partner ServerName


Next, you will enter the Partner ServerName information. This
information includes the machine name or IP Address of your
Partner Site, the DSN you wish to associate with your replication
design, and the data directory location for the data which you
want to replicate.
<Partner ServerName="remote.hostname" DSN="DXDatabase"
DataDirectory="C:\MYDATA" />

1 Specify the machine name or IP address for your Partner Site.


For example, if the machine name of your Partner Site is SiteB,
you would change remote.hostname to SiteB. The entry would
now look like the following:
<Partner ServerName="SiteB" DSN="DXDatabase"
DataDirectory="C:\MYDATA" />

5-20
1-Way Deployment Using DXDeploy

2 In the DSN entry, specify the Data Source Name (DSN) that you
are associating with your replication database.
For this example, change DSN="DXDatabase" to
DSN="SalesDB". The line would now read:
<Partner ServerName="SiteB" DSN="SalesDB"
DataDirectory="C:\MYDATA" />

3 Specify the absolute path to the root directory of the data files on
the Partner Site.
For our example, in the line for Partner Servername, change
DataDirectory="C:\MYDATA" to
DataDirectory="C:\CompanyData\SalesData".
The line should read something similar to the following:
<Partner ServerName="SiteB" DSN="SalesDB"
DataDirectory="C:CompanyData\SalesData" />

4 Make sure to save your file once all the changes are made.

Run DXDeploy ³ To run DXDeploy on the First Site


on the First Site 1 On the First Site, open a command prompt and type the
following:
DXDeploy C:\PVSW\Replication\Docs\EXP_1WAY.XML

The command is case-insensitive.


2 Press Enter.
As DXDeploy executes, high-level status messages display on the
screen as it completes certain actions. For a successful
deployment, the following messages appear:
Š Starting the CreateDSN action
Š Starting the Design action
Š Starting the Activate action
Š Activation done, now synchronizing tables
By default, detailed messages from DXDeploy are written to
dxdeploy.log, not to the screen. This log is located in the
<Installation Directory >\Replication\LogFiles folder. If you
want to view detailed messages on the screen while DXDeploy
executes, use the /LOGFILE= option.

5-21
Data Synchronization Deployment Models

3 For example, you would type the following:


DXDeploy /LOGFILE= C:\PVSW\Replication\Docs\EXP_1WAY.XML

DXDeploy is complete when the command prompt reappears.


You may also check the DXDeploy log file to determine when
DXDeploy completes. The following message appears at the
bottom of the log file: “Successfully completed all deployment
actions.”
1 Optionally, start PCC if it is not already running. (Select Control
Center & Documentation from the Pervasive group on the Start
menu.)
2 In Pervasive PSQL Explorer under Engines, open the SalesDB
database branch. Notice that SalesDB is now listed as a database
with the A icon shown on its Replication node. This indicates
that the database is activated.

Figure 5-1 SalesDB Database Activated on First Site

Copy the ³ To copy the template to the Partner Site


Template to the 1 After DXDeploy completes on the First Site, copy the SalesData
Partner Site directory from \PVSW\Replication\Templates\SalesDB to
C:\CompanyData on your Partner Site.

Note Note that the example used here contains data files in both
relative and absolute locations. When copying your files, you
must include absolute paths to data residing outside the
DataDirectory location you specified. For information on where
to copy your files, see “File Copying” on page 4-18 in Getting
Started with Pervasive DataExchange.

5-22
1-Way Deployment Using DXDeploy

Tip When using DXDeploy deployment, the template consists of


a copy of the database files. These files are all located in the
directory C:\PVSW\Replication\Templates.

Run DXDeploy ³ To run DXDeploy on the Partner Site


on the Partner 1 On the Partner Site, open a command prompt.
Site
2 At the prompt, you would type the following:
DXDeploy C:\CompanyData\SalesData\EXP_1WAY.XML

The command is case-insensitive.


3 Press Enter.
DXDeploy provides high-level status messages on the screen as
it completes certain actions. For a successful deployment, the
following messages appear:
Š Starting the CreateDSN action
Š Starting the Design action
Š Starting the Activate action
By default, detailed messages from DXDeploy are written to
dxdeploy.log, not to the screen. DXDeploy is complete when the
command prompt reappears. You may also check the DXDeploy
log file to determine when DXDeploy completes. The following
message appears at the bottom of the log file: “Successfully
completed all deployment actions.”
When DXDeploy runs on the Partner Site, it performs an initial
replication with the First Site. This replication populates data on the
Partner Site so that it is the same as on the First Site.

Note Depending on database size and connection bandwidth,


initial replication can take from a few minutes to several hours.

Tip For steps to remove the deployed database you just created,
see “Working with the Examples” on page 5-6 and “Removing
Databases Deployed with DXDeploy” on page 5-6.

5-23
Data Synchronization Deployment Models

1-Way Deployment Using Designer


This section describes how to perform an example 1-way Data
Synchronization replication between a First Site and a Partner Site.
Conducting the example session is optional, but recommended.
You need two machines for the example session. One machine must
have DataExchange installed as a First Site. The other machine must
have DataExchange installed as a Partner Site.
The following steps use the sample Tracker database provided with
the installation of DataExchange.
The tasks required to complete this type of replication include the
following:
1 Create a Template on the First Site Using Designer
2 Copy First Site Files to the Partner Site
3 Activate the First Site Template
4 Activate the Partner Site Template
5 Initiate Replication
6 Verify the Changes Were Replicated

Before You Get Before performing this task you must install Pervasive
Started DataExchange on a First Site and a Partner Site as explained in
Getting Started with Pervasive DataExchange.
We strongly recommend that you shut down all applications using
the database you are about to deploy before using this deployment
method.

Tip So that you can restore your database to its original state
after this deployment exercise, we recommend saving a copy of
your database files before proceeding with this example.

Note Currently, you must have an ODBC-compliant DSN and


DDFs in order to use the DataExchange Designer for this
deployment method.

5-24
1-Way Deployment Using Designer

Create a ³ To create a template on the First Site


Template on 1 On the First Site machine, start PCC if it is not already running.
the First Site (Select Control Center & Documentation from the Pervasive
Using Designer group on the Start menu.)
2 In PCC, select DataExchange Designer.
The Designer wizard asks you to specify the data to be replicated.

Figure 5-2 Data Location

3 For this example, enter Tracker in the Location field, leave


1-way selected as the default method, and click Next.
The wizard asks you to identify the replication project, network,
and release. These names are of your own choosing to help keep
track of what you need to replicate.
4 For this example, enter the following:
Š Project: DX_1WayTest
Š Network: Test
Š Release: 1.0
Project and network names are limited to 20 characters, and the
release name must be 8 characters or less.
The names for project, network, and release are of your own
choosing and help you identify and keep track of what you need
to replicate.
5 Click Next.
The wizard provides a summary of your input for the replication
project.
6 Click Finish.

5-25
Data Synchronization Deployment Models

A message informs you that DataExchange Designer is creating


the replication system tables. After the replication system tables
are created, DataExchange Designer opens.
Notice that DataExchange Designer initially lists the tables in the
Tracker sample database in the Not Replicated tab.

Figure 5-3 DataExchange Designer

7 Select all of the tables. Press the Shift key and, while holding it
down, click the last table in the list.

Figure 5-4 DataExchange Designer with All Tables Selected

8 Right-click the selected tables, then click Replicate Table.

Figure 5-5 Replicate Table Command in DataExchange Designer

5-26
1-Way Deployment Using Designer

All of the tables move from the Not Replicated tab to the
Replicated tab. The view on the right shows the information for
the selected table on the Replicated tab.

Figure 5-6 View of Replicated Tables in DataExchange Designer

9 Click File Save to save your work.


10 Click Tools Create Replication Template. A message about
starter data appears.

See “Design Completion,” on page 8-7 for more information


about starter data.
11 Leave the selected default option Prepare database data for
replication to other sites and click OK.
Messages inform you that DataExchange Designer is preparing
the database for activation then preprocessing the existing
(starter) data. After the data has been preprocessed, another
message informs you that the template has been created.

12 Click OK to complete the template creation process.


13 Select File Exit to close the Designer wizard.

5-27
Data Synchronization Deployment Models

Next, you will copy all of the files from the Demodb folder to
your Partner Site.

Copy First Site ³ To copy the First Site files to the Partner Site
Files to the 1 From the First Site, copy all of the files from the folder
Partner Site PVSW\Replication\Demodb to the same folder on the Partner
Site.
2 Answer Yes to confirm file replacement.

Note When using DataExchange Designer deployment, the


template includes the actual database files. If your database
contains files in other directories, you must copy them to the
same path on the Partner Site as on the First Site.

Activate the ³ To activate the template at the First Site


First Site The command-line utility dxact activates the databases.
Template
1 On the First Site, open a command prompt.
2 At the prompt, type the following:
dxact /FIRSTSITE Tracker

Capitalization is for emphasis. The command is case-insensitive.


3 Press Enter.
By default, messages from Dxact are written to dxact.log, not to
the screen. This log is located in the <Installation Directory
>\Replication\LogFiles folder. If you want to view messages on
the screen while Dxact executes, use the /LOGFILE= option. For
example, at the command prompt you would enter the
following:
dxact /FIRSTSITE Tracker /LOGFILE=

See “dxact” on page 7-6 in Pervasive DataExchange User’s Guide


for more information about the Dxact utility.
The activation process is complete when the command prompt
reappears. You now need to activate Tracker on the Partner Site.

5-28
1-Way Deployment Using Designer

Activate the ³ To activate the template at the Partner Site


Partner Site 1 At a command prompt on the Partner Site machine, type the
Template following:
dxact /PARTNERNETADDR=address Tracker

where address is the name or IP address of the First Site machine.


For example, if the First Site is a machine named TM, the
command would be
dxact /PARTNERNETADDR=TM Tracker

The /PARTNERNETADDR option indicates the Partner Site address.


Capitalization is for emphasis. The command is case-insensitive.
2 Press Enter.
The activation process is complete when the command prompt
reappears. You have now activated both your First Site and
Partner Site databases.
3 Close the command prompt.
1 On the Partner Site, start PCC if it is not already running. (Select
Control Center & Documentation from the Pervasive group on
the Start menu.)
2 In Pervasive PSQL Explorer under Engines, open the Tracker
database branch. Notice that Tracker database is now listed as a
database with the A icon shown on its Replication node. This
indicates that the database is activated.
In PCC on the First Site, the status for Tracker on that machine
should also show an A. If you don’t see the A icon, right-click the
Replication node and select Refresh. The Partner Site in this
example is named DL.

5-29
Data Synchronization Deployment Models

Figure 5-7 Activated Indicator in Pervasive PSQL Explorer

Now that your First Site and Partner Site databases are activated,
you are ready to replicate data between them.

Make Sample ³ To change the database records


Database You may change records in your database from either site.
Changes DataExchange replicates data and synchronizes each database as
changes are made, whether the changes occur at the First Site or the
Partner Site. For the sake of this example, the following steps assume
that you are performing the actions from the First Site.
1 Start PCC if it is not already running. (Select Control Center &
Documentation from the Pervasive group on the Start menu.)
2 Click the Tables node for the Tracker database.
3 Right-click table Customer and click Open, or double-click it.
SQL Editor opens and displays all records in table Customer.
4 Position the cursor in the NameStr field for CustomerID 1.
5 Change the NameStr from American Network Group to
Worldwide Distributors. You may need to press the Insert key
before you can change the string.
6 Close SQL Editor.
This saves the change to the Customer table.

5-30
1-Way Deployment Using Designer

Initiate ³ To replicate data from First Site to Partner Site


Replication You may initiate replication from either site. These steps assume that
you are performing the actions from the First Site.
1 In PCC, right-click the Replication - Connected node in
Pervasive PSQL Explorer and select Statistics and Log Views.

Figure 5-8 Starting Statistics View Utility

The Replication Progress and Log Viewers open.

Figure 5-9 Replication Progress and Log Viewers

2 In the toolbar, click the Initiate replication icon .


The Initiate Replication dialog appears.

5-31
Data Synchronization Deployment Models

Figure 5-10 Initiate Replication Dialog

In this example, note that the source database is Tracker (TM)


on your First Site and the database to replicate with is Tracker
(DL) on your Partner Site.
3 Click Replicate.
The replication process begins. The Replication Progress Viewer
reports the operation.

5-32
1-Way Deployment Using Designer

Figure 5-11 Example Replication Process in Statistics View Utility

4 Notice that the Completed column reports “successful.”


5 Select File Exit to close the viewers.
Your next task is to verify that the data changes were replicated
from Tracker (TM) to Tracker (DL).

Verify the ³ To verify the changes were replicated


Changes Were 1 In PCC on the Partner Site, open the Tables node for the Tracker
Replicated database, right-click the Customer table, and select Open, or
double-click the table.
SQL Editor opens and displays customer data.
2 Note that the change you made to Tracker has been replicated to
the Partner Site.
3 Close SQL Editor.
You have completed this deployment exercise.

Tip For steps to remove the deployed database you just created,
see “Working with the Examples” on page 5-6 and “Removing
Databases Deployed with Designer” on page 5-8.

5-33
Data Synchronization Deployment Models

2-Way Deployment Using DXDeploy


This section provides a high level discussion for how to deploy a
database for replication using the DXDeploy utility. This section
uses the sample database, TRACKER, as a working example.
TRACKER is provided with the installation of the Pervasive PSQL
Server or Workgroup product.
You need two machines for the example session. One machine must
have DataExchange installed as a First Site. The other machine must
have DataExchange installed as a Partner Site.
This section contains the following tasks:
1 Create the XML Descriptor File
2 Run DXDeploy on the First Site
3 Copy the Template to the Partner Site
4 Run DXDeploy on the Partner Site
This section omits setting up a replication schedule. Since the
TRACKER deployment is only an example, setting up a regular
replication schedule is unnecessary.

Before You Get Before performing this task you must install Pervasive
Started DataExchange on a First Site and a Partner Site as explained in
Getting Started with Pervasive DataExchange.

Tip So that you can restore your database to its original state
after this deployment exercise, we recommend saving a copy of
your database files before proceeding with this example.

In order to complete the changes necessary to the XML descriptor


file, we recommend that you make note of the following items:
„ Name or IP addresses for the two database servers
„ Root path for the source data
„ Directories and file names for the source data
„ Root path for the replicated data

5-34
2-Way Deployment Using DXDeploy

Caution All applications using the database you are about to


deploy must be shut down before using this deployment
method.

Create the XML ³ To create the XML Descriptor file


Descriptor File 1 Open the XML descriptor file CUSTOM.XML in a text editor, or
copy and paste the following CUSTOM.XML text in a new file.
The file is located in the \PVSW\Replication\Docs directory.

Tip The XML Descriptor template file used in the following


example displays items that you need to change in italics. As each
entry is completed in the instructions, they are shown in bold.

Note The <!-- and --> tags indicate comments and are ignored
by DXDeploy. The comments included in the template files are
intended as informational and may be edited or deleted.

You should see something similar to the following.


<?xml version="1.0"?>
<DXDeployment>

<!--
Change Method to "2-way" for 2-way Data Synchronization
deployments.
-->

<Configuration Project="DXProj" Network="DXNet"


Release="1.0" Method="1-way">

<!--
In <Sites>, enter hostnames or IP addresses of First and
Partner sites. Do not enter "localhost". Specify
DataDirectory presently containing data files on
First Site, and DataDirectory to contain data files
on Partner Site.
-->

<Sites>

5-35
Data Synchronization Deployment Models

<First ServerName="this.hostname" DSN="DXDatabase"


DataDirectory="C:\MYDATA">

<!--
In <Files>, enter paths of data files.
Both Include and Exclude paths have the following
properties:
Relative paths are relative to DataDirectory given in
<Sites>.
Absolute paths must all start with the same drive letter,
which must be the same drive letter as in DataDirectory.
Absolute paths cannot be used if sites are located on the
same server.
Paths can specify files (not directories) individually
or by wildcard.
Paths are not recursive (subdirectories are not
included.)
Subdirectories for include and exclude are supported.
Examples below.
-->

<Files>
<Include Path="*.mkd" />
<Include Path="MoreData\dataFile.dat" />
<Exclude Path="DontNeed.dat" />
<Include Path="C:\OtherDir\*" />
<Exclude Path="C:\OtherDir\Temp*" />

<!--
DDF changes can be replicated, but will not become
automatically effective in the schema of partner
database.
-->

<Include Path="*.ddf" />


</Files>
</First>

<Partner ServerName="remote.hostname" DSN="DXDatabase"


DataDirectory="C:\MYDATA" />
<!--
<Files> is not applicable in <Partner>; files in <First>
are used.

5-36
2-Way Deployment Using DXDeploy

-->

</Sites>
</Configuration>

<!--
Optionally, remove actions to be omitted. An empty
<Actions> section will only validate this deployment
descriptor. Actions can only be removed from the end
of the list (e.g. remove Activate, or remove Activate
and Design.)
-->

<Actions>
<CreateDSN />
<Design />
<Activate />
</Actions>

</DXDeployment>

Caution You must edit the XML Descriptor file to include the
required information in order for DXDeploy to successfully
replicate your data.

2 Save CUSTOM.XML as CUST_2WAY.XML.


You may save the file to the location of your choice on your First
Site machine. For ease of discussion, this task assumes that you
save it to C:\PVSW\Replication\Docs.

Tip In the event the CUSTOM.XML file is no longer available on


your system, copy the text included in this file to recreate a
template descriptor file.

Configuration Project
You will first enter the information needed by DXDeploy to
configure your replication project. This information includes
your replication project name, network and release.

5-37
Data Synchronization Deployment Models

In your newly created CUST_2WAY.XML file, find the


following:
<Configuration Project="DXProj" Network="DXNet"
Release="1.0" Method="1-way">

1 In the Configuration Project entry, specify as project name for


your design. This name is of your own choosing, and we
recommend a name that helps you remember which database is
involved. The project name is limited to 20 characters.
For example, if you are replicating a database named
mydatabase, then you might name the project mydbproject.
Using this as our example, change DXProj to mydbproject. The
line would now read:
<Configuration Project="mydbproject"
Network="DXNet" Release="1.0" Method="1-way">

2 The next entry is your replication network name. This name


represents the group of sites that will participate in your
replication. The network name is limited to 20 characters.
For example, if the sites included in your replication network are
sites in the administration department, then you could name
your network admin dept net. Using this as our example, change
DXNet to admin dept net. The line would now read:
<Configuration Project="mydbproject" Network="admin
dept net" Release="1.0" Method="1-way">

3 Enter a release name for this replication design. The release is


similar to a version number for the replication database design.
Your first design might be release 1.0. You could then make the
next design on this database as 2.0, as so on. The release name is
limited to 8 characters.
For our example, we’ll make this release name 1.0, since it’s our
first design on this replication database. Using this example, the
line would now read:
<Configuration Project="mydbproject" Network="admin
dept net" Release="1.0" Method="1-way">

5-38
2-Way Deployment Using DXDeploy

4 Enter a replication method to use for this design. The method


you select depends on your database. The only choices that
DXDeploy can successfully replicate with are 1-way or 2-way. If
you are uncertain of the method you should use, see “Data
Synchronization Deployment Methods” on page 5-2 for
database properties and corresponding deployment methods.
Because this example illustrates 2-way deployment, change the
1-way entry to 2-way. Our example would now read:
<Configuration Project="mydbproject" Network="admin
dept net" Release="1.0" Method="2-way">

Sites - First ServerName


Next, you will enter the First ServerName information needed
by DXDeploy. This information includes the name of your First
Site machine, the DSN you wish to associate with your
replication design, and the data directory location for the data
with which you want to replicate. See “Database Selection” on
page 8-4, for conceptual information about the First
ServerName and DataDirectory entries.
<First ServerName="this.hostname" DSN="DXDatabase"
DataDirectory="C:\MYDATA">

1 In the First ServerName entry, specify the machine name or IP


address of your First Site machine.
For example, if the name of your First Site is SiteA, change
this.hostname to SiteA. The line would now read:
<First ServerName="SiteA" DSN="DXDatabase"
DataDirectory="C:\MYDATA">

Note “Localhost” is not permitted as the machine name.

2 In the DSN entry, specify the Data Source Name (DSN) that you
want DXDeploy to associate with your replication database.
Since our example uses the Tracker database, you might enter a
DSN named TrackerDB. Using this example, change
DXDatabase to TrackerDB. The line would now read:

5-39
Data Synchronization Deployment Models

<First ServerName="SiteA" DSN="TrackerDB"


DataDirectory="C:\MYDATA">

3 The DataDirectory entry specifies the directory location on the


machine specified as First ServerName where the database
resides. In other words, the path to the root directory of the data
files on the First Site.
For example, the location of your Tracker database is on your
First Site machine at the <Installation Directory
>\Replication\Demodb location. Using this as our example, you
would change C:\MYDATA to C:\PVSW\Replication\Demodb.
The line would now read:
<First ServerName="SiteA" DSN="TrackerDB"
DataDirectory="C:\PVSW\Replication\Demodb">

Files
Now you need to specify the tables in your database that you
want to include and exclude from your replication design. In
simplest terms, you specify the data you want to replicate and
the data you don’t want to replicate. See “Replicated Tables” on
page 8-7 for conceptual information about selecting tables for
replication.
The Include and Exclude Path entries listed here are not all
required; they simply illustrate examples of how Include and
Exclude Path statements can be structured. The template
includes the following examples:
<Include Path="*.mkd" />

<Include Path="MoreData\dataFile.dat" />

<Exclude Path="DontNeed.dat" />

<Include Path="C:\OtherDir\*" />

<Exclude Path="C:\OtherDir\Temp*" />

1 First, include the .mkd files for the database. By using the
wildcard (*) character, you can include all of the .mkd files in the
DataDirectory path using one statement.

5-40
2-Way Deployment Using DXDeploy

Because the Tracker database that we are using is a SQL


database, the data files have the .mkd file extension. For this
example, you will retain the <Include Path="*.mkd" />
statement to include all of your Tracker data files. The Files
section now looks something like this:
<Files>

<Include Path="*.mkd" />

<Include Path="MoreData\dataFile.dat" />

<Exclude Path="DontNeed.dat" />

<Include Path="C:\OtherDir\*" />

<Exclude Path="C:\OtherDir\Temp*" />

2 Specify the path and file names for any files you want to include
or exclude that are located in a subdirectory of the Data
Dictionary path you specified.
For example, say you have a subdirectory called
C:\PVSW\Replication\Demodb\Misc, which contains
misc_file1.dat, misc_file2.dat, and misc_file3.dat. You want to
include all of these files except misc_file3.dat. You would change
<Include Path="MoreData\dataFile.dat" /> to <Include
Path="Misc\*.dat" />. Then you would change <Exclude
Path="DontNeed.dat" /> to <Exclude
Path="Misc\misc_file3.dat" />. The entry would look
something like this:
<Include Path="*.mkd" />
<Include Path="Misc\*.dat" />
<Include Path="Misc\misc_file3.dat" />

Another example would be to include or exclude data that falls


outside of the DataDictionary path you specified, or at an
absolute path location. In other words, data you want to
replicate that does not reside in C:\PVSW\Replication\Demodb,
but instead resides at the C:\Archive location. Because
DataExchange supports the use of absolute paths, we can add a
table located outside the DataDirectory location specified. It is
important to note that absolute paths, if specified, must all start
with the same drive letter, which must be the same drive letter
specified by DataDirectory.

5-41
Data Synchronization Deployment Models

For our example, we’ll say that there is one file at this location
that you want to exclude from the replication design; this file is
C:\Archive\History.dat. You would change <Include
Path="C:\OtherDir\*" /> to <Include Path="C:\Archive\*.dat" /
>. Then you would change <Exclude
Path="C:\OtherDir\Temp*" /> to <Exclude
Path="C:\Archive\History.dat" />. Now, the files section should
look similar to the following:
<Files>
<Include Path="*.mkd" />
<Include Path="Misc\*.dat" />
<Include Path="Misc\misc_file3.dat" />
<Include Path="C:\Archive\*.dat" />

<Include Path="C:\Archive\History.dat" />

3 Specify the path to the data dictionary files that you want to
replicate.
Because TRACKER has data dictionary files (DDFs), retain the
<Include Path="*.ddf" /> line. Typically, you want to replicate
your DDFs to maintain a backup version of them. Note that the
DSN created by DXDeploy does not use TRACKER’s DDFs.
DXDeploy creates its own DDFs for specific use by replication.
The completed Files section now looks something like this:
<Files>
<Include Path="*.mkd" />
<Include Path="Misc\*.dat" />
<Include Path="Misc\misc_file3.dat" />
<Include Path="C:\Archive\*.dat" />

<Include Path="C:\Archive\History.dat" />

<Include Path="*.ddf" />

Sites - Partner ServerName


Next, you will enter the Partner ServerName information. This
information includes the machine name or IP Address of your
Partner Site, the DSN you wish to associate with your replication
design, and the data directory location for the data which you
want to replicate.

5-42
2-Way Deployment Using DXDeploy

<Partner ServerName="remote.hostname"
DSN="DXDatabase" DataDirectory="C:\MYDATA" />

1 Specify the machine name or IP address for your Partner Site.


For example, if the machine name of your Partner Site is SiteB,
you would change remote.hostname to SiteB. The entry would
now look like the following:
<Partner ServerName="SiteB" DSN="DXDatabase"
DataDirectory="C:\MYDATA" />

2 In the DSN entry, specify the Data Source Name (DSN) that you
are associating with your replication database.
For this example, change DSN="DXDatabase" to
DSN="TrackerDB". The line would now read:
<Partner ServerName="SiteB" DSN="TrackerDB"
DataDirectory="C:\MYDATA" />

3 Specify the absolute path to the root directory of the data files on
the Partner Site.
For our example, in the line for Partner Servername, change
DataDirectory="C:\MYDATA" to
DataDirectory="C:\PVSW\Replication\Demodb".
The line should read something similar to the following:
<Partner ServerName="SiteB" DSN="TrackerDB"
DataDirectory="C:\PVSW\Replication\Demodb" />

Actions
Optionally, you can specify actions for DXDeploy to initiate or omit
by removing one or more of the Action statements. It is important to
note that you can only remove these statements from the bottom up.
In other words, you cannot remove <Design /> without removing
<Activate /> or DXDeploy will not run successfully.
<CreateDSN />
<Design />

<Activate />

5-43
Data Synchronization Deployment Models

Note If you remove all of the Action statements, all actions will
be performed.

1 To perform all the actions available, your Actions section should


now look something like the following:
<Actions>
<CreateDSN />
<Design />
<Activate />

</Actions>

Or remove the section completely to perform all the Actions.


2 Make certain to save your file once all the changes are made.

Run DXDeploy ³ To run DXDeploy on the First Site


on the First Site 1 On the First Site, open a command prompt.

2 At the prompt, you would type the following:


DXDeploy C:\PVSW\Replication\Docs\CUST_2WAY.XML

The command is case-insensitive.


3 Press Enter.
DXDeploy provides high-level status messages on the screen as
it completes certain actions. For a successful deployment, the
following messages appear:
Š Starting the CreateDSN action
Š Starting the Design action
Š Starting the Activate action
Š Activation done, now synchronizing tables
By default, detailed messages from DXDeploy are written to
dxdeploy.log, not to the screen. This log is located in the
<Installation Directory >\Replication\LogFiles folder. If you
want to view detailed messages on the screen while DXDeploy
executes, use the /LOGFILE= option. For example, DXDeploy /
LOGFILE= CUST_2WAY.XML. (A space character follows the equal
sign.)

5-44
2-Way Deployment Using DXDeploy

DXDeploy is complete when the command prompt reappears.


You may also check the DXDeploy log file to determine when
DXDeploy completes. The following message appears at the
bottom of the log file: “Successfully completed all deployment
actions.”
4 Optionally, open Pervasive Control Center (PCC) and in
Pervasive PSQL Explorer under Engines, open the TrackerDB
branch. Notice that TrackerDB is now listed as a database with
the A icon shown on its Replication node. This indicates that the
database is activated.

Figure 5-12 TrackerDB Activated on First Site

Copy the ³ To copy the template to the Partner Site


Template to the 1 After DXDeploy completes on the First Site, copy the DemoDB
Partner Site directory from C:\PVSW\Replication\Templates\TrackerDB to
C:\PVSW\Replication on your Partner Site.
Note that the example used here contains data files in both
relative and absolute locations. When copying your files, you
must include absolute paths to data residing outside the
DataDirectory location you specified. For information on where
to copy your files, see “File Copying” on page 4-18 in Getting
Started with Pervasive DataExchange.

Note When using DXDeploy deployment, the template consists


of a copy of the database files. These files are all located in the
<Installation Directory >\Replication\Templates directory.

5-45
Data Synchronization Deployment Models

Run DXDeploy ³ To run DXDeploy on the Partner Site


on the Partner 1 Othe Partner Site, open a command prompt.
Site
2 At the prompt, you would type the following:
DXDeploy C:\PVSW\Replication\DemoDB\CUST_2WAY.XML

The command is case-insensitive.


3 Press Enter.
DXDeploy provides high-level status messages on the screen as
it completes certain actions. For a successful deployment, the
following messages appear:
Š Starting the CreateDSN action
Š Starting the Design action
Š Starting the Activate action
By default, detailed messages from DXDeploy are written to
dxdeploy.log, not to the screen. DXDeploy is complete when the
command prompt reappears. You may also check the DXDeploy
log file to determine when DXDeploy completes. The following
message appears at the bottom of the log file: “Successfully
completed all deployment actions.”
When DXDeploy runs on the Partner Site, it performs an initial
replication with the First Site. This replication populates data on the
Partner Site so that it is the same as on the First Site.

Note Depending on database size and connection bandwidth,


initial replication can take from a few minutes to several hours.

Tip For steps to remove the deployed database you just created,
see “Working with the Examples” on page 5-6 and “Removing
Databases Deployed with DXDeploy” on page 5-6.

5-46
2-Way Deployment Using Designer

2-Way Deployment Using Designer


This section describes how to perform an example 2-way Data
Synchronization replication between a First Site and a Partner Site.
Conducting the example session is optional, but recommended.
You need two machines for the example session. One machine must
have DataExchange installed as a First Site. The other machine must
have DataExchange installed as a Partner Site.
The following steps use the sample database Tracker provided with
the installation of DataExchange. The tasks required to complete this
type of replication include the following:
1 Create the Template Design
2 Copy First Site Files to the Partner Site
3 Activate the First Site Template
4 Activate the Partner Site Template
5 Initiate Replication
6 Verify the Changes Were Replicated

Before You Get Before performing this task you must install Pervasive
Started DataExchange on a First Site and a Partner Site as explained in
Getting Started with Pervasive DataExchange.
We strongly recommend that you shut down all applications using
the database you are about to deploy before using this deployment
method.

Tip So that you can restore your database to its original state
after this deployment exercise, we recommend saving a copy of
your database files before proceeding with this example.

Note Currently, you must have an ODBC-compliant DSN and


DDFs in order to use the DataExchange Designer for this
deployment method.

5-47
Data Synchronization Deployment Models

Create the ³ To create the template design


Template 1 On the First Site machine, start PCC if it is not already running.
Design (Select Control Center & Documentation from the Pervasive
group on the Start menu.)
2 In PCC, select DataExchange Designer.
The Designer wizard asks you to specify the data to be replicated.

Figure 5-13 Data Location

3 For this example, enter Tracker in the Location field, select


2-way as the method, and click Next.
The wizard asks you to identify the replication project, network,
and release. These names are of your own choosing to help keep
track of what you need to replicate.
4 For this example, enter the following:
Š Project: DX_2WayTest
Š Network: Test
Š Release: 1.0
Project and network names are limited to 20 characters, and the
release name must be 8 characters or less.
The names for project, network, and release are of your own
choosing and help you identify and keep track of what you need
to replicate.
5 Click Next.
The wizard provides a summary of your input for the replication
project.
6 Click Finish.

5-48
2-Way Deployment Using Designer

A message informs you that DataExchange Designer is creating


the replication system tables. After the replication system tables
are created, DataExchange Designer opens.
Notice that DataExchange Designer initially lists the tables in the
Tracker sample database in the Not Replicated tab.

Figure 5-14 DataExchange Designer

7 Select all of the tables. Press the Shift key and, while holding it
down, click the last table in the list.

Figure 5-15 DataExchange Designer with All Tables Selected

8 Right-click the selected tables, then click Replicate Table.

Figure 5-16 Replicate Table Command in DataExchange Designer

5-49
Data Synchronization Deployment Models

All of the tables move from the Not Replicated tab to the
Replicated tab. The view on the right shows the information for
the selected table on the Replicated tab.

Figure 5-17 View of Replicated Tables in DataExchange Designer

9 Click File Save to retain your work.


10 Click Tools Create Replication Template. A message about
starter data appears.

See “Design Completion,” on page 8-7 for more information


about starter data.
11 Leave the selected default option Prepare database data for
replication to other sites and click OK.
Messages inform you that DataExchange Designer is preparing
the database for activation then preprocessing the existing
(starter) data. After the data has been preprocessed, another
message informs you that the template has been created.

12 Click OK to complete the template creation process.


13 Select File Exit to close the Designer wizard.

5-50
2-Way Deployment Using Designer

Next, you will copy all of the files from the Demodb folder to
your Partner Site.

Copy First Site ³ To copy the First Site files to the Partner Site
Files to the 1 From the First Site, copy all of the files from the folder
Partner Site PVSW\Replication\Demodb to the same folder on your Partner
Site.
2 Answer Yes to confirm file replacement.

Note When using DataExchange Designer deployment, the


template consists of the actual database files. If your database
contains files in other directories, you must copy them to the
same path on the Partner Site as on the First Site.

Activate the ³ To activate the template at the First Site


First Site The command-line utility dxact activates the databases.
Template
1 On the First Site, open a command prompt.
2 At the prompt, type the following:
dxact /FIRSTSITE Tracker

Capitalization is for emphasis. The command is case-insensitive.


3 Press Enter.
By default, messages from Dxact are written to dxact.log, not to
the screen. This log is located in the <Installation Directory
>\Replication\LogFiles folder. If you want to view messages on
the screen while dxact executes, use the /LOGFILE= option. At
the command prompt, you would type the following:
dxact /FIRSTSITE Tracker /LOGFILE=

See “dxact” on page 7-6 for more information about the Dxact
utility.
The activation process is complete when the command prompt
reappears. You now need to activate Tracker on the Partner Site.

5-51
Data Synchronization Deployment Models

Activate the ³ To activate the template at the Partner Site


Partner Site 1 At the command prompt on the Partner Site machine, type the
Template following:
dxact /PARTNERNETADDR=address Tracker

where address is the name or IP address of the First Site machine.


For example, if the First Site is a machine named TM, the
command would be
dxact /PARTNERNETADDR=TM Tracker

The /PARTNERNETADDR option indicates the Partner Site address.


Capitalization is for emphasis. The command is case-insensitive.
2 Press Enter.
The activation process is complete when the command prompt
reappears. You have now activated both your First Site and
Partner Site databases.
3 Close the command prompt.
1 On the Partner Site, start PCC if it is not already running. (Select
Control Center & Documentation from the Pervasive group on
the Start menu.)
2 In the Pervasive PSQL Explorer under Engines, open the Tracker
database branch. Notice that Tracker database is now listed as a
database with the A icon shown on its Replication node. This
indicates that the database is activated.
In PCC on the First Site, the status for Tracker on that machine
should also show an A. If you don’t see the A icon, right-click the
Replication node and select Refresh. The Partner Site in this
example is named DL.

5-52
2-Way Deployment Using Designer

Figure 5-18 Activated Indicator in Pervasive PSQL Explorer

Now that your First Site and Partner Site databases are activated,
you are ready to replicate data between them.

Make Sample ³ To change the database records


Database You may change records in your database from either site.
Changes DataExchange replicates data and synchronizes each database as
changes are made, whether the changes occur at the First Site or the
Partner Site. For the sake of this example, the following steps assume
that you are performing the actions from the First Site.
1 Start PCC if it is not already running. (Select Control Center &
Documentation from the Pervasive group on the Start menu.)
2 Click the Tables node for the Tracker database.
3 Right-click table Customer and click Open, or double-click it.
SQL Editor opens and displays all records in table Customer.
4 Position the cursor in the NameStr field for CustomerID 1.
5 Change the NameStr from American Network Group to
Worldwide Distributors. You may need to press the Insert key
before you can change the string.
6 Close SQL Editor.
This saves the change to the Customer table.

5-53
Data Synchronization Deployment Models

Initiate ³ To replicate data from First Site to Partner Site


Replication You may initiate replication from either site.These steps assume that
you are performing the actions from the First Site.
1 In PCC, right-click the Replication - Connected node in
Pervasive PSQL Explorer and select Statistics and Log Views.

Figure 5-19 Starting DataExchange Monitoring Tools

The Replication Progress and Log Viewers open.

Figure 5-20 Replication Progress and Log Viewers

2 In the toolbar, click the Initiate replication icon .


The Initiate Replication dialog appears.

5-54
2-Way Deployment Using Designer

Figure 5-21 Initiate Replication Dialog

In this example, note that the source database is Tracker (TM)


on your First Site and the database to replicate with is Tracker
(DL) on your Partner Site.
3 Click Replicate.
The replication process begins. The Replication Progress Viewer
reports the operation.

5-55
Data Synchronization Deployment Models

Figure 5-22 Example Replication Process in Statistics View Utility

4 Notice that the Completed column reports “successful.”


5 Select File Exit to close the viewers.
Your next task is to verify that the data changes were replicated
from Tracker (TM) to Tracker (DL).

Verify the ³ To verify that your changes were replicated


Changes Were 1 In PCC on the Partner Site, open the Tables node for the Tracker
Replicated database, right-click the Customer table, and select Open, or
double-click the table.
SQL Editor opens and displays customer data.
2 Note that the change you made to Tracker has been replicated to
the Partner Site.
3 Close SQL Editor.
You have completed this deployment exercise.

Note If you make changes from both the Partner and First Sites,
each database is replicated to reflect all changes at both sites.

5-56
2-Way Deployment Using Designer

Tip For steps to remove the deployed database you just created,
see “Working with the Examples” on page 5-6 and “Removing
Databases Deployed with Designer” on page 5-8.

5-57
Data Synchronization Deployment Models

5-58
chapter

Example Database Design


for Data Synchronization 6
Understanding Database Design Considerations for Data Synchronization

An effective way in which to understand how to design a database for


Data Synchronization is to study an example. Although Pervasive
DataExchange offers replication solutions for both backing up and
synchronizing your databases, this chapter details an example Data
Synchronization design using Tracker, the sample database provided
with Pervasive DataExchange. We’ll use this database to illustrate the
available functionality in Pervasive DataExchange Data
Synchronization Edition.
This chapter discusses the following sections:
„ “Data Synchronization Design Considerations” on page 6-2
„ “Basic Data Synchronization Design” on page 6-6
„ “Security” on page 6-10
„ “Sample Tracker Database” on page 6-11

1
Example Database Design for Data Synchronization

Data Synchronization Design Considerations


This section discusses database design considerations for creating a
new database schema using Data Synchronization. These
considerations can also be used for replicating an existing database.
The sample database, Tracker, is used for this design.

Note If the Tracker database has been deleted from your


computer you can recreate it with the sample Tracker.SQL
script. See “Sample Tracker Database” on page 6-11.

Application A reseller company uses a tracking program, called Tracker, to store


Overview customer and product information and to track sales through
purchase orders. The business rules are as follows:
„ The company has a number of geographically distributed sales
regions.
„ Each employee of the company is associated with a specific sales
region.
„ Employees can edit customer entries and assign customers to
themselves.
„ Employees are responsible for creating purchase orders.
„ A single list of products is shared among all regions.
Based on the above business rules, the following database schema
was used.
The Purchase and PurchDet tables help avoid many-to-many
relationships. A single purchase can contain many purchase details,
which are essentially line items on a single purchase order. That is, a
purchase will exist for a given day, and all the items bought on that
purchase order are listed in the PurchDet table.
The tables contain the following fields (asterisks denote primary key
fields, double asterisks denote foreign key fields). Note that this is the
first attempt at the structure, and changes can be made after
considering design factors that could be desirable for replication.

2
Data Synchronization Design Considerations

Figure 6-1 Tracker Schema

Region Table

Field Type Description

RegionID* Long Integer Primary key for region table

NameStr Char[100] Name of the region

Employee Table

Field Type Description

EmpID* Long Integer Primary key for employee table

FName Char[30] First name

Initial Char[5] Middle Initial

LName Char[30] Last name

RegionID ** Long Integer Index to the region name

Customer Table

Field Type Description

CustID* Long Integer Primary key for customer table

NameStr Char[100] Name of the company

Street Char[100] Street name

3
Example Database Design for Data Synchronization

Field Type Description

City Char[30] City name

State Char[50] State, province or county name

ZIP Char[10] ZIP or postal code

Phone Char[20] Phone number

CntEmail Char[100] E-mail address of the primary company contact

CntName Char[50] Name of the primary company contact

Comments Char[255] Any comments regarding the company

SlsRepID ** Long Integer Index to the employee who works with the company

Purchase Table

Field Type Description

PurID* Long Integer Primary key for purchase table

PurDate Date/Time Date and time of purchase order

CustID ** Long Integer Index to the name of the customer who ordered

EmpID ** Long Integer Index to the employee who took the order

DelInst Char[50] Delivery instructions

Purchase Detail Table

Field Type Description

PurDetID* Long Integer Primary key for purchase detail table

PurchID ** Long Integer Index to the purchase order

ProdID ** Long Integer Index to the product ordered

PurchQty Integer Amount ordered

Cost Char[12] Total cost of the purchase detail

4
Data Synchronization Design Considerations

Product Table

Field Type Description

ProdID* Long Integer Primary key for product table

ProdName Char[50] Name of the product

ProdDesc Char[248] Description of the product

Price Char[12] Price of the product

5
Example Database Design for Data Synchronization

Basic Data Synchronization Design


Pervasive DataExchange Data Synchronization Edition provides you
the functionality to easily configure your database designs to mirror
the distributed nature of your business. Designing your database for
Data Synchronization can be as simple or as complex as your data
and business needs demand.
The tasks required to complete a basic Data Synchronization design
include the following:
1 Select the database
2 Identify the database
3 Select tables for replication

Database First you select a database to use for your replication design. You
Selection may choose to open an existing database, or you can create a new
database for this purpose. The next figure shows the Database
Information dialog where the database name is entered and the
DataExchange Method is selected, using Data Synchronization.

Figure 6-2 Data Synchronization Database Selection Dialog

DataExchange Method
If you select a new database for replication, you must select the
DataExchange Method to use when you enter the database
information. In selecting an existing database, the DataExchange
Method is already determined by the method previously used for the
selected database.
The method you select depends on your database and your business
requirements. The choices are 1-way and 2-way.

6
Basic Data Synchronization Design

The next figure shows the Database Information dialog where the
database name is entered and the DataExchange Method is selected,
using Data Synchronization.

Figure 6-3 Data Synchronization Database Selection Dialog

Database Connection Information


If applicable, you will need to enter the User Name and Password for
your selected database.

Database When creating a new database for replication, you must designate
Identification specific identifiers for the Project, Network, and Release names
associated with your replication design.

Project
A project represents a single replicated database. The replication
Project Name is of your own choosing and helps you identify and
keep track of what you need to replicate. You can use a simple-to-
understand name that helps you remember which database is
involved.
If your goal is to replicate with a database named mydatabase, then
you may want to call the project mydatabase project or something
similar that helps you remember which database is involved.
A Project name must be 20 characters or less.
A project can be associated with more than one replication network.
That is, you could create a design for mydatabase project, finance
department network, 1.0 and mydatabase project, accounting group
network, 1.0.

7
Example Database Design for Data Synchronization

Network
A replication network is the grouping of replication sites that will
participate in the replication. The name for the replication network
is of your own choosing and helps you identify and keep track of
what you need to replicate. A name that helps you remember the
grouping is very useful. For example, you could name a grouping of
sites in the finance department finance network.
The Network name must be 20 characters or less.

Release
The release is like a version number for the design of the replication
database. Your first design could be version 1, for instance. If you
choose to change the design later, then you would create a version 2
and so forth.
The Release name must be 8 characters or less.
The name for the replication release is of your own choosing and
helps you identify and keep track of what you need to replicate.
The Project, Network, and Release names are added to the database
network analyst (DNA), which is the system database used by the
Replication Engine. The replication utilities use these names from
the DNA database to allow or disallow certain actions. For example,
databases that differ only by release are allowed to replicate together.

Tip Replication project names and network names must match to


allow replication.

Replicated When you first start the DataExchange Designer, the database tables
Tables are listed in the left pane on the Not Replicated tab. Initially, none of
the database tables are flagged for replication; all of the tables are
marked as Not Replicated.

8
Basic Data Synchronization Design

To begin your design, you decide which tables to use for replication
and mark these tables accordingly.

Note Selecting tables for replication is a required task for both 1-


way and 2-way Data Synchronization designs.

This completes the tasks required for a basic replication design. The
next sections discuss Security and the Sample Tracker Database.

9
Example Database Design for Data Synchronization

Security
Pervasive DataExchange automatically encrypts all data transmitted
between two sites. The Replication Engine controls the encryption
for you.
For information on Pervasive PSQL Security, see What's New in
Pervasive PSQL included with your Pervasive PSQL database engine.

10
Sample Tracker Database

Sample Tracker Database


If the Tracker database is not listed in Pervasive PSQL Control
Center, you can create it from the file Tracker.sql. Tracker.sql is
included in the Pervasive DataExchange installation at <Installation
Directory >\Replication\Demodb). This file contains the SQL
statements to recreate the Tracker demo database.

³ To create the Tracker database using Tracker.sql


1 Start PCC if it is not already running. (Select Control Center &
Documentation from the Pervasive group on the Start menu.)
2 Right-click Databases and select New Database.

The New Database dialog box appears.


3 Fill in the options for the database name and the database
directory as listed:
Š Database Name: Tracker
Š Location: C:\Program Files\Pervasive
Software\PSQL\Replication\DemoDB
You may specify a different directory so long as the folder
already exists and does not contain any Pervasive PSQL database
files (.ddf or .mkd file extensions).
4 Click Finish.
The empty database is created and ready to run the SQL statements
in Tracker.sql.
5 In PCC, select File Open.
An Open dialog box appears.
6 Browse to C:\Program Files\Pervasive
Software\PSQL\Replication\DemoDB and open the file
tracker.sql.

11
Example Database Design for Data Synchronization

SQL Editor starts.


The system asks you to select a database in which to run the SQL
statements.

7 Click OK.
SQL Editor displays the SQL statements in Tracker.sql.
8 Select SQL Execute All SQL Statements.
The statements create the Tracker database tables and populate
them with data.
9 After all SQL statements have run, close SQL Editor.
10 Right-click Databases and select Refresh to redisplay the list of
databases, including their tables.

12
D ATA E XCHANGE T OOLS AND
U TILITIES
chapter

Using the DataExchange


Utilities and Services 7
A Reference for Using the DataExchange Utilities and Services

„ “Utilities and Services Overview” on page 7-2


„ “Command-line Utilities” on page 7-5
„ “GUI-based Utilities” on page 7-31
„ “Services” on page 7-33

7-1
Using the DataExchange Utilities and Services

Utilities and Services Overview


Pervasive DataExchange contains a suite of utilities and services for
every phase of replication. The Pervasive DataExchange utilities
assist you in designing, customizing, and administering your
replication requirements. This section covers the following topics:
„ Replication Stages and the Utilities Used
„ Accessing the Utilities

Replication The next table lists the Pervasive DataExchange utilities and services
Stages and the and the four primary replication stages in which each is used.
Utilities Used Detailed information on the Pervasive DataExchange utilities and
services is included in the sections that follow.

Replication Utility/Service Name File Name For more


Stage information...

Activation Activate a Project Release dxact See “dxact” on


page 7-6

Activation Deactivate a Project dxdeact See “dxdeact” on


Release page 7-11

Activation Utility to read/write the event dxdeploy See “dxdeploy”


handler DLL path to the on page 7-13
database.

Design / Deployment Utility dxdeploy See “dxdeploy”


Activation on page 7-13

Design / Deployment Wizard dpwizard See “dpwizard”


Activation on page 7-32

Design Designer prd See “prd” on page


7-32 and Chapter
8, “Using the
DataExchange
Designer”

Design Dynamic Table dxdynpath See “dxdynpath”


Configuration and Test on page 7-15
Utility

(Real-Time Backup Edition


only)

Design Flat File Copy Utility ffcopy See “ffcopy” on


page 7-26

7-2
Utilities and Services Overview

Replication Utility/Service Name File Name For more


Stage information...

Design Template Remover Wizard trwizard See “trwizard” on


page 7-32

Replication Pervasive DataExchange dxagent See “dxagent” on


Agent page 7-33

Replication Control Table Cleanup dxcleanup See “dxcleanup”


Configuration Utility on page 7-9

Replication Table Synchronization and dxsynctables See


Check Utility “dxsynctables”
on page 7-25

Replication Administrator da See “da” on page


7-31 and Chapter
9, “Using
DataExchange
Manager”

Replication Statistics and Log View replmonitor See “replmonitor”


on page 7-32 and
Chapter 10,
“Using the
Replication
Progress and Log
Viewers”

Replication Console Replication dxrepl See “dxrepl” on


Initiation Utility page 7-23

All Pervasive PSQL Replication replserv See “replserv” on


page 7-36

Accessing the Some of the DataExchange utilities can be accessed from a single
Utilities control point, Pervasive Control Center (PCC) or the Start menu.
Many tools contain only a command-line interface and must be
accessed from a command prompt. Services are available from the
Windows Control Panel. The following information outlines the
various ways to access the Pervasive DataExchange utilities, services
and shortcuts.

Accessing the Utilities from a Command Prompt


For most of the replication utilities you’ll need to open a command
prompt window to run the executable. You can open a command
prompt window from the Windows environment.

7-3
Using the DataExchange Utilities and Services

³ To open a Command Prompt window in Windows


1 Select Start Programs Accessories Command Prompt.

Note For more information on using the command-line


utilities, see “Command-line Utilities” on page 7-5.

Accessing the Utilities from PCC


Expand the tree view in PCC if it is not already expanded. The menus
in PCC are context-sensitive; they vary according to which object
(node) in the tree is selected.

Note Command-line utilities are not available from PCC.

³ To access the utilities from PCC


1 Select the Replication node for a specific database
2 Select DataExchange from the menu and select the utility.

Note For more information on using the GUI utilities, see


“GUI-based Utilities” on page 7-31.

7-4
Command-line Utilities

Command-line Utilities
This section provides information about the command-line utilities
included in Pervasive DataExchange. The following table lists the
Pervasive DataExchange command-line utilities, along with a brief
description of the utility. The section following this table details each
individual utility and includes a list of the options available for each
utility.

Utility File Name Utility Name Description

dxact Database Activation Utility Activates an enabled


database by registering it with
the local runtime environment
as belonging to a site on the
replication network.

dxcleanup Control Table Cleanup Sets/gets control table


Configuration Utility cleanup schedules for an
activated database.

dxdeact Database Deactivation Utility Deactivates a release that


was previously activated
using dxact.

dxdeploy Deployment Utility Deploys DataExchange on


two sites using settings given
in the XML deployment
descriptor file.

dxdynpath Dynamic Table Configuration Supports appending,


and Test Utility replacing, showing and
(Real-Time testing regular expressions
Backup Edition and file patterns for a
only) designed database.

dxrepl Console Replication Initiation Replicates files from DSN to


Utility Partner Site.

dxsynctables Table Synchronization and Finds modified data missed


Check Utility by DataExchange event
handler and returns control
tables to the consistent state.

ffcopy Flat File Copy Utility Copies non-Btrieve files from


First Site to Partner Site.

7-5
Using the DataExchange Utilities and Services

dxact Pervasive DataExchange Activate a Project Release

Description
This program activates an enabled database by registering it with the
local replication runtime environment.
If the Replication Engine is running and control tables have been
populated, the first replication with the initial Partner Site will be
performed automatically. Once this first replication has succeeded,
the newly activated database will be fully aware of all administrative
data in that network, including all replication schedules.

Syntax
DXACT [options] <DSN>

Argument Description

<DSN> Data Source Name for the database to be activated.

Options

Option Description

/DES[CRIPTION]=<string> Description of this replication site, e.g.


"My First Site". Database name will be
automatically appended to it.

[default=MyFirstSite]

/DL[LPATH]=<string> Full path to the event handler DLL, if


specified.

[default=<null>]

/FI[RSTSITE] Use this switch only if this is the First Site


at which this release is being activated

/FO[RCEINSTALL] If specified, allows activation of a


database that is a copy of an already-
activated site

7-6
Command-line Utilities

Option Description

/LOG={flags} Specify which messages type(s) to log:

I = informational messages
W = warning messages
E = error messages

For example, '/log=e /log=w' or '/log=we'


(the default) logs errors and warnings
only. Any message type left unspecified is
suppressed.

[default=iwe]

/LOGF[ILE]=<string> File name for log messages. Specifying '/


LOGFILE=' alone sets logging to the
console.

[default=<Installation Directory
>\Replication\LogFiles\DXACT.log]

/LOGH[ISTORY]=nnn Number of files to maintain in the log


history

[default=5]

/LOGS[IZE]=nnn Maximum size of the log file (0 means 'no


limit')

[default=0]

/LOGW[IDTH]=nnn Log messages are wrapped to fit within


this line length. (minimum 50)

[default=79]

/NOI[NITIALREPL] If specified, Replication Engine will not


perform an initial replication after the
release has been activated.

/NOL[OGO] Do not display starting logo.

/ODBCC[ONNSTR]=<string> Additional ODBC connection string


parameters in the form:

<name>=<value>[;<name>=<value>...]

[default=<null>]

/ODBCN[AME]=<string> User name for ODBC connection

[default=PDUSER]

/ODBCP[ASSWORD]=<string> Password for ODBC connection

[default=<null>]

7-7
Using the DataExchange Utilities and Services

Option Description

/PA[RTNERNETADDR]=<string> The network address of the Partner Site


we should replicate with first. If this switch
is not specified, DXact will display a
prompt for the user to enter the partner
network address

[default=<LocalHost>]

/PN[LICENSE]=<string> Specifies name of PNLicense file to


register (specify at network First Site only)

[default=<Installation Directory
>\bin\repllicense.pnl]

/PR[EPROCESS] If specified, preprocessing of starter data


will be performed. This should be done
unless it is known that no database
changes occur between design and
activation, and that starter data was
preprocessed at design time. Otherwise,
starter data will not get replicated.

/REC[ONCILEREP] If specified, Replication Engine will


perform reconciliation processing during
the initial replication after the release has
been activated. Should be specified
unless data is identical between the site
being activated and the First Site.
Otherwise, reconciliation will not be
performed.

/RED[ESIGN] If specified, the database will still capture


events while Redesign occurs.

/SI[TETYPE]=<string> Override new site's default site type. Must


be one of: COMPLETE or HIGH

[default=COMPLETE]

/SU[BSCRIBESITES] If specified, this site will be automatically


subscribed to all new sites (via the dSite
table).

/H[ELP] Displays the command usage help text.

Note: The default installation directory varies depending on the version of your
operating system.

Examples
Running the following example from a command prompt on a First
Site activates a DSN named Demodata on a First Site machine.

7-8
Command-line Utilities

DXACT /FIRSTSITE Demodata

The next example, if run from a Partner Site, would activate a DSN
named Demodata on a Partner Site machine replicating with a
machine named XPServer.
DXACT /PARTNERNETADDR=XPServer Demodata

This example activates the DSN named Demodata on the First Site
machine and sets the Dxact logging to the console.
DXACT /FIRSTSITE /LOGFILE= Demodata

This example activates the DSN named Demodata on the Partner


Site machine replicating with a machine addressed as Adminserver
and sets the Dxact logging to a file named adminlog.txt located at
<Installation Directory >\Reports.
DXACT /PARTNERNETADDR=AdminServer /
LOGFILE=C:\<Installation Directory
>\Reports\adminlog.txt Demodata

dxcleanup Pervasive DataExchange Control Table Cleanup


Configuration Utility

Description
This program sets or shows the control table cleanup schedules for
an activated database.

Syntax
DXCLEANUP [options] <Operation> <DSN>

Argument Description

<Operation> Valid arguments include SET or SHOW

<DSN> Database datasource name

7-9
Using the DataExchange Utilities and Services

Options

Option Description

/C[LEANUPPERIOD]=nnn Time (in days) between cleanup cycles

[default=7]

/DXA[DMIN]=<string> DX administrator name

[default=ADMIN]

/DXP[ASSWORD]=<string> DX administrator password

[default=password]

/LOG={flags} Specify which messages type(s) to log:

I = informational messages
W = warning messages
E = error messages

For example, '/log=e /log=w' or '/log=we'


(the default) logs errors and warnings
only. Any message type left unspecified is
suppressed.

[default=iwe]

/LOGF[ILE]=<string> File name for log messages. Specifying '/


LOGFILE=' alone sets logging to the
console.

[default=<Installation Directory
>\Replication\LogFiles\DXCLEANUP.log]

/LOGH[ISTORY]=nnn Number of files to maintain in the log


history

[default=5]

/LOGS[IZE]=nnn Maximum size of the log file (0 means 'no


limit')

[default=0]

/LOGW[IDTH]=nnn Log messages are wrapped to fit within


this line length. (minimum 50)

[default=79]

/N[OLOGO] Do not display starting logo.

/ODBCN[AME]=<string> User name for this database (if security


enabled)

[default=<null>]

7-10
Command-line Utilities

Option Description

/ODBCP[ASSWORD]=<string> Password for the user specified as


ODBCName (if security enabled)

[default=<null>]

/OL[DESTALLOWED]=nnn Age (in days) of oldest allowed record

[default=90]

/H[ELP] Displays the command usage help text.

Note: The default installation directory varies depending on the version of your
operating system.

Example
This example displays the number of days set for the cleanup period
and the age (in days) of the oldest allowed record currently in place
for the data source name demodata.
dxcleanup show demodata

A message should display that lists the name and version of the
control table cleanup configuration utility, and additional
information such as the following:
Cleanup Period is 7 day(s)

Oldest Allowed is 90 day(s)

dxdeact Pervasive DataExchange Deactivate a Project Release

Description
This program deactivates a release that was previously activated
using DXact and removes the activated database from the list of
those available for replication. If you want to delete a replicated
database from physical storage, you must deactivate it first.

Syntax
DXDEACT [options] <DSN>

Argument Description

<DSN> Database datasource name

7-11
Using the DataExchange Utilities and Services

Options

Option Description

/K[EEPINFO] Keep Activation Information in system


database (by default, that info is
removed)

/LOG={flags} Specify which messages type(s) to log:

I = informational messages
W = warning messages
E = error messages

For example, '/log=e /log=w' or '/log=we'


(the default) logs errors and warnings
only. Any message type left unspecified is
suppressed.

[default=iwe]

/LOGF[ILE]=<string> File name for log messages. Specifying '/


LOGFILE=' alone sets logging to the
console.

[default=<Installation Directory
>\Replication\LogFiles\DXDEACT.log]

/LOGH[ISTORY]=nnn Number of files to maintain in the log


history

[default=5]

/LOGS[IZE]=nnn Maximum size of the log file (0 means 'no


limit')

[default=0]

/LOGW[IDTH]=nnn Log messages are wrapped to fit within


this line length. (minimum 50)

[default=79]

/N[OLOGO] Do not display starting logo.

/ODBCN[AME]=<string> User name for this database (if security


enabled)

[default=<null>]

/ODBCP[ASSWORD]=<string> Password for the user specified as


ODBCName (if security enabled)

[default=<null>]

7-12
Command-line Utilities

Option Description

/R[EDESIGN] Use this switch only if planning to


redesign this database.

/H[ELP] Displays the command usage help text.

Examples
This example deactivates the data source name demodata and
retains the activation information in the system database; by default,
activation information is removed.
dxdeact /keepinfo demodata

dxdeploy Pervasive DataExchange Deploy DataExchange

Description

This program deploys DataExchange on two sites using settings


given in the XML Deployment Descriptor file. This utility
streamlines replication processes by combining functionality of
DataExchange Designer, Dxact, and Dxsynctables.

Syntax
DXDEPLOY [options] <XML File>

Argument Description

<XML file> XML Deployment Descriptor file. XML Descriptor file


templates (EXPRESS.XML and CUSTOM.XML) are
located in <Installation Directory >\Replication\docs.

7-13
Using the DataExchange Utilities and Services

Options

Option Description

/LOG={flags} Specify which messages type(s) to log:

I = informational messages
W = warning messages
E = error messages

For example, '/log=e /log=w' or '/log=we'


(the default) logs errors and warnings
only. Any message type left unspecified is
suppressed.

[default=iwe]

/LOGF[ILE]=<string> File name for log messages. Specifying '/


LOGFILE=' alone sets logging to the
console.

[default=<Installation Directory
>\Replication\LogFiles\DXDEPLOY.log]

/LOGH[ISTORY]=nnn Number of files to maintain in the log


history

[default=5]

/LOGS[IZE]=nnn Maximum size of the log file (0 means 'no


limit')

[default=0]

/LOGW[IDTH]=nnn Log messages are wrapped to fit within


this line length. (minimum 50)

[default=79]

/N[OLOGO] Do not display starting logo.

/S[ITE]=<string> Choose which site in Sites list to deploy:


First | Partner

(This setting is optional and is used for


demonstration purposes only.)

[default=<null>]

/H[ELP] Displays the command usage help text.

Note: The default installation directory varies depending on the version of your
operating system.

7-14
Command-line Utilities

XML Descriptor File Templates


DXDeploy is used to implement Real-Time Backup, 1-way, and 2-
way Data Synchronization deployment methods. The DXDeploy
utility uses an XML descriptor file that you create to include specific
information about your database and replication environment. As
shown in the syntax example, this file is included as an argument
when you execute the utility. DXDeploy uses the XML descriptor file
to handle the processes required for replication.
Pervasive DataExchange includes two different XML descriptor
templates you can use to create your specific XML descriptor file to
use with DXDeploy. You must edit the template to include necessary
information in order for DXDeploy to successfully replicate your
data.

Caution You cannot use these template files as-is and successfully
replicate your data. You must create a template file to include specific
information about your replication environment.

EXPRESS.XML
See “1-Way Deployment Using DXDeploy” on page 5-12 for an
example deployment using the EXPRESS.XML template file.

CUSTOM.XML
See “2-Way Deployment Using DXDeploy” on page 5-34 for an
example deployment using the CUSTOM.XML template file.

dxdynpath Pervasive DataExchange Dynamic Table Configuration


and Test Utility (Real-Time Backup Only)

Description
Append, replace or show the existing include and exclude patterns
and/or regular expressions for a given designed database. Optionally
test existing or hypothetical patterns or regular expressions.

Syntax
DXDYNPATH [options] <Operation> <DSN>

7-15
Using the DataExchange Utilities and Services

Argument Description

<Operation> Valid arguments include APPEND, REPLACE, SHOW or


TEST.

<DSN> Database datasource name created by DataExchange.

Options

Option Description

/F[ILEPATH]=<string> Absolute file path to test (valid only for


<Operation> TEST).

The path used here is the absolute


path to the database created by
DataExchange.

[default=<null>]

/LOG={flags} Specify which messages type(s) to log:

I = informational messages
W = warning messages
E = error messages

For example, '/log=e /log=w' or '/log=we'


(the default) logs errors and warnings
only. Any message type left unspecified is
suppressed.

[default=iwe]

/LOGF[ILE]=<string> File name for log messages. Specifying '/


LOGFILE=' alone sets logging to the
console.

[default=<Installation Directory
>\Replication\LogFiles\DXDYNPATH.log]

/LOGH[ISTORY]=nnn Number of files to maintain in the log


history

[default=5]

/LOGS[IZE]=nnn Maximum size of the log file (0 means 'no


limit')

[default=0]

7-16
Command-line Utilities

Option Description

/LOGW[IDTH]=nnn Log messages are wrapped to fit within


this line length. (minimum 50)

[default=79]

/N[OLOGO] Do not display starting logo.

/ODBCN[AME]=<string> User name for this database (if security


enabled)

[default=<null>]

/ODBCP[ASSWORD]=<string> Password for the user specified as


ODBCName (if security enabled)

[default=<null>]

/P[ATTERN]=<string> Glob-style pattern (e.g. "dir


newfile*.mkd") or regular expression.

For <Operation> APPEND or REPLACE,


PATTERN is applied to Dynamic Table
Configuration. For <Operation> TEST,
PATTERN is used to test for a match,
otherwise ignored

[default=<null>]

/T[YPE]=<string> INCLUDE, EXCLUDE or BOTH (BOTH is


valid only for <Operation> SHOW)

[default=INCLUDE]

/H[ELP] Displays the command usage help text.

Note: The default installation directory varies depending on the version of your
operating system.

Remarks
It is critical that to note that any file that is being considered for use
with the dxdynpath utility requires system keys.
Before we explain how DataExchange automatically includes or
excludes files using pattern matching, let’s first discuss the types of
expressions you can use.

Note Dxdynpath should only be used with the Real-Time


Backup Edition.

7-17
Using the DataExchange Utilities and Services

Types of You may use the following types of pattern-matching expressions


Expressions with the dxdynpath utility:
„ Dir expressions
„ Regular expressions

Dir Expressions
This type of expression is based on the Windows directory (dir)
command, and provides an alternative to using regular expressions.
Dir expressions have the following characteristics:
„ Must contain “dir” as the first characters (“dir” is case-
insensitive).
„ May include a relative path to the dictionary files. See “Relative
Paths” on page 7-19. Absolute paths are not allowed.
„ Must include the name(s) of file(s). File names may include the
“?” or “*” wildcard. Note that a period (.) designates a period. It
is not the same as the “?” wildcard.
„ May include the slash (/) character, back slash (\) character, or a
combination of the two.
„ May include the parameter “/s” to indicate the processing of files
in subdirectories. The “/s” parameter may not be the first
characters in the expression. Other than that, the parameter is
not positional.
„ Must include a space character as the separator between the
elements of the expression.
„ May be used in a series, separated by semi-colons (;). A space
character may precede or follow the semi-colon if you choose,
but is not required.
The following Dir expressions are valid examples:
„ dir mydbase\*.mkd /s
„ dir ..\..\acct/acct*.?db
„ Dir ../payables/custdb/??posted??.pay
„ dir mydbase\*.mkd /s ; dir ..\..\acct/acct*.?db

Regular Expressions
Regular expressions are a pattern matching technique that let you
parse and manipulate text. DataExchange uses the same regular

7-18
Command-line Utilities

expressions as the Windows version of the programming language


perl.
Regular expressions have the following characteristics:
„ May include literal or relative paths. If relative paths are used, see
“Relative Paths” on page 7-19.
„ May include the slash (/) character, back slash (\) character, or a
combination of the two as characters in a relative path. When
paired with the “..”characters in a relative path, slash and back
slash are interpreted as part of a path structure. For example,
..\..\.*bak. If relative paths are used, see “Relative Paths” on page
7-19.
„ May be used in a series, separated by semi-colons (;). A space
character may precede or follow the semi-colon if you choose,
but is not required.
„ May use uppercase characters, lowercase characters, or a
combination of the two. (Windows is case-insensitive.)
„ Must be surrounded by double quotes if the expression contains
characters that are meaningful to the command line interpreter.
For example, the “|” character is legitimate in a regular
expression to indicate “or.” That same character, however,
represents a pipe directive to the command line interpreter. Any
regular expression that uses the “|” character must be
surrounded by double quotes. If you are unsure about a
character, surround the regular expression with double quotes.
„ Must use valid regular expression syntax, with the exceptions
noted above in this bulleted list. Consult the regular expression
syntax in your perl documentation.
The following regular expressions are valid examples:
„ “..\..\(mon|tue|wed|thru|fri)\\(([01][0-9]|2[0-3]))\\.*\.mkd”
(any mkd file in a relative directory structure of weekday\hour)
„ .*bak (any backup file in or below the “home” directory)
„ day\dt\.ddf (dictionary files with a name format of day[0-
9]t.ddf, such as day0t.ddf, day4t.ddf, and so forth)
„ (\w+)\\.*\\\1\\.* (all files in subordinate directories under the
“home” directory where a subordinate directory name recurs,
for example /data/acct/data/purged)

7-19
Using the DataExchange Utilities and Services

Relative Paths
Relative paths are relative to a “home” directory. The home directory
is the one that contains data dictionary files (DDFs) recognized by
DataExchange. To be recognized by DataExchange, the dictionary
files must have been created by one of the DataExchange utilities or
by a DataExchange replication process. If you already have
dictionary files created by a replication process, the home directory
is relative to their location.
Relative paths use “..\” to refer to a directory level. You may also the
slash character (/) instead of the back slash (\). Each “..\” means to
move up the directory structure relative to the home directory. For
example, if your home directory is c:\myapp\mydata\accounts\,
then a relative path of “..\” navigates to c:\myapp\mydata. Similarly,
a relative path of “..\..\” navigates to c:\myapp.

Verifying Expression Pattern Matching


Regular expressions can be challenging to construct correctly.
Because of this, DataExchange provides a command-line utility,
Dxdynpath.exe, that helps you to verify the pattern matching of your
regular and dir expressions. The utility compares the pattern against
the command line arguments and reports if the comparison passes
or fails.

Note Dxdynpath bases the pattern matching solely on its


command line arguments. It does not check for the existence of
files or directories, nor navigate directories. For example, if you
are testing an expression against the file name
acctdata\Bbzz95.mkd, Dxdynpath does not check if file
Bbzz95.mkd exists in directory acctdata.

The following example compares a dir expression against a supposed


file located in c:\bklog\hr or in any subdirectories to c:\bklog\hr.
(The example would be entered as a single line at the command
prompt.)
Dxdynpath /f=c:\mydata\acct\dbQ299x.mkd /p="Dir
..\..\bklog\hr\dbQ2???.mk? /s" test mydbdsn

Dxdynpath reports “matches pattern” because supposed file


dbQ299x.mkd matches the pattern and resides in a subdirectory of
c:\bklog\hr.

7-20
Command-line Utilities

By default, output from Dxdynpath is written to a log file, not to the


screen. If you want output written to the screen, use the /LOGF=
option.

Examples
This example displays the include and exclude patterns currently in
place for the data source name demodata.
dxdynpath /t=both show demodata

If there are no include or exclude patterns configured, a message


similar to the following returns:
INCLUDE pattern is ""

EXCLUDE pattern is ""

Running the following command on the First Site appends


attend*.mkd as an include pattern to any include patterns that
already exist for demodata.
dxdynpath /t=include /p="dir attend*.mkd" append
demodata

Note Commands are case insensitive. You may use uppercase


characters, lowercase characters, or a combination of the two.

dxregevnt Pervasive DataExchange Utility to read/write the event


handler DLL path to the database

Description
Registers, unregisters or shows the event handler for an activated
database.

Syntax
DXREGEVNT [options] <Operation> <DSN>

Argument Description

<Operation> Valid arguments include REGISTER, UNREGISTER or


SHOW

<DSN> Datasource name

7-21
Using the DataExchange Utilities and Services

Options

Option Description

/DXA[DMIN]=<string> DX administrator name

[default=ADMIN]

/DXP[ASSWORD]=<string> DX administrator password

[default=password]

/LOG={flags} Specify which messages type(s) to log:

I = informational messages
W = warning messages
E = error messages

For example, '/log=e /log=w' or '/log=we'


(the default) logs errors and warnings
only. Any message type left unspecified is
suppressed.

[default=iwe]

/LOGF[ILE]=<string> File name for log messages. Specifying '/


LOGFILE=' alone sets logging to the
console.

[default=<Installation Directory
>\Replication\LogFiles\DXREGEVNT.log
]

/LOGH[ISTORY]=nnn Number of files to maintain in the log


history

[default=5]

/LOGS[IZE]=nnn Maximum size of the log file (0 means 'no


limit')

[default=0]

/LOGW[IDTH]=nnn Log messages are wrapped to fit within


this line length. (minimum 50)

[default=79]

/N[OLOGO] Do not display starting logo.

/ODBCN[AME]=<string> User name for this database (if security


enabled)

[default=<null>]

7-22
Command-line Utilities

Option Description

/ODBCP[ASSWORD]=<string> Password for Administrator.

[default=<null>]

/P[ATH]=<string> Absolute path to an event handler (a


shared library)

[default=<null>]

/H[ELP] Displays the command usage help text.

Note: The default installation directory varies depending on the version of your
operating system.

Examples
Running this example displays if the specified database has an Event
Handler DLL registered.
dxregevnt show demodata

If you do not have an Event Handler DLL registered, a message


similar to the following displays:
No Event Handler is Registered

The next example registers an Event Handler DLL named


dxevent.dll located at c:\<Installation Directory >\bin with
demodata.
dxregevnt /p="c:\<Installation Directory
>\bin\dxevent.dll" register demodata

If you have an Event Handler DLL registered, a message similar to


the following displays:
Event Handler is "c:\<Installation Directory
>\bin\dxevent.dll"

dxrepl Pervasive DataExchange Console Replication Initiation


Utility

Description
Replicate files from DSN to Partner Site.

7-23
Using the DataExchange Utilities and Services

Syntax
DXREPL [options] <DSN> [<SiteID>]

Argument Description

<SiteID> The target site for the replication session [default=<null>]

<DSN> The Pervasive Replication datasource name

Options

Option Description

/LOG={flags} Specify which messages type(s) to log:

I = informational messages
W = warning messages
E = error messages

For example, '/log=e /log=w' or '/log=we'


logs errors and warnings only. Any
message type left unspecified is
suppressed. [default=iwe]

/LOGF[ILE]=<string>/ File name for log messages. Specifying '/


LOGFILE=' alone sets logging to the
console.

[default=<Installation Directory
>\Replication\LogFiles\DXREPL.log]

/LOGH[ISTORY]=nnn/ Number of files to maintain in the log


history [default=5]

/LOGS[IZE]=nnn Maximum size of the log file (0 means 'no


limit') [default=0]

/LOGW[IDTH]=nnn Log messages are wrapped to fit within


this line length. (minimum 50) [default=79]

/N[OLOGO] Do not display starting logo.

/ODBCN[AME]=<string> User name for this database (if security


enabled) [default=<null>]

/ODBCP[ASSWORD]=<string> Password for the user specified as


ODBCName (if security enabled)
[default=<null>]

7-24
Command-line Utilities

Option Description

/H[ELP] Displays the command usage help text.

Note: The default installation directory varies depending on the version of your
operating system.

dxsynctables Pervasive DataExchange Table Synchronization and


Check Utility

Description
Finds modified data missed by DataExchange event handler and
returns control tables to the consistent state.

Syntax
dxsynctables [options] <Table> <DSN>

Argument Description

<Table> Name of table to be updated (*=All tables)

<DSN> Datasource name

Options

Option Description

/E[XCLUDE]=<string> Optional comma-separated list of tables


to exclude

[default=<null>]

/F[ORCE] Forces update of timestamped columns.

/LOG={flags} Specify which messages type(s) to log:

I = informational messages
W = warning messages
E = error messages

For example, '/log=e /log=w' or '/log=we'


(the default) logs errors and warnings
only. Any message type left unspecified is
suppressed. [default=iwe]

7-25
Using the DataExchange Utilities and Services

Option Description

/LOGF[ILE]=<string> File name for log messages. Specifying '/


LOGFILE=' alone sets logging to the
console. [default=<Installation Directory
>\Replication\LogFiles\]

/LOGH[ISTORY]=nnn Number of files to maintain in the log


history [default=5]

/LOGS[IZE]=nnn Maximum size of the log file (0 means 'no


limit') [default=0]

/LOGW[IDTH]=nnn Log messages are wrapped to fit within


this line length. (minimum 50) [default=79]

/M[SD] Mark the data with starter data timestamp

/N[OLOGO] Do not display starting logo.

/ODBCN[AME]=<string> User name for this database (if security


enabled) [default=<null>]

/ODBCP[ASSWORD]=<string> Password for the user specified as


ODBCName (if security enabled)
[default=<null>]

/H[ELP] Displays the command usage help text.

Note: The default installation directory varies depending on the version of your
operating system.

ffcopy Pervasive DataExchange Flat File Copy Utility

Description
The ffcopy utility copies non-Btrieve files from First Site to Partner
Site. This tool can run by hand or as part of the DX session event
handling scheme.
See “DxEvent.sql / dxevent.dll” on page 7-28 for more information
about event handling.

Syntax
ffcopy.exe [options] <DATAFILE>

7-26
Command-line Utilities

Argument Description

<DATAFILE> The MKD file name associated with the table created by the
fcopy.sql script

Options

Option Description

/LOG={flags} Specify which messages type(s) to log:

I = informational messages
W = warning messages
E = error messages

For example, '/log=e /log=w' or '/log=we'


(the default) logs errors and warnings
only. Any message type left unspecified is
suppressed. [default=iwe]

/LOGF[ILE]=<string> File name for log messages. Specifying '/


LOGFILE=' alone sets logging to the
console. [default=<Installation Directory
>\Replication\LogFiles\FFCOPY.log]

/LOGH[ISTORY]=nnn Number of files to maintain in the log


history [default=5]

/LOGS[IZE]=nnn Maximum size of the log file (0 means 'no


limit') [default=0]

/LOGW[IDTH]=nnn Log messages are wrapped to fit within


this line length. (minimum 50) [default=79]

/H[ELP] Displays the command usage help text.

Note: The default installation directory varies depending on the version of your
operating system.

Setup steps
Run ffcopy.sql file to create the database file that contains the
information about the files to be copied. The columns of the table
have the following meaning.

LocalFN Local Name and Path of Local file to Replicate

RemoteFN Remote Name and Path of File to Replicate, can be UNC or


Drive

7-27
Using the DataExchange Utilities and Services

ReserveInt1 Set to 0 initially, used by DLL after that, do not alter manually

ReserveInt2 Set to 0 initially, used by DLL after that, do not alter manually

PartnerSideDelete If '1', file existing only in RemoteFN (not in LocalFN), will be


deleted.

CopyInProc Locking byte for other instances of this DLL

ReserveByte Set to 0, reserve by DLL

Functionalities
1 Find names may include wildcards (*, ?).
2 A new file that matches a wildcard is detected only on the local
site and will be copied to the remote site.
3 If a wildcard matches sub-directories, they will be traversed and
new directories will be created on the remote side if they do not
exist.
4 Change detection algorithm: A file on NTFS contains 3 dates -
creation date, modification date, and accessed date. If a local file
is more recent than its remote partner file, the local file is copied
to the remote directory. (Note that copying a file does not
change its modification date).
5 Check the ffcopy.log file for information and errors.

Note To match all files in a directory, use "*" (for example,


c:\files\*), not "*.*".

Logging
ffcopy.exe logs information and error messages to the replication log
files directory which is commonly located in
<Installation Directory
>\replication\logfiles\ffcopy.log.

7-28
Command-line Utilities

DxEvent.sql / dxevent.dll
The dxevent.dll handles replication session event callbacks. The
following events are handled:

OnReplicationRequest Called whenever a replication session is initiated with the


database via user interaction, a scheduled replication, or
a DX API call and before a connection has been
established with the Partner Site.

PreSessionStart Called once before each session is initiated with the


attached database and before any attempt to contact the
Partner Site has been made.

PostSessionStart Called after the connection has been made with the
Partner Site and before any data has been replicated.
This is the first callback method that receives an identifier
for the replication session. In addition, it receives the
name and network address of the Partner Site.

OnSessionEnd Called after all the data has been replicated and before
the network connection is terminated. This is the last
session callback method that receives the SessionID.
Useful for reporting the results of a replication session
including the number of data conflicts resolved.

The dxevent.dll, in conjunction with the dxEvent table in your


database will allow the user to spawn 3rd party executables or scripts
when the above events occur during a replication session.

Setup steps
Run dxEvent.sql to create the dxEvent table in your database. The
dxEvent table columns have the following meaning.

dxEventType char(30) Contains the event name {OnReplicationRequest,


PreSessionStart,PostSessionStart,OnSessionEnd}

Command char(128) Contains the command the user wants to run (ex.
'c:\<Installation Directory >\bin\ffcopy.exe
myfiles.mkd')

Wait bit Set this bit if you want the callback DLL to wait for the
command to return and check the status code

NeedArgs bit Set this bit if you want the callback DLL to pass in
session args such as dsn name, dbname, session id

Ignore bit Set this bit if you want the callback DLL to ignore this
command

7-29
Using the DataExchange Utilities and Services

Activate (dxact.exe) your database using the /DL option set to


dxevent.dll.

Note The replication engine (replserv.exe) must be restarted in


order for the dxevent.dll to take effect.

Logging
dxevent.dll logs information and error messages to the replication
log files directory which is located in:
<Installation Directory
>\replication\logfiles\dxevent.log.

Event Callback API


The event callback API is documented in the Pervasive
DataExchange API Reference. Contact Pervasive Software Support
for a copy of the DataExchange API Reference.

7-30
GUI-based Utilities

GUI-based Utilities
Pervasive DataExchange includes four graphical user interface
(GUI) utilities for completing replication design, administration and
monitoring tasks. The following table lists the GUI-based utilities
and offers a brief description for each utility.

Utility File Utility Name Description


Name

da Manager GUI DX Administration utility.


Sets up notifications, user
access, and replication
schedule information.

prd Designer GUI Template Designer utility.


Supports creating and
updating design templates for
replication.

replmonitor Replication Progress and Log GUI statistics and logging view
Viewers utility. Configures replication
sessions, monitors data
replication, and sets logging
options.

dpwizard Deployment Wizard Wizard to deploy replication.

trwizard Template Remover Wizard Wizard to remove a replication


template.

da Pervasive DataExchange Manager

DataExchange Manager

Description
The DataExchange Manager is used to administer replication
networks. DataExchange Manager is a separate application that can
be run external to PCC. You can access the Manager by selecting
DataExchange Manager from the Pervasive group on the Start
menu, or from within PCC by selecting DataExchange Manager.
For more information on using the DataExchange Manager, see
Chapter 9, “Using DataExchange Manager.”

7-31
Using the DataExchange Utilities and Services

prd DataExchange Designer

Description
The DataExchange Designer is used to design and update a database
for replication. You create design templates for replication using this
utility. DataExchange Designer is also a separate application that can
be run external to PCC. You access the Designer by selecting
DataExchange Designer from the Pervasive group on the Start
menu or from within PCC by selecting DataExchange Designer.
For more information on using the DataExchange Designer, see
Chapter 8, “Using the DataExchange Designer.”

replmonitor Replication Progress and Log Viewers

Description
Pervasive DataExchange allows you to configure replication
sessions, initiate replication, monitor it, and log it. The tools with
which you perform these actions are the Replication Progress and
Log Viewers. Their window is accessed from Pervasive Control
Center (PCC).
For more information, see Chapter 10, “Using the Replication
Progress and Log Viewers.”

dpwizard Pervasive DataExchange Deployment Tool

Description
Deployment Tool walks you through the steps necessary to deploy
replication on First and Partner Sites. The wizard is an automated
alternative to the DXDeploy command-line utility and can be
invoked by selecting DataExchange DeploymentTool from the
Pervasive group on the Start menu, or from within PCC by selecting
DataExchange DeploymentTool

trwizard Pervasive DataExchange Template Remover Wizard

Description
Template Remover is a wizard that deletes a replication template.
You can no longer use the template to activate sites. You access this

7-32
GUI-based Utilities

wizard by selecting DataExchange Template Remover from the


Pervasive group on the Start menu.

7-33
Using the DataExchange Utilities and Services

Services
Pervasive DataExchange includes two services that initiate
automatically at the time of startup. This section discusses these
services and includes specific information on configuring these for
your specific business requirements.

File Name Utility Name Description

dxagent Pervasive DataExchange Detects critical replication


Agent failures, and notifies
administrators by E-mail.

replserv Pervasive PSQL Replication Performs data replication


between Pervasive PSQL
databases.

dxagent Pervasive DataExchange Agent

Description
Detects critical replication failures and notifies administrators by
e-mail.

Failure Notification
DataExchange has the ability to notify you by electronic mail
(e-mail) if a scheduled replication fails. The failure can be either of
the following types:
„ A scheduled replication fails to replicate within a specified
period.
„ A replication site cannot be communicated with (perhaps the
machine is down, the network has failed, and so forth).

Notification Agent
DataExchange installs a component called the notification agent if
the machine contains the Pervasive PSQL Server product. The
notification agent, or DXAgent, provides the notification
functionality when scheduled replication fails.
The agent is not available if you install DataExchange on a machine
with the Pervasive PSQL Workgroup product. If you use a
Workgroup engine as a replication site, set up your replication

7-34
Services

schedule on the site that contains the Server database engine. The
agent on the Server machine will detect if replication fails on the site
with the Workgroup engine.
The agent initiates an e-mail if a replication failure occurs. The
subject line of the e-mail contains the words “DataExchange alert.”
The body of the e-mail contains the following primary content:
„ Identity of computer on which the failure occurred
„ Name of database
„ Time since the last successful replication

Communication Protocol
The agent requires the basic Simple Mail Transfer Protocol (SMTP)
to communicate with a mail server. Each replication machine with
an agent must be configured to access the SMTP server.
Correspondingly, the SMTP server must be set up to accept e-mail
from each replication site running the agent.
The agent does not deal with authentication or encryption. It does
allow a different port other than the standard SMTP port 25. Thus,
if a firewall opens a different port, you can specify which one. The
port must not require authentication or encryption.
If a replication failure occurs and the SMTP server cannot be
reached, a pop-up message appears. The message informs you that
e-mail could not be sent and lists the name of the SMTP server that
cannot be communicated with. Note that the pop-up message
appears even if no one is logged on to the computer. Also, the
message continues to display until replication succeeds or the SMTP
server becomes available. This is true even if you click OK to dismiss
the message.

Agent Configuration
DataExchange contains a configuration file with which you
configure the agent.

³ To configure the notification agent


1 Open the text file DXAgentConfig.XML in a text editor. The file
is located in the <Installation Directory >\Replication\Config
directory.
<?xml version="1.0"?>

7-35
Using the DataExchange Utilities and Services

<dxagentconfig>
<smtpserver>
<hostname>SMTP Server To Be Configured
</hostname
<port>25</port>
</smtpserver>
<email>
<from>DXAgent@MyCompany.com</from>
<to>E-mail Address To Be Configured</to>
</email>
</dxagentconfig>

2 Specify the following in the file:


Š SMTP Server To Be Configured – The name or IP address
of the e-mail server.
Š 25 – The port number on the e-mail server used for
receiving mail. By default, this is set to port 25.
Š DXAgent@mycompany.com – The e-mail address used by
the agent for the sender of the notification. This address is
for information only and does not have be an valid address.
Š E-mail Address To Be Configured – The e-mail address
used by the agent for the recipient of the notification. Only
one address is allowed, but it may be a group address.
The following example shows a modified DXAgentConfig.XML
file.
<?xml version="1.0"?>
<dxagentconfig>
<smtpserver>

<hostname>myserver.mylocation.mycompany.com</
hostname>
<port>25</port>
</smtpserver>
<email>
<from>DXAgent@mycompany.com</from>

<to>mailbox@myserver.mylocation.mycompany.com</to>
</email>
</dxagentconfig>

3 Save DXAgentConfig.XML after you modify it.


4 If you have not already done so, modify your replication
schedule to include notification.

7-36
Services

replserv Pervasive PSQL Replication Service

Description
The executable of the Replication service. The Pervasive
DataExchange service performs data replication between Pervasive
PSQL databases.
For information on starting and stopping the Replication Service,
see “Starting and Stopping Replication,” on page 2-2.

7-37
Using the DataExchange Utilities and Services

7-38
chapter

Using the DataExchange


Designer 8
A Tour of the DataExchange Designer Features and Functionality

„ “DataExchange Designer Concepts” on page 8-2


„ “DataExchange Designer GUI Visual Reference” on page 8-13
„ “DataExchange Designer Tasks” on page 8-22

8-1
Using the DataExchange Designer

DataExchange Designer Concepts


Welcome to the DataExchange Designer. The DataExchange
Designer allows you to customize a design for replication. This
chapter is designed to help you better understand the features
available in the DataExchange Designer and how each feature is used
to create a customized replication design.
This section contains the following topics:
„ Overview
Š Real-Time Backup Edition
Š Data Synchronization Edition
„ 1-Way / 2-Way Methods
Š Database Selection
Š DataExchange Method
Š Database Identification
Š Database Connection Information
Š Replicated Tables
„ Design Completion
Š Templates
„ Administration
Š Database Settings
Š Preferences

Overview The Designer can be used with both Data Synchronization and Real-
Time Backup Editions. An alternate method for Real-Time Backup
and Data Synchronization 1-way and 2-way replications is to use the
DXDeploy utility.
For information on using DXDeploy, see Chapter 7, “Using the
DataExchange Utilities and Services.”

Real-Time Backup Edition


You can use the Designer in the Real-Time Backup Edition, or you
can use the DXDeploy utility. This deployment utility is designed to
simply and effectively handle the design and activation phases of
your replication backup.

8-2
DataExchange Designer Concepts

The procedures for using the Designer to create a replication design


template for your Real-Time Backup are identical to the procedures
for 1-way Data Synchronization. Refer to “1-Way / 2-Way Methods”
on page 8-3, and follow the instructions to create a template for Real-
Time Backup using the DataExchange Designer.
For information on creating a design for your replication backup,
refer to Chapter 4, “Real-Time Backup Deployment Models.”
For more information on using DXDeploy, see Chapter 7, “Using
the DataExchange Utilities and Services.”

Data Synchronization Edition


For the Data Synchronization Edition, the DataExchange Designer
requires that you select a DataExchange Method of replication that
you want to implement. The method you select depends on your
database and your business requirements. The choices are 1-way and
2-way.

1-way
Select the 1-way method if one or more of the following is true:
„ You want a data replication solution to ensure that you can
restore data from a backup copy. This is a 1-way replication
from one machine to another or from multiple machines to a
single backup machine.
„ You want a data portal solution to ensure a backup of your data
and the ability to run reports on the backup server.

Note The maximum length of a record that can be replicated for


the 1-way method is 61,057 bytes.

2-way
Select the 2-way method if one or more of the following is true:
„ You want a data synchronization solution (2-way replication).
„ You do not require sophisticated conflict handling. That is,
record conflicts can be handled at the column level granularity
based on the most recent timestamp and other criteria.

8-3
Using the DataExchange Designer

1-Way / 2-Way This section explains the concepts of using the DataExchange
Methods Designer to create and customize replication designs for both
DataExchange Methods. The instructions here provide the
foundation for using either the 1-way or 2-way method, in that both
methods require you to perform the following:
1 Select the database
2 Identify the database
3 Select tables for replication

Note The DataExchange Designer interface varies, depending


on the DataExchange Method you choose to use. Concepts
which pertain to specific DataExchange Methods are noted
accordingly.

Database Selection
First you select a database to use for your replication design. You
may choose to open an existing database, or you can create a new
database for this purpose. The next figure shows the Database
Information dialog where the database name is entered and the
DataExchange Method is selected, using Data Synchronization.

Figure 8-1 Data Synchronization Database Selection Dialog

The next figure shows the Database Information dialog where the
database name is entered and the DataExchange Method is selected,
using Real-Time Backup.

8-4
DataExchange Designer Concepts

Figure 8-2 Real-Time Backup Database Selection Dialog

DataExchange Method
If you select a new database for replication, you must select the
DataExchange Method to use when you enter the database
information. In selecting an existing database, the DataExchange
Method is already determined by the method previously used for the
selected database.
The method you select depends on your database and your business
requirements. The choices are 1-way and 2-way.

Database Connection Information


If applicable, you will need to enter the User Name and Password for
your selected database.
See “Basic Design Tasks” on page 8-22 for more information on
selecting databases for replication.

Database Identification
When creating a new database for replication, you must designate
specific identifiers for the Project, Network, and Release names
associated with your replication design.

Project
A project represents a single replicated database. The replication
Project Name is of your own choosing and helps you identify and
keep track of what you need to replicate. You can use a simple-to-
understand name that helps you remember which database is
involved.

8-5
Using the DataExchange Designer

If your goal is to replicate with a database named mydatabase, then


you may want to call the project mydatabase project or something
similar that helps you remember which database is involved.
A Project name must be 20 characters or less.
A project can be associated with more than one replication network.
That is, you could create a design for mydatabase project, finance
department network, 1.0 and mydatabase project, accounting group
network, 1.0.

Network
A replication network is the grouping of replication sites that will
participate in the replication. The name for the replication network
is of your own choosing and helps you identify and keep track of
what you need to replicate. A name that helps you remember the
grouping is very useful. For example, you could name a grouping of
sites in the finance department finance network.
The Network name must be 20 characters or less.

Release
The release is like a version number for the design of the replication
database. Your first design could be version 1, for instance. If you
choose to change the design later, then you would create a version 2
and so forth.
The Release name must be 8 characters or less.
The name for the replication release is of your own choosing and
helps you identify and keep track of what you need to replicate.
The Project, Network, and Release names are added to the database
network analyst (DNA), which is the system database used by the
Replication Engine. The replication utilities use these names from
the DNA database to allow or disallow certain actions. For example,
databases that differ only by release are allowed to replicate together.

8-6
DataExchange Designer Concepts

Tip Replication project names and network names must match


to allow replication.

Replicated Tables
When you first start the DataExchange Designer, the database tables
are listed in the left pane on the Not Replicated tab. Initially, none of
the database tables are flagged for replication; all of the tables are
marked as Not Replicated.

To begin your design, you decide which tables to use for replication
and mark these tables accordingly.

Note Selecting tables for replication is a required task for both 1-


way and 2-way DataExchange Methods.

If you are designing a replication template for Real-Time Backup, 1-


way, or 2-way deployments, and you have completed the steps in this
section, you may proceed to the section titled “Design Completion”
on page 8-7.
See “Basic Design Tasks” on page 8-22 for more information on
selecting databases for replication.

Design After you have completed your design, you save and apply the design
Completion to create the replication template. Templates are required for designs
in order to establish a structure on which to base data replication.

8-7
Using the DataExchange Designer

Templates
Saving the design writes design information to one of the replication
system control tables for the template. The design information for
your data has not yet been applied directly to the template itself.
The save action also verifies the design and ensures that you have not
specified anything incorrectly. If there are errors, the DataExchange
Designer displays a window describing the error and instructing you
on how to correct the error. Once the save process completes
successfully, a message is presented in the lower left corner of the
DataExchange Designer main window.

When you choose to save the design template, the Designer creates a
template with initial design information, such as the replication
system control tables. This action applies the design of your data to
the template. That is, the Designer creates a replication control table
for each data table you chose to replicate, and updates the replication
system control tables.
A dialog box appears, like the following, on which you can specify
the copy of “starter” data. The default is to copy the starter data.
.

If the database you are designing contains data and you want to
replicate that data, then you must copy the data as starter data to the
replication template. If you clear this selection, the data will not be
replicated.
This option applies only to data existing in the database before
configuring the database for replication. All data entered into the

8-8
DataExchange Designer Concepts

database after the database is configured for replication gets


replicated (provided the data is entered into a table specified for
replication).
A message appears informing you that the replication template has
been created. The template contains the replication control tables
and the data tables.
When you use dxact.exe to activate a site, you can specify whether to
copy starter data to the activated site. To copy the data during
activation, it must be in the template. Using the /PREPROCESS option
with dxact.exe ensures that the data is in the template when you
create it with the DataExchange Designer. See “dxact” on page 7-6
for information on using this utility.
See “Design Completion Tasks” on page 8-22 for more information
on working with Templates.

Administration Database Settings


You can apply settings for the following areas:
„ Authentication
„ Information Files

Authentication
Authentication is not used with Pervasive PSQL databases. Pervasive
PSQL databases can replicate with any site regardless of the
replication network.

Information Files
Information files contain information about the replication design
and are primarily used for troubleshooting. The DataExchange
Designer creates two information files when you first save your
design (thereafter, a save updates the files). The files are named in the
format xPDnnnnnn.OUT and xPDnnnnnn.REF. The default location
is the directory where you installed Pervasive PSQL.
Generally, you do not have to use the information files unless
requested by a technical support representative.

8-9
Using the DataExchange Designer

Preferences
You can set DataExchange Designer preferences to determine if
database selection is automated at startup and how messages and
errors are logged.

Wizard
The Startup Wizard can be invoked when you launch the
DataExchange Designer, by setting the preferences on the Wizard
tab of the Designer. This dialog lets you open a new database or select
an existing database to use for your replication design.

Logging
The log file for the DataExchange Designer is PRD.log. This file is
located in <Installation Directory >\Replication\LogFiles. You can
specify certain options about the information contained in the log,
the size and location of the log, and the number of logs that retain
historical information.

8-10
DataExchange Designer Concepts

The following table describes each available Logging Level option


and provides a sample log entry for that option.
Table 8-1 DataExchange Designer Logging Level Options

Option Name Description

Error This setting turns on or off the logging of errors to the PRD.log
file.

‹ Select this check box to turn on error logging to the


PRD.log file.

‹ Clear this check box to turn off error logging.

Errors are indicated by an E in the first column:

E 01de 1117-11:54:34 Unable to connect to


'acct03db'

Warning This setting turns on or off the logging of warnings to the


PRD.log file.

‹ Select this check box to turn on warning logging to the


PRD.log file.

‹ Clear this check box to turn off warning logging.

Warnings are indicated by a W in the first column:

W 01de 1117-11:54:34 Connection to acct03db


not found.
Attempting to create connection.

Information This setting turns on or off the logging of information


messages to the PRD.log file.

‹ Select this check box to turn on information logging to the


PRD.log file.

‹ Clear this check box to turn off information logging.

Information messages are indicated by an I in the first column:

I 019c 1109-14:06:36 Pervasive PSQL


Replication Administrator

8-11
Using the DataExchange Designer

Table 8-1 DataExchange Designer Logging Level Options

Option Name Description

Debug This setting turns on or off the logging of debug information to


the PRD.log file.

‹ Select this check box to turn on debug information logging


to the PRD.log file.

‹ Clear this check box to turn off the logging of debug


information.

Debug information is indicated by a D in the first column:

D01de 1117-11:54:26 DRE address for PDDNA is


user_main

Tracing This setting turns on or off the logging of trace information to


the PRD.log file. The information being traced is every
function call.

‹ Select this check box to turn on trace information logging


to the PRD.log file.

‹ Clear this check box to turn off the logging of trace


information.

Trace information is indicated by a T in the first column:

T 0177 1117-13:19:41 0 <<


DDBInserter::InsertRecord (0ms)

Caution Avoid using the Trace option for long periods (over 30
minutes), particularly if you are performing numerous tasks
with the DataExchange Designer. Trace outputs every function
call to the log file. Your log file can grow enormously in a very
short period. Generally, only use Trace when requested by a
technical support representative.

The Verbose Logging option applies only to the Debug Logging


Level option. (The Debug option must also be checked.) Verbose
Logging outputs the source program file name and the line number
within the file. The following example shows that source file
dbodbcsend located a driver for Pervasive PSQL (line 425 of the
source code).
D 01de 1117-11:54:34 dbodbc 425 Pervasive PSQL driver found:
'Pervasive ODBC Client Interface'

8-12
DataExchange Designer Concepts

Log file options you can set include Maximum Log Size, Maximum
Logs to Keep, and the Name of Log File.
Maximum Logs to Keep - This value sets the number of history files
retained. Each time the Designer is activated, a new PRD.log file is
created, renaming the previous PRD.log file to PRD.lo1.
For example, when the Designer is activated, the files PRD.log and
PRD.lo1 are created. PRD.log is then empty and starts acquiring data
once more. The next time the Designer is activated, PRD.lo1
becomes PRD.lo2, a new PRD.lo1 is created from PRD.log, and
PRD.log is again empty and able to acquire data. The Maximum
Logs to Keep setting determines the extent of the history retained:
lo1, lo2, lo3, and so forth.
Name of Log File - This specifies the location and name of the
current log. The Pervasive DataExchange logs are located at
<Installation Directory >\Replication\Logfiles. The default log file
name for the Designer is PRD.log. You can change the location and
the name of log file for the DataExchange Designer if you prefer.
This completes the discussion of DataExchange Designer concepts.
The next section discusses the graphical user interface of the
DataExchange Designer.

8-13
Using the DataExchange Designer

DataExchange Designer GUI Visual Reference


This section details the objects on the DataExchange Designer
graphical user interface (GUI). The areas that are described in this
section include:
„ Main Window
„ Designer Menu and Toolbar
„ Database Design pane

Main Window The main window of the DataExchange Designer displays when the
application is first started or after you have selected a database for
use, depending on the application settings you have made. The
following image shows the main window of the DataExchange
Designer GUI. The primary objects in this window include:
„ Title Bar
„ Menu Bar
„ Toolbar
„ Database Design Pane
„ Status Bar

Figure 8-3 Designer Main Window

8-14
DataExchange Designer GUI Visual Reference

The following table describes the main window GUI objects. Each
object is explained in depth in the subsequent sections of this
chapter.

GUI Object Description Related Information

Title Bar Shows the name of the utility.

Also contains the following:

‹ Minimize button

‹ Maximize button

‹ Close button

Menu Bar Provides the following menu “Designer Menu and


options: Toolbar” on page 8-15

‹ File

‹ Actions

‹ Tools

‹ View

‹ Help

Toolbar Contains toolbar buttons that “Designer Menu and


allow you to complete a Toolbar” on page 8-15
number of tasks quickly and
easily.

Contains the following


buttons:

‹ New Database

‹ Open Database

‹ Save Database

‹ Verify Design

‹ Create Replication
Template

‹ Create a New Release

‹ View Messages

‹ Refresh

‹ Help Topics

8-15
Using the DataExchange Designer

GUI Object Description Related Information

Database design Displays the tables available “Database Design pane”


pane for design from the selected on page 8-21
database.

Contains the following


objects:

‹ Replicated tab

‹ Not Replicated tab

Status Bar Displays helpful information


for selected tasks.

Displays the following


replication status information:

‹ Database Name

‹ Project Name

‹ Network Name

‹ Release Name

Designer Menu The following image shows the menu and toolbar in the
and Toolbar DataExchange Designer interface.

Figure 8-4 Designer Menu and Toolbar

8-16
DataExchange Designer GUI Visual Reference

The following table details each object available from the Designer
Menu and Toolbar components.

GUI Object Description Related Information

Menu Bar Shows the following menu


options:

‹ File

‹ Actions

‹ Tools

‹ View

‹ Help

Toolbar Provides toolbar buttons that


allow you to complete a
number of tasks quickly and
easily.

Contains the following


buttons:

‹ New Database

‹ Open Database

‹ Save Database

‹ Verify Design

‹ Create Replication
Template

‹ Create a New Release

‹ View Messages

‹ Refresh

‹ Help Topics

File menu Provides the following menu


commands:

‹ New

‹ Open...

‹ Save

‹ Exit

8-17
Using the DataExchange Designer

GUI Object Description Related Information

New (Ctrl+N) Opens the Database “To create a new


Information dialog with which database for replication”
or you can specify a new on page 8-24
database to design.

(New Database
button)

Open... (Ctrl+O) Displays the Database Select “To open an existing


or New dialog with which you database for replication”
or can select a replication on page 8-25
template database or a new
database to open.
(Open Database
button)

Save (Ctrl+S) Saves the current state of the


design in one of the replication
or control tables. The Designer
adds the replication control
tables to an existing database
(Save Database when you open the database.
button) A template already contains
the replication control tables.
Save Database is not the
same as Create Replication
Template.

Exit Quits the application and


prompts you to save your
work.

Actions menu Provides the following


commands:

‹ Replicate Table

‹ Don’t Replicate Table

‹ Refresh

Replicate Table Designates a table for “To designate a table for


replication. replication” on page 8-27

Don’t Replicate Designates a table to which “To designate a table not


Table you want excluded from to be replicated” on page
replication. 8-28

8-18
DataExchange Designer GUI Visual Reference

GUI Object Description Related Information

Refresh (F5) Displays an updated, or


refreshed, view of the current
or replication design.

(Refresh button)

Tools menu Provides the following


commands:

‹ Verify Design

‹ Create Replication
Template...

‹ Create New Release...

Verify Design Checks your replication


design for referential integrity.
or Any design errors are
reported in a messages
window.
(Verify Design
button)

Create Replication Creates a replication template “To create a Replication


Template... from the current design. Template based on a
design” on page 8-29
or

(Create
Replication
Template... button)

Create New Creates a new release for the “To create a new release
Release... current design. of a design” on page 8-30

or

(Create New
Release... button)

8-19
Using the DataExchange Designer

GUI Object Description Related Information

View menu Provides the following


commands:

‹ Database Settings...

‹ Database Information...

‹ Verification Messages...

‹ Preferences...

‹ Switch Views

Database Settings Displays the current settings “To access the Database
for the selected database. Settings” on page 8-30
Database settings include:
“To display Authentication
‹ Authentication Settings” on page 8-31

‹ Information Files “To set the Information


Files location” on page 8-
32

Database Displays the Database “To view Database


Information Certification Information for Certification information”
the selected database. on page 8-32
Database Certification
Information includes:

‹ Name

‹ Type

‹ Location

‹ Project Certificate

‹ Organization Certificate

Verification Displays all applicable “To view generated


Messages messages related to the Verification Messages” on
verification of the selected page 8-33
or database.

(View Messages
button)

8-20
DataExchange Designer GUI Visual Reference

GUI Object Description Related Information

Preferences Displays the current “To set DataExchange


application settings for Designer preferences” on
DataExchange Designer. page 8-33
Setting options include:
“To designate settings for
‹ Wizard the startup wizard” on
page 8-33 on page 8-33
‹ Logging
“To set the DataExchange
Designer logging
preferences” on page 8-
34

Switch Views
(Ctrl+Shift+Tab)

Help menu Provides the following


commands:

‹ Help Topics (F1)

‹ About Pervasive
DataExchange Designer

Help Topics (F1) Lists the documentation topics “To display help” on page
for DataExchange Designer. 8-23.
or

(Help Topics
button)

About Displays the name and


DataExchange version of DataExchange
Designer Designer and the Pervasive
DataExchange copyright
information.

8-21
Using the DataExchange Designer

Database The following image shows the Database Design pane and the
Design pane objects which are included in this component of the DataExchange
Designer GUI.

Figure 8-5 Database Design pane

The following table details the objects included each of the tabbed
dialogs in the Database Design pane.

GUI Object Description Related Information

Replicated Tab The Replicated tab shows For information on


you a list of all the tables in the performing the tasks
selected database that are available from the
designated for replication. Replicated tab, see “Basic
Design Tasks” on page 8-
This is a list of the tables that 22
you have designated to be
replicated. Only the tables in
this list will be replicated for
the database your are
designing.

Table Displays the Table name.

Not Replicated The Not Replicated tab For information on


Tab contains a list of the tables performing the tasks
that you have designated to available from the Not
not include in replication. Replicated tab, see “Basic
Design Tasks” on page 8-
This is a list of the tables that 22.
you have designated not to
replicate. The tables in this list
will not be replicated for the
database your are designing.

Table Displays the Table name.

8-22
DataExchange Designer Tasks

DataExchange Designer Tasks


This section details the tasks that you perform with the
DataExchange Designer. The tasks are separated into the following
categories:

Category Description

General Tasks Introduces you to working with the


DataExchange Designer.

Basic Design Tasks Apply to creating designs for both Real-


Time Backup and Data Synchronization
Editions.

Design Completion Tasks Apply to completing and applying


replication designs.

Administrative Tasks Apply to setting preferences for


replication designs.

General Tasks The tasks described in this section apply to general use of the tool
and are intended to introduce you to working with DataExchange
Designer.
“To start DataExchange Designer as a stand-alone application” on
page 8-23
“To start DataExchange Designer from PCC” on page 8-23
“To display help” on page 8-23

Basic Design The tasks described in this section apply to all replication designs.
Tasks Both Real-Time Backup and Data Synchronization Editions require
that these tasks be completed. The following lists the tasks included
in this category.
“To create a new database for replication” on page 8-24
“To open an existing database for replication” on page 8-25
“To designate a table for replication” on page 8-27
“To designate a table not to be replicated” on page 8-28

8-23
Using the DataExchange Designer

Design “To create a Replication Template based on a design” on page 8-29


Completion “To create a new release of a design” on page 8-30
Tasks

Administrative “To access the Database Settings” on page 8-30


Tasks “To display Authentication Settings” on page 8-31
“To set the Information Files location” on page 8-32
“To view Database Certification information” on page 8-32
“To view generated Verification Messages” on page 8-33
“To set DataExchange Designer preferences” on page 8-33
“To designate settings for the startup wizard” on page 8-33
“To set the DataExchange Designer logging preferences” on page 8-
34

General Tasks

³ To start DataExchange Designer as a stand-alone


application
1 Select DataExchange Designer from the Pervasive group on
the Start menu.

³ To start DataExchange Designer from PCC


1 Start PCC if it is not already running. (Select Control Center &
Documentation from the Pervasive group on the Start menu.)
2 In PCC expand the database node for the database for which you
want to create a design.
3 Select DataExchange Designer.

³ To display help
1 Click Help, then select the type of help you want:
Š Help Topics – Lists the documentation topics for
DataExchange Designer.
Š About – Displays the name and version of DataExchange
Designer and the Pervasive DataExchange copyright
information.

8-24
DataExchange Designer Tasks

Tip You may also press F1 to access the list of help topics.

Basic Design Tasks

Note The tasks described in this section apply to all replication


designs created with the DataExchange Designer.

³ To create a new database for replication


1 From the DataExchange Designer menu bar click File New.
The Database Information dialog will prompt you for
information about the new database.

2 Type the DBName for the database you want to design.

Tip The database must exist and already have been added to
ODBC.

3 Select the DataExchange Method to use. Choices include 1-way


or 2-way.

8-25
Using the DataExchange Designer

If you are designing a template for Real-Time Backup


replication, you will not have the option to select a
DataExchange Method.
4 If the database uses Pervasive PSQL security, enter Master for
the the User Name. This is the default user name for databases
with Pervasive PSQL security.
Database security can be enabled through Pervasive Control
Center (PCC). To verify if security is enabled, right-click a
database name in the PCC tree and select Properties. Select the
Security tab, which will state if security is enabled.
5 Type the Password for the Master user name.
6 Click Next. The Database Identification dialog will prompt you
for information about the replication design.

7 Enter or select from the drop-down list the Project name for
your design. Project names must be 20 characters or less.
8 Enter or select from the drop-down list the Network name for
your design. The Network name must be 20 characters or less.
9 Enter the Release name for your design. The release is like a
version number for the design of the replication database. The
Release name must be 8 characters or less.

8-26
DataExchange Designer Tasks

Tip The Project names and Network names must match to allow
replication.

³ To open an existing database for replication


1 From the DataExchange Designer menu bar click File Open.
The Database Select or New dialog displays, showing the list of
template databases available for design.

2 Select the desired template from the list.


3 Click Finish to open the template.

Note You can select Enable New Database from this screen, and
the Database Information dialog discussed in “To create a new
database for replication” on page 8-24 displays.

8-27
Using the DataExchange Designer

³ To designate a table for replication


1 In the Database Design pane, click the Not Replicated tab to
display the tables not yet designated for replication.
2 Select the table or tables you want to designate for replication.

Tip To select multiple tables in the list, click the first table in the
list. Press the Shift key and, while holding it down, click the
additional tables for selection in the list.

3 Click Actions Replicate Table.

Tip You can also designate tables for replication by right-


clicking the selected table(s), then click Replicate Table.

The selected tables move from the Not Replicated tab to the
Replicated tab.

As you select each table name on the Replicated tab, the view on
the right changes to show information for that table. The first
tab on the right shows the structure for a particular table.

8-28
DataExchange Designer Tasks

³ To designate a table not to be replicated


1 In the Database Design pane, click the Replicated tab to display
the tables designated for replication.
2 Select the table or tables you want to exclude from replication.

Tip To select multiple tables in the list, click the first table in the
list. Press the Shift key and, while holding it down, click the
additional tables for selection in the list.

3 Click Actions Don’t Replicate Table.

Tip You can also exclude tables from replication by right-


clicking the selected table(s), then clicking Don’t Replicate
Table.

The selected tables move from the Replicated tab to the Not
Replicated tab.

8-29
Using the DataExchange Designer

For more information on Basic Designs, see “1-Way / 2-Way


Methods” on page 8-3.

Design Completion Tasks

³ To create a Replication Template based on a design


1 Click Tools Create Replication Template. A dialog appears
on which you specify to copy starter data to other replication
sites.

If the database you are designing contains data and you want to
replicate that data, then you must copy the data as starter data to
the replication template.

8-30
DataExchange Designer Tasks

Note When you activate a site you can specify whether to copy
the starter data to the activated site. If you want to copy the data
during activation, it must already be in the template. The
DataExchange Designer and dxact.exe each have options dealing
with copying data.

2 Do one of the following:


Š To copy data (the default), click OK.
Š To not copy data, clear the Copy starter data to other sites
option, then click OK.

³ To create a new release of a design


1 Click Tools Create New Release.
The New Release Name dialog displays.

2 Type a new Release Name, which must be 8 characters or less.


3 Click OK. A message appears informing you that the new release
was successfully created.

4 Click OK.

Administrative Tasks

³ To access the Database Settings


1 Click View Database Settings.

8-31
Using the DataExchange Designer

2 The Database Settings dialog displays.

You can apply settings for the following areas:


Š Authentication
Š Information Files

³ To display Authentication Settings


1 From the Database Settings dialog, select the Authentication
tab.

I replicate only with Registered Sites


This option is automatically disabled for you because you are
designing with Pervasive PSQL databases. Registered sites do not
apply to Pervasive PSQL databases, which can replicate with any site
regardless of the replication network being used.

8-32
DataExchange Designer Tasks

I replicate with any Site


This option is automatically selected for you because you are
designing with Pervasive PSQL databases. Pervasive PSQL databases
can replicate with any site regardless of the replication network being
used.

³ To set the Information Files location


1 From the Database Settings dialog, select the Information Files
tab.

2 Type the location, or use the browse button, for the location
where you want the information files to be created. The default
location is the directory where you installed Pervasive PSQL.
3 Click OK.

³ To view Database Certification information


1 Click View Database Information. The Database
Certification displays.

8-33
Using the DataExchange Designer

2 Click OK.

³ To view generated Verification Messages


1 Click View Verification Messages. A pop-up window appears
that contains the messages. The next illustration shows the
message window.

³ To set DataExchange Designer preferences


1 Click View Preferences.
The Settings dialog displays, showing the tabbed areas for which
you can designate preferences.
You set preferences on the following Settings tabs:
Š Wizard
Š Logging

³ To designate settings for the startup wizard


1 Click View Preferences.
2 The Settings dialog displays. Select the Wizard tab.
3 Do one of the following:
Š Select the Show Wizard on Start Up check box to invoke the
Startup Wizard when the DataExchange Designer opens.
Š Clear the Show Wizard on Start Up check box to start the
DataExchange Designer without invoking the Startup
Wizard automatically.

8-34
DataExchange Designer Tasks

Note If you have selected to launch the Designer without


invoking the Startup Wizard, you must use either File New
to open a new database or File Open to open an existing
database.

³ To set the DataExchange Designer logging


preferences
1 Click View Preferences.
2 The Settings dialog displays. Select the Logging tab.

3 Mark the check box for each of the Logging Levels option for
which you want Designer to report.
Š Error - records Error messages to the log file
Š Warning - records Warning messages to the log file
Š Information - records Information messages to the log file
Š Debug - records debugging information to the log file
Š Tracing - records trace information to the log file.
For more information on Logging Level options, see “Logging” on
page 8-9.

Caution Avoid using the Trace option for long periods (over 30
minutes), particularly if you are performing numerous tasks

8-35
Using the DataExchange Designer

with the DataExchange Designer. Generally, only use Trace


when requested by a technical support representative.

4 Select if you want Verbose Logging.

Note This only applies to the Debug Logging Level. Debug must
be selected in order to use this option.

5 Enter the Maximum Log Size (in bytes) for the log file.
6 Enter the Maximum Logs to Keep. This is the number of log files
you want DataExchange Designer to maintain.
7 Enter the location and name of the log file for DataExchange
Designer.
8 Click OK.

8-36
chapter

Using DataExchange
Manager 9
A Tour of DataExchange Manager Utility

The topics in this chapter include:


„ “DataExchange Manager Concepts” on page 9-2
„ “DataExchange Manager GUI Visual Reference” on page 9-9
„ “DataExchange Manager Tasks” on page 9-12

9-1
Using DataExchange Manager

DataExchange Manager Concepts


DataExchange Manager provides a standard interface to administer
your activated databases. You may perform the following
functionality with the utility:
„ Manage replication schedules
„ Mange information about a site
„ Manage user information and group memberships
To use DataExchange Manager, you must log on to the utility and
connect to a database. By default, the logon user name is “ADMIN”
and the password is “password.” Both are case-sensitive.
The log file for DataExchange Manager is DA.log. This log is located
in <Installation Directory >\Replication\LogFiles. You may
customize certain aspects of the logging as explained in
“DataExchange Manager Tasks” on page 9-12.

Managing The replication of data to and from sites can be automated by


Replication schedules. You may also initiate replication manually. With
Schedules DataExchange Manager, you may view, change, add, and delete
replication schedules.
A schedule becomes effective immediately if you create one for the
First Site machine on which you are running the DataExchange
Manager. If you create a schedule for a site not local to machine on
which the DataExchange Manager is running, the schedule becomes
effective after the next successful replication between those sites. For
example, suppose you are running the DataExchange Manager on
machine A and you create a schedule for machine B. The schedule
takes effect the next time site A replicates with site B.

Site Schedule Tab


The site Schedule tab allows you to view, create, delete, or edit
replication schedules for a site. You can also schedule periods when
replication is not to occur. You access the site Schedule tab by
clicking Database Sites.

9-2
DataExchange Manager Concepts

Figure 9-1 Site Schedule Tab

A schedule for the First Site applies to all sites that are subscribed to
the First Site. You can create as many schedules as you need for each
site.

Managing Site DataExchange Manager allows you to manage information about


Information any site in your replication network from a single site (assuming that
you have the correct authorization). By default, a user defined in
DataExchange Manager as a System Administrator can view all sites.
By default, users other than system administrators can view only
their own site.
Managing a remote site is done the same way as managing your own
site. However, because any changes you make to a remote site are
initially stored in your local copy of the replication system database,
the changes do not take effect until your site replicates with the
managed site. To manage a remote site, your site must subscribe to
that remote site.

Site List
The site list contains a list of all the sites to which you have
administrative access in the replication network. You display the site
list by clicking Database Sites. The first entry in the site list is
always All Sites. The other sites are listed below All Sites.

9-3
Using DataExchange Manager

Figure 9-2 Site List

Site Information Tab


The site Information tab allows you to view or change the
information about a site, such as contact information for a person
responsible for the site. You access the site Information tab by
clicking Database Sites.

Figure 9-3 Site Information Tab

Remove Site from Replication Network


The Information tab contains an option Remove Site from
Replication Network. This options acts as a toggle to remove a site
from a replication network, or to restore a site that has been
previously removed. This option does not delete any database files.
The option marks the site as no longer belonging to the replication
network.
This option is typically used to exclude a database from replication
for a long-term period. See “Using the Replication Progress and Log
Viewers” on page 10-1.

9-4
DataExchange Manager Concepts

The other sites on your replication network do not know that a site
has been removed until you perform a replication. Until you
replicate, only the site for which you are logged on to DataExchange
Manager knows that a site has been removed. An example helps
clarify this.
The DataExchange Manager requires that you connect to a specific
database when you log on. Assume that you select MyDataBase when
you log on to DataExchange Manager. Once logged on, you remove
site Partner_Site_2. At this point, only the replication tables for
MyDataBase contain the removal information. The information has
not been replicated to the rest of your replication network.
If you were to open the Initiate Replication dialog and select
MyDataBase as the source database, Partner_Site_2 would not be
included in the list of sites to replicate with. However, if you were to
select a different site on the same replication network—for example
Partner_Site_1—then Partner_Site_2 would still be listed in the sites
to replicate with because you have not yet replicated. After you
replicate, then Partner_Site_2 is no longer listed in the sites to
replicate with.
Note that the first replication after removing (or restoring) a site
from the replication network will fail for that site. The log file for
DataExchange Designer, DRE.log, contains an error message similar
to the following:
E 019f 0303-15: 6:25 Partner site Partner_Site_2(site
number: 00LFLU) has been removed from the replication
network - it cannot replicate with any other site.

After the first replication, this error no longer occurs because all sites
on the replication network are aware of the site’s status (removed or
restored).

Managing DataExchange Manager is supplied with two groups of users: System


Users Administrators and Everyone. With DataExchange Manager, you
may view, change, add, and delete user information and
membership groups.
Each group contains certain permissions within DataExchange
Manager and within your replication project.
By default, the System Administrator user for DataExchange
Manager is named ADMIN. The ADMIN user’s password, by

9-5
Using DataExchange Manager

default, is “password.” Both are case-sensitive. When you add a user,


he or she is automatically added to the Everyone permission group.
The following table compares the default permissions of System
Administrators (abbreviated System Admins) and Everyone.
Table 9-1 Permissions Comparison Between Default Groups

Permissions Within DataExchange Manager and System Everyone


Replication Network Admins

Can add DataExchange Manager users 


Can see all users 
Can change information for any group or user 
Can view, add, change, or delete replication schedules 
for any site

Can view, add, change, or delete replication schedules 


only for their own site

Can change only their own user information 


Can change any site’s information 
Can change only their own site’s information 

Tabbed Dialogs and User List


Two tabbed dialogs allow you to specify user information and group
membership, respectively. You access the tabbed dialogs by clicking
Database Users.
A user list appears to the left of the tabbed dialogs and contains a list
of the users who can access DataExchange Manager. By default,
nonadministrative users have permission to see only themselves in
the list.

9-6
DataExchange Manager Concepts

Figure 9-4 Location of User List and User Tabbed Dialogs

By default, new users added to your database project are


automatically made members of the Everyone group. To change a
user’s membership from the Everyone group, you must change the
user’s group membership. See “To change a user’s group
membership” on page 9-22.

User Information Tab


This tab allows you to specify information about a user such as
name, address, login name, and password.

Figure 9-5 User Information Tab

User Membership Tab


This tab controls a user’s membership in the defined permission
groups.

9-7
Using DataExchange Manager

Figure 9-6 User Membership Tab

Your ability to perform many administrative and data access


functions is controlled by the permission group to which you
belong.

Managing With DataExchange Manager, you may only view the permission
Permissions groups available with DataExchange Manager. The DataExchange
permission groups are System Administrators and Everyone. You
access the permissions group list by clicking Database Permission
Groups.

Figure 9-7 Permissions Group List

A user’s permissions are determined based on the permission groups


to which they belong. As you add new users, you must decide the
appropriate permission group to which that user should belong. By
default, new users added to your replication project are
automatically made members of a permission group Everyone.

9-8
DataExchange Manager GUI Visual Reference

DataExchange Manager GUI Visual Reference


This section details the objects on the DataExchange Manager
graphical user interface (GUI).

Main Window The following image shows the main window of the GUI. The table
following the image describes the GUI objects.

Figure 9-8 DataExchange Manager Main Window

GUI Object Description Related Information

Title Bar Shows the name of the utility

Actions menu Provides the following


commands:

‹ Reconnect

‹ Refresh

‹ Exit

Reconnect Displays the Logon dialog “To log on to


command from which you may DataExchange Manager”
disconnect from and on page 9-13
or reconnect to a database as a
different user or connect to a “To log on as a different
icon user or to connect to a
different database.
different database” on
page 9-13

9-9
Using DataExchange Manager

GUI Object Description Related Information

Refresh command Applies changes made by “To refresh


another running copy of DataExchange Manager
or DataExchange Manager so view” on page 9-16
that the changes are visible to
icon your instance of the utility.

Exit command Terminates the execution of


DataExchange Manager.

Database menu Provides the following


commands:

‹ Sites

‹ Users

‹ Permission Groups

Sites command Switches to site view. A list of “Managing Replication


sites appears in the List pane Schedules” on page 9-2
or and tabbed dialogs appear in
the Tabbed Dialog pane. “Managing Site
icon Information” on page 9-3

“Site Information Tasks”


on page 9-19

Users command Switches to user view. A list of “User Tasks” on page 9-


users appears in the List Pane 20
or and tabbed dialogs appear in
the Tabbed Dialog pane.
icon

Permission Groups Switches to permission group “DataExchange Manager


command view. A list of permission GUI Visual Reference” on
groups appears in the List page 9-9
or pane.

icon

Options command Displays the dialog on which “To set the log options for
you specify logging options for DataExchange Manager”
DataExchange Manager. on page 9-14

Help menu Provides the following


commands:

‹ Help Topics

‹ About

Help Topics Lists the documentation topics “To display help” on page
for DataExchange Manager. 9-17

9-10
DataExchange Manager GUI Visual Reference

GUI Object Description Related Information

About Displays the name and “To display help” on page


version of DataExchange 9-17
Manager and the Pervasive
DataExchange copyright
information.

List pane Depending on the selected “Site Information Tasks”


view, displays a list of the on page 9-19
following:
“User Tasks” on page 9-
‹ Activated sites within the 20
replication network

‹ DataExchange Manager
users

‹ Permission Groups

Tabbed Dialog Depending on the selected “Site Information Tasks”


pane view, displays the following: on page 9-19

‹ Tabbed dialogs for “User Tasks” on page 9-


working with sites 20

‹ Tabbed dialogs for


working with users

View indicator Specifies the current view: “Site Information Tasks”


on page 9-19
‹ Sites
“User Tasks” on page 9-
‹ Users 20
‹ Permission

Logged on Identifies the database to “To log on to


Database indicator which DataExchange DataExchange Manager”
Manager is currently on page 9-13
connected.
“To log on as a different
user or to connect to a
different database” on
page 9-13

User indicator Identifies the user currently “User Tasks” on page 9-


accessing DataExchange 20
Manager.

9-11
Using DataExchange Manager

DataExchange Manager Tasks


This section explains the tasks that you perform withDataExchange
Manager:
„ “General Tasks” on page 9-12
„ “Schedule Tasks” on page 9-18
„ “Site Information Tasks” on page 9-19
„ “User Tasks” on page 9-20

General Tasks General tasks apply to the overall use of the tool:
„ “To start DataExchange Manager from Pervasive Control
Center (PCC)” on page 9-12
„ “To start DataExchange Manager from a command prompt” on
page 9-12
„ “To log on to DataExchange Manager” on page 9-13
„ “To log on as a different user or to connect to a different
database” on page 9-13
„ “To change a logon password” on page 9-13
„ “To set the log options for DataExchange Manager” on page 9-
14
„ “To refresh DataExchange Manager view” on page 9-16
„ “To display help” on page 9-17

³ To start DataExchange Manager from Pervasive


Control Center (PCC)
1 Start PCC if it is not already running. (Select Control Center &
Documentation from the Pervasive group on the Start menu.)
2 In Pervasive PSQL Explorer, click Engines.
3 Click DataExchange Manager.

³ To start DataExchange Manager from a command


prompt
1 At the operating system, access a command prompt. (For
example, select Start Run, type cmd then click OK.)
2 At the command prompt, type da then press Enter.

9-12
DataExchange Manager Tasks

The DataExchange Manager executable is DA.EXE. The


executable also supports command-line options. At a command
prompt, enter da /H to display the help text and view the
available options.

³ To log on to DataExchange Manager


You must log on to DataExchange Manager before you can use the
utility. A logon dialog appears when you start the utility.
1 From the Database selection list, select the activated database to
which you want to connect.

2 For Logon Name, type a valid user’s name. The default logon
name is ADMIN (all capital letters).
3 For Password, type a valid password. The default password is
password (all lowercase).
4 Click OK.

Note DataExchange Manager terminates after three


unsuccessful attempts to connect to a database.

³ To log on as a different user or to connect to a


different database
These steps require that you already be logged on to DataExchange
Manager.
1 Click Actions Reconnect or click .
Clicking Cancel returns you to DataExchange Manager.
However, if an unsuccessful logon attempt has been made,
clicking Cancel exits DataExchange Manager.

9-13
Using DataExchange Manager

³ To change a logon password


Permission Group Requirement: You must be a member of the
System Administrator Permission Group to perform this task.
1 Click Database Users or click .
2 In the user list, click the user whose password you want to
change.
3 Click the Information tab.
4 Click Change Password.
5 Type a new password in the New Password and Confirm
Password entry fields.

Note The password is stripped of leading and trailing blanks.

6 Click OK to return to the Information tab.


7 Click Apply to save your changes.

³ To set the log options for DataExchange Manager


1 In the menu bar, click Options.
2 Specify the options you want on the logging options dialog.
The following image shows the Options dialog.

9-14
DataExchange Manager Tasks

Option Discussion

Error Turns on or off the logging of errors to the log file. Errors are
indicated by an E in the first column:

E 0142 1109-16:33:26 Login unsuccessful, the


username/password combination is invalid

Information Turns on or off the logging of information messages to the log


file. Information messages are indicated by an I in the first
column:

I 019c 1109-14:06:36 Pervasive PSQL


Replication Administrator

Tracing Turns on or off the logging of trace information to the log file.
The information being traced is every function call. Trace
information is indicated by a T in the first column:

T 0172 1109-16:33:26 0 << MessageEvent (0ms)

Caution: Avoid using the Trace option for long periods (over
30 minutes), particularly if you are performing numerous
tasks with DataExchange Manager. Trace outputs every
function call to the log file. Your log file can grow enormously
in a very short period. Generally, use Trace only when
requested by a technical support representative.

Warning Turns on or off the logging of warnings to the DA.log file.


Warnings are indicated by a W in the first column:

W 0142 1109-14:07:05 Could not find site


000000

Debug Turns on or off the logging of debug information to the log file.
Debug information is indicated by a D in the first column:

D 013f 1109-14:06:37 Response received from


DRE:

1:SUCCESS:PD2PQQ85001,TrackerPROJ (net) -
Tracker

PD2PQQ85002,TrackerPROJ (net) – TrackerPrtnr

PD2PQQ86001,tracker-project

int-tut-network) - IntTut_First_Site

PD2PQQ86002,tracker-project

int-tut-network) - IntTut_Partner_Site

PD2PQQ86003,tracker-project

(int-tut-network) - drelogtest

9-15
Using DataExchange Manager

Option Discussion

Verbose Logging This option applies only to Debug. (The Debug option must
also be checked.) Verbose outputs the source program name
and the line number within the program. For example, the
following example shows that program cmdsend is receiving
a response from the replication engine (line 308 of the source
code).

D 013f 1109-14:06:37 cmdsend 308 Response


received from DRE:

1:SUCCESS:PD2PQQ85001,TrackerPROJ (net) –
Tracker

Note: Some of the programs listed in verbose mode may not


exist as a separate file on physical storage. Verbose mode
shows the programs that are part of a compiled executable or
dynamic link library.

Maximum Log This value determines when a new history log file is started
Size (lo1, lo2, and so forth). See Maximum Logs to Keep.

Maximum Logs to This value sets the number of history log files retained. When
Keep a log file reaches its maximum size, the file is reassigned to
the next history file name.

For example, when the log (assume it is DA.log) reaches its


maximum size, DA.lo1 gets created. DA.log is then empty
and starts acquiring data once more. When the maximum
size is again reached, DA.lo1 becomes DA.lo2, a new DA.lo1
is created from DA.log, and DA.log is again empty and able
to acquire data. The Keep setting determines the extent of
the history retained: lo1, lo2, lo3, and so forth.

Name of Log File This specifies the location and name of the current log file.
The Pervasive DataExchange logs are located at
<Installation Directory >\Replication\Logfiles. You can
change the location and the name of log file for
DataExchange Manager if you prefer.

Note: The default installation directory varies depending on the version of your
operating system.

³ To refresh DataExchange Manager view


When you make changes to a database from another running copy
of DataExchange Manager, such as adding a user or changing a
schedule, the changes may not be immediately visible to your
current instance of the Manager.
For example, suppose that you made changes to a specific user in a
second instance of the Manager. To see the changes, you would need

9-16
DataExchange Manager Tasks

to switch to the user Information tab in the first Manager and refresh
the view.
1 In the menu bar, click Options, or press F5 or click .

³ To display help
1 Click Help, then the type of help you want:
Š Help Topics – Lists the documentation topics for
DataExchange Manager.
Š About – Displays the name and version of DataExchange
Manager and the Pervasive DataExchange copyright
information.
You may also press F1 to access the list of help topics.

9-17
Using DataExchange Manager

Schedule Tasks Schedule tasks apply to automating replication:


„ “To create a replication schedule” on page 9-18
„ “To change a replication schedule” on page 9-19
„ “To delete a replication schedule” on page 9-19

³ To create a replication schedule


Permission Group Requirement: You must be a member of the
System Administrator Permission Group to perform this task.
1 Click Database Sites or click .
2 In the site list, click the site for which you want to set up a
replication schedule.
You cannot set up a schedule for All Sites.
3 Click the Schedule tab.
4 Click Add on the tab.
5 Type a name for the new schedule.
6 Specify the days of the week, month, or specific dates for which
the replication occurs.
7 Specify the hours, in 24-hour format, for which the replication
occurs.
The range is 00:00 to 23:59.
8 Specify the action taken by the schedule:

Option Meaning

Schedule every [value] The frequency, in whole minutes, in which the


minutes replication schedule runs. A value of zero indicates
continuous replication, which means that another
replication session begins as soon as the previous
session completes.

Do not replicate Disables the replication schedule.

Notify if no replication after See “dxagent” on page 7-34 for a discussion of the
[value] minutes notification agent and how this option applies to the
agent.

The minutes value for the notify option must be


either zero, for continuous replication, or greater
than the Replicate every value by at least one
minute.

9-18
DataExchange Manager Tasks

9 Click Apply to save the changes.


10 Click OK to acknowledge that a replication is required for the
change(s) to take effect.

³ To change a replication schedule


Permission Group Requirement: You must be a member of the
System Administrator Permission Group to perform this task.
1 Click Database Sites or click .
2 In the site list, click the site for which you want to set up a
replication schedule.
You cannot set up a schedule for All Sites.
3 Click the Schedule tab.
4 In the Name list, click the schedule that you want to change.
5 Complete steps 6 through 9 as explained in “To create a
replication schedule”.

³ To delete a replication schedule


Permission Group Requirement: You must be a member of the
System Administrator Permission Group to perform this task.
1 Click Database Sites or click .
2 In the site list, click the site that you want to delete.
3 Click the Schedule tab.
4 Click Delete on the tab.
5 Click Yes to confirm the deletion.

Site Site information tasks apply to contact information about a site or


Information removing a site from a replication network:
Tasks „ “To change site information” on page 9-19
„ “To remove a site from or restore a site to a replication network”
on page 9-20

³ To change site information


Permission Group Requirement: You must be a member of the
System Administrator Permission Group to perform this task.

9-19
Using DataExchange Manager

1 Click Database Sites or click .


2 In the site list, click the site that you want to delete.
3 Click the Information tab.
4 Specify the contact information for the site.
To remove a site from a replication network, or to restore a site
that has been previously removed, see the following task.
5 Click Apply to save the changes.

³ To remove a site from or restore a site to a replication


network
1 Click Database Sites or click .
2 In the site list, click the desired site.
3 Click the Information tab.
4 Do one of the following:
Š To remove a site, select Remove Site from Replication
Network.
Š To restore a site already removed, clear Remove Site from
Replication Network.

Note The option Remove Site from Replication Network does


not require you to apply the action. Selecting or clearing the
option is sufficient. For the removal or restoration to take effect,
however, you must perform a replication session.

User Tasks User tasks apply to adding or deleting users and membership groups
and changing user information:
„ “To add a new user” on page 9-20
„ “To change user information” on page 9-21
„ “To delete a user” on page 9-21
„ “To change a user’s group membership” on page 9-22

³ To add a new user


Permission Group Requirement: You must be a member of the
System Administrator Permission Group to perform this task.

9-20
DataExchange Manager Tasks

1 Click Database Users or click .


2 Click the Information tab.
3 Click Add on the Information tab.
4 Type the desired user information in the entry fields. The First
Name, Last Name, Logon Name, and Password are mandatory.
Note that the Logon name is automatically converted to
uppercase and stripped of leading and trailing blanks.
5 Click Set Password.
6 For New Password, type the desired password. Retype this same
password for Confirm Password.
7 Click OK.
Note that the password is stripped of leading and trailing blanks.
8 Click Apply to save your changes.

³ To change user information


Permission Group Requirement: To edit a user’s information (other
than your own), you must be a member of the System Administrator
Permission Group. All users can change their own information.
1 Click Database Users or click .
2 In the user list, click the desired user.
3 Click the Information tab.
4 Change the user information as desired.
See “To change a logon password” on page 9-13 if you want to
change a password.
5 Click Apply to save your changes.

³ To delete a user
Permission Group Requirement: You must be a member of the
System Administrator Permission Group to perform this task.
1 Click Database Users or click .
2 In the user list, click the desired user.
3 Click the Information tab.

9-21
Using DataExchange Manager

4 Click Delete.
You cannot delete the default administrator user ADMIN.

³ To change a user’s group membership


Permission Group Requirement: You must be a member of the
System Administrator Permission Group to perform this task.
1 Click Database Users or click .
2 In the user list, click the desired user.
3 Click the Membership tab.
4 In the Work Sets pane, click the work set to which the
permission group belongs.

Permission groups for a selected work set are sorted into two
lists: Not a Member Of and Member Of. The selected user is a
member of all those groups in the Member Of list.
5 Click the desired permission group, then use the arrow buttons
between the lists to move the group to the Member Of or Not a
Member Of lists.
For example, in the following image, if you wanted to add a user
to the System Administrators group, click System
Administrators in the Not a Member Of list, then click .

6 Click Apply to save your changes.

9-22
chapter

Using the Replication


Progress and Log Viewers 10
A Brief Look at the Replication Progress and Log Viewers

Pervasive DataExchange allows you to configure replication


sessions, initiate replication, monitor it, and log it. The tools with
which you perform these actions are the Replication Progress and
Log Viewers. Their window is accessed from Pervasive Control
Center (PCC).
This chapter covers the following topics:
„ “Checking the Replication Engine and Service” on page 10-2
„ “Initiating Replication from the Progress and Log Viewers” on
page 10-4
„ “Recording and Monitoring Replication Activity” on page 10-7

10-1
Using the Replication Progress and Log Viewers

Checking the Replication Engine and Service


³ To view engine and service state
1 From Pervasive Control Center (PCC), right-click the
Replication - Connected node and select View Engine and
Service State.
2 The Engine and Service State dialog box, similar to the
following, displays:

The information displayed in this dialog is informational only


and cannot be edited.

³ To view the state of a database


1 In PCC, right-click the Replication node under a specific
database and select View Database State.
If the database has been activated, the following dialog appears:

10-2
Checking the Replication Engine and Service

All of the fields on the dialog are ready-only.


The types of states include the following:
„ DNA. This indicates that the database is the replication system
database: Database Network Analysis (DNA). This database has
a data source name like PD00000x and is created when you
install Pervasive DataExchange.

Caution Do not delete this database. Pervasive DataExchange


will not function if you do.

„ Pure. This indicates that the database does not contain


replication control tables. That is, the database has not been
activated nor is it a template.
„ Template. This indicates that the database is a replication
template.
2 Click Close when you’re done.

10-3
Using the Replication Progress and Log Viewers

Initiating Replication from the Progress and Log Viewers


You can manually initiate a replication session. The Initiate
Replication dialog box lets you select a database to replicate, the type
of replication, and the sites to include. This section covers the
following topics:
„ “Initiating a Replication Session” on page 10-4
„ “Reading the Initiate Replication Dialog Box” on page 10-6

Initiating a ³ To initiate replication


Replication 1 In PCC, right-click the Replication - Connected node in
Session Pervasive PSQL Explorer, then do one of the following:
Š Select Initiate Replication.
Š Select Statistics and Log Views to open the Replication
Progress and Log Viewers and then in the toolbar, click the
Initiate replication icon .
The Initiate Replication dialog appears.

10-4
Initiating Replication from the Progress and Log Viewers

2 Select the Source Database you want from the Source Database
drop-down list.
3 Click the type of replication you want. Choose one of the
following options:
a. Replicate data between the source database and the
selected sites.
This option replicates data between the source database and
the selected sites. This is the default and causes the
Replication Engine to replicate the data among the
machines specified, resolving any data conflicts. Either the
default conflict handling is used (most recent change wins)
or an event handler callback DLL is used if you specified
one at activation time.
b. Delete and replace all data on the selected sites with data
from the source database.
This option deletes and replaces all data on the selected sites
with data from the source database. This deletes all data on
the sites you check mark in the list of sites to replicate with.
The data from the source database replaces the data. The
source database can be used to delete/replace data on one or
more sites. Conflict resolution is not performed.
c. Delete and replace all data on the local site with data from
the selected site.
This option deletes and replaces all data on the local site
(the source database) with data from the selected site. This
deletes all data in the source database and replaces it with
the data from the selected site. You can designate only one
selected site (a one-to-one situation). Conflict resolution is
not performed.
4 Check mark the sites with which you want to replicate with the
source database. Clear the check mark for the sites you do not
want to participate in the replication.
5 Click Replicate.

Note The list of sites to replicate with may seem inconsistent


depending on how you activated your Partner Sites.

10-5
Using the Replication Progress and Log Viewers

Reading the The list of sites to replicate with may seem inconsistent depending
Initiate on how you activated your Partner Sites.
Replication Here's an example of how the list may appear inconsistent. You
Dialog Box create Partner Site PS1 and perform an initial replication with the
First Site (the default behavior). You create Partner Site PS2 but do
not perform an initial replication with the First Site.
In the Initiate Replication dialog, if you select as the source database
the First Site or PS1, neither shows PS2 as a site to replicate with. This
may lead you to question, "what became of my second Partner Site?
Why isn't PS2 in the list?"
It is not in the list because the information about the replication
network, such as the sites on it, is also replicated. If you select PS2 as
the source database, the choice First Replication Site shows as a site
to replicate with. After you replicate with the First Site, then PS2
appears in the list for the First Site and PS1.
The easiest way to ensure consistency in the list is to perform an
initial replication with the First Site when you activate each Partner
Site. A Partner Site cannot replicate with other sites until it replicates
with the First Site.

10-6
Recording and Monitoring Replication Activity

Recording and Monitoring Replication Activity


This section covers the following topics:
„ “Setting Log Options” on page 10-7
„ “DRE Log File” on page 10-8

Setting Log ³ To set Log Options


Options 1 In PCC, right-click Replication - Connected and select Statistics
and Log Views.
2 Right-click in the Replication Log Viewer and select Log
Messages.
A drop-down menu displays log commands and settings.

3 You may select the option shown in the following table for the
actions you wish to perform.
Table 10-1 Replication Logging Commands
Command Description

Clear Log Removes all lines from the log display pane. (The log on
physical storage is not affected.)

Copy Copies the current highlighted line in the pane. You can then
paste the copied line into another application.

Freeze ‹ Controls the display of log information while the


DRE.log is updated. If selected, no new entries are
displayed in the pane. The DRE.log file continues to
receive information if loggingis enabled. Toggling
the setting redisplays the current log information.

‹ If not selected, new log information appears in the


display pane as the DRE.log is updated. This is the
default behavior.

10-7
Using the Replication Progress and Log Viewers

Table 10-1 Replication Logging Commands


Command Description

Log Messages Toggle the selection for each of the following logging options
as needed:

‹ Debug Logging - Writes debug messages to the log file

‹ Error - WrItes error messages to the log file

‹ Information - Writes information messages to the log file

‹ Warning - Writes warning messages to the log file

‹ Verbose Logging - Writes the source program name and


the program line number

Group By Displays entries grouped by Type (debug, error, information,


and warning) or by None. The default is None, which lists all
of the log information with the most recent at the top.
Information grouped by Type is initially collapsed into a single
node to be expanded for viewing.

DRE Log File The Replication Engine records its operation in the file DRE.log. You
can use this log file to monitor replication activities.
Where appropriate, the messages in the DRE.log include the user-
supplied names for the database, replication project, replication
network, and replication release. The local database is referred to by
its data source name (DSN). Remote sites are referred to by their
display name and a site number. Remote sites typically have the same
database name as the local site.
Each site in every replication network is numbered, beginning at
1,000,000 for the First Site, and incrementing by one for each site
thereafter. These numbers appear as base 36 numbers. The DRE log
is the only log that uses the base 36 site numbers.
The type of message in DRE.log is indicated by a letter in the first
column of the message, as follows:
„ D - debug
„ E - error
„ I - information
„ W – warning
The following table describes each available Logging Level option
and provides a sample log entry for that option.

10-8
Recording and Monitoring Replication Activity

Table 10-2 Replication Progress and Log Viewers Logging Level Options
Option Name Description

Error The option turns on or off the logging of errors to the DRE.log
file.

Errors are indicated by an E in the first column:

E 01b7 0219-13:51:34 Partner site


AcctSvr1(site number: 00LFLV) has been
removed from the replication network - it
cannot replicate with any other site.

If checked, the option turns on the logging of errors.

Warning The option turns on or off the logging of warnings to the


DRE.log file.

Warnings are indicated by a W in the first column:

W 01a7 0219-09:52:19 CONFLICT: Type V:


Starter data in record F1 for table Purchase
is different at the two sites - conflict must
be resolved manually (key:
PDCID(2147483360)). The starter-data (data in
the database when the database was first
designed and activated) must be identical on
each site in the Replication Network. To
resolve the conflict manually, insure that
this is so.

If checked, the option turns on the logging of warnings.

Information The option turns on or off the logging of information


messages to the DRE.log file.

Information messages are indicated by an I in the first


column:

I01ae 0216-16:04:10 Attempting replication on


Replication
Network Finance-Network. Local database is
AcctPay.
This database is in Project: Finance-Project,
Replication Network: Finance-Network,
Release: 1.0.

If checked, the option turns on the logging of information


messages.

10-9
Using the Replication Progress and Log Viewers

Table 10-2 Replication Progress and Log Viewers Logging Level Options
Option Name Description

Verbose Logging This option applies only to Debug. (The Debug option must
also be checked.) Verbose outputs the source program name
and the line number within the program. For example, the
following example shows that program drelutil is creating an
update list record at line 306 of the source code.

D 0136 1107-16:00:04 drelutil 306 Creating


update list record with key 1000001

Debug The option turns on or off the logging of debug information to


the DRE.log file.

Debug information is indicated by a D in the first column:

D 0193 0216-16:04:27 Committing transaction

If checked, the option turns on the logging of debug


information. Typically, use Debug only for troubleshooting
and not as a general setting for the DRE.log.

Tip Typically, use Verbose only for troubleshooting and not as a


general setting for DRE.log.

Some of the programs listed in verbose mode may not exist as a


separate file on physical storage. Verbose mode shows the programs
that are part of a compiled executable or dynamic link library.
For instructions on setting logging options, refer to “Checking the
Replication Engine and Service” on page 10-2.

10-10
S UPPLEMENTAL I NFORMATION
appendix

Basic Troubleshooting
A
How to Identify and Solve Common Problems

This chapter provides information for troubleshooting and


resolving the most commonly encountered problems. This chapter
includes the following sections:
„ “Troubleshooting Resources” on page A-2
„ “Troubleshooting Strategies” on page A-3
„ “Installation” on page A-4
„ “Uninstalling” on page A-5
„ “Network Communications” on page A-6
„ “Database Engine” on page A-7
„ “Replication Engine” on page A-8
„ “Log Files” on page A-9
„ “Data Replication” on page A-13
„ “Notification Agent” on page A-23
„ “How to Get Additional Help” on page A-24

A-1
Basic Troubleshooting

Troubleshooting Resources
The following table describes resources available to help you solve
problems.
Table A-1 Resources that Assist with Problem Determination
Feature/ Function For More
Component Information

DataExchange log Logs information during replication See “Log Files” on


files processing. page A-9

DataExchange Table Ensures that every record in the See “dxsynctables”


Synchronization and data tables has a corresponding on page 7-25 in
Check utility record in the replication control Pervasive
tables. DataExchange
User’s Guide

Pervasive System Tests active engine installations See “Network


Analyzer and network communications in Communications” on
DataExchange. page A-6

Knowledge Base Provides information about many Search the


Pervasive software configurations Pervasive
and common environments. Knowledge base at:
http://
www.pervasive.co
m/kb

A-2
Troubleshooting Strategies

Troubleshooting Strategies
You must first diagnose a problem before you can fix it. The
following checklist contains items to help you diagnose problems
with DataExchange.
R Did DataExchange install correctly?
R Did DataExchange uninstall correctly?
R Does the network function correctly?
R Is the database engine running?
R Is the replication engine running?
R Is data being replicated correctly?
R Is the notification agent sending e-mail?
R Do the log files contain errors?
R Are other sources of help available?
The rest of this chapter discusses each checklist item in more depth.

A-3
Basic Troubleshooting

Installation
This section discusses topics that pertain to installation.

Multiple Unpredictable results can occur if you design replication databases


DataExchange with more than one DataExchange Designer. For this reason, install
Designers only one DataExchange Designer per replication network.
DataExchange Designer is installed as part of a First Site installation.
In other words, install only one First Site per replication network.

Terminal To install DataExchange to a Terminal Server client, you must first


Services modify a registry setting on the Terminal Server client. See
“Installing Over Windows Terminal Services” on page 3-2 in Getting
Started with Pervasive DataExchange.

A-4
Uninstalling

Uninstalling
If you have activated databases that are located under <Installation
Directory >\Replication, first deactivate them then delete the
replication template with the Template Remover wizard. If you do
not deactivate the database then remove the template, uninstall
leaves the database files and the associated replication files. The
remaining files do not cause any problems but you may prefer to
reclaim physical storage by deleting them. You may delete the files
manually if you want. Remember, also, to remove the DSN
associated with the database.
See “Working with the Examples” on page 5-6 for a discussion of
how to deactivate a database and remove a template.

A-5
Basic Troubleshooting

Network Communications
Pervasive System Analyzer (PSA) is a diagnostic utility included with
the Pervasive PSQL database engines. PSA can be used as a stand-
alone diagnostic tool to help you troubleshoot network problems.

Note For DataExchange, use PSA only to troubleshoot network


problems. PSA is capable of other functions pertaining only to
the Pervasive PSQL database engines. The additional functions
in PSA (such as archiving) do not apply to DataExchange.

How to Start ³ To start PSA


PSA 1 Select Pervasive System Analyzer from the Pervasive group on
the Start menu.

Note To troubleshoot your network communications for


DataExchange, select Test Active Installation on the System
Analyzer Options dialog in PSA.

Documentation The use of PSA is detailed in the Pervasive PSQL User's Guide. Please
for PSA see that guide for complete information regarding PSA.

A-6
Database Engine

Database Engine
The Pervasive PSQL database engine must be running to perform
replication.

³ To verify Pervasive PSQL Server engine is running


1 Open the Windows Control Panel.
2 Click Administrative Tools, then open Services.
3 Scroll the list until you reach the following services:
Š Pervasive PSQL Transactional Engine
Š Pervasive PSQL Relational Engine
Both of these services must be started for the Pervasive PSQL
database engine to function correctly.
The Status column shows whether the service is currently
running. The Startup column shows whether the service is set to
automatically start on system startup or start manually.
4 If a service is not started, right-click its icon and select Start.

³ To verify Pervasive PSQL Workgroup engine is


running
1 Check for the Workgroup icon in the Windows task bar:

If this icon (engine running) is showing, the engine is running.


The engine is not running if either of the following is true:
Š The engine-running icon is not showing in the Windows
task bar.
Š The following icon (engine stopped) is showing in Pervasive
PSQL Explorer:

You can start the engine by clicking Start Programs


Pervasive PSQL Engines Pervasive PSQL Workgroup
Engine.

A-7
Basic Troubleshooting

Replication Engine
The DataExchange replication engine must be running to perform
replication.

³ To verify replication engine is running with Pervasive


PSQL Server
1 Open the Windows Control Panel.
2 Click Administrative Tools, then open Services.
3 Scroll the list of services until you reach the service Pervasive
PSQL Replication.
This service must be started for the DataExchange replication
engine to function correctly.
The Status column shows whether the service is currently
running. The Startup column shows whether the service is set to
automatically start on system startup or start manually.
4 If the service is not started, right-click its icon and select Start.

³ To verify replication engine is running with Pervasive


PSQL Workgroup
1 Check the Workgroup icon in the Windows tasteable

If this icon is showing, the engine is running. The engine is not


running if this icon is not showing.
You can start the engine by clicking DataExchange
Replication Engine from the Pervasive group on the Start
menu.

A-8
Log Files

Log Files
Pervasive DataExchange allows you to enable event logging via log
files. You may record the activity of the DataExchange Designer, the
DataExchange Monitoring Tools, the DataExchange Manager, and
the Replication Engine. Additionally, DataExchange keeps a
messages log and an installation log.
All logs are text files and have a file extension of .log for the most
current one saved. The files produce any mix of data: Information,
Warning, Error, and Debugging. You can choose verbose (as
opposed to terse) messages. Verbose messages contain the name of
the program and a line number within the program to help you
debug situations. Verbose applies only to the Debug logging level.
You can change the default location of the logs, which is
<Installation Directory >\Replication\LogFiles. If you want, you can
also change the default log size and the default number of files kept
(a history). You can view the LogFiles folder by selecting
DataExchange LogFiles from the Pervasive group on the Start
menu.

Log File Size If you set the maximum log size to zero, or no limit, the log will
increase in size to whatever capacity the physical storage allows. We
recommend that you do not set a maximum log size of zero except
for troubleshooting. Even then, avoid using the no limit setting for
an extended period (typically, more than four hours). The DRE log,
for example, can grow rapidly depending on the type of logging
being performed (such as Debug logging), the frequency of
replication, and the number of sites replicating.
In the case of the DRE.log, when the log file reaches its maximum
size, the file is reassigned to the next history file name. For example,
when the Dre.log reaches its maximum size, it gets renamed to
Dre.lo1 and a new Dre.log gets created. Dre.log is then empty and
starts acquiring data once more. When the maximum size is again
reached, Dre.lo1 gets renamed to Dre.lo2, Dre.log gets renamed to
Dre.lo1, and a new Dre.log is again empty and able to acquire data.
The Maximum Logs to Keep setting determines the extent of the
history retained: lo1, lo2, lo3, and so forth.
Other DataExchange components automatically start a new log file
when the utility or service executes. In this situation, each time the

A-9
Basic Troubleshooting

utility is activated the associated XXX.log file is copied to a new


XXX.lo1 file. The utility then begins logging in the now empty
XXX.log file. Again, the Maximum Logs to Keep setting determines
the extent of the history retained: lo1, lo2, lo3, and so forth.
The DataExchange Designer, DataExchange Manager, and the
DataExchange Monitoring Tools have a Logging dialog that allows
you to change the logging settings.

Log File The following table describes the content of the various log files.
Descriptions
Log File (.log) Description

da The log updated by DataExchange Manager when you


modify schedules, user access, and so forth.

dnewsite The replication installation log. This log is created when you
install Pervasive DataExchange and contains information
about setting up the replication DNA database.

dre This log contains detailed information on the status of the


replications, and is the most active log file. The Replication
Engine updates this log as replication occurs.

The default maximum size of this log is 2 MB. You may want
to limit this log to a maximum 5 MB. Some text editors cannot
open files larger than 10 MB.

When the Replication Engine reassigns the DRE log to the


next history version (DRE.log to DRE.lo1, for instance), some
log messages may be lost. The loss is typically minimal and
may not even occur, depending on the replication activity
when the history version is assigned.

dregdtk This log is created if you install a First Site (which includes the
DataExchange Designer). The log contains information
about registering the licenses.

dxact The log updated by the activation utility when you activate a
site.

dxdeact The log updated by the deactivation utility when you


deactivate a site.

dxevent The log updated by the dxevent.dll, which handles replication


session event callbacks.

dxsynctables The log updated by the dxsynctables utility, which is used to


synchronize data files and the replication data control files.

A-10
Log Files

Log File (.log) Description

ffcopy The log updated by the ffcopy.exe utility, which copies non-
Btrieve files from a First Site to a Partner Site.

mer This log is written to if errors occur while DataExchange


routes calls to the MKDE. This log is usually empty. If you
suspect that data is not getting replicated correctly, check this
log.

msg This log lists messages about the replication sessions, the
sites that replicated and if the replication was successful. The
Replication Engine writes to this log. The dre log is more
detailed.

prd The log that DataExchange Designer updates when you


design a replication template.

reh This log contains information only if the Replication event


handlers encounter problems updating control tables. If you
suspect that data is not getting replicated correctly, check this
log.

replinst The log that Pervasive DataExchange creates to record


information related only to installation. This log file is
especially useful if installation fails.

Note that if installation fails, the file is located in the Windows


directory for Windows 9x and in the WINNT directory under
Windows 2000.

sess#### These logs contain information about particular replication


sessions. The #### represents a four-digit number.

The logs are created if you set up a replication schedule and


then replicate. The logs are deleted if you stop the replication
engine, and are also deleted at regular intervals. The deletion
interval is set by a registry setting.

³ To access logging options in DataExchange Manager


1 In PCC, click the name of a database.
2 Click Tools Manager.
3 Log on to Manager.
4 Click Options.

³ To access logging options


1 In PCC, right-click Replication under the name of a database.

A-11
Basic Troubleshooting

2 Select Statistics and Log Views.


3 Right-click in the Replication Log Viewer and select Log
Messages.

³ To change the deletion interval for session logs

Caution Incorrectly editing your computer’s registry can


damage the registry. The damage can cause undesirable results,
such as your computer not being able to boot. If you do not feel
comfortable editing the registry, obtain the services of a qualified
technician. Pervasive Software accepts no responsibility for a
damaged registry.
We suggest that you create a backup of your registry before
editing the registry. Refer to the online help for your operating
system. Look for index entries such as “registry, backing up,” or
“emergency repair disk.”

1 Select Start Run, type regedt32 in the Open field of the Run
dialog box, and click OK.
Registry Editor opens.
2 Find the following registry key:
HKEY_LOCAL_MACHINE\Software\Pervasive
Software\Pervasive Replication\SessionExpiry
3 Double-click REG_DWORD for the key.
The Edit DWORD Value dialog opens.
4 In the Value Data field, change the value to the desired minutes
(5 is the default).
5 Click OK.
6 Exit Registry Editor.

A-12
Data Replication

Data Replication
This section discusses topics that pertain to replicating data.

List of Sites to The Initiate Replication dialog allows you to start a replication.
Replicate With (Right-click Replication - Connected in the PCC tree, then click
Seems Tasks Initiate Replication to display the dialog.) On this dialog,
Inconsistent you select a source database and the sites to replicate with. The list of
sites to replicate with may seem inconsistent depending on how you
activated your Partner Sites.
Here’s an example of how the list may appear inconsistent. You
create Partner Site PS1 and perform an initial replication with the
First Site (the default behavior). You create Partner Site PS2 but do
not perform an initial replication with the First Site.
In the Initiate Replication dialog, if you select as the source database
the First Site or PS1, neither shows PS2 as a site to replicate with. This
may lead you to question, “what became of my second Partner Site?
Why isn’t PS2 in the list?”
It is not in the list because the information about the replication
network, such as the sites on it, is also replicated. If you select PS2 as
the source database, the choice First Replication Site shows as a site
to replicate with. After you replicate with the First Site, then PS2
appears in the list for the First Site and PS1.
The easiest way to ensure consistency in the list is to perform an
initial replication with the First Site when you activate each Partner
Site. A Partner Site cannot replicate with other sites until it replicates
with the First Site.

Replication The other sites on your replication network do not know that a site
Fails for a has been deactivated until you perform a replication. Therefore, the
Deactivated first replication after deactivating a site from the replication network
Site will fail for that site. This is the normal behavior.
The DRE.log file contains an error message similar to the following:
E 019f 0301-15:46:25 Partner site Partner_Site_2
(site number: 00LFLU) has been removed from the
replication network - it cannot replicate with any
other site.

A-13
Basic Troubleshooting

After the first replication, this error no longer occurs because all sites
on the replication network are aware of the site’s status
(deactivated).

Note If you deactivate a First Site, you must perform a manual


replication if you reactivate the First Site. After you reactivate the
First Site, you must manually initiate a replication session from
each Partner Site to the First Site. The replication sessions ensure
that all available sites appear on the Initiate Replication dialog.
This action is not required if you deactivate/reactivate a Partner
Site. It applies only to a First Site.

False Alert If you delete, disable, or modify a schedule, the other replication sites
Because of are not aware of this because replication does not take place. The
Schedule notification agent on the other sites continues to contact the
Manipulation scheduling site. If the scheduling site is down or unreachable, the
agent sends a failure alert. The alert is false because the schedule no
longer applies.
To prevent such false alerts, manually initiate replication after you
delete, disable, or modify a schedule. The replication ensures that the
schedule changes get replicated. Alternatively, if your entire
replication network no longer needs replication, deactivate all
replication sites on the network.

Correct Alarms This situation occurs if you change a schedule remotely. For
but Replication example, you start DataExchange Manager on site B and use it to
on Wrong change the schedule on site A. The replication engine on site A will
Schedule not use the new settings until you restart the engine. The notification
agent, however, uses the new schedule without having to be
restarted. The agent properly notifies of replication being off
schedule.
To prevent this situation, do not update schedules remotely.

Dynamically If your dynamically created tables are not being replicated, verify
Created Tables that the file matching patterns in the dCNF table are correct.
Not Being DataExchange provides a utility, Dxdynpath, to help you verify file
Replicated matching patterns. See “dxdynpath” on page 7-15 in Pervasive
DataExchange User’s Guide.

A-14
Data Replication

Note that relative paths are relative to a home directory that contains
data dictionary files (DDFs) recognized by DataExchange.

Note Dxdynpath should only be used with the Real-Time


Backup Edition.

SQL Triggers SQL triggers are a type of stored procedure that are automatically
and Replication executed when data in a table is modified with an INSERT,
UPDATE, or DELETE. (Stored procedures are SQL statements that
are predefined and saved in the database dictionary.)
Replication updates the base table before updating the dependent
tables. This sequence maintains the correct foreign key relationships.
In the case of the sample database Tracker, for example, the Region
table is updated before the Employee table.
For illustration, suppose you have a database with a base table A and
a dependent table B (table B has a foreign key relationship to table
A). You create a trigger that updates base table A when a new record
is inserted into table B.
Partner site 1 inserts a new record into table B, causing the trigger to
execute. Table A is updated on Partner Site 1. Then you replicate
Partner Site 1 with your other sites.
On the other sites, replication updates table A, then inserts a new
record into table B, causing the trigger in table B to execute and again
attempt to update table A. This may not be the desired behavior
because the Replication Engine has already updated the record in
table A with changes made on Partner Site 1.
Definite rules concerning triggers and replication cannot be given.
In general, carefully consider each trigger that is part of a replicated
database. Make certain that the trigger’s functionality and the
behavior of replication are compatible to ensure the outcome you
desire.

Data Conflicts The template data prepared for replication during design is marked
When differently (with timestamps and other internal methods) than the
Activating data prepared during activation. The Replication Engine resolves the
Partner Sites differences during replication. In a few cases, data conflicts may
result between how you activate your First Site versus how you
activate your Partner Sites.

A-15
Basic Troubleshooting

Index For data files with 4096 byte page size, you are limited to 119 index
Segments segments per file. Because each indexed nullable column with true
NULL support requires an index consisting of 2 segments, you
cannot have more than 59 indexed nullable columns in a table (or
indexed nullable true NULL fields in a Btrieve file). This limit is
smaller for smaller page sizes.
Any file created with Pervasive PSQL, with file create mode set to 7.x,
and TRUENULLCREATE set to the default value of On, has true
null support. Files created using an earlier file format, or with
Pervasive PSQL 7, or with TRUENULLCREATE set to Off, do not
have true null support and do not have this limitation.
Refer to the Pervasive PSQL book SQL Engine Reference for more
information about TRUENULLCREATE.

A-16
Data Conflicts

Data Conflicts
Central to any replication solution is its ability to detect and resolve
conflicts when they occur. The best method of handling conflicts is
a preventative one: avoid conflicts by design. In addition to this,
Pervasive DataExchange includes a default last-in-wins policy. By
maintaining time stamps in control tables and synchronizing clocks
on replication sites, an accurate account of when records where
inserted, updated, and deleted is kept. The Replication Engine is
responsible for enforcing the conflict policy (and logging conflicts)
as they occur.
In addition, Pervasive DataExchange provides an interface with
which you can define your own conflict resolution. You can design
the appropriate conflict resolution for any set of business rules and
provide the resolution through an event handler DLL. The DLL
overrides or extends the functionality of the Replication Engine.
For information about creating an event handler DLL, contact
Pervasive Software. We will supply you the Event Callback API
documentation.

Conflict Types Data conflicts are divided into types by Pervasive DataExchange.
Each conflict is recorded in the log dre.log. You can read the log
entries and determine what, if any, action needs to be taken.
Messages similar to the following appear in the log. It contains the
type of conflict, the key of the record involved, and how the conflict
was resolved.
When a conflict occurs and a record must be overwritten, the newest
record is always used. To alter this behavior, you can register your
customized Event Handler DLL with the Replication Engine.
W 0130 0321-17:44:04 CONFLICT: Type I: Record 2 for
table Customer has been altered at both sites (key:
123).
W 0130 0321-17:44:04 Type I conflict resolved:
Record 2 will be updated at partner (Table Customer,
key: 123).

The log file of the Site where the record was not updated will contain
a message saying that the record at the partner Site was updated (as
above). At the Site where a record was overwritten messages similar
to the following indicate the data value that was updated as well as

A-17
Basic Troubleshooting

the new value (in this case the last name Yin was replaced by the last
name Yan:
I 0130 0321-17:44:04 Local field Customer.LastName
replaced by remote value
I 0130 0321-17:44:04 Before: Yin
I 0130 0321-17:44:04 After: Yan

Type I Conflict
A Type I conflict occurs when a record has been updated at both
Sites since the last replication session. When this occurs the newer
record is replicated and a log message similar to the following is
generated:
W 0130 0321-17:44:04 Type I conflict resolved:
Record 2 will be updated at partner (Table Customer,
key: 123).

Variations of this conflict type include the following possible


scenarios and associated log messages:
„ local site has more recent record and initiator is local site
W 01f8 08-17 19:09:41 CONFLICT: Type I: a record in
table Employee has been altered at both sites
GIDSysKey: 632940095990000027 GIDSiteID:
0 Unless overridden by an event handler, the DRE
will choose the most recent (partner) record.
„ local site has more recent record and initiator is partner site
W 055c 08-17 19:00:51 CONFLICT: Type I: a record in
table Employee has been altered at both sites
GIDSysKey: 632940095990000028 GIDSiteID: 0 Unless
overridden by an event handler, the DRE will choose
the most recent (local) record.
„ partner site has more recent record and initiator is local site
W 0518 08-17 19:14:25 CONFLICT: Type I: a record in
table Employee has been altered at both sites
GIDSysKey: 632940095990000029 GIDSiteID: 0 Unless
overridden by an event handler, the DRE will choose
the most recent (local) record.
„ partner site has more recent record and initiator is partner site
W 0954 08-17 19:05:23 CONFLICT: Type I: a record in
table Employee has been altered at both sites
GIDSysKey: 632940095990000030 GIDSiteID: 0 Unless
overridden by an event handler, the DRE will choose
the most recent (partner) record.

A-18
Data Conflicts

Type V Conflict
Type V conflicts occur when there is an error with the starter data at
each Site (the data that already exists in the database when your
database application is activated).
If starter data exists at one Site and not at the other, the starter data
is replicated to the other site. If the existing starter data is different,
however, a type V conflict is logged and replication stops:
W 0130 0321-17:44:04 CONFLICT: Type V: Starter data
in record 2 for table Customer is different at the
two sites - the conflict must be resolved manually.

Type VI and VIa Conflicts


Conflicts between a record inserted or updated at one site and
deleted at another site are treated as a Type VI conflict. During
conflict processing, if all records are updated at one site (or the
record was inserted) and the record is deleted at the other site, a type
VIa conflict is logged and the most recent operation wins. If any
records are not updated, then the delete operation must always win.
This type VI conflict needs to be resolved in this way because there is
insufficient information available to reinsert the entire record at the
site where the record was deleted. The following describes the
possible scenarios and the associated log messages:
„ record updated or inserted locally and deleted on the partner site
W 0130 0321-17:44:04 CONFLICT: Type VI: A locally-
updated record in table Customer has been deleted
at the partner site (key: 123)
Creation date: 2000/05/10 12:26:45
Deletion date: 2000/05/11 11:18:23
The record will be deleted locally.
W 0130 0321-17:44:04 CONFLICT: Type VIa: A newly-
inserted record in table
Customer has been deleted at the partner site (key:
123)
Creation date: 2000/05/10 12:26:45
Deletion date: 2000/05/11 11:18:23
The record will be transmitted.
„ record updated or inserted at the partner site and deleted locally
W 0a78 08-17 13:05:13 CONFLICT: Type VI: A record
in table t1 has been deleted at the partner site and
updated locally. GIDSysKey:
632939880130000000 GIDSiteID: 0 The record will be
deleted locally.

A-19
Basic Troubleshooting

Successful Conflict Resolution


Note that if conflicts were successfully resolved during a replication
cycle, a message similar to the following appears in the replication
log file:
0082 0818-10:47:36 Replication of Tracker with
000030 ended successfully with 2 conflicts
resolved.

Resolving The best way to avoid primary key conflicts is to design your source
Primary Key database with unique primary keys. If you are using an existing
Conflicts database for replication that does not have unique primary keys, you
can designate primary keys with the Pervasive PSQL Control Center.
A primary key conflict occurs when two rows have been inserted into
two different activated databases that have the same primary key.
Because each row could potentially have relevant data, the
replication engine stops the replication and will not modify these
rows.
You will see the following errors the DRE.log file on the system that
detects the primary key conflict. For this example, the primary key
conflict has been detected on the Region table of the sample database
Tracker.
E 01cb 1108-11:42:21 sqlhelp 852 ODBC Error -1:
(S1000) ‘[Pervasive][ODBC Client
Interface][LNA][Pervasive][ODBC Engine
Interface][Data Record Manager] The record has a
key field containing a duplicate value(Btrieve
Error 5)’ <-4994>
E 01cb 1108-11:42:21 dbutil 629 ODBC statement
failed: -1 from function Execute
E 01cb 1108-11:42:21 dbutil 636 ODBC statement:
INSERT INTO "Region" ("RegionID","NameStr") VALUES
(?,?)
E 01cb 1108-11:42:21 dsectbl 927 Unable to insert
new record into table Region having key: 8
E 01cb 1108-11:42:21 dresyncs5368 FSM:{22: An ODBC
error occurred}: Unable to store next
PD2PQQ88002.Region record from partner’s data list
(key:PDCID(1000010))

All other systems that attempt to replicate with this system will fail
with the Error:

A-20
Data Conflicts

E 01e8 1108-11:36:40 dresyncs1542 Error received


from partner replication engine: ‘Update of Region
failed’
Replication stopped.

Remedying a primary key conflict requires manual intervention.


You must update the primary key of one of these conflicting rows to
a new, unique value. Following that, you must start a replication
session.
For instance, from the example above, the conflict occurred with
primary key 8. So, on one of the databases involved you would
update the primary key to 9, a unique key value for the table. Then
you would replicate the two systems together.
Note that during this replication, the replication control tables are
cleaned up to correct the primary key conflict, and the following
message is written to the DRE.log file as a warning message. The
purpose of this message is to let you know that the primary key
conflict was successfully resolved.
W 01b7 1107-17:12:56 dsectbl 893 A primary key
conflict has been rectified on a replication
control table. Table: PDCRegion, Column: CRegionID
with key value of: 8

So, what transpired in terms of data in the database? Here is the


contents of the Region table throughout the process.
First, a row with the same key is inserted onto each site.

Site 1 Site 2

RegionID NameStr RegionID NameStr

8 Site1Data 8 Site2Data

We replicate and we get the primary key conflict, replication is


stopped, no tables are updated.

Site 1 Site 2

RegionID NameStr RegionID NameStr

8 Site1Data 8 Site2Data

A-21
Basic Troubleshooting

Update one of the sites to a new unique value.

Site 1 Site 2

RegionID NameStr RegionID NameStr

9 Site1Data 8 Site2Data

Replicate the new change.

Site 1 Site 2

RegionID NameStr RegionID NameStr

8 Site2Data 8 Site2Data

9 Site1Data 9 Site1Data

Now both sites are replicated to a consistent copy and no data has
been lost.

A-22
Notification Agent

Notification Agent
If the notification agent is not sending e-mail, check the following:
„ The agent is running as a service
„ The agent is correctly configured (see “dxagent” on page 7-34 in
Pervasive DataExchange User’s Guide)
„ The SMTP port through which the agent communicates does
not require authentication or encryption
„ Each replication machine with an agent has access to the SMTP
server
„ The SMTP server is set up to accept e-mail from each replication
site running the agent

³ To verify notification agent is running


1 Open the Windows Control Panel.
2 Click Administrative Tools, then open Services.
3 Scroll the list of services until you reach the service Pervasive
DataExchange Agent.
This service must be started for the notification agent to
function correctly.
The Status column shows whether the service is currently
running. The Startup column shows whether the service is set to
automatically start on system startup or start manually.
4 If the service is not started, right-click its icon and select Start.

Testing the Mail The SMTP mail server must also be functioning correctly. If
Server required, verify that the SMTP mail server is sending and receiving
e-mail correctly. Reference the documentation supplied for your
SMTP server software or check for testing procedures on vendor
Web sites.

A-23
Basic Troubleshooting

How to Get Additional Help


Pervasive Software strives to ensure that your product installation is
easy and successful. If you encounter problems during or after the
installation that are not covered in the user documentation, please
contact Pervasive Software and we will address your problem
promptly.
The following table lists a variety of resources to help you get answers
to your questions, troubleshoot problems, and interact with the
Pervasive team as well as with other customers.
Table A-2 Pervasive Software Resources and Contact Information
Resource Description Contact Information

Pervasive Software Web site The Pervasive Software Web site http://www.pervasive.com
is a great source for everything
Pervasive PSQL.

Pervasive Resource Center The Resource Center provides a http://www.pervasive.com/


quick and easy way to access resources/
Pervasive resources, such as:

Free Trials - Data Sheets - White


Papers - Success Stories - Tech
Papers - Demos - Webinars - Audio
- Training - Subscription Center -
Developer Center - Community
Forums

FTP Site The Pervasive FTP site contains ftp://ftp.pervasive.com/support/


downloadable updates and
patches to our product offerings, as
well as additional debugging tools,
documentation, third-party tools,
and beta releases.

Newsgroup The Pervasive PSQL newsgroup is news://comp.databases.btrieve.


managed by the end-user
community, posting and answering
questions as they wish.

Technical Support The Support site contains product http://www.pervasive.com/support/


support assistance, support
offerings, as well as online forms to
submit service tickets, feedback
and product defects.

A-24
How to Get Additional Help

Table A-2 Pervasive Software Resources and Contact Information


Resource Description Contact Information

Pervasive PSQL Knowledge Base The Pervasive PSQL Knowledge http://www.pervasive.com/support/


Base is a searchable database of
information on installation,
configuration, component
management, product defect
status, and answers to the
frequently asked questions
(FAQs).

Pervasive Library View the current documentation http://www.pervasive.com/library


and technical papers online and
access Pervasive discussion
forums.

Online Documentation Download the latest versions of http://www.pervasive.com/support/


Pervasive PSQL product manuals. technical/online_manuals.asp

The complete suite of online Access installed documentation


documentation is installed from the Pervasive program on the
automatically on Windows, unless Start menu or from the installation
you specifically excluded it, during CD-ROM.
installation.

Printed Documentation Printed versions of each manual http://www.pervasive.com/


are available for purchase ecommerce/Scripts/default.asp
separately, or you may purchase
the entire documentation set. Send e-mail to:
salessupport@pervasive.com

Or telephone:
1 800 287 4383.

Telephone Contacts Pervasive Software has offices http://www.pervasive.com/


worldwide to help solve your company/contact
product support issues.

E-Mail Contacts Pervasive Software welcomes your


comments, suggestions and
requests for assistance via e-mail.

Technical If you still have questions or problems relating to your Pervasive


Support DataExchange installation, you can obtain help from the Pervasive
Customer Support department.
Your purchase of Pervasive products entitles you to 30 days of free
technical support for installation and configuration problems.

A-25
Basic Troubleshooting

A-26
appendix

Supported Data Types


B
Pervasive DataExchange Data Types

This appendix contains the following topics:


„ “Data Types” on page B-2
„ “Notes on Data Types” on page B-4

B-1
Supported Data Types

Data Types
The following table lists the Pervasive PSQL data types supported by
Pervasive DataExchange.

Pervasive PSQL Pervasive DataExchange Can be Used as Primary


Data Type Implementation Key for Replication

Bit bool no

Tinyint byte yes

Utinyint byte yes

Decimal numeric yes

Numeric1 numeric no

Bigint1 numeric no

Ubigint1 numeric no

Currency1 numeric no

Longvarbinary blob no

Binary blob no

Longvarchar blob no

Char2 string yes

Varchar3 string yes

Integer long yes

Uinteger long yes

Identity4 long yes

Smallint short yes

Usmallint short yes

Smallidentity short yes

Float double yes

Real double yes

Double double yes

B-2
Data Types

Pervasive PSQL Pervasive DataExchange Can be Used as Primary


Data Type Implementation Key for Replication

Date timestamp yes

Time timestamp yes

Timestamp timestamp yes

Note :
1
Partially supported data type in Pervasive PSQL. Refer to the
appendix on Pervasive PSQL supported data types in the SQL
Engine Reference.
2
Limited to 255 characters.
3
Limited to 254 characters.
4Although Identity is supported in Pervasive DataExchange for
replication primary keys, using it for any part of a unique index
is strongly discouraged.

B-3
Supported Data Types

Notes on Data Types


This section outlines special information regarding the use of data
types in Pervasive DataExchange.

DECIMAL DECIMAL is implemented in Pervasive DataExchange as a


NUMERIC and can be use as a primary key for replication.

NUMERIC, The other data types that are implemented as NUMERICS cannot be
BIGINT, used as primary keys for replication. These include NUMERIC,
UBIGINT and BIGINT, UBIGINT, and CURRENCY.
CURRENCY

CHAR The CHAR data type is limited to 255 characters.

VARCHAR The VARCHAR data type is limited to 254 characters.

IDENTITY Although you may use IDENTITY data types for primary keys in
DataExchange, we strongly recommend that you not use this data
type as part of a unique index.

B-4
appendix

Reserved Table Names


C
Pervasive DataExchange Reserved Words and Table Names

DataExchange reserved words are keywords with special meanings


when processed by the Replication Engine. These words cannot be
used as database or table names in your applications. The following
is a list of the Replication system table names used by DataExchange.
Table C-1 Replication System Table Names
ActivateInfo dActHist dActSite

dActTbl dCmd dCmdSite

dCnf dFKey dFragF

dFragI dGrp dIDB

dIDBDef dKey dLang

dMsg dMsgLang dPKey

dPrm dPrmGrp dPrmTyp

dQueue dSched dSchema

dSet dSFSite dSite

dSiteExt dSiteLnk dSiteSet

dSort dTblChg dTrn

dUsr dUsrGrp dUsrPrf

dVer dWSTS

In addition to the system table names listed here, DataExchange


creates a unique replication table for each user table in your database
that you have marked for replication. Replication user tables created
by DataExchange are named by preceding the original table name

C-1
Reserved Table Names

with PDC. For example, a table named Billing.MKD has a


companion replication table named PDCBilling.MKD.
DataExchange uses the PDCtablename convention to keep track of
the replication database tables during replication.
In the event of tables with the same name in different folders,
DataExchange creates a unique file name, similar to the naming
convention used for log files. For example, two tables named
Billing.MKD located in different directories would result in a table
named PDCBilling.MKD and PDCBilling0.MKD.
Pervasive DataExchange requires that the replication tables created
from selected user tables have unique names and be preceded by
PDC. Pervasive PSQL limits table names to 20 characters. Replication
table names created by DataExchange meet all of these requirements.

Note A database deployed for replication is allowed to include


table names that start with PDC. However, if you add those tables
to a replication template, DataExchange asks you to confirm
that they are not files internal to the replication system.

Other Pervasive DataExchange conforms to almost all of the same


Limitations limitations and conditions implied in Pervasive PSQL. The following
lists any known Pervasive DataExchange limitations that differ from
those listed for the Pervasive PSQL ODBC Engine Interface.

Pervasive PSQL Feature Pervasive DataExchange Limit or Condition

Database tables 4,800 (per replication network)

For the complete list of Pervasive PSQL ODBC Engine Interface


limitations, see the ODBC Engine in the SQL Engine Reference.

C-2
appendix

Advanced Topics
D
A Look at Advanced Topics for Pervasive DataExchange

This appendix discusses advanced topics dealing with installation of


Pervasive DataExchange. The following section is included:
„ “Installing DataExchange as Part of Your Application” on page
D-2

D-1
Advanced Topics

Installing DataExchange as Part of Your Application


The DataExchange Getting Started guides explain how to install
DataExchange interactively from a CD. You can also install
DataExchange as part of your own application installation process.
The DataExchange installation can be noninteractive, in which no
input is required from the user. This is referred to as a silent
installation.
See also Installation Toolkit Handbook under the “Embedding
Pervasive PSQL” topic at http://www.pervasive.com/library/
index.asp?_shownode=EMB.

How To The following steps explain how to perform a silent installation for a
Perform a First Site and a Partner Site.
Silent Install
Note Ensure that all Pervasive PSQL utilities, such as PCC, and
all applications that use Pervasive PSQL are closed before
performing a silent install.

³ To install DataExchange silently


1 Copy all files from the Pervasive DataExchange CD to a
temporary directory on a hard disk.
Use a machine that does not have DataExchange already
installed.
2 Execute the DataExchange setup.exe program on the hard disk
and include the -r argument.
For example, you would type setup -r. This creates an
InstallShield record of the installation.
Continue the installation as explained in “Installing Pervasive
DataExchange” on page 3-6 of the Getting Started with Pervasive
DataExchange. Select First Site as the type of installation.
3 Copy the setup.iss file from the Windows directory (identified
by the %windir% system variable) to the directory containing
the DataExchange setup.exe file.
Setup.iss is an InstallShield script file that was created by the
setup -r process from the previous step.

D-2
Installing DataExchange as Part of Your Application

4 Open setup.iss in an editor.


Notice that szType is set to Complete (szType=Complete).
“Complete” indicates a First Site installation.
5 Modify the SiteName and HostAddr to the name or IP address
of the machine that you want to be the First Site.
For example, if the machine name is DXSRVR, the entries would
read SiteName=DXSRVR and HostAddr=DXSRVR.
6 For szEdit1, specify a DataExchange server activation license.
For example, if your license is AAAA1234BBBB5678CCCC9999,
the entry reads szEdit1=AAAA1234BBBB5678CCCC9999.
7 Save setup.iss with a name that identifies it as pertaining to a
First Site (such as first.iss).
You have created an ISS file for the First Site. You now need to
create an ISS file for the Partner Site by modifying the First Site
ISS file.
8 Save first.iss with a name that identifies it as pertaining to a
Partner Site (such as partner.iss).
9 Change szType to Typical (szType=Typical).
“Typical” indicates a Partner Site installation.
10 Modify the Site Name and HostAddr to the name or IP address
of the machine that you want to be the Partner Site.
For example, if the machine name is DXPRTNR, the entries
would read SiteName=DXPRTNR and HostAddr=DXPRTNR.
11 In the [DlgOrder] section, perform the following actions:
a. Change count=9 to count=8.
b. Delete the line Dlg4=AskYesNo-0.
c. Renumber the subsequent dialog lines sequentially:
Dlg4=SdSelectFolder-0
Dlg5=Site Information-0
Dlg6=SdStartCopy-0
Dlg7=SdFinish-0
12 Delete the section [AskYesNo-0] and all of its subordinate lines,
such as Result=1.

D-3
Advanced Topics

13 Delete setup.iss.
14 Add the contents of the temporary directory, with both of the
newly created ISS files, to your installation media.
15 Use the following commands to silently install DataExchange
from your media.
Š For a First Site: setup -sms /f1 first.iss /s (or whatever you
named the ISS file in step 7)
Š For a Partner Site: setup -sms /f1 partner.iss /s (or whatever
you named the ISS file in step 8)

D-4
appendix

Glossary
E
Replication Terminology

Accelerated In Btrieve 7.x, a file open mode that provides improved response
time over Normal mode when updating data files. However,
Accelerated mode disables the MicroKernel’s logging capability.
Therefore, the MicroKernel cannot guarantee transaction durability
or atomicity on files opened in Accelerated mode.
If you are using Btrieve 6.x, Accelerated mode is equivalent to
Normal mode, except that opening a data file in Accelerated mode
cancels the effect of flagging a file as transactional.

Activated A database on a specific site that is capable of replicating data to or


Database from another site's database, provided the other site is a member of
the same replication network. Activated databases contain a copy of
the replication template with information about the sites that
constitute the replication network.

Activation The process of creating a new database for replication—or enabling


an existing one—and establishing the database as belonging to a site.

Change The change capture/change apply mechanism is a major subsystem


Capture / of any replication implementation and is used to track and
Change Apply propagate modifications to replicated databases. Change capture
occurs concurrent with database application execution, whereas
change apply occurs during database synchronization. The Pervasive
DataExchange change capture mechanism is not log-based. It is
based on control tables that store only the most recent changes. It
reflects the current state of the database and not the history of prior
states as in log-based mechanisms.

Control Table Each replicated table in the database has a control table associated
with it. Control tables store a record for each record in its

E-1
corresponding user table, and contain associated information such
as the creation date of the record, last change date for the record, and
so forth. By creating a control table for each replicated table,
Pervasive PSQL ensures that you do not have to make any changes
to your existing tables to enable replication.

DataExchange A graphical user interface tool for enabling your database for
Designer replication. DataExchange Designer allows you to enable all of
Pervasive DataExchange's features.

DataExchange A graphical user interface for managing tasks, users, and sites in a
Manager replication network. DataExchange Manager can:
„ Manage replication schedules
„ Manage site information
„ Manage local or remote sites

DNA Database Network Analysis, the replication system database.

Encryption Encryption is the process of disguising a message to hide its contents.


An encrypted message is referred to as ciphertext; the original, or
decrypted message is referred to as plaintext.

First Site Every replication network must have a First Site, which is the first
site to be activated for replication. The First Site contains
information about the whole replication network, such as, sites
available for replication, etc. It also contains a copy of the whole
database. Any other site in the replication network is a Partner Site.

Globally- A record ID that is guaranteed to be unique throughout your entire


Unique IDs network, even if some sites create many new records in the same
table between replications.

Hub and Spoke A network configuration that consists of a centralized server that
maintains a complete copy of the database (the hub) and several
connected servers or workstations with subsets of the replication
data (spokes). The replication process typically consists of all spokes
replicating with the hub at a predetermined time. Then, upon this
successful initial replication, the updates are distributed to all spokes
via a second replication cycle from the hub to each spoke site.

E-2
In Place Activation of an existing database by either using a replication
Activation template or by using a design exported from a template.

Local Table A nonreplicated table. Each site can have different local tables.

N-Tiered A network configuration that is similar to hub and spoke, but with
additional levels (or tiers) in the network. An n-tiered configuration
can be thought of as a hub and spoke network, where the spoke sites
are also hub sites for the next tier in the configuration hierarchy.
Thus, a centralized server can replicate with three second tier server
sites, each of which, in turn, communicates with several desktop and
notebook machines.
N-tiered configurations allow some scalability that is not available in
hub and spoke networks. Configuring these network topologies and
balancing the load as the network grows requires some planning.

Network A network is a collection of sites that can replicate among


themselves. You can create separate environments, called networks,
in which to run different versions of your database. For example,
Version 1.0 could be running on a Production network, while
Version 2.0 could be running on a Test network with its own
separate and distinct data.

ODBC Open Data Base Connectivity, a standard programming interface


used to connect to a variety of data sources. Pervasive DataExchange
connects to all of its supported databases using ODBC.

Partner Site Any site that is not the First Site in a replication network.

Peer-to-Peer A replication network configuration in which every node, regardless


of its size, amount of data, or location, behaves as a true peer to other
sites in the network. Each node with a Replication Engine can
schedule and manage replication and provides it share of the
replication processing burden. Peer-to-peer is the default replication
network configuration.

Project A project represents a single replicated database. Each time you


enable a different database, you must specify a new project. A project
can contain a number of networks and releases.

E-3
Refresh A term used for a mode of synchronization that involves
unidirectional flow of data, as opposed to the default bidirectional
flow of data commonly referred to as replication. A refresh is used to
manually override the conflict resolution rules by specifying a
prevailing site. For example, a “refresh local” operation overwrites
all local data with data from a specified site.

Release A release represents a change in your database's schema. Therefore,


each time you modify your database schema you must create a new
release. A replication project can contain several networks and
releases.

Replication The default database synchronization mode that involves


bidirectional flow of data between two or more sites based on
conflict resolution rules.

Replication The component that manages the replication process. All replication
Engine is performed in the background and can be fully automated
according to schedules that you define.
Pervasive Control Center contains the user interfaces to the
Replication Engine from which you can:
„ Remotely manage replication sites
„ View current state of replication nodes
„ Query history of replication activity
„ Provide multiple views of replication statistics and information
„ Filter replication messages/logs

Replication A collection of sites that can replicate among themselves. A


Network replication network can contain several releases.

Replication A copy of a database that includes the user’s database tables,


Template replication control tables, system tables, and optionally, the user
data.

Site A replication-enabled database that can replicate and synchronize


database information with other sites across TCP/IP networks over
an ODBC interface. Each local replication-enabled database is one
site regardless of the number of users accessing it or the amount of
data stored in it. A site can be:

E-4
„ one computer with its own local database
„ a local database shared by a local network
„ a large client/server database used by hundreds or thousands of
users

Subscription A site’s authorization to replicate with other sites on the replication


network.

Template See Replication Template.

E-5
E-6
Index
Numerics database setting 8-9
Automating Replication
1-way method
with schedules 9-2
concepts 8-4
overview 5-2
selecting 8-3 B
2-machine configuration Basic concepts
for Real-Time Backup 4-2 of Pervasive DataExchange 2-1
2-way method Basic designs
concepts 8-4 concepts 8-4
overview 5-2 tasks to create 8-25
selecting 8-3 Bigint
data type B-4
A
Accelerated C
defined E-1 Change Apply
Accessing DataExchange Utilities defined E-1
from a command prompt 7-3 Change Capture
from Pervasive Control Center 7-4 defined E-1
Activate a Project Release utility Char
See Dxact.exe data type B-4
Activated Database Clear Log
defined E-1 log file actions 10-7
Activating Client DSN 2-7
project release 7-6 defined 2-7
template on first site 4-12, 5-28, 5-51 Command prompt
template on partner site 4-12, 5-29, 5-52 accessing utilities from 7-3
Activation 3-2 opening in Windows 7-4
DSN created 3-2 Command-line Utilities
First and Partner Sites 3-3 Dxact.exe 7-6
more information 3-4 Dxcleanup.exe 7-9
Adding new dynamic tables to an activated database Dxdeact.exe 7-11
3-20 DXDeploy.exe 7-13
Administrative tasks Dxdynpath.exe 7-15
in DataExchange Designer 8-31 Dxregevnt.exe 7-21
Advanced Topics Dxsynctables.exe 7-25
Silent Install D-1 Ffcopy.exe 7-26
Assigning Components
permissions 9-9 in DataExchange 1-4
Attributes Concepts
of XML Descriptor file 4-20 basic designs 8-4
Authentication Data Synchronization Edition 8-3

Index 1
database connection information 8-5 in DataExchange Designer 8-10
database identification 6-7, 8-5 setting in DataExchange Manager 9-14
network 8-6 setting in Designer 8-35
project 8-5 Custom.XML Descriptor file 5-35
release 8-6
database selection 8-4 D
DataExchange methods 8-5 Da.exe 7-31
1-way 8-4 See also DataExchange Manager
2-way 8-4 Da.log A-10
design completion 8-8 Data conflicts
initiate replication 10-4 with partner site activation A-15
network 6-8 Data dictionary files for DataExchange 7-20
Real-Time Backup Edition 8-2 Data recoverable but not current
release 6-8 in disaster recovery 4-26
replicated tables 8-7 Data Source Names
Configuration assigned during activation 3-2
for DataExchange Notification Agent 7-35 Data Source Names (DSNs) 2-7
for dynamic tables 7-15 Data Synchronization
for Real-Time Backup 4-2 basic design considerations 6-6
using many-to-one 4-3 database design overview 6-2
using multiple machines 4-3 DataExchange methods
using one-to-many 4-19 1-way 8-3
using two machines 4-2 2-way 8-3
Console Application concepts 8-3
Replication Engine 2-3 deployment models 5-1
Control Table additional information resources 5-4
cleanup (Dxcleanup.exe) 7-9 using DataExchange Designer and Utilities 5-
configuration (Dxcleanup.exe) 7-9 4
defined E-1 using Dxact.exe 5-4
Control Table Cleanup Configuration utility using DXDeploy.exe 5-3
See Dxcleanup.exe working with the examples 5-6
Copy deployment using Deployment Wizard 5-11
log file actions 10-7 design considerations 6-2
Copying example database design 6-1
files 7-26 security 6-10
flat files 7-26 Tracker sample database 6-11
Creating understanding database designs 6-1
design templates 8-30 Data Types B-2
new release of a design 8-31 bigint B-4
new replication database 8-25 char B-4
sample Tracker database currency B-4
from SQL 6-11 decimal B-4
Currency notes about B-4
data type B-4 numeric B-4
Current Log supported B-2
size A-9 ubigint B-4

2 Index
varchar B-4 replicating dynamically created tables 3-20
Data unrecoverable relative paths 7-20
in disaster recovery 4-25 types of expressions 7-18
Database verifying expression pattern matching 7-20
activation utility 7-6 reserved words C-1
connection information system table names C-1
concepts 8-5 table name limitations C-2
creating new replication 8-25 using 3-1
deactivation utility 7-11 DataExchange components
selection DataExchange Agent 1-4
concepts 8-4 Documentation 1-4
settings in DataExchange Designer 8-31 overview 1-4
Authentication 8-9 Replication Engine 1-2, 1-4
Information Files 8-9 Replication Event Handler (REH) 1-2, 1-4
Database Certification Information Utilities 1-4
viewing 8-33 DataExchange Designer 7-32
Database Design administrative tasks 8-31
considerations for Data Synchronization 6-6 database settings 8-31
for Data Synchronization 6-1 defined E-2
Database Engine deploying Real-Time Backup 4-7
checking status A-7 GUI icons 8-14
Database Identification logging 8-10
concepts 6-7, 8-5 main window visual reference 8-14
network 6-8, 8-6 menu and toolbar 8-16
project 6-7, 8-5 overview 8-2
release 6-8, 8-6 removing databases after deployment 5-8
Database Network Analysis (DNA) 3-2 replicated tables 6-9
Database network analyst concepts 8-7
See DNA See also Prd.exe
Database state setting preferences 8-10, 8-34
DNA 10-3 logging 8-10
Pure 10-3 wizard 8-10
Template 10-3 tasks
viewing 10-2 access the Database Settings 8-31
Databases create a new database for replication 8-25
named 2-7 create a new release of a design 8-31
Tracker create a replication template based on a design
creating from SQL 6-11 8-30
DataExchange designate settings for the startup wizard 8-34
(PDC) user table names C-1 designate tables for replication 8-28
Agent 7-34 designate tables not to be replicated 8-29
See also DXAgent.exe display Authentication Settings 8-32
data dictionary files 7-20 display help 8-24
notification agent 7-34 open an existing database for replication 8-27
communication protocol 7-35 set logging preferences 8-35
configuration 7-35 set preferences 8-34

Index 3
set the Information Files location 8-33 refresh view 9-16
start Designer as a stand-alone application 8- remove a site from replication network 9-20
24 restore a site to replication network 9-20
start Designer from PCC 8-24 set logging options 9-14
view Database Certification information 8-33 start from command prompt 9-12
view generated Verification Messages 8-34 start from PCC 9-12
templates 8-8 user information tab 9-7
troubleshooting multiple installations A-4 user membership tab 9-7
using for Data Synchronization deployments 5-4 DataExchange methods
DataExchange Documentation 1-5 1-way 8-3
DataExchange Editions 1-3 2-way 8-3
Data Synchronization 1-3, 8-3 concepts 8-5
Real-Time Backup 1-3, 8-2 DataExchange Monitoring Tools 7-32
DataExchange Manager 7-31 See also Pvreplcm.exe
defined E-2 tasks
GUI icons 9-9 view engine and service state 10-2
log 9-14 view the state of a database 10-2
logon DataExchange Template Remover Wizard
name 9-13 See also Trwizard.exe
password 9-13 DataExchange Utilities
main window visual reference 9-9 accessing 7-3
managing overview 1-4, 7-2
user permissions 9-9 when used 7-2
users 9-5 DBNAMES (Named Databases) 2-7
permissions 9-9 Deactivate a Project Release utility
replication schedules 9-2 See Dxdeact.exe
schedules 9-2 Deactivating
See also Da.exe project release 7-11
site information 9-3 Debug information
site information tab 9-4 logging in DataExchange Designer 8-10, 8-12, 8-
site list 9-3 35
site schedule tab 9-2 logging in DataExchange Manager 9-15
tasks 9-12 logging in DataExchange Monitoring Tools 10-
add new user 9-20 10
change logon password 9-14 Decimal
change replication schedule 9-19 data type B-4
change site information 9-19 implemented as numeric B-4
change user information 9-21 Deploy DataExchange utility
change user’s group membership 9-22 See DXDeploy.exe
connect as different user 9-13 Deploying
connect to different database 9-13 replication 7-13
create replication schedule 9-18 Deployment
delete a user 9-21 using Deployment Wizard
delete replication schedule 9-19 for Data Synchronization 5-11
display help 9-17 for Real-Time Backup 4-5
logging on 9-13 using Designer

4 Index
for Real-Time Backup 4-7 Documentation
using DXDeploy.exe for DataExchange 1-5
for many-to-one Real-Time Backup 4-18 for Pervasive System Analyzer A-6
for Real-Time Backup 4-6 Getting Started Guides 1-5
Deployment Models User’s Guide 1-5
for Data Synchronization Edition 5-1 Dre.log A-10
1-way using Designer 5-24 Dregdtk.log A-10
1-way using DXDeploy.exe 5-12 DSN 3-2
2-way using Designer 5-47 client
2-way using DXDeploy.exe 5-34 defined 2-7
using Deployment Wizard 5-11 engine
for Real-Time Backup Edition 4-1 defined 2-7
using DataExchange Designer 4-7 DSNs
using Deployment Wizard 4-5 created during activation 3-2
using DXDeploy.exe 4-6, 4-18, 4-20 created during design 3-2
Deployment Wizard 3-4 DX Designer
deploying Data Synchronization 5-11 See DataExchange Designer
deploying Real-Time Backup 4-5 DX Manager
Descriptor File See DataExchange Manager
attributes 4-20 DX Monitoring Tools
Custom.XML 5-35 See DataExchange Monitoring Tools
Express.XML 4-20, 5-13 Dxact.exe 3-4, 7-6
Design See also Utilities
DSN created 3-2 using for Data Synchronization deployments 5-4
Designer Dxact.log A-10
See DataExchange Designer DXAgent.exe 7-34
Designs not installed on Workgroup engine 2-5
basic See also Services
concepts 8-4 starting the service 2-5
tasks to create 8-25 stopping the service 2-5
completing DXAgentConfig XML file 7-35
concepts 8-8 Dxcleanup.exe 7-9
for Data Synchronization databases 6-1 See also Utilities
tasks to complete 8-30 Dxdeact.exe 7-11
Disaster Recovery See also Utilities
data recoverable but not current 4-26 Dxdeact.log A-10
failover 4-24 DXDeploy.exe 5-3, 7-13
for Real-Time Backup 4-24 removing databases after deployment 5-6
no data recoverable 4-25 See also Utilities
setting primary site back into replication 4-26 using in many-to-one configuration 4-20
setting up a new primary site 4-25 using with Data Synchronization deployments 5-
DNA database 3-2 3
database identification 8-6 using with Real-Time Backup 4-6, 4-18
defined E-2 Dxdeploy.exe 3-4
state 10-3 Dxdynpath utility 7-20
Dnewsite.log A-10 Dxdynpath.exe 7-15

Index 5
See also Utilities running DXDeploy.exe on 5-21, 5-44
Dxevent.log A-10 specifying in XML Descriptor file 5-16, 5-39
Dxregevnt.exe 7-21 Flat File Copy utility
See also Utilities See Ffcopy.exe
Dxsynctables.exe 7-25
See also Utilities G
Dxsynctables.log A-10 General tasks
Dynamic Table Configuration and Test utility in DataExchange Designer 8-24
See Dxdynpath.exe in DataExchange Manager 9-12
Dynamic Tables Getting Started Guides 1-5
configuration and test utility 7-15 Globally-Unique IDs
Dynamically created tables defined E-2
replicating 3-20 Glossary of terms E-1
Group By
E log view option 10-8
E-mail GUI-based Utilities
response to replication failure 7-34 Da.exe 7-31
Email Prd.exe 7-32
See E-mail ReplMonitor.exe 7-32
Encryption Trwizard.exe 7-32
defined E-2
Engine H
checking status A-8 Home directory for DataExchange DDFs 7-20
DSN 2-7 How to find
defined 2-7 information 1-5
replication (Replserv.exe) 2-2, 2-3 Hub and Spoke
Event Handler defined E-2
component of DataExchange 1-4
registering 7-21
Express.XML Descriptor file 4-20, 5-13
I
In Place Activation
defined E-3
F Index segments
Failover troubleshooting A-16
disaster recovery 4-24 Information
Failure notification 7-34 about Data Synchronization deployments 5-4
Ffcopy.exe 7-26 how to find 1-5
See also Utilities Information Files
Ffcopy.log A-10 database setting 8-9
Files Initiate Replication
copying utility 7-26 concepts 10-4
First Site Installation troubleshooting A-4
activating template on 4-12, 5-28, 5-51 Installing DataExchange
activation 3-3 as part of your application D-2
copying files from 5-28, 5-51 silently D-2
creating template on 4-8, 5-25, 5-48 troubleshooting A-4
defined E-2

6 Index
L Trace 8-12
Logon name for DataExchange Manager 9-13
Limitations
Logon password for DataExchange Manager 9-13
of DataExchange C-2
Local Table
defined E-3 M
Log File actions Managing
clear log 10-7 replication schedules 9-2
copy 10-7 site information 9-3
Log files users for DataExchange Manager 9-5
Da A-10 Many-to-One Configuration
Dnewsite A-10 for Real-Time-Backup 4-3
Dre A-10 Many-to-One Deployment
Dregdtk A-10 for Real-Time Backup
Dxact A-10 using DXDeploy.exe 4-18
Dxdeact A-10 Maximum Log Size
Dxevent A-10 logging option 8-13
Dxsynctables A-10 Maximum Logs to Keep
Ffcopy A-10 logging option 8-13
Mer A-10 Menu and toolbar
Msg A-10 for DataExchange Designer 8-16
Prd A-10 Mer.log A-10
Reh A-10 Messages, Verification
session A-10 viewing 8-34
setting Monitoring Tools
in DataExchange Designer 8-35 See DataExchange Monitoring Tools
setting in DataExchange Designer 8-10 Msg.log A-10
setting size A-9
used for troubleshooting A-9 N
Log options Name of Log File
setting 10-7 logging option 8-13
Log View options Named databases 2-7
group by 10-8 Network
Logging concepts 6-8, 8-6
on to DataExchange Manager 9-13 defined E-3, E-4
Logging Level Options 10-9 Network communications
Debug 10-10 testing A-6
Error 10-9 troubleshooting A-6
Information 10-9 Not Replicated Tables 8-29
Verbose Logging 10-10 Notification agent
Warning 10-9 troubleshooting A-23
Logging options Notification of replication failures 7-34
in DataExchange Designer 8-10, 8-12, 8-35 N-Tiered
in DataExchange Manager 9-14 defined E-3
Maximum Log Size 8-13 Numeric
Maximum logs to keep 8-13 data type B-4
Name of Log File 8-13 data type used for primary key B-4

Index 7
O managing 9-9
Pervasive DataExchange
ODBC
overview 1-2
defined E-3
overview of basic concepts 2-1
One-to-many
Pervasive PSQL
configuration 4-19
client, defined 2-7
Operations
server, defined 2-7
using DataExchange 3-1
Pervasive PSQL Engine
Options
checking status A-7
logging level 10-9
checking status of Server A-7
Debug 10-10
checking status of Workgroup A-7
Error 10-9
Pervasive PSQL Replication Service 7-37
Information 10-9
See also Replserv.exe
Verbose logging 10-10
Pervasive PSQL utilities
Warning 10-9
See Utilities
Overview
Pervasive System Analyzer
of 1-way method 5-2
documentation A-6
of 2-way method 5-2
starting A-6
of DataExchange Designer 8-2
using for troubleshooting A-6
of DataExchange Utilities 1-4, 7-2
Prd.exe 7-32
of Pervasive DataExchange 1-2, 2-1
See also DataExchange Designer
of Tracker example database design 6-2
Prd.log 8-10, A-10
of Utilities and Services 7-2
Preferences
setting in Designer 8-10
P Primary Keys
Partner Site resolving conflicts A-20
activating template on 4-12, 5-29, 5-52 Primary Site
copying files to 4-11, 5-28, 5-51 putting back into replication after disaster
copying template to 5-22, 5-45 recovery 4-26
data conflicts when activating A-15 setting up after disaster recovery 4-25
defined E-3 Project
running DXDeploy.exe on 5-23, 5-46 activation 7-6
specifying in XML Descriptor file 5-20, 5-42 concepts 6-7, 8-5
Partner Sites deactivation 7-11
activation 3-3 defined E-3
Password to log on to DataExchange Manager 9-14 deployment 7-13
Pattern matching Pure database
verifying 7-20 state 10-3
Peer-to-Peer Pvreplcm.exe
defined E-3 See also DataExchange Monitoring Tools
Performing actions
on the log file
clear log 10-7
R
Real-Time Backup
copy 10-7
concepts 8-2
Permissions
configuration 4-2
assigning
deployment models 4-1
in DataExchange Manager 9-9

8 Index
deployment using DataExchange Designer 4-7 See DataExchange Designer
deployment using Deployment Wizard 4-5 Replication Engine
deployment using DXDeploy.exe 4-6 checking status A-8
disaster recovery 4-24 defined E-4
no data recoverable 4-25 Replserv.exe 2-2, 2-3
disaster recovery failover 4-24 starting and stopping as a console application 2-3
many-to-one configuration 4-3 starting manually 2-3
many-to-one deployment starting the service 2-2
using DXDeploy.exe 4-18, 4-20 stopping the service 2-2
multiple machine configuration 4-3 Replication Progress and Log Viewers 7-32
recovering from data loss 4-24 Replication schedules
two-machine configuration 4-2 automating 9-2
Refresh Replication System Table Names
defined E-4 limitations C-2
option in Designer 8-19 Replication Templates
view in DataExchange Manager 9-16 See Templates
Register Event Handler utility Replication terminology
See Dxregevnt.exe defined E-1
Registering Replication Tools
event handler 7-21 See Utilities
REH ReplMonitor.exe 7-32
See also Dxregevnt.exe Replserv.exe 2-2, 2-3, 7-37
Reh.log A-10 Replserv.exeSee also Services
Relative path for DataExchange DDFs 7-20 Reserved words C-1
Release 8-6 Resources
concepts 6-8 for troubleshooting A-2
defined E-4 Restoring
Release name 8-6 a site to replication network 9-4
Removing
a site from replication network 9-4 S
databases deployed with Designer 5-8 Sample Tracker Database 6-11
databases deployed with DXDeploy.exe 5-6 creating with SQL Editor 6-11
Replace Data on Local Site with Data from Selected Saving
Site 10-5 design templates 8-8
Replicate Data Between Source and Selected Sites 10- Schedule tasks
5 in DataExchange Manager 9-18
Replicated Tables Schedules
concepts 8-7 managing for replication 9-2
Replication Schedules, using to automate replication 9-2
automating with schedules 9-2 Scheduling replication 9-2
defined E-4 Security
deployment utility 7-13 in Data Synchronization 6-10
initiating 10-4 Services
removing a site from network 9-4 DXAgent.exe 2-5, 7-34
restoring a site to network 9-4 overview 7-2
Replication Designer Pervasive DataExchange 7-2

Index 9
Replication Engine 2-2 Subscriptions
Replserv.exe 7-37 defined E-5
See also Notification agent Synchronization
Services, terminal of tables 7-25
installation issues A-4 System database
Session log files A-10 DNA 3-2
Setting System Failure
Designer preferences 8-10, 8-34 recovering from in Real-Time Backup 4-24
Designer settings 8-31
logging options T
in DataExchange Designer 8-10 Tabbed work areas
in DataExchange Manager 9-14 in DataExchange Designer
startup wizard settings 8-34 Logging 8-35
Settings Not Replicated tab 8-22
Authentication 8-32 Replicated tab 8-22
Information Files location 8-33 Wizard 8-34
Show Wizard on Startup 8-34 in DataExchange Manager
Silent Install D-2 Site Information 9-4
Simple mail transfer protocol Site Schedule 9-2
See DataExchange notification agent User Information 9-7
Site User Membership 9-7
defined E-4 Table designs
information 9-3 completing 8-8
setting primary back into replication 4-26 Table Names
setting up new primary 4-25 limitations C-2
Site information tasks Table Synchronization and Check utility
in DataExchange Manager 9-19 See dxsynctables.exe
Site List Tables
in DataExchange Manager 9-3 checking utility 7-25
SMTP designate for replication 8-28
See DataExchange notification agent Not Replicated 8-29
SQL Editor Replicated 8-28
used to create Tracker sample database 6-11 synchronization utility 7-25
Starter data 8-8 Tasks
Starting in DataExchange Designer 8-23
DXAgent service 2-5 administrative 8-31
Replication Engine basic designs 8-25
as a console application 2-3 design completion 8-30
as a service 2-2 general 8-24
manually 2-3 in DataExchange Manager 9-12
Statistics and Log Views command 5-4 general 9-12
Stopping schedule 9-18
DXAgent service 2-5 site information 9-19
Replication Engine user 9-20
as a console application 2-3 Technical Support A-25
as a service 2-2 Template database

10 Index
state 10-3 See also DataExchange Template Remover
Template Descriptor Files Wizard
Custom.XML 5-35 Two-machine configuration
Express.XML 4-20, 5-13 for Real-Time Backup 4-2
Template Remover Wizard 7-32
Templates U
concepts 8-8 Ubigint
creating for replication 8-30 data type B-4
defined E-4 Understanding
Terminal Services Data Synchronization database designs 6-1
troubleshooting installation of A-4 Uninstalling
Terminology DataExchange A-5
used in DataExchange E-1 User tasks
Testing in DataExchange Manager 9-20
dymanic tables 7-15 User’s Guide 1-5
network connectivity A-6 Users
Tools assigning permissions 9-9
See Utilities for DataExchange Manager 9-5
Trace information tab in DataExchange Manager 9-7
logging option 8-12 membership tab in DataExchange Manager 9-7
Tracker sample database Utilities
creating from SQL 6-11 accessing from a command prompt 7-3
Tracker.SQL accessing from Pervasive Control Center 7-4
using to create sample database 6-11 command-line
Troubleshooting Dxact.exe 7-6
data conflicts when activating partner sites A-15 Dxcleanup.exe 7-9
index segments A-16 Dxdeact.exe 7-11
installation issues A-4 DXDeploy.exe 7-13
installation of multiple DataExchange Designers Dxdynpath.exe 7-15
A-4 Dxregevnt.exe 7-21
installation of terminal services A-4 Dxsynctables.exe 7-25
network connectivity A-6 Ffcopy.exe 7-26
primary key conflicts A-20 DataExchange 1-4
resources A-2 GUI-based
strategies A-3 Da.exe 7-31
uninstalling issues A-5 Prd.exe 7-32
using log files A-9 ReplMonitor.exe 7-32
using Pervasive System Analyzer A-6 Trwizard.exe 7-32
verifying database engine is running A-7 overview 7-2
verifying Pervasive PSQL Server engine is running Pervasive DataExchange 7-2
A-7 replication stages used in 7-2
verifying Pervasive PSQL Workgroup engine is used in Data Synchronization deployments 5-4
running A-7 Designer 5-4
verifying replication engine is running A-8 Dxact.exe 5-4
Trwizard.exe 7-32 Utility
to verify pattern matching 7-20

Index 11
V
Varchar
data type B-4
Verbose Logging
option in DataExchange Designer 8-12
option in DataExchange Manager 9-16
option in DataExchange Monitoring Tools 10-10
option used in troubleshooting A-9
Verification Messages
viewing 8-34
Verifying
regular expression patterns 7-20
status of database engine A-7
status of replication engine A-8
Viewing
Database Certification Information 8-33
Verification Messages 8-34

W
Words
reserved C-1
Workgroup Engine
DXAgent.exe not installed 2-5
Working with the Examples
in Data Synchronization 5-6

X
XML Configuration File
DXAgentConfig.XML 7-35
XML Descriptor File
attributes 4-20
Custom.XML 5-35
Express.XML 4-20, 5-13
specifying First Site 5-16, 5-39
specifying Partner Site 5-20, 5-42

12 Index

Вам также может понравиться