The dbfhconfig Command Line Utility

Use the dbfhconfig command line utility to create and edit the database configuration file.

Syntax:

dbfhconfig [action][options]

Or:

dbfhconfig @<response-file-name> [-verbose]
action
Can be one of the following:
  • -add - adds a new <server> or <dsn> entry.
  • -delete - deletes a <server> or <dsn> entry.
  • -list - lists details of the configuration file.
  • -novault - the connection credentials are stored as plain text (default).
  • -update - updates a <server> or <dsn> entry.
  • -vault - the connection credentials are stored in the secrets vault (that is, they are encrypted); see Configure a Secrets Vault for the Micro Focus Database File Handler for more information.
options
Specify one or more of the following:
-bitism:32|64|both
Used to indicate the bitism of the associated ODBC data source. Some ODBC drivers, such as IBM Db2, require that data source names are unique, and so 32-bit and 64-bit connections to the same database must have different DSN entries. When set to both,the same DSN name is used for both 32-bit and 64-bit connections (default).
-comment:<comment>
Adds a comment line for the associated <server> or <dsn> entry. Use with the -add -dsn:<dsn-name> or -update -dsn:<dsn-name> actions/options.
-connect:<connection-string>
Adds a connection string to establish connection to the associated <server>. Connection strings are an alternative method to connecting to a database via an ODBC connection. Use with the -add -dsn:<dsn-name> or -update -dsn:<dsn-name> actions/options.
-connopts:<options>
The connection life-time options; see Database Connection Lifetime for a more detailed explanation. Use with the -add -dsn:<dsn-name> or -update -dsn:<dsn-name> actions/options
<options> can be one or more of the following, separated by a comma or a space:
  • close.heartbeat=y|n - close/leave after heartbeat (default = n).
  • close.syncpoint=y|n - close/leave after syncpoint (default = n).
  • close.task=y|n - close/leave after end of task (default = n).
  • max.cached=<n> - max number of connections to keep cached (default = 10).
  • max.dbopts=<n> - number of database operations before closing connections (default is 2147483647, that is INT_MAX).
-db:<db-name>
The name of the database to be used. This is used when a single physical database is used to host multiple datastores/regions. Use with the -add -dsn:<dsn-name> and -update -dsn:<dsn-name> actions/optons.
-dbopts:<options>
The database provider-specific options supported by MFDBFH; see Database Provider-specific Options for details of supported <options>. Use with the -add -dsn:<dsn-name> or -update -dsn:<dsn-name> actions/options
-dsn:<dsn-name>
The data source name. Use with the -add, -delete, and -update actions.
-feature:<options>
The features in use for the specified region database. Use with the -add -dsn:<dsn-name> -type:region and -update -dsn:<dsn-name> -type:region actions/options.
<options> can be one or more of the following, separated by a comma or a space:
  • all - all available region features enabled (default).
  • none - no region features enabled.
  • [+|-]reslocking - enables\disables database resource locking.
-file:<file-name>
Specifies the name of the configuration file to update. Use with the -add, -delete, and -update actions.
If not specified, the file defaults to the value of the MFDBFH_CONFIG environment variable.
-heartbeat:<secs>
The cross-region heartbeat interval, in seconds (default = 5). Use with the -add -dsn:<dsn-name> and -update -dsn:<dsn-name> actions/options. See Specifying the Cross-region Heartbeat Interval for more information.
-name:<name>
The name of the datastore, region, or database. Use with the -add -dsn:<dsn-name> and -update -dsn:<dsn-name> -type:datastore actions/options.
-nobanner
Suppresses output to a minimum.
-odbcdsn:<dsn-name>
The ODBC data source name with which to connect to a database. This option is used when you have multiple datastores, region databases, and/or a cross-region database stored in a single database, and you want those resources to share an ODBC database connection see Database Connections for more information. Use with the -add -dsn:<dsn-name> and -update -dsn:<dsn-name> actions/options.
-optio:<options>
Optimized I/O operations. Use with the -add -dsn:<dsn-name> -type:datastore and -update -dsn:<dsn-name> -type:datastore actions/options.
<options> can be one or more of the following, separated by a comma or a space:
  • all - all available I/O optimizations are enabled.
  • none - no I/O optimizations are enabled (default).
  • [+|-]oi - enables\disables I/O optimizations for ESDS, KSDS and RRDS files opened for input.
  • [+|-]oiseq - enables\disables I/O optimizations for (line-)sequential files opened for input.
  • [+|-]oo - enables\disables I/O optimizations for ESDS, KSDS and RRDS files opened for output.
  • [+|-]ooseq - enables\disables I/O optimizations for (line-)sequential files opened for output.
-optiokeyreads:<n>
The number of records to read ahead for KSDS, ESDS, and RRDS files when optimised I/O is enabled (see -optio). Specify 0 if the MFDBFH default value (of 50 records) is to be used.
-optioseqreads:<n>
The number of records to read ahead for LSEQ, and SEQ files when optimised I/O is enabled (see -optio). Specify 0 if the MFDBFH default value (of 50 records) is to be used.
-password:<password>
The password used to connect to the database. Use with the -add -dsn:<dsn-name> and -update -dsn:<dsn-name> actions/options.
-program:<prog-name>
The program/process name with which to apply the specified connection options (instead of it inheriting the connection-wide options). Use with the -add -server:<name> -dsn:<dsn-name> -connopts:<options> action/options.
-provider:<db-type>
The type of database. Use with the -add -server action/option.
<db-type> can be one of the following:
  • db2 - Db2.
  • ora or oracle - Oracle.
  • postgresql or pg - PostgreSQL.
  • sqlserver or ss - Microsoft SQL Server or Azure SQL Database.
-server:<name>
The name of the server. Use with the -add, -delete, and -update actions.
-type:<dsn-type>
The type of dsn. Use with the -add -dsn:<dsn-name> action/option.
<dsn-type> can be one of the following:
  • datastore
  • database
  • region
  • crossregion
-user:<user-name>
The user name used to connect to the database. Use with the -add -dsn:<dsn-name> and -update -dsn:<dsn-name> actions/options.
@<response-file-name>
Multiple actions, as listed above, can be added to a text file, one command per line. When that response file is run, each line is executed in turn.
For example, the following contents of a response file creates a configuration file (my.cfg) containing the required configuration for a MSSQL database (MYSRV) with one datastore (FILES) and one region database (ESDEMO):
-add -file:my.cfg -server:MYSRV -provider:ss -comment:"SQL Server server"
-add -file:my.cfg -server:MYSRV -dsn:SS.MASTER -type:database -name:master
-add -file:my.cfg -server:MYSRV -dsn:SS.FILES -type:datastore -name:FILES
-add -file:my.cfg -server:MYSRV -dsn:SS.CAS.ESDEMO -type:region -name:ESDEMO

If the file was saved with a name of commands.txt, you would run it using:

dbfhconfig @commands.txt