HPlogo KSAM/3000 Reference Manual: HP 3000 MPE/iX Computer Systems > Appendix E RECOVERY FROM SYSTEM FAILURE

RELOADING A KSAM FILE

» 

Technical documentation

Complete book in PDF
» Feedback

 » Table of Contents

You use FCOPY to reload a KSAM file when KEYINFO cannot recover the file. You must first use the KSAMUTIL BUILD command to build the new file, and then use FCOPY to copy the file. In general, you should use the KEY=0 option of FCOPY (see section II for a complete description of the FCOPY options for KSAM files). KEY=0 copies the file in chronological sequence so that the new file will be an exact copy of the original file, except that records marked for deletion are physically deleted from the file.

For example, to reload the file TEST to a new KSAM file, NEWTEST:

 

     :RUN FCOPY.PUB.SYS 

     >FROM=TEST;TO=(NEWTEST,NEWKEY) ;KEY=0;NEW 

After the file is successfully reloaded, you should purge the old file TEST and rename the file NEWTEST. To do this, run KSAMUTIL and use the PURGE and RENAME commands as follows;

 

RUN KSAMUTIL.PUB.SYS 

HP32208V2.4 THU, MAR 8,1979,1:05 PM            KSAMUTIL VERSION:A.3.0 

>PURGE TEST 

TEST,TESTKEY PURGED 

>RENAME NEWTEST,TEST 

>RENAME NEWKEY,TESTKEY 

Now you can run any existing programs that referenced the old file TEST.

The only time you might not want to use the KEY= option to reload a damaged file is if the key file has been accidentally purged. In this case, and if the file has fixed-lengt,h records, you can use the NOKSAM option. This option needs only the original data file. As it copies the data file in chronological order to a new KSAM file, it creates a key file with key entries for the data records. The NOKSAM option does not, however, allow you to copy a data file with variable-length records. Refer to the instructions for copying variable-length KSAM files in Section II.

For example, to reload a KSAM data file for which you have only a data file with fixed-length records, first build the new data file, NEWFIL, then use the following FCOPY command:

 

>FROM=DATAFIL;TO=NEWFIL;NOKSAM;NOUSERLABELS; 

  SUBSET=#%377,%377,,EXCLUDE           |

  |\______________________/|           | 

                  |                    | 

                  |                    | 

                  |                    | 

   to exclude records marked         you must not copy 

      for deletion by -1 in             user labels to a 

       first two characters              KSAM file 

This command copies only the non-deleted records; it creates a new KSAM file with only valid records and a key file that has key entries for each data record.

After a system crash in which the key file is lost, it is possible that the MPE end-of-file follows the KSAM end-of-file because it was written to disc just before the crash. If this is the case and you use the NOKSAM option you should also use a SUBSET option to copy only the records up to the KSAM end-of-file, not the undefined area between the KSAM and MPE end-of-files.

EXPAND KEY BLOCK BUFFER AREA

Depending on the length of the existing file, the reloading procedure can take a long time. One way to shorten this time is to increase the number of key block buffers in the extra data segment for the file. Since reloading is a write-only operation, the more buffers that can be allocated to key blocks, the less swapping is needed between the extra data segment and disc as new key entries are added.

In order to increase the number of key block buffers, enter the following commands:

 

:RUN FCOPY.PUB.SYS 

>FROM=TEST;TO=(NEW,NEWK);SUBSET=1,0 <------------ create new file with 0 records 

>:FILE F=NEW;DEV=,,20 <------------ increase number of key block buffers 

>FROM=TEST;TO=*F;KEY=0 <------------ copy data in chronological order 

                  | 

                  |------ remember to back reference file 
Feedback to webmaster