DOCS

Compressing a Database

Compressing databases includes both the release of unused memory and the defragmentation of memory.

The Rochade access method, RISAM, ensures that Rochade databases do not have unusable memory gaps, only unused memory that can result from write and delete operations. Therefore, compression of a database in the sense of a reduction of the required storage space is possible only in connection with the -release option of the rodbucx<os> service program.

You can use the option -compress in connection with these options:

You can use rodbucx<os> with the option -compress or the option -defrag to compress a database.

Either option stores the data records in contiguous fashion and thus optimizes access to the database items. While rodbucx<os> with -compress stores data records merely in contiguous fashion, -defrag also stores them in the order of the record keys.

You can specify the option -copy in addition to the options -compress and -defrag to copy the contents of the new compressed database to the source database instead of removing the source database and then renaming the compressed one.

This enables you to retain all attributes of the source database file (for example, owner, group, access control lists, etc.).

ASG recommends that you use the copy method if rodbucx<os> runs with different user permissions than the regular server operation (for example, during installation or maintenance) or if you have assigned special access permissions for the database files that you want to retain. If you do not want to use the method (for example, because copying the contents requires too much time), you must reset the access permissions manually afterwards.

You can specify the option -release in addition to the option -compress to release the contents of the memory registered in the free memory list (for example, deleted records and free memory spaces).

If a very large number of items has been deleted, this can reduce the amount of required memory by a considerable amount, too.

Normally, deleting items from the database does not automatically reduce the size of the database, but merely releases memory space within the database. That space is used again when new items are written or existing items are updated.

The conditions that lead to a release of disk space under z/OS are explained in Compressing Databases under z/OS.

If you are using restore logging, the of LOG file recording will be interrupted when you call rodbucx<os> with the -release option. Therefore, ASG recommends that you create a new backup of the databases and restart the logging process. For details, see Restore Logging.
You can specify the option -numreb in addition to the option -compress to convert databases that were created with Rochade Server versions earlier than 8.00.

After conversion, earlier Rochade Server versions will no longer be able to access the databases.

The service program rodbucx<os> uses temporary files during compression of a database. For this reason, you must ensure that there is at least as much available disk space as is taken up by the largest database file. Using the -dir option, you can specify a directory for the temporary files. Otherwise, the temporary files are written to the current directory. Optionally, you can use the -tempdb option to specify a file to be used as a temporary file for the database by rodbucx<os>.

For details about specifying temporary datasets under z/OS, see the table listed under Compressing Databases under z/OS.

Example (UNIX)

rodbucxu ROSRV server.ini -defrag -release -d=/tmp -db=DATA

This command compresses a UNIX database described in the section DATA of the server initialization file server.ini. During compression, temporary files are created in the /tmp directory.

To compress a database while the server is running

1. Activate the online backup mode.
2. Create a copy of the database that you want to compress.
3. In the server initialization file, change the DFILE setting for the database to point to the copied database file.
4. Compress the database copy.
5. Deactivate the online backup mode. The server reads the updated DFILE setting and, therefore, transfers the data from the buffer database to the new compressed database. You can then delete the old database.
  • You must use only the options -compress or -defrag to compress the database. If you specify another option (for example, -release or -numrebuild), the identity record of the database is modified, and the server will not accept it as a replacement for the old database.
  • You cannot replace the existing databases arbitrarily with other databases. The server writes a set of special records to the databases when activating the online backup mode, and uses these records to examine the identity of the databases.

Compressing Databases under z/OS

To compress a database under z/OS, you must always specify a temporary file. If you also want to physically reduce the database, by default, use the installed job RODUCPR, which specifies both the database and the temporary file via the DS name of a VSAM dataset. For information on how to specify a file via the DS name of a VSAM dataset, see Specifying Files under z/OS.

Before calling the job RODBUCPR, make sure that the databases you wish to compress are not in use and that enough free space is available on the hard drive. For more information, see Database Maintenance.

This table summarizes the way RODBUCXM works, depending on the manner in which the database and the temporary file for the database are specified:

Temporary File Specification Database Specified via DS Name Database Specified via ddname

Temporary File Specified via DS name

RODBUCXM creates the temporary file and allocates it.

RODBUCXM reads the allocation information from the database section <db_section> of the initialization file.

If that section does not contain any PRIMARY and SECONDARY settings, RODBUCXM will use the database allocation values.

RODBUCXM compresses the database in the temporary database.

RODBUCXM renames the temporary database.

The size of the database is reduced to the size of the temporary file.

RODBUCXM creates the temporary file and allocates it.

RODBUCXM reads the allocation information from the database section <db_section> of the initialization file.

If that section does not contain any PRIMARY and SECONDARY settings, RODBUCXM will use the database allocation values.

RODBUCXM compresses the database in the temporary database.

RODBUCXM copies the temporary database to the database.

Allocation and size of the database do not change.

Temporary File Specified via ddname

The temporary file must exist and must be allocated.

RODBUCXM compresses the database in the temporary database.

RODBUCXM deletes the database and generates it anew.

RODBUCXM reads the allocation information from the database section <db_section> of the initialization file.

RODBUCXM copies the temporary database to the database.

Allocation and size of the database change if smaller values were specified in the initialization file at the time when the database was created.

The temporary file must exist and must be allocated.

RODBUCXM compresses the database in the temporary database.

RODBUCXM copies the temporary database to the database.

Allocation and size of the database do not change.