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.
- -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.
[17]
- -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. Datastores are automatically updated from time to time (for example, when
structural changes are required). Sometimes, these automatic updates fail (usually as the result of insufficient database
permissions), and therefore must be rerun manually. This option generates the script file required to run the 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.
[8]
- -verify - list or recover the integrity of a datastore[10]\region and cross-region database
[17].
- 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
-keytypes action.
- -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:db2 action/option.
- -datastore:<url>
- The URL of the datastore from which you want to list or recover files from. Use with the
-openfiles,
-upgrade, and the
-keytypes -import/-export action/options.
- -db:<dbname>
- Name of database to be created or used. Use with the
-script -provider:db2 action/option.
- -delete
- Specifies that keytype metadata is deleted for a particular datastore. Use with the
-keytypes action.
- -ebcdic
- Creates a database with EBCDIC support. Use with the
-createdb -provider:db2 action/option.
- -existdb:<db-name>
- Name of an existing database into which a datastore, region, or cross-region database is to be created. Use with the
-script -provider:db2 action/option.
- -export:<file-name>
- Specifies a file with which to export the keytype metadata for a particular datastore. Use with the
-keytypes -datastore action/option.
- -file:<url>
- Specifies the datastore data file that you want to add keytype metadata to, or remove keytype metadata from. Use with the
-keytypes -add/-delete action/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
-createdb action for input files, the
-script or
-upgrade actions for generated script files, or
-diags -usedb:<instance> -name:<object-name> action/options for diagnostics files
[17].
- -force
- Forces closed an open file reguardless of its status. Use with the
-openfiles -recover -pid action/options.
[19]
- -hex
- Displays the name of the specified region in hexadecimal. Use with the
-region -list -usedb:<dbname> -name:<region-name> action/options.
[15]
- -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:pg actions/options.
[8]
- -import:<file-name>
- Specifies the file containing keytype metadata that is to be imported. Use with the
-keytypes -datastore action/option.
- The following example shows the required format for the import file, where
file1.dat, located at the root of the datastore, has an alphanumeric primary key and a signed COMP-X first alternate key;
file2.dat, located in the PAY1 sub-folder, has an alphanumeric primary key and first alternate key, and an unsigned COM-X second alternate
key:
<?xml version="1.0" encoding="us-ascii" standalone="no"?>
<keytypes_definitions>
<keytypes_definition filename="file1.dat" folder="/" types="AN,SCOMPX"/>
<keytypes_definition filename="file2.dat" folder="/PAY1" types="AN,AN,UCOMPX"/>
</keytypes_definitions>
- -list
- Lists the results of the specified actions:
-casprocess -list shows 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[10]\region and cross-region database[17].
- -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:datastore and
-script -type:region actions/options, and the
-region -list/recover action/options.
- -nobanner
- Synonym for -quiet
- -password:<pwd>
- The password used to connect to a database. Use with the
-createdb -provider:az|pg|ss action/options.
- -pid:<process-id>
- The process ID applicable to the specified action. Use with the
-casprocess -recover or
-openfiles -recover actions/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:pg action/option.[8]
- -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:
-
db-type
|
Description
|
az
|
Azure SQL database
|
azuresqldb
|
Azure SQL database
|
db2
|
Db2
|
postgresql
|
PostgreSQL
|
pg
|
PostgreSQL
|
sqlserver
|
Microsoft SQL Server
|
ss
|
Microsoft SQL Server
|
- -recover
- Recovers the resources owned by a CAS process,
closes open datastore files with a status of
Inactive or
In doubt (as indicated by
-openfiles -list)[19], or repairs datastores\region and cross-region databases containing integrity issues. Use with the
-casprocess,
-region,
-openfiles, or
-verify[10] actions/options.
- -replace
- Replaces keytype metadata that already exists for files. Use with the
-keytypes,
-add, or
-import actions/options.
- -reset
- Reset the status of a region database. Use with the
-region -status action/option.
- -status
- List or reset the status of a region database. Use with the
-region action.
- -type:<script-type>
- Specifies the type of database creation script, which can be one of: crossregion, datastore, or region. Use with the
-script and
-createdb actions.
- -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
|
- Use with the
-keytypes -add/-replace/-import/-export/-list action/options.
- -usedb:<instance>
- Use the specified database server instance. Use with the
-casprocess -list/-recover,
-createdb -provider:az|ss,
-openfiles -list/-recover, or the
-openfiles -list/-recover actions/options.
- -user:<user-name>
- The user name used to connect to a database. Use with the
-createdb -provider:az|pg|ss action/options.
- -verbose
- Displays additional information, such as the database configuration file and script folder locations in effect, for the current
operation.