Update the Configuration File for Db2 Datastores

Attention: This feature is in Early Adopter Product (EAP) release status. We will continue the development of additional features and provide additional interfaces via patch updates and future releases. Please contact Micro Focus SupportLine if you require further clarification.
  1. If you do not already have a database configuration file (MFDBFH.cfg), in a text editor, create a simple text file and name it MFDBFH.cfg. If you already have a configuration file, skip to step 3.)
  2. Code the base element:
    <datastores>
    </datastores>
  3. Add a <server> element for each database server instance you intend to connect to. Each <server> element contains 3 attributes:
    Note: If you are editing a configuration file that already contains entries to the required server instance, skip to step 5.
    • name - the name of the instance.
      Tip: An entry of localhost:<port> defaults to your machine name when the file is processed.
      Note: You can use an environment variable as the name of the data source: set a variable in your environment, and then use the following syntax:
      <server name=$(env-name) type="db2" access="odbc"/>
    • type - the type of database. For Db2 databases this is db2
    • access - the type of protocol for the database connection. Currently only odbc is supported.

    For example, for a local Db2 connection on the default port:

    <datastores>
       <server name="localhost:50000" type="db2" access="odbc">
       </server>
    </datastores>
  4. Next, you need to add <dsn> elements for each datastore. Each <dsn> element contains the following attributes:
    • name - unique name within the server element.
    • type - the type of database. For datastore databases, this is type="datastore".
    • dsname - the name to which Enterprise Server will refer to the datastore; this is the name specified as the <datastore-name> when the script file was created, or the name given as the data source name if using an ODBC data source.
    • optio - the optimizations that are applied to database file handling operations at run-time. The available options are specified in the following table. If this attribute is not specified, no optimizations are applied.
      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.
      {+|-}ioseq Enables (+) or disables (-) input/output optimizations for line-sequential files opened for input.
      {+|-}ooseq Enables (+) or disables (-) input/output optimizations for line-sequential files opened for output.
    • bitism - primarily used for Db2 connections that use an ODBC DSN. Due to the Db2 architecture, you need to specify the bitism of the connection if both 32- and 64-bit access is required. Permissible values are 32, 64, and both. If you are using any type of connection other than an ODBC DSN connection for Db2, this attribute is not required.
    • dbname - for Db2 connections where the datastore is housed in an existing database (that typically holds other datastores, region and cross-region databases). If this option is omitted, a new database is created.
    • userid and password - a set of valid credentials used to access the database. If you are using the connect attribute, you specify the credentials in the connection string instead, and do not need to specify these attributes.
    • connect - the database connection string; see Database Connection Strings for the database-specific syntax. This element is required if there is no ODBC DSN connection.
    <datastores>
       <server name="localhost:50000" type="db2" access="odbc">
          <dsn name=<unique-name> type="datastore" dsname=<datastore-name> dbname=<existing-db> optio=<options> connect=<connection-string>/>
       </server>
    </datastores>
  5. Save the configuration file, ensuring it is named MFDBFH.cfg.

Example MFDBFH.cfg

The following is an example of a configuration file that contains two datastores, a region database, and a cross-region database. The first datastore, the region, and cross-region databases are housed in an existing database called MYMFFILS, connecting using direct connection syntax. The second datastore (DB2.SEQ) is a separate database, configured using an ODBC data source.

<datastores>
   <server name="localhost:50000" type="db2" access="odbc">
      <dsn name="DB2.VSAM" type="datastore" dsname="VSAM" optio="none +ooseq" dbname="MYMFFILS" connect="db=MYMFFILS;uid=db2admin;pwd=myPass"/>
      <dsn name="DB2.SEQ" type="datastore" dsname="VSAM" optio="none +ooseq" userid="db2admin" password="myPass"/>
      <dsn name="DB2.ESDEMO" type="region.cas" region="ESDEMO" feature="all" dbname="MYMFFILS" connect="db=MYMFFILS;uid=db2admin;pwd=myPass"/>
      <dsn name="DB2.CROSSREGION" type="crossregion.cas" dsname="$XREGN$" dbname="MYMFFILS" connect="db=MYMFFILS;uid=db2admin;pwd=myPass"/>
   </server>
</datastores>

If you have not already created the databases using the sql script files, you must use the dbfhadmin command line utility to run the scripts; after which, use dbfhdeploy to add files to the datastores.