Version 7.4.4
 —  DBA Tasks  —

Database Space Management

This document provides the DBA with all pertinent information related to database space management. Information is provided about

This information is organized under the following headings:


Adabas Physical Extents

An Adabas physical extent (database container) is a collection of physical blocks assigned to a given database component (Associator, Data Storage, Work) during the definition of the database (see the ADADEF utility, ASSOSIZE, DATASIZE and WORKSIZE parameters).

The space for a physical extent is allocated using the standard allocation procedures of the operating system in use.

An Adabas physical extent may be allocated within a single operating system extent which consists of a primary extent only, or may be allocated as a primary extent together with one or more secondary extents. The secondary extents need not be contiguous to the primary extent or to each other.

An Adabas physical extent may be contained on a single physical volume or may extend across multiple volumes. The Associator and Data Storage components may each contain up to five Adabas physical extents.

Top of page

Relative Adabas Block Number (RABN)

Adabas information is stored in space allocated in "blocks". A block's size depends on

For example, the default device type used by Adabas is the IBM 3380 disk. This device is assumed in many utility and operating parameters as the device type unless another is specified.

When 3380 space is allocated for Adabas, it must be designated as Associator (ASSO), Data Storage (DATA), the Work area (WORK), logging area (PLOG, CLOG, RLOG), sort area, or temp area. A 3380 block allocated to ASSO contains 2004 bytes, but a 3380 block allocated to DATA contains 4820 bytes. Block sizes are predefined for each device type and Adabas component; Adabas Device types and Block Sizes lists block sizes by device type and component.

Adabas block sizes are not fixed by hardware; however, they are referred to as "physical" blocks to coincide with the level of description used for physical block (FBA) devices. Software AG tries to maintain consistent block definitions, by device type, from release to release. However, in some cases the block size for a component type may change to accommodate expanded Adabas facilities. Thus, a specific Adabas component (PLOG, ASSO, etc.) may need to be reformatted before you can run a new Adabas release.

Adabas identifies and addresses each physical block within a database component by its "relative Adabas block number" (RABN) , which indicates the block's position relative to the beginning of the component. RABNs are assigned in ascending sequence in Data Storage, Associator, or Work, starting with 1 for the first physical block in the first Adabas physical extent (the first track of the first extent is not used). If multiple physical extents are used, the RABN assignment continues across the physical extents.

The number of RABNs that can be assigned to ASSO and DATA depends on the RABNSIZE parameter, which is specified when the database is defined. RABNSIZE specifies the length of relative Adabas block numbers in the database (not the length of the block itself).

See Relative Adabas Block Number (RABN) Calculation in the Adabas Operations documentation for more information about RABNs.

Top of page

Adabas Logical Extents

An Adabas logical file extent is a group of consecutive RABNs allocated by the Adabas nucleus or an Adabas utility.

For each file loaded into the database, a minimum of one of each of the following types of Adabas logical extents is allocated to the file:

Logical extent Allocated from the physical extent . . .
Data Storage Data Storage
address converter Associator
normal index Associator
upper index Associator

Additional logical extents are allocated by the Adabas nucleus or an Adabas utility when additional space is needed as a result of file maintenance.

A maximum of one address converter may be allocated for any file. The maximum number of logical file extents that can be defined for any other type of logical extent is five.

When the Adabas nucleus starts up, the FCBs are checked. If there are alreay five extents of any extent type, the Adabas nucleus prints messags suggesting that the files should be reordered. In addition, if the last file extent of each type has only five or less free ISNs or blocks left, the nucleus locks the file for utility use only and nucleus response code 75 is issued. Normal users trying to access the file will then get response code 17 or 48.

Top of page

Adabas Space Allocation and Deallocation

This section provides an overview of Adabas space allocation and deallocation procedures. A full understanding of these procedures will help ensure correct and efficient database space management.

Free Space Table

All space available for allocation is stored in the free space table (FST). This table contains all RABN extents that are currently available for an allocation to any file.

Space Allocation by the Adabas Nucleus

When processing an add or update record command, the Adabas nucleus may need to allocate an additional extent to any of the following file components:

Address Converter (AC)

The size of the address converter is initially defined by the MAXISN parameter in the ADALOD utility. The actual "highest expected" ISN is slightly higher because the address converter is stored in entire blocks.

Example:

If RABNSIZE=3, MAXISN=5000 on a model 3380 with 668 entries per block (2004/3) results in 8 blocks. The highest ISN expected (before further expansion) is therefore 5343 (668 � 8 - 1).

If RABNSIZE=4, MAXISN=5000 on a model 3380 with 501 entries per block (2004/4) results in 10 blocks. The highest ISN expected is therefore 5009 (501 � 10 - 1).

If the Adabas nucleus requires an additional extent for a file when executing N1 commands, the allocation routine attempts to locate a new extent of 25% of the current size:

Normal Index (NI), Upper Index (UI), Data Storage (DS)

For the purpose of allocating a new extent, the following formulas are used:

