Configuration Files
This section can help you create, edit, and use configuration files with Enterprise Server.
You can use a configuration file to do any of the following:
-
Save a custom setup that you can move from one Enterprise Server server to another.
-
Restrict Databridge Client access to specified local sources, base or filtered. (This feature is currently not available via the user interface.)
-
Create filters that are more complex than those you can create in the user interface. For example, you can define a parametric filter that can be invoked for multiple sources using a different parameter value for each one.
Importing a Configuration File
When you create or edit a Enterprise Server configuration file, observe the following formatting guidelines.
-
The remote source configuration options must match the SOURCE settings in Databridge Server parameter file.
-
The remote (or file) source must be declared before any of its local sources in the parameter file. Otherwise, options can be listed in any order.
-
Multiple options can be listed on a single line, or can be split across multiple lines.
-
No termination or continuation characters are required.
-
The comment character is the pound sign (#). It can appear anywhere on a line; anything after the comment character is ignored.
To import a configuration file
Note
After the file is imported, any further configuration changes must be made via the user interface. (Note that restricted host lists can't be edited in the user interface.)
-
Open the sample Enterprise Server configuration file. See Sample Configuration File.
-
Save the sample configuration file with a new name in the Config directory.
-
Using a text editor, in the configuration file specify the following sources:
-
Remote source
-
Local source(s) and their filters
-
-
Specify any other configuration options while making sure to observe the formatting guidelines, and then save the file. See Configuration File Options.
-
Import the configuration file using one of the following methods:
- Open a command prompt window, navigate to the directory where you installed Enterprise Server and enter the following:
dbenterprise configure *configfilename*
where configfilename is the name of the Enterprise Server configuration file. If the configuration file is in a different directory than the Enterprise Server Config subdirectory, enter the directory, too.
- From the DBEnterprise window, click the Import button, navigate to the file you want to import, and then click the Open button.
For both methods, a message informs you whether the import was successful. If successful, the Enterprise Server window updates with the new sources. This may take a while, depending on the number of sources you are creating and on your connection to the MCP server. If the import was not successful, consult the log file for the reason.
- Open a command prompt window, navigate to the directory where you installed Enterprise Server and enter the following:
-
After you've successfully imported the configuration file, provide the Databridge Clients with the information necessary to use the sources you just created. See Connecting a Databridge Client to Enterprise Server.
Sample Configuration File
#######################################################################
# #
# Databridge Enterprise Server #
# #
# Sample Configuration File #
# #
# #
# Copyright (C) 2019 Micro Focus or one of its affiliates. #
# #
#######################################################################
# This is a Enterprise Server configuration file that defines
# the remote source and local sources, any of which may be cached.
# Configuration files are typically stored in the directory
# specified by the ConfigFiles registry key.
#
# To process this file use:
#
# DBEnterprise configure <thisfilename>
#
# or run Enterprise Server without any command line options and click on
# the Import button and specify this file name.
#
#
#-------------------------------------------------------------------------
#
# Remote Source
#
#-------------------------------------------------------------------------
# The Remote Source specifies the Databridge Server SOURCE, host name or
# IP address, and port number. Enclose the IP address with quotation marks.
# For example: "192.168.1.100".
# A configuration file can have only one remote source.
# All local sources are based on the remote source.
remote source BankDB at "192.168.1.100" port 5000
# ------
# The VIEW LOG option determines if Enterprise Server opens
# the log file at the end of each server or cacher run.
# Possible values for the VIEW LOG option:
#
# ALWAYS [ ASK ]
# NEVER
# ON FAILURE [ ASK ] (display log if result other than
# OK, COMMIT, or AUD_UNAVAIL)
#
# If ASK is specified, Enterprise Server asks if you want
# to view the log. The default setting is:
# VIEW LOG = ON FAILURE ASK.
view log = never
mirror in directory "d:\data\Mirrored"
# parent directory of mirrored audits cached in directory "d:\Databridge\Cache"
# location of cached files for this source
# When caching ... maxwait 10 seconds
# Number of seconds to wait for more audit
# or FOREVER or DONTWAIT (default).
retry 5 seconds
# Number of seconds between retries.
# Default is 60 seconds.
modifies before and after images
# cache both for modified records (default)
#- modifies after images only
# saves space but won't work with key changes
# The following list restricts which hosts can run a DBClient
# that uses this source.
host "TURING"
host "hawking"
# When DBServer sends a notification that more audit is
# available, run the following batch file.
on notify, run "C:\Program Files\Databridge\Enterprise\Notify.bat"
clients 2
# Number of client databases using this source.
# (Determines when to purge processed cache files.)
#-------------------------------------------------------------------------
#
# Local Sources
#
#-------------------------------------------------------------------------
# Local sources are accessible via Enterprise Server
# but not via DBServer.
local source Warehouse
# ---------
view log = on failure ask
cache directory "d:\Databridge\Cache"
# Individual cached audit files are titled:
#
# <directory>\<source>\<afn>
#
# where <directory> is the directory name specified in this option,
# <source> is the name of the source,
# and <afn> is the Audit File Number.
#
# For example, d:\Databridge\Cache\Warehouse\0891
clients 1
# number of client databases using this source
# (determines when to purge processed cache files)
# Defaults to 1.
# The following list restricts which hosts can run a DBClient
# that uses this source.
host "TURING"
host "192.168.1.51"
host "192.168.16.2"
# filtering conditions
select * from BANK where ^ updatetype (delete);
select * from BRANCH where ^ updatetype (delete);
select * from ACCOUNT where ^ updatetype (delete);
select * from CUSTOMER where ^ updatetype (delete);
select * from L1 where ^ updatetype (delete);
select * from SHORT-VF where ^ updatetype (delete);
select * from TELLER where ^ updatetype (delete);
select none from TRIALBALANCES;
# discard everything for this data set
select all from other datasets
# keep everything for unselected datasets
# (This is set by default.)
#-------------------------------------------------------------------------
# The following defines a filter with one formal parameter, BankNbr.
# When a local source uses this filter it must specify the actual value
# for BankNbr.
filter ByBank (BankNbr)
# ------
select * from BANK where BANK-ID = BankNbr;
select * from BRANCH where BANK-ID = BankNbr;
select * from CUSTOMER where BANK-ID = BankNbr;
select * from HISTORY where BANK-ID = BankNbr;
select none from other datasets
# discard everything for unselected datasets
#-------------------------------------------------------------------------
# The following sources are filtered but not cached. Updates are
# always read from the remote host and then filtered before
# returning them to the client.
local source OnlyBank1
# ---------
using ByBank (1) # Filter is defined above. Use 1 for BankNbr.
local source OnlyBank3
# ---------
using ByBank (3) # Filter is defined above. Use 3 for BankNbr.
local source OnlyBank99
# ----------
using ByBank (99) # Filter is defined above. Use 99 for BankNbr.
local source OnlyBank880
# -----------
using ByBank (880) # Filter is defined above. Use 880 for BankNbr.
Configuration File Options
The configuration file has three types of declarations: RemoteSource, LocalFilter and LocalSource. The file must start with a RemoteSource declaration followed by RemoteSource declaration options. Either LocalFilter or LocalSource declarations can appear next, followed by any number of declaration options specific to that declaration.
All configuration file options have a corresponding option or method in the Enterprise Server user interface, except for the restricted host list (which can only be created in the configuration file).
As you create or edit a configuration file, observe the following formatting rules:
-
Multiple options can be listed on a single line, or can be split across multiple lines.
-
No termination or continuation characters are required.
-
The comment character is the pound sign (#). It can appear anywhere on a line; anything after the comment character is ignored.
-
Declarations and options can end with a comma or semicolon, if desired.
Note
The syntax examples in this document represent options two ways: optional items (items that may or may not be specified) are enclosed by square brackets ([]) and separated by vertical bars; required items (items that must be specified) are enclosed by braces ({}) and separated by vertical bars. All variable items are shown in italics.
RemoteSource Declaration
When you create a remote source, the host name or IP address and port number must match that of the running Databridge Server. The base source is implicit in the remote source. (When you create a remote source using the user interface application, you must explicitly create a base source via the Add to DBEnterprise command.)
For the RemoteSource declaration, you can use options from the SourceOptions table and the RemoteSourceOnlyOptions table. RemoteSourceOnlyOptions are unique to a RemoteSource and can follow only RemoteSource declarations. Options can be listed in any order. The syntax is as follows:
[ REMOTE ] SOURCE remotesourcename AT "hostnameoripaddress" PORT portnum RemoteSourceOptions
LocalSource Declaration
The LocalSource declaration specifies a local source that is derived from a base source. The user interface equivalent to this declaration is the Add local (filtered) source command on the context menu for a Databridge Server defined base source. The syntax is as follows:
[ LOCAL ] SOURCE localsourcename LocalSourceOptions
For the LocalSource declaration, you can use any combination of options from the SourceOptions. In addition, you can use FilterReference and LocalFilterOptions, which are unique to local sources. FilterReference uses the following syntax:
USING filtername [ ( parameterlist ) ]
where filtername is the name of a LocalFilter.
The optional parameterlist (which must be enclosed in parentheses) is a list of values that substitute for the formal parameters specified in the LocalFilter declaration. (See the ByBank filter and the OnlyBank1, OnlyBank3, OnlyBank99, and OnlyBank880 local sources declared in the BankDB.cfg sample configuration file.)
For an example of LocalFilterOptions syntax, see "LocalFilterOptions" at the end of this document.
LocalFilter Declaration
A local filter specifies conditions that are required of the updates (in addition to DBGenFormat FILTER conditions on the MCP Server) before they are sent to the client. The syntax is as follows:
FILTER filtername [ ( formalparameterlist ) ] localfilteroptions
The filtername can be any name and is the identifier that a LocalSource includes in the USING option. The optional formalparameterlist, which must be enclosed in parentheses, are the place-holder names that will be replaced by the actual values in the USING option. See the ByBank filter and the OnlyBank1, OnlyBank3, OnlyBank99, and OnlyBank880 local sources declared in the BankDB.cfg sample configuration file.
The localfilteroptions are listed in the FilterOptions table.
SourceOptions
SourceOptions can be used for RemoteSources or LocalSources. Once you describe the RemoteSource declaration, you can map the remote source into several local sources. Local sources can specify their own filtering in addition to the filtering already done by the Remote Source (Databridge Server). You can list these options in any order.
Option | Does this | Syntax | UI Setting |
---|---|---|---|
cache parent directory -or- cached in directory |
Enables update caching and specifies the location of cached update files. | [ { CACHE | CACHED } [ IN |
checkpoint | Determines the frequency with which the Databridge Client commits (saves) updates from Enterprise Server. | CHECKPOINT [ CLIENT | CLIENTS ] [ EVERY ] numblocks [ AUDIT ] BLOCKS CHECKPOINT [ CLIENT |
client count | Indicates the number of Databridge Clients that are expected to read the cached audit updates. | CLIENTS [ = ] number | Remove cache files when read n times in the Base Source Cache Properties and Source Cache Properties dialog boxes |
restricted host list | Specifies Databridge Clients that have access to this Enterprise Server source. Leave blank to give all Databridge Clients access. | HOST { "hostname" | "ipaddress" } |
view log | Determines if the log file opens at the end of each server or cacher run. | VIEW LOG = { ALWAYS [ASK] | NEVER |
RemoteSourceOnlyOptions
RemoteSource options are unique to RemoteSource declarations (that is, they're only used for remote sources).
Option | Does this | Syntax | UI Setting |
---|---|---|---|
on notify | Specifies a batch file or a command to run when Databridge Server sends a notification that more audit is available. | ON NOTIFY [ , ] RUN "commandfilepath" | When more audit is available, run in the Base Source Properties dialog box |
maxwait | Specifies a maximum wait period, which essentially determines the number of times that Enterprise Server re-queries Databridge Server for new audit when caching updates. | MAXWAIT { FOREVER | DONTWAIT | numseconds [ SECONDS ] } |
Wait for audit to cache / Max seconds in the Base Source Cache Properties dialog box |
mirror directory | Specifies where mirrored audit files will be stored. | MIRROR [ IN | ON |
LocalFilterOptions
These "select" options determine which records are sent to the client.
Option | Does this | Syntax | UI Setting |
---|---|---|---|
select from | Specifies which updates to send to the client from the indicated data set. Use as many times as needed for other data sets. ALL and * are equivalent. |
SELECT { ALL | * } FROM datasetname [ WHERE expression ] NOTE: If datasetname is a reserved word, it must be in quotation marks. The syntax for expression is the same as that used for DBGenFormat (see the Databridge Host Administrator's Guide). |
select none from | Discard all updates from the indicated data set. Use as many times as needed for other data sets. |
SELECT NONE FROM datasetname NOTE: If datasetname is a reserved word, it must be in quotation marks. |
WHERE box in the Row Filter dialog box. |
select from other data sets | Determines what to do with updates for data sets not specified by one of the first two options. The NONE value discards all other updates. ALL and * are equivalent. |
SELECT { ALL | * | NONE } FROM OTHER DATASETS |
WHERE box in the Row Filter dialog box. |