Reorganising with Compression

This option is not recommended for general use, because if something goes wrong while the data file is being processed the database will neeed to be restored from a backup. Option 3 is much safer, because it builds a new data file and only removes the old data file when the new one is known to be OK and secured.

This option is something of a misnomer - it does not truly compress the data file - it merely removes any holes in the data file by moving later records into the space occupied by the hole. The only option of REORGDB that can genuinely improve the data file compression is option 3: Rebuild data and index file. If you have a database without an index file at all, or a hopelessly corrupted index, this option can be used to rebuild the index file without changing the data file in any way, by running REORGDB like this:
reorgdb -db dbname -nosqueeze -corrupt -index
You will need to create a dummy index file, by copying bd.ind to dbname.ind

  1. On the DP4 System menu, select the Database management option. The Database Management menu is displayed.

  2. Select the Reorganise database option and enter the database name.

  3. On the Database Reorganisation Facilities menu, select option 1 - Compress data file and rebuild index

    DP4 displays a message for each stage of the reorganisation. There are several stages:

  4. When the reorganisation utility terminates, press <Enter> to return to the DP4 System menu. Back up the database, using one of the methods described earlier.

Crash Recovery

If the machine crashes during the 'Indexing other tables' phase, you can continue the reorganisation by renaming an old index file to the index filename (if you do not have an old index file, use one from another database with the same numbering system and generation number equal to or less than the crashed database), and restarting the reorganisation from the Run program option of the DP4 System menu:
REORGDB -CORRUPT
If the machine crashes before the 'Indexing other tables' phase, your only option is to restore the database from a backup.