Use the following commands to view the enterprise server processes that may be in error after an abnormal termination, and to recover such processes.
The following command lists the CAS processes still running for the svr-mydb database server instance on svr-01:
dbfhadmin -casprocess -list -usedb:svr-mydb -host:svr-01
The following command lists the CAS processes still running for the svr-mydb database server instance, on the host MYHOST:
dbfhadmin -casprocess -list -usedb:svr-mydb -host:MYHOST
The following command recovers the CAS process for process ID 12345, for the svr-mydb database server instance on svr-01:
dbfhadmin -casprocess -recover -usedb:svr-mydb -host:svr-01 -pid:12345
The following command recovers all CAS processes for the svr-mydb database server instance on svr-01:
dbfhadmin -casprocess -recover -usedb:svr-mydb -host:svr-01
Use the following commands to create databases from a script file. Running these commands ahead of time ensures processing is not delayed when access is required and the databases are yet to be created.
The following command creates an ANSI-encoded MSSQL datastore database by running the mydb.sql script file:
dbfhadmin -createdb -file:mydb.sql -type:datastore -provider:ss
The following command creates an EBCDIC-encoded Db2 datastore database by running the mydb.sql script file:
dbfhadmin -createdb -file:mydb.sql -type:datastore -provider:db2 -ebcdic
Use the following commands to view data files still open after an abnormal termination of an enterprise server, and to recover/release them. Also, there are a number of commands to administer the column types of indexed keys.
The following command lists the data files still open for the VSAM datastore hosted on svr-mydb:
dbfhadmin -openfiles -list -datastore:sql://svr-mydb/VSAM -host:svr-01
The following command recovers the data files still open for the VSAM datastore hosted on svr-mydb:
dbfhadmin -openfiles -recover -datastore:sql://svr-mydb/VSAM -host:svr-01
The following command specifies that the column type for the primary key of the MYFILE.dat file is alphanumeric, and the column type for the first alternate key is signed COMP-X:
dbfhadmin -keytypes -add -file:sql://svr-mydb/VSAM/MYFILE.dat -types:AN,SCOMPX
The following command replaces existing key types for the specified data file:
dbfhadmin -keytypes -add -replace -file:sql://svr-mydb/VSAM/MYFILE.dat -types:AN,SCOMPX
The following command deletes the key types that have been specified for MYFILE.dat, and the column types for indexed keys revert to type BINARY:
dbfhadmin -keytypes -delete -file:sql://svr-mydb/VSAM/MYFILE.dat
The following command exports the list of key types for the VSAM datastore to the MYKEYTYPES.xml file:
dbfhadmin -keytypes -export:MYKEYTYPES.xml -datastore:sql://svr-mydb/VSAM
The following command imports a list of key types to the VSAM datastore from the MYKEYTYPES.xml file:
dbfhadmin -keytypes -import:MYKEYTYPES.xml -datastore:sql://svr-mydb/VSAM
The following command imports a list of key types to the VSAM datastore from the MYKEYTYPES.xml file, replacing any existing types that correspond to the ones in the file:
dbfhadmin -keytypes -import:MYKEYTYPES.xml -datastore:sql://svr-mydb/VSAM -replace
The following command lists the key types set for each data file in the datastore:
dbfhadmin -keytypes -list -datastore:sql://svr-mydb/VSAM
Use the following commands to create script files that can be used to create databases.
The following command creates a script file (createdb.sql) that can be run to create a Db2 cross-region database:
dbfhadmin -script -type:crossregion -provider:db2 -file:createdb.sql
The following command creates a script file (createdb.sql) that can be run to create a Db2 cross-region database using the SYSTEM_1252_US Windows collating sequence:
dbfhadmin -script -type:crossregion -provider:db2 -file:createdb.sql -collate:SYSTEM_1252_US
The following command creates a script file (createdb.sql) that can be run to create a PostgreSQL datastore called MYFILES:
dbfhadmin -script -type:datastore -name:MYFILES -provider:pg -file:createdb.sql
The following command creates a script file (createdb.sql) that can be run to create an MSSQL region database called ESDEMO:
dbfhadmin -script -type:region -name:ESDEMO -provider:ss -file:createdb.sql
The following command creates a script file (createinmydb.sql) that can be run to create a Db2 datastore called mySEQ, which will be stored in the existing Db2 database called masterSEQDB:
dbfhadmin -script -type:datastore -name:mySEQ -provider:db2 -file:createinmydb.sql -existdb:masterSEQDB