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 the name of the database server instance. An entry of localhost:<port> is also valid, which defaults to your machine name.
Next you need to specify the databases within the instance.
dbfhconfig -add -server:<server-name> -dsn:<dsn-name> -type:database -name:postgres [-user:<user-name>] [-connect:<connection-string>]
where <dsn-name> is the ODBC data source for the PostgreSQL postgres database, or if you are using a connection string (instead of an ODBC data source), it is a unique name within the configuration in which to reference the database; <user-name> is a valid user for the instance (password credentials are discussed in a later step); and <connection-string> is the database connection string if you are establishing a database connection without the use of an ODBC data source - see Database Connection Strings for the database-specific syntax.
dbfhconfig -add -server:<server-name> -dsn:<dsn-name> -type:datastore -optio:<opts> -name:<dsname> [-user:<user-name>] [-connect:<connection-string>]
where <dsn-name> is the ODBC data source for the datastore, or if you are using a connection string (instead of an ODBC data source), it is a unique name within the configuration in which to reference the datastore; <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="localhost:5432" type="postgresql" access="odbc"> <dsn name="PG.POSTGRES" type="database" dbname="postgres" userid="clerk" password="$$vault$$"/> <dsn name="PG.VSAM" type="datastore" dsname="VSAM" optio="none +ooseq" userid="clerk" password="$$vault$$"/> <dsn name="PG.ESDEMO" type="region.cas" region="PGDEMO" feature="all" userid="clerk" password="$$vault$$"/> <dsn name="PG.CROSSREGION" type="crossregion.cas" userid="clerk" password="$$vault$$"/> </server> </datastores>