You should only create or update a configuration file using the dbfhconfig command line utility.
set MFDBFH_CONFIG=<location-and-name-of-file>
If you do not set this variable, a file named MFDBFH.cfg is assumed to be located in the current directory.
dbfhconfig -add -server:<server-name> -provider:pg
where <server-name> is a name in which to group your related servers within the configuration file. This could be the name of the database server instance if you are creating separate databases for each datastore, or if you intend to house multiple datastores/regions under one database, it could be the name of that. An entry of localhost:<port> is also valid, which defaults to your machine name.
Next you need to specify the databases within <server-name>.
dbfhconfig -add -server:<server-name> -dsn:<name> -type:database -name:postgres [-connect:<connection-string>]
where <name> is either the name you will give an ODBC data source for the PostgreSQL postgres database (in which case, make a note of it for a later step), or a unique name within the server configuration in which to reference the database if you are using a connection string; and <connection-string> is the database connection string (if you are not using an ODBC data source) - see Database Connection Strings for the database-specific syntax.
dbfhconfig -add -server:<server-name> -dsn:<name> -type:datastore [-db:<existing-db>] [odbcdsn:<dsn-name>] -optio:<opts> -name:<dsname> [-connect:<connection-string>]
where <name> is either the name you will give an ODBC data source for the datastore (in which case, make a note of it for a later step), or a unique name within the server configuration in which to reference the datastore if you are using a connection string; <existing-db> is the name of an existing database in which the datastore is stored - if this option is omitted, it is implied that the datastore is housed in its own database; <dsn-name> is the name of the data source used as a shared database connection (if you are using ODBC data sources and using a single physical database) - see Database Connections for more information; <opts> are the optimizations to be applied to I/O operations; and <dsname> is the actual name of the datastore (as configured in the data source properties).
option | description |
---|---|
all | All optimizations applied, as if +<opt> had been specified for each available option. You can then selectively disable certain options using -<opt>. |
none | No optimizations applied. |
{+|-}oiseq | Enables (+) or disables (-) optimizations for line-sequential files opened for input. |
{+|-}ooseq | Enables (+) or disables (-) optimizations for line-sequential files opened for output. |
{+|-}oi | Enables (+) or disables (-) optimizations for ESDS, KSDS, and RRDS files opened for input. |
{+|-}oo | Enables (+) or disables (-) optimizations for ESDS, KSDS, and RRDS files opened for output. |
The following is an example of a configuration file that contains a datastore, a region database, and a cross-region database. As the login credentials are required to establish a connection to this database, the secrets vault has also been enabled: see Configure a Secrets Vault for the Micro Focus Database File Handler for more information.
<datastores usevault="true">
<server name="MyMainDB" type="postgresql" access="odbc">
<dsn name="PG.POSTGRES" type="database" dbname="postgres" userid="clerk" password="$$vault$$"/>
<dsn name="PG.VSAM" type="datastore" dsname="VSAM" dbname="MyMainDB" optio="none +ooseq" userid="clerk" password="$$vault$$"/>
<dsn name="PG.ESDEMO" type="region.cas" region="PGDEMO" dbname="MyMainDB" feature="all" userid="clerk" password="$$vault$$"/>
<dsn name="PG.CROSSREGION" type="crossregion.cas" dbname="MyMainDB" userid="clerk" password="$$vault$$"/>
</server>
</datastores>
Next, if you have not used connection strings in your database configuration file, you must create the data sources for each of the databases you have configured. If you have used connection strings, you can skip the data source creation and use the dbfhdeploy command line utility to upload files to your datastores.