If a program dies, or there is some other system failure, files may become corrupted, destroyed, or left in an inconsistent state. If this occurs, the files may be recovered with the built-in library routine, C$RECOVER.
For any Vision files or relative files, C$RECOVER can be successful only if every operation on the files, including file OPEN, was done within a transaction.
To use the recovery function, you need the most recent backup copy of all the files that record their transactions. You also need all of the log files that were started immediately after the backup was created. Here's one way to perform a recovery:
The C$RECOVER library routine only recovers the updates recorded in the log file specified by the configuration variable LOG-FILE. To recover updates recorded in multiple log files, specify each log file in the LOG-FILE variable and call C$RECOVER for each one. For example:
SET CONFIGURATION "LOG-FILE" TO "default.log". CALL "C$RECOVER". SET CONFIGURATION "LOG-FILE" TO "file1.log". CALL "C$RECOVER". SET CONFIGURATION "LOG-FILE" TO "file2.log". CALL "C$RECOVER". SET CONFIGURATION "LOG-FILE" TO "file3.log". CALL "C$RECOVER".
To ensure that your data can be recovered, you should:
The backup data files should have the same absolute or relative pathname as when the original programs were run. If there are any cases where relative pathnames are used for the log or data files, run the program that calls the C$RECOVER routine from the same directory as the original programs. For the program that calls the C$RECOVER routine, specify the log file in the configuration file or in the environment.
If the recovery process terminates prematurely due to an error, and files are left open, they are automatically closed before the call to C$RECOVER returns.
If a failure occurs during the recovery process, and no other copies of the backup files are available, then automatic recovery is not possible. This means that you should make sure to have an extra backup copy of your data files.