defragdb — Pack (defragment) database
call defragdb(handle,verbose,status) integer*4 handle integer* verbose integer*4 status
defragdb
packs the database
handle
. All inactive and/or deleted sets are
removed, as well as any empty space. Note that
defragdb
modifies the file offset (also
referred to as file address) of the datasets. If no empty space is
found defragdb
does not modify the
database.
handle
Database handle (input). The file handle
handle
may not exceed the maximum number of
simultaneously open databases.
verbose
Verbose flag (input). Dummy argument for compatibility with version 6.
status
Status code returned (output). Upon successful completion of the operation, the status value 0 is returned. A negative value is returned, if an error has been detected. A positive value is returned, if a warning has been issued. See MemCom error codes.
In the current version of MemCom
this function is still in an experimental state, i.e it is not
completely safe: If, for some reason (power off, kill process, etc.)
mcDBpack
cannot terminate, some or all data are
lost. If, for the time being, an absolutely safe operation is
required, copy the entire file to a new file (note that this method
requires up to twice the amount of disk space occupied by the
current database).
defragdb
changes the file addresses of
the datasets. Thus, any function which makes use of such addresses
(like when calling vdb
file operations) must
then be updated!