The dbfhadmin Command Line Utility
Use the dbfhadmin command line utility to administer datastores and cross-region databases, enabling you to recover resources in the event of an abnormal termination of the database.
Use the dbfhadmin command-line tool to recover resources from region, cross-region, and datastore databases in the event of a system failure. You can also use it to ensure that the database column used for primary and alternate indexed keys are set to the correct SQL type.
Note:
You must run the command from an environment where the MFDBFH_CONFIG variable points to a configuration file that contains data source entries for the databases to be administered.
Syntax:
dbfhadmin [action][options]
- Actions
- Refer to the running of the command as a whole:
-casprocess- list or recover resources in CAS processes.-createdb- create a database.Warning:This option is not supported for the creation of Oracle databases.-diags- generate a diagnostics file containing details of the region and cross-region databases, the database configuration file contents, and the table contents of the cross-region database and region databases. Use with the additional-datastoreoption to include datastore lock information.-keytypes- list, add, delete, import, or export key type metadata.-openfiles- list files or close open files in a datastore.-region- list or recover region resources. You may be required to free locked resources using this method if the automated recovery process has been unable to - console log error messages may indicate when this has been the case.-script- generate an SQL script for creating databases.-upgrade- generate an SQL script for upgrading datastores, region and cross-region databases. These are automatically updated from time to time (for example, when structural changes are required). Sometimes, the automatic updates fail (usually as the result of insufficient database permissions), and therefore must be rerun manually. The-upgradeoption generates the script file required to run a manual update. Once you have the required file, you should run it with sysadmin privileges, using the command-line tool appropriate for your database type.-verify- list or recover the integrity of a datastore/region and cross-region database.
- Options
- Defines the options for the specified action. Valid values are:
- -add
- Specifies that keytype metadata is added or updated for a particular datastore. Use with the
-keytypesaction. - -collation:<id>
- The collation type used when creating a Db2 database. The default is SYSTEM_1252_US for Windows, and SYSTEM_923_US for UNIX/Linux. Use with the
-script-provider:db2action/option. - -configfile:<name>
- The path and file name of the database configuration file. This is optional if the MFDBFH_CONFIG environment variable is already in effect, but if set, will override the value of the MFDBFH_CONFIG.
- -datastore:<url>
- The URL of the datastore from which you want to list or recover files, or garner diagnostics
from. Use with the
-openfiles,-upgrade, and the-keytypes -import/-exportaction/options to list/recover files, or use with the-diags -usedb -nameaction/options to dump datastore lock information to a MFDBFH_Diagnostics.txt file. - -db:<dbname>
- Name of database to be created or used. Use with the
-script -provider:db2|pg|ssaction/option. - -delete
- Specifies that keytype metadata is deleted for a particular datastore. Use with the
-keytypesaction. - -ebcdic
- Creates a database with EBCDIC support. Use with the
-createdb -provider:db2action/option. - -existdb:<db-name>
- Name of an existing physical database into which a datastore, region, or cross-region database is to be created. Use with the
-script -provider:db2|pg|ssand the-createdb -provider:ora -scriptaction/options.Note:For Oracle databases, this option is mandatory, as MFDBFH will not create the specified database if its underlying physical database does not already exist. - -export:<file-name>
- Specifies a file with which to export the keytype metadata for a particular datastore. Use with the
-keytypes -datastoreaction/option. - -file:<url>
- Specifies the datastore data file that you want to add keytype metadata to, remove keytype
metadata from. Use with the
-keytypes -add/-deleteor-checkrbasaction/options. - -file:<file-name>
- Specifies the input file name for database creation, or the output file name for generated
scripts or region diagnostics. Use with the
-createdbaction for input files, the-scriptor-upgradeactions for generated script files, or-diags -usedb:<instance> -name:<object-name>action/options for diagnostics files. - -force
- Forces closed an open file regardless of its status. Use with
the
-openfiles -recover -pidaction/options. - -hex
- Displays the name of the specified region in hexadecimal. Use
with the
-region -list -usedb:<dbname> -name:<region-name>action/options. - -host:<name>
- The host name targeted for process recovery, for forced file closure, or for PostgreSQL database creation. Use with the
-casprocess -list/-recover,-openfiles -list/-recover, or-createdb -provider:pgactions/options. - -import:<file-name>
- Specifies the file containing keytype metadata that is to be imported. Use with the
-keytypes -datastoreaction/option. - -list
- Lists the results of the specified actions, for the specified database:
-casprocess -listshows the active processes,-region -list -usedb:<dbname>shows region resource locks for a particular database,-openfiles -list -usedb:<dbname>shows the files currently open, or-verify -list -usedb:<dbname>shows the integrity of a datastore\region and cross-region database. - -name:<object-name>
- The name of the datastore or region database script to be created, or region resource to be recovered. Use with the
-script -type:datastoreand-script -type:regionactions/options, and the-region -list/recoveraction/options. - -nobanner
- Synonym for -quiet
- -password:<pwd>
- The password used to connect to a database. Use with the
-createdb -provider:pg|ssaction/options. - -pid:<process-id>
- The process ID applicable to the specified action. Use with the
-casprocess -recoveror-openfiles -recoveractions/options. - -port:<number>
- The port number required for PostgreSQL database creation. You are required to specify this when the database is using a non-default port number or is on a remote server. Use with the
-createdb -provider:pgaction/option. - -provider:<db-type>
- The name of database provider for which the script is to be generated (
-script), or database creation (-createdb). <db-type> can be one of: - -recover
- Recovers the resources owned by a CAS process, closes open datastore files with a status of
InactiveorIn doubt(as indicated by-openfiles -list), or repairs datastores\region and cross-region databases containing integrity issues. Use with the-casprocess,-region,-openfilesor-verifyactions/options. - -regionid:<id>
- Specifies a particular region within a PAC to recover -
<id> is a PAC UUID, which you can
locate by running dbfhadmin -casprocess
-list. Use with the
-casprocess -recoveraction/option. - -replace
- Replaces keytype metadata that already exists for files. Use with the
-keytypes,-add, or-importactions/options. - -reset
- Reset the status of a region database. Use with the
-region -statusaction/option. - -status
- List or reset the status of a region database. Use with the
-regionaction. - -type:<script-type>
- Specifies the type of database creation script, which can be one of: crossregion, datastore, datastore_funcs, or region. Use with the
-scriptand (with the exception of datastore_funcs) the-createdbactions. - -types:<key-types>
- Defines the column types for a file's primary and alternate keys. Specify the key types as a comma-delimited list, using the following types:
Type Description AN Alphanumeric BIN Binary SCOMPX Signed COMP-X UCOMPX Unsigned COMP-X - -usedb:<instance>
- Use the specified database server instance. Use with the
-casprocess -list/-recover,-createdb -provider:ss,-openfiles -list/-recover, or the-openfiles -list/-recoveractions/options. - -user:<user-name>
- The user name used to connect to a database. Use with the
-createdb -provider:pg|ssaction/options. - -verbose
- Displays additional information, such as the database configuration file and script folder locations in effect, for the current operation.