graphics/ni_ui_ds.png

where

B number of blocks currently allocated.
E highest ISN expected.
U highest ISN currently allocated.

If an extent found in the FST is contiguous with the end of a previous extent, it is allocated for a maximum of "Z" blocks.

If no such extent can be found in the FST

Additionally, if the MAXNI, MAXUI, or MAXDS parameter is specified for the current file, the nucleus allocates no more than the specified maximum number of blocks for the NI, UI, or DS, respectively.

Space Allocation with the ADADBS Utility

ADD/INCREASE Associator, Data Storage

If the physical extent for the Associator or Data Storage has been exhausted, the ADD or INCREASE function (using Adabas Online System or the ADADBS utility) may be used to provide additional physical space.

The ADD function requires the allocation of an additional dataset to the Associator or Data Storage. The new dataset may be located on the same or a different device type than those currently in use. Both the Associator and Data Storage may consist of no more than five datasets each.

The INCREASE function results in the physical extension of an existing dataset. The new space must, however, first be formatted using the ADAFRM utility. There is no restriction on the number of times the INCREASE function may be used.

Following an ADD function, the new dataset must be formatted using the ADAFRM utility before it can be used, and the appropriate changes must be made to all Adabas job control as described in the Adabas Operations documentation.

After increasing Data Storage four times, it may be necessary to run the REORASSO function of the ADAORD utility to reorder the Data Storage space table (DSST) to a single extent and allow four more increases in Data Storage.

To permit formatting or reordering, the nucleus session terminates automatically following an ADADBS ADD or INCREASE operation.

ALLOCATE Function

The ALLOCATE function (Adabas Online System or ADADBS utility) may be used to allocate an extent of a specific size for any of the following file components:

It is also possible to specify where the extent is to be allocated by specifying a starting RABN.

Using this function, the DBA may, based on knowledge of the projected size of a file, allocate extents of a specific size, rather than having Adabas perform the assignment. This may avoid having Adabas allocate an extent which is too small or too large (see ADALOD utility). MAXNI/MAXUI and MAXDS values in effect for the accessed file are not checked.

DEALLOCATE Function

The DEALLOCATE function (Adabas Online System or ADADBS utility) may be used to deallocate an extent allocated for any of the following file components:

It is also possible to specify where deallocation is to begin by specifying a starting RABN. The deallocated space is returned to the free space table (FST).

DELETE Function

The DELETE function (Adabas Online System or ADADBS utility) causes an existing file to be deleted from the database. All space which was assigned to the file is returned to the free space table and is available for reuse. DELETE can delete complete expanded files only.

RECOVER Function

The RECOVER function (Adabas Online System or ADADBS utility) may be used to recover space which was allocated during an execution of the ADAINV or ADALOD utility which terminated abnormally. The recovered space is returned to the free space table and is available for reuse.

REFRESH Function

The REFRESH function (Adabas Online System or ADADBS utility) results in the setting of a file status to 0 records loaded and 1 extent allocated to each file component. Any additional extents other than the first extent are returned to the free space table.

RELEASE and UNCOUPLE Functions

The RELEASE and UNCOUPLE functions (Adabas Online System or ADADBS utility) results in the deletion of an inverted list or physical coupling lists. The space used for the list can be recovered only by using ADAORD. When releasing a descriptor for an expanded file, each component file must be released individually. ADADBS displays a message whenever a descriptor of an expanded file is being released.

Space Allocation with the ADAINV Utility

COUPLE/INVERT Functions

The COUPLE and INVERT functions (Adabas Online System or ADAINV utility) may result in the assignment of additional blocks for the NISIZE file component (but not DSSIZE or MAXISN). This occurs if the available space becomes full during processing of the input data.

In such a case, if there are any index blocks freed during deletion by the nucleus, these blocks are reused. Then, if available, a range of blocks in the free space table whose size is within the range M1 through M2 will be taken.

M1 and M2 are computed as follows:

M2 = M1 + M1/8
M1 = MAX (A2, NIB/4 + KZ)

where

KZ zappable value (default = 10)
NIB number of NI blocks in use

and

A2 = MIN (A1, NIB * 2)
A1 = IUN * NIB/IUS

where

IUN number of unused ISNs
IUS number of used ISNs

When inverting a descriptor for an expanded file, each component file must be individually inverted. ADAINV displays a message whenever a descriptor of an expanded file is being inverted.

Space Allocation with the ADALOD Utility

LOAD Function

The LOAD function of the ADALOD utility is used to load a file into a database.

DSSIZE Parameter

The number of blocks or cylinders specified with the DSSIZE parameter is allocated and assigned to the first DS extent at the beginning of ADALOD execution.

The DSRABN and/or DSDEV parameters may be used to force the allocation to a specific RABN and/or device.

If during processing of the input data, this first allocated extent becomes full, a search is made for a range of free blocks in the free space table whose size is within the range M1 through M2.

M1 and M2 are computed as follows:

M2 = M1 + M1/8
M1 = MAX (A2, DSB/4 + KZ)

