Using the DataExchange Utilities and Services
A Reference for Using the DataExchange Utilities and Services
See the following topics for tools and resources used in different phases of creating and maintaining a replication network:
Utilities and Services Overview
DataExchange contains a suite of utilities and services for every phase of replication. The DataExchange utilities assist you in designing, customizing, and administering your replication requirements. This topic covers the following:
Replication Stages and the Utilities Used
The next table lists the DataExchange utilities and services and the four primary replication stages in which each is used. Detailed information on the DataExchange utilities and services is included in the topics that follow.
Accessing the Utilities
Some DataExchange utilities can be accessed as windows opened in PSQL Control Center (PCC) or from the Start menu. Other tools offer only a command-line interface and must be run from a command prompt. Services are available in the Windows Control Panel. The following topics list ways to access the DataExchange utilities, services, and shortcuts.
Accessing Command-Line Utilities
To run the replication command-line utilities, open a command prompt.
Note For more information, see Command-Line Utility Reference.
Accessing GUI Utilities and Wizards in PCC
To run GUI utilities or wizards, follow these steps:
1
PCC menus vary according to what is selected in the tree.
2
Select the Replication node for a database
3
Select DataExchange from the PCC menu and select the utility.
Note For more information, see GUI-based Utilities.
Command-Line Utility Reference
This topic provides a reference to the command-line utilities in DataExchange. The following table lists the utilities with brief descriptions. Following this table you can find more detail about each utility and a list of its command-line options.
dxact
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
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 Win10Server.
dxact /PARTNERNETADDR=Win10Server 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 in C:\ProgramData\Actian\PSQL\Reports.
dxact /PARTNERNETADDR=AdminServer /LOGFILE=C:\ProgramData\Actian\PSQL\Reports\adminlog.txt Demodata
dxcleanup
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}
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
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
 
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
DataExchange Deploy
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
 
/S[ITE]=<string>
XML Descriptor File Templates
DXdeploy is used to implement 1-way Real-Time Backup and 1-way and 2-way Data Synchronization. The DXdeploy utility uses an XML descriptor file that you create to capture 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.
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
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
 
/T[YPE]=<string>
Remarks
Any file used 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:
Must contain dir as the first characters (dir is not case-sensitive).
The following dir expressions are valid examples:
Regular Expressions
Regular expressions are a pattern-matching technique to 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 use the slash character (/) instead of the backslash (\). 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
Constructing valid regular expressions can be challenging. To help, DataExchange provides the utility Dxdynpath.exe to verify the pattern matching of your regular and dir expressions. The utility compares the pattern against the command line arguments and reports whether the comparison passes or fails.
Note Dxdynpath bases pattern matching solely on its command line arguments. It does not check for the existence of files or directories or navigate them. For example, if you test an expression against the file acctdata\Bbzz95.mkd, dxdynpath does not check whether this folder and file exist.
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
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
 
/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 in C:\Program Files (x86)\Actian\PSQL\bin with demodata on 64-bit systems.
dxregevnt /p="C:\Program Files (x86)\Actian\PSQL\bin\dxevent.dll" register demodata
If you have an Event Handler DLL registered, a message similar to the following displays:
Event Handler is "C:\Program Files (x86)\Actian\PSQL\bin\dxevent.dll"
dxrepl
DataExchange Console Replication Initiation Utility
Description
Replicate files from DSN to Partner Site.
Syntax
dxrepl [options] <DSN> [<SiteID>]
 
<SiteID>
<DSN>
Options
 
/LOGF[ILE]=<string>/
dxsynctables
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
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
DataExchange Manager
Description
DataExchange Manager is used to administer replication networks. It is a separate application that can be run external to PCC. You can open it by selecting Actian DataExchange 13 > DX Manager from the Start menu or within PCC by selecting DataExchange > Manager.
For more information, see Using DataExchange Manager.
replmonitor
Replication Progress and Log Viewers
Description
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 PCC.
For more information, see Using the Replication Progress and Log Viewers.
dpwizard
DataExchange Deployment Wizard
Description
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 Actian DataExchange 13 > DX Deployment Wizard from the Start menu or from within PCC by selecting DataExchange > Deployment Wizard.
trwizard
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 Actian DataExchange 13 > DX Template Remover from the Start menu or from within PCC by selecting DataExchange > Template Remover.
Services
DataExchange includes two services that initiate automatically at the time of startup. This topic discusses these services and includes specific information on configuring these for your specific business requirements.
dxagent
DataExchange Agent
Description
Detects critical replication failures and notifies administrators by email.
Failure Notification
DataExchange has the ability to notify you by email 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 PSQL Server product. The notification agent, or DX Agent, provides the notification functionality when scheduled replication fails.
The agent is not available if you install DataExchange on a machine with PSQL Workgroup. 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 can detect whether replication fails on the site with the Workgroup engine.
The agent sends email if a replication failure occurs. The email subject line contains the words “DataExchange alert.” The email body 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. The SMTP server correspondingly must be set up to accept email 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 email 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
In a text editor, open the file DXAgentConfig.xml, found on 64-bit systems in C:\Program Files (x86)\Actian\PSQL\Replication\Config.
<?xml version="1.0"?>
<dxagentconfig>
   <smtpserver>
     <hostname>SMTP Server To Be Configured
     </hostname
     <port>25</port>
   </smtpserver>
   <email>
     <from>DXAgent@MyCompany.com</from>
     <to>Email Address To Be Configured</to>
   </email>
</dxagentconfig>
2
SMTP Server To Be Configured – The name or IP address of the email server.
25 – Port number on the email server used for receiving mail. By default, set to port 25.
DXAgent@mycompany.com – The email 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.
Email Address To Be Configured – The email 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
PSQL Replication Service
Description
The executable of the Replication service. The DataExchange service performs data replication between PSQL databases.
For information, see Starting and Stopping Replication.