Previous Topic Next topic Print topic


Recovery command options

Recovery command options can be specified in either of the following two ways:

  • Depending on the operating system, they can be placed into the Windows registry or the UNIX resource file:
    • In the Windows registry, the Command Line Options property provides command line options for the Indexed File Recovery utility when Recovery is selected on the Select File tab of the RM/COBOL Properties dialog box.
    • In the UNIX resource file, the Options keyword, described in Command Line Options, provides command line options for the Indexed File Recovery utility in the global resource file /etc/default/recover1rc and the local resource file ~/.recover1rc.
  • They can be specified in the Recovery Command itself.

The following options may be specified to modify the behavior of the Indexed File Recovery (recover1) utility.

I
Use the I option to cause recover1 to test only the file integrity and then stop. The file will not be modified in any way. Specifying the I option causes both the T and Z options to be ignored. If no problems are discovered, the exit code is set to 0. If a problem is discovered, the exit code is set to 1. The I option has the following format:
-I

The default is for recover1 to do a complete recovery of the indexed file if the file is marked as needing recovery. See the Y and Z options in this topic for additional options that modify the behavior of the Indexed File Recovery utility.

Note: The integrity scan is a quick test of the file and is not comprehensive. Some problems, such as records with invalid duplicate keys, will not be detected. Indexed files with no errors detected by the integrity scan may still receive “98” errors or other I/O errors.
K
Use the K option to indicate that the Key Information Block (KIB) should be assumed to be invalid and, optionally, to specify a template file for recovering the KIB. The K option has the following format:
-K [template-file]

If no template-file is specified, the user will be prompted either for a template file or for enough information to rebuild the KIB. If template-file is specified, it should be the name of a valid indexed file with the same format as the file being recovered. This file will be used as a template. The required KIB information is read from the KIB of the template file. The template file can be a backup copy of the file being recovered, if the backup occurred before the file was damaged, or, it can be a file created by performing an OPEN OUTPUT in a COBOL program with the proper file control entry and file description entry for the file being recovered. An OPEN OUTPUT must have been performed on the template file, but it need not contain any records. A template file must be specified if the KIB is corrupt and the file uses either an enumerated code set or an enumerated collating sequence. The default is to check the KIB for validity and, if it is found to be invalid, prompt for either a template file or information to rebuild the KIB. The name of the template file is not resolved through any environment variables.

Warning: A template file with the wrong block size can cause the loss of a large percentage of the recoverable records in your file.
L
Use the L option to write information about errors encountered while recovering the file to a log file. The L option has the following format:
-L [log-file]

Only the first 100 errors will be logged. In addition to errors, a number of informational lines about the indexed file and its recovery are written to the log file, including information about sort memory (see the M option regarding sort memory). If log-file specifies an environment variable name, the environment variable value will be resolved before opening the log file; this allows the use of the name PRINTER to send the log information to the print device. If log-file is omitted in the L option, the default value of log-file is PRINTER. If the L option is not specified, the default is not to write a log file.

Note: Environment variables can be set using synonyms set in the Windows registry or the UNIX resource file.
M
Use the M option to specify the number of megabytes of memory to allocate to the sort algorithm used in phase 4, build node blocks. The M option has the following format:
-M [MB-of-memory]

where MB-of memory is a number in the range 0 to 2000. Allocating more memory generally results in faster execution of recover1 and causes fewer node blocks to be built. If this option is not specified, a suitable number will be computed; in this case, sort memory is limited to no more than 40 million bytes. When a log file is written (see the L option), a line is written into the log file to show the maximum effective sort-memory size. If the M option is specified without a number of megabytes, the default value of 50 is used.

Note: Specifying a number for MB-of-memory that is too large for your system may result in very poor system performance.
Q
Use the Q option to cause recover1 to perform its work without displaying information or asking the operator questions. The Q option has the following format:
-Q

If the file is marked as needing recovery, or has a non-zero Open For Modify Count, then it will be recovered. Otherwise, no action occurs. This behavior can be modified by using the Y option. The default is to display information and ask questions, which must be answered by the operator.

T
Use the T option to indicate that unused space should be truncated and returned

to the operating system. The T option has the following format:

-T

Specifying the T option will result in a minimal size indexed file, but may reduce performance if records are subsequently added to the indexed file. The default is not to truncate the file. When the file is not truncated, any empty blocks remain part of the file and are available for use in adding new records to the file.

Note: Some versions of UNIX do not support the operating system call required to

truncate a file.

Y
Use the Y option to cause recover1 to assume that the operator wants to answer “y” to all possible questions and therefore not stop to wait for a response. The Y option has the following format:
-Y

Using the Y option will cause a file to be recovered even if it is not marked for recovery, including the case of when the Q option is also specified. The default is to wait for a response from the operator after a question is displayed.

Z
Use the Z option to reset the Open For Modify Count to zero, without performing a full recovery. The Z option has the following format:
-Z

If the file is marked as needing recovery, the Z option is ignored. The default is to treat a non-zero Open For Modify Count as indicating that the file needs recovery.

Note: Use the Z option with caution. Resetting the Open For Modify Count to zero without performing a full recovery may leave the file in a corrupted state.
Previous Topic Next topic Print topic