Using the DataExchange Utilities and Services

Using the DataExchange Utilities and Services
A Reference for 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
The next table lists the Pervasive DataExchange utilities and services and the four primary replication stages in which each is used. Detailed information on the Pervasive DataExchange utilities and services is included in the sections that follow.
Accessing the Utilities
Some of the DataExchange utilities can be accessed from a single 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. Refer to the operating system documentation for how to access a command prompt.
Note For more information on using the command-line utilities, see Command-line Utilities.
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.
*
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.
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.
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>
 
Options
[default=<Installation Directory >\Replication\LogFiles\DXACT.log]
[default=<Installation Directory >\bin\repllicense.pnl]
Examples
Running the following example from a command prompt on a First Site activates a DSN named Demodata on a First Site machine.
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>
 
Options
/LOG={flags}
[default=<Installation Directory >\Replication\LogFiles\DXCLEANUP.log]
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>
 
Options
[default=<Installation Directory >\Replication\LogFiles\DXDEACT.log]
 
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 Dxact and Dxsynctables.
Syntax
DXDEPLOY [options] <XML File>
 
Options
[default=<Installation Directory >\Replication\LogFiles\DXDEPLOY.log]
/S[ITE]=<string>
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 for an example deployment using the EXPRESS.XML template file.
CUSTOM.XML
See 2-Way Deployment Using DXDeploy 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>
 
<Operation>
Options
[default=<Installation Directory >\Replication\LogFiles\DXDYNPATH.log]
/T[YPE]=<string>
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.
Types of Expressions
You may use the following types of pattern-matching expressions with the dxdynpath utility:
*
*
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:
*
*
*
*
*
*
*
The following Dir expressions are valid examples:
*
*
*
*
Regular Expressions
Regular expressions are a pattern matching technique that let you parse and manipulate text. DataExchange uses the same regular expressions as the Windows version of the programming language perl.
Regular expressions have the following characteristics:
*
*
*
*
*
*
The following regular expressions are valid examples:
*
*
*
*
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.
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>
 
Options
[default=<Installation Directory >\Replication\LogFiles\DXREGEVNT.log]
/P[ATH]=<string>
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.
Syntax
DXREPL [options] <DSN> [<SiteID>]
 
<SiteID>
<DSN>
Options
/LOGF[ILE]=<string>/
[default=<Installation Directory >\Replication\LogFiles\DXREPL.log]
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>
 
Options
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.
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 Manager from the operating system Start menu or Apps screen, or from within PCC by selecting DataExchange then Manager.
For more information on using the DataExchange Manager, see Chapter 8, Using DataExchange Manager.
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 9, Using the Replication Progress and Log Viewers.
dpwizard
Pervasive DataExchange Deployment Wizard
Description
Pervasive DataExchange Deployment Wizard 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 Deployment Wizard from the operating system Start menu or Apps screen, or from within PCC by selecting DataExchange then Deployment Wizard.
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 wizard by selecting Template Remover from the operating system Start menu or Apps screen.
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.
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:
*
*
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 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:
*
*
*
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.
*
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"?>
<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
*
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
4
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,.