Show TOC

auto_shrinkLocate this document in the navigation structure

Use

Use this command to switch the function for automatically reducing the data area on and off.

Together with the function for automatically extending the data area, you can use this command to ensure that the fill level of a database at any time does not fall below a defined value and not raise beyond another defined value (see also: auto_extend). This way you make sure that the disk space is economically used and that the database cannot run out of capacity.

You can use the auto_shrink command for automatically deleting data volumes of the FILE type.

The system automatically checks whether a data volume can be deleted when the fill level of the data area falls below the specified value. It also checks whether the automatic data area extension function is active. It deletes surplus volumes if the following conditions apply:

  • The specified percentage for the fill level is met or the specified number of empty data volumes is left over after the data area was shrunk.

  • The resulting fill level does not exceed the fill level specified for the data area extension reduced by the buffer size.

You can switch this function on or off. The default setting is OFF.

You also use this DBM command to display the status of this function.

Note

The group of DBM commands that uses the built-in event dispatcher requires its own event task. For this reason, make sure when you switch on this function that the FloatingServiceTasks and PreservedEventTasks database parameter values are large enough.

Also make sure that the X server is running since the auto_shrink function only works if X server is running on the database computer.

Recommendation

Use this command only if your database has multiple data volumes and the volumes have roughly the same size.

Prerequisites

You have the server permissions EvtDispMgm and ParamFull or AccessUtility.

Structure

auto_shrink <ON_spec> | OFF | SHOW

<ON_spec> :: = ON <shrinkage_spec>

<shrinkage_spec> :: = [Fill Level <percentage>] [Empty Volumes <number>] [Shrinkcheck Stepsize <percentage>] [Buffer Percentage <percentage>] [Buffer Empty Volumes <number>]

Option

Description

ON

Activate function

Fill Level <percentage>

Target fill level as percentage of the data area when shrinking the data area.

The system default value is 75.

Empty Volumes <number>

Number of the empty volumes to remain when shrinking the data area.

The system default value is 2.

Note

Empty Volume is only an arithmetic value. It corresponds to the average size of a data volume in this database calculated by dividing the reserved data area by the number of the available data volumes.

Shrinkcheck Stepsize <percentage>

Percentage of the fill level used by the system to check periodically whether volumes can be deleted. It is applied by the system if the defined conditions do not fully apply when an event for deleting volumes is triggered: While the fill level continues decreasing the system checks in intervals determined by the Shrinkcheck Stepsize value whether the conditions for deleting volumes apply.

The system default value is 5.

Buffer Percentage <percentage>

Defines the percental difference between the thresholds for the auto_shrink and the auto_extend functions

The system default value is 5.

Buffer Empty Volumes <number>

Number of empty volumes (calculated in volumes of an average size) that is to remain after volumes were deleted.

The system default value is 2.

OFF

Deactivate function

SHOW

Display function status

Result

OK

In the event of errors, see Reply Format.

Note

This reply confirms that the command was sent to the database kernel. The system does not verify your configuration. A misconfiguration may prevent the automatic shrinkage of the data area. Therefore, check in the KnlMsgArchive or the dbm.prt log files whether the data area shrinks as intended. You can also use Database Studio to find out whether the number of volumes decreases.