REORGDB

Reorganises/rebuilds a database. See Reorganising the Database in the DP4 Developer's Manual for further information about this program. It is intended to replace the -HOLES option, little used in the past, and withdrawn as of release 4.622, with an improved "Defragment Database" Option.

Command Tail Description

−ADVANCED

Updates database structure to use new 4.622 features. Only effective if -DATA is also specified.

−BUILD table
index role

Rebuild individual indexes

−CORRUPT

Allow the reorganisation of the index of a database which has the corrupt flag set. This option will fail if the data file contains corruptions. If you intend to use option 1 to rebuild the database it is advisable also to specify the −NOSQUEEZE command tail to prevent the data file from being altered.

−DATA

Rebuild the data and index files and bring all data up to the current database generation. For databases with enahnced data compression this option calculates the optimal compression strategy for the database.

−DEFRAGMENT

New option for 4.622, only available for databases using "Two File Index". Quick reorganisation that optimises index and sorts data file for faster database access.

−DELETE

Allows option 7 (data deletion) to be selected so that you can delete data from selected or all tables. Normally option 7 is hidden and disabled.

−DELETION
−TABLE a −TABLE b...

Selects option 7, and deletes data from selected or all tables. Using this option (which rebuilds the database completely) may be faster than deleting data using normal deletion operations if all or most of the data on the database will be deleted.

−FILE name

Reads tables to delete from file

−HEAP n

Allocates the heap size; n is heap size in kilobytes. Default is 4096 up to release 4.621 and 16384 from release 4.622. Values in excess of 32878 are unlikely to improve performance significantly.

−INDEX

Rebuild the index file (option 1) and combine unused space on the data file. The -DATA option will usually give better results and is only marginally slower than this option.

−LOCAL

Allow speed optimisation where database is on the same machine as REORGDB. This command tail is not needed from release 4.525/4.621 onwards

−NOSPACE

Omit the disk space check. There is no need to use this command tail as of release 4.622

−NOSQUEEZE

Causes option 1 only to build a new index, and to suppress all non vital data file changes.

−OPTIMISE

Rearrange the index to improve performance. From release 4.622 this may also reduce the size of the index file significantly

−RESET

Causes all timestamps to be set back to 0. May be needed if database timestamp has reached its maximum value.

−ROLLBACK

Enable rollback recovery for database reorganisations using -HOLES or -BUILD command tails

−RESET

Enables the database timestamp reset to 0. Stops DBERA and SRDD from working properly.

−ALTSORT

−SORT

When the data file is rebuilt using option 3 or option 7, both these command tails attempt to reorder the database data file to improve performance by sorting data into primary key sequence. The −ALTSORT option sorts each table separately, the −SORT options groups related tables together (so that order_line records stay near the corresponding order header record for example). From release 4.622 these command tails are only relevant when the -corrupt option is used, because normally the data file is built by fetching all the data from the old database in primary key sequence, thus sorting the data perfectly.In release 4.621, the −ALTSORT option significantly improves performance, both of REORGDB, and of the reorganised database.

−SORTSIZE n

The number of bytes of key information used for sorting. The default is the entire key. 0 reorders the data by table numbers ignoring the key information


The command tails below are obsolete from release 4.622

−400

Build a database compatible with release 4.230 or 4.400.

−FAST

Speed up options that build a new index, at the expense of building less efficient and larger index. This option is unlikely to speed up REORGDB except on medium sized databases.

−HOLES

Combine all unused space in the data file

−PINDEX

Turn on physical indexing for all tables. Physical indexing is not supported from release 4.622, because it normally offers no advantage over using the primary index

−REUSE

Re-use the space occupied by deleted records. This option is only relevant on databases where the "keep deleted" records flag is set for one or more tables, usually as a result of having used SRDD against the database. This flag is ignored by release 4.622.

−SHUTDOWN hh:mm
(24 hour clock)

Force holes option to terminate at specified time