The Database Configuration File

The database configuration file (by default, named MFDBFH.cfg) is used by the native database file handler (MFDBFH), and for enterprise server region management.

It contains a list of database server instances, the databases available within them, and connection details. The types of database server currently supported are Microsoft SQL Server and Azure database, PostgreSQL, and Db2. You may have one or more instances of each type configured within the same configuration file.

Within each server instance element, you configure a <dsn> element for each database available. Databases are either of type database, datastore, region.cas, or crossregion.cas; see Types of Database for more information.

To create or edit the configuration file, Micro Focus recommends that you use the dbfhconfig command line utility, and also that you enable the configuration file to use a secrets vault, so that the database connection credentials can be stored securely, behind an encryption process.

MFDBFH or Enterprise Server establishes connection with a database using either a corresponding ODBC data source configured on your machine, or through a direct connection string (see Database Connection Strings).

See the Update the Configuration File for <db-type> topic in the relevant Configuring Datastores or Configuring Region and Cross-Region Databases sections for full details.

The following example shows three server instances: one of type sqlserver (called svr-mysqldb), one of type postgresql (stored locally on port 5432), and one of type Db2 (whose location is determined by the variable TESTMFDBFH_DBINST_DB2). The first two use the ODBC data source names configured, but the last one (Db2) specifies direct connection details via the connect option.

<datastores usevault="true">
  <server name="svr-mysqldb" type="sqlserver" access="odbc">
    <dsn name="SS.MYMASTER" type="database" dbname="master"/>
    <dsn name="SS.VSAM" type="datastore" dsname="VSAM"/>
    <dsn name="SS.CAS.ESDEMO" type="region.cas" region="ESDEMO" feature="all"/>
    <dsn name="SS.CROSSREGION" type="crossregion.cas"/>
  </server>
  <server name="${VAR2AZDB}" type="azuresqldb" access="odbc">
    <dsn name="AZ.MYMASTER" type="database" dbname="master" userid="azusr" password="$$vault$$"/>
    <dsn name="AZ.VSAM" type="datastore" dsname="VSAM" userid="azusr" password="$$vault$$"/>
    <dsn name="AZ.SEQ" type="datastore" dsname="SEQ" optio="+ooseq" userid="azusr" password="$$vault$$"/>
    <dsn name="AZ.CAS.ESDEMO" type="region.cas" region="ESDEMO" feature="all" userid="azusr" password="$$vault$$"/>
    <dsn name="AZ.CROSSREGION" type="crossregion.cas" userid="azusr" password="$$vault$$"/>
  </server>
  <server name="localhost:5432" type="postgresql" access="odbc">
    <dsn name="PG.POSTGRES" type="database" dbname="postgres"/>
    <dsn name="PG.VSAM" type="datastore" dsname="PGVSAM" userid="clerk" password="$$vault$$"/>
    <dsn name="PG.CAS.PGDEMO" type="region.cas" region="PGDEMO" feature="all" userid="clerk" password="$$vault$$"/>
    <dsn name="PG.CROSSREGION" type="crossregion.cas" userid="clerk" password="$$vault$$"/>
  </server>
  <server name="${TESTMFDBFH_DBINST_DB2}" type="db2" access="odbc">
    <dsn name="DB2.COPYTEST" type="datastore" dsname="COPYTEST" optio="all -ooseq" connect="$$vault$$"/>
    <dsn name="DB2.VSAM" type="datastore" dsname="VSAM" optio="all -ooseq" connect="$$vault$$"/>
    <dsn name="DB2.CAS.CROSSREGION" type="crossregion.cas" optio="none" connect="$$vault$$"/>
    <dsn name="DB2.CAS.TESTDB" type="region.cas" region="TESTDB" connect="$$vault$$"/>
  </server>
</datastores>

Each instance has a number of datastore, region, and cross-region databases. The sqlserver, azuresqldb, and postgresql server instances also have an entry for type=database; this is mandatory in order for MFDBFH or Enterprise Server to be able to interact with those instances.

Use the MFDBFH_CONFIG environment variable to locate this configuration file, both when running applications through Enterprise Server and when using the dbfhdeploy command line utility. If the variable is not set, the configuration file is assumed to be located in the current directory, or in the enterprise server region's system directory.