where

KZ zappable value (default = 10)
DSB number of DS blocks in use

and

A2 = MIN (A1, DSB * 2)
A1 = IUN * DSB/IUS

where

IUN number of unused ISNs
IUS number of used ISNs

If enough space is found in the free space table and that space follows immediately an already allocated extent, this space is added to the end of the extent. In this case no new extent is allocated.

If a new extent is needed, the free space table is scanned and the number of blocks needed to satisfy the size of M1 through M2 is taken for the new extent. Up to five extents are possible. If space is not available, ADALOD ends with an error message.

MAXISN Parameter

The MAXISN value is converted into a number of blocks and rounded up to a full block boundary. This range of blocks is allocated at the beginning of ADALOD execution and is assigned to the first address converter extent for the file.

The ACRABN parameter may be used to force the allocation to begin at a specific location.

If during processing of the input data, this first allocated extent becomes full, ADALOD tries to allocate another AC extent whose size is 25% of the sum of all currently existing AC extent sizes.

NISIZE/UISIZE Parameters

At the beginning of its execution, ADALOD allocates and assigns the blocks or cylinders specified by the NISIZE and UISIZE parameters to the first NI and UI extents, respectively.

The NIRABN and UIRABN parameters can be used to force extent allocation to begin at a specific RABN.

If you omit the NISIZE or UISIZE parameters, ADALOD does not initially allocate NI and UI space. Instead, ADALOD waits until all incoming descriptor values have been written to the Temp dataset, and then estimates NISIZE and UISIZE values as follows:

UPDATE Function

The UPDATE function of the ADALOD utility performs a mass add/delete of records to/from an existing file, reorganizes and (if necessary) expands the Associator and/or Data Storage space.

The ADALOD UPDATE functions allocates additional AC space if the MAXISN parameter specifies a new, higher maximum ISN value-even if the restructuring of the AC, NI and UI performed by UPDATE results in more unused current space. ADALOD UPDATE adds Data Storage space if the current Data Storage space cannot hold the new records.

MAXISN Parameter

If a MAXISN value is specified for the UPDATE operation that is greater than the current value for the file, the difference between the old and the new MAXISN setting is computed. The number of AC blocks to satisfy this amount is then allocated from the free space table as an additional extent. The ACRABN parameter may be used to force the allocation to begin at a specific location.

If during processing of the input data the current AC and/or Data Storage extent becomes full, ADALOD tries to allocate another AC and/or Data Storage extent whose size is 25% of the sum of all currently existing AC and/or Data Storage extent sizes.

Space Allocation by the ADAORD Utility

ADAORD reorders the respective Adabas Associator component (AC, NI/UI, DSST) and Data Storage to reclaim unusable space for reuse. Although ADAORD functions affect only the selected component files of an Adabas expanded file, there is no change to the logical consistency of an expanded file; therefore, ADAORD does not have to be performed on each component file of an expanded file, unless desired.

Function Accessed Table Types
REORFASSO AC, NI, UI
REORASSO AC, NI, UI, DSST
REORFDATA, REORDATA DS
REORFILE, REORDB AC, NI, UI, DS

For each accessed file and for each accessed table type (depending on the function), the following action is taken:

If one of the extents become full, the same action is taken as described for the ADALOD (UPDATE) utility (see the previous section).

Space Allocation by ADASAV (RESTORE FILES Function)

If a file to be restored is already present in the database (OVERWRITE parameter must be specified) the space used by all these files is returned to the free space table. If a component file of an expanded file is specified, then all related component files must also be specified.

If space is available, multiple input extents may be compressed in a new single extent. If there is not enough contiguous free space available, ADASAV will split the tables over several new extents (up to five for each table). If such space is not available, ADASAV will terminate with ERROR-060.

Top of page

Using the Database Status Report to Control Space Use

Database space utilization information can be obtained directly from the database status report produced by executing the ADAREP utility or using Adabas Online System.

In addition to a file allocation map and a block allocation map, this report lists the number of blocks

See the ADAREP chapter in the Adabas Utilities documentation for a detailed explanation of the information provided on this report.

The DBA should frequently review this report to identify potential space utilization problems.

The next section contains guidelines on problems which may be detected using the status report, and recommendations as to what action should be taken to prevent and/or resolve each problem.

Top of page

Potential Space Use Problems and Recommended Actions

This section provides a summary of the problems most often encountered concerning database space utilization, and the recommended corrective action to be taken to prevent and/or correct problems.

Full Physical Extents

  1. The Associator physical extent is nearly or completely full.

  2. The Data Storage physical extent is nearly or completely full.

Maximum Physical Extents Reached

  1. The maximum of five Associator physical extents has been reached.

  2. The maximum of five Data Storage physical extents has been reached.

Maximum Logical Extents Reached

  1. The maximum logical extents for the address converter, normal index, or upper index for a file has been reached.

  2. The maximum logical extents limit for either Data Storage or the Data Storage space table for a file has been reached.

Top of page