Version 6.3.1
 —  Adabas Utilities  —

ADADEV (Disk Space Management)

This document describes the utility "ADADEV".

The following topics are covered:

Note:
This utility only applies to UNIX platforms.


Functional Overview

The ADADEV utility provides several functions for managing disk space to be used by Adabas via the raw disk I/O interface.

ADADEV requires READ/WRITE access to the specified disk-section device file. See Installation, Installing Adabas for information about raw disk-section usage in your system.

Each disk section used by Adabas must be initialized once with ADADEV. Preallocation for Adabas container files or for Adabas sequential files is not necessary, but can be useful sometimes. Disk space is allocated automatically when creating container extents with ADAFRM or when creating Adabas sequential files with an Adabas utility. If space has not been preallocated, a best-fit algorithm is used for container extents. For Adabas sequential files, one half of the largest available free space is allocated if it is larger than 1 MB. If the allocated space is exceeded, an automatic extension is performed if the immediate right neighbour is a free space area.

The number of container extents and sequential files per raw section is limited to 338.

This utility is a multi-function utility.

Top of page

Procedure Flow

graphics/adadev.png

Data Set Environment
Variable
Storage Medium Additional Information
Control statements stdin   Utilities Manual
ADADEV messages stdout   Messages and Codes
Adabas sequential file DEVxyz (see note 1) Disk, Tape (see note 2)  

Notes:

  1. xyz = PLG, CLG, 00n, OUT, ERR, LOG, EXP, DTA, DVT.
  2. A named pipe can be used for this sequential file (see Administration, Using Utilities for details).

The sequential files DEVPLG, DEVCLG, DEV00n, DEVOUT, DEVERR, DEVEXP, DEVDTA, DEVDVT and DEVLOG can have multiple extents. For detailed information about sequential files with multiple extents, see Administration, Using Utilities.

Top of page

Checkpoints

The utility writes no checkpoints.

Top of page

Control Parameters

The following control parameters are available:

     ALLOCATE = keyword[,START_SECTOR = number]
                [,BLOCKSIZE = numberKB] ,SIZE = number [B|M]

     CHANGE = (keyword,keyword)

     COMBINE = keyword, DESTINATION = string

     COPY = keyword, DESTINATION = string

     DBID = number

     DEALLOCATE = {*|keyword}

     FREE_SPACE

     INITIALIZE

     LAYOUT

D    [NO]MOUNTCHECK

     MOVE = keyword, DESTINATION = string

     NEW_DBID = (container-name, new-dbid)

     REALLOCATE = {*|keyword}

     RESET

     RESIZE

M    SECTION = string

     UNLOCK = keyword

ALLOCATE

ALLOCATE = keyword[,START_SECTOR = number]
           [,BLOCKSIZE = numberKB] ,SIZE = number [B|M]

In accordance with the keyword specified, this function allocates space for an Adabas container file or Adabas sequential file. The space is allocated using a best-fit algorithm if no start sector is specified. The keyword can take the values ASSOx, DATAx, WORKx, TEMPx and SORTx (where x is a number between 1 and the maximum number of extents allowed, as described in Administration, Using Utilities), PLG, CLG, BCK, BCKOUT, RECOUT, ERR, MUPLOG, MUPTMP, ORDEXP, DTA or DVT. The DBID parameter must be set before space can be allocated to an ASSO, DATA or WORK file, or to PLG, CLG, BCK, BCKOUT or RECOUT.

The DBA can use this function to preallocate container files or Adabas sequential files. Reasons for using it include performance aspects, avoiding fragmentation (by specifying the start sectors) and reserving space for a database that is to be created in the future.

If ADADBM or ADAFRM are used to create a container file in a disk section, the preallocated space is taken if it is available. If there was no preallocation made, the allocation is made using a best-fit algorithm. The same sizes must be used when preallocating and creating container files.

START_SECTOR = number

This parameter specifies the sector at which allocation is to start.

BLOCKSIZE = numberKB

Values up to 32KB can be used to specify the container block-size when the allocation is being made in blocks. The defaults are 2KB for ASSO container files, 4KB for all other container files and 1 KB for Adabas sequential files.

SIZE = number [B|M]

This parameter specifies the size of the area to be allocated in blocks or megabytes. If 'B' is appended to the number, the size is in blocks. By default, the size is given in megabytes.

CHANGE

CHANGE = (keyword, keyword)

This function changes the type of the container file or Adabas sequential file specified by the first keyword into the type specified by the second keyword.

The following keyword combinations are allowed:

From To
WORK1 TEMP1, SORT1, SORT2
TEMP1 WORK1, SORT1, SORT2
SORT1 WORK1, TEMP1, SORT2
SORT2 WORK1, TEMP1, SORT1
DTA MUPLOG
MUPLOG DTA
RECOUT PLG (* see note)
BCKOUT BCK (* see note)

Note:
(*) If RECOUT [BCKOUT] is a copy of PLG.n [BCK00n], the new Adabas sequential file name will be the corresponding name.

The DBID parameter must be set before the keywords WORK1, RECOUT or BCKOUT are used.

The WORK1 container of a given database can only be changed to a SORT or TEMP container if there is no autorestart pending.

COMBINE

COMBINE = keyword, DESTINATION = string

This parameter combines multiple Adabas sequential file extents into a single extent. The keyword can take the values PLG.n, CLG.n, BCK00n, BCKOUT, RECOUT.n, ERR, MUPLOG, ORDEXP, DTA or DVT. The keywords can also be followed by an extent label (m). In some cases, the DBID parameter must be set (see ALLOCATE for further information).

A COMBINE can start at an arbitrary extent, but must end with the final (end-of-file) extent. All subsequent extents can be specified interactively, or by predefined environment variables. If DEVxyz is set, the first extent is taken from the default path name. If DEVxyz is not set, Adabas looks in the current disk section to find the first extent.

`string' is either the path name of the device file that represents the raw interface of a disk section, the path name of a tape device, the (path) name of a non-existent file of a file system or a period (".").

See Administration, Using Utilities for further information.

Example 1:

In this example, PLOG 2 of database 100 consists of 3 extents that are all located at the same disk section /dev/rdsk/c4d0s2.

Environment Variable Setting
DEVPLG /dev/rdsk/c4d0s2 /dev/rdsk/c4d0s2

The ADADEV commands are as follows:

adadev: section=/dev/rdsk/... 
adadev: dbid=100
adadev: combine=plg.2(1)
adadev: destination=PLOG_2

All extents of PLOG 2 are combined into one file which will be written into the file system under the name PLOG_2. The section must be specified twice in DEVPLG so that it can flip-flop.

Example 2:

In this example, PLOG 3 of database 100 consists of 9 extents, and the extents 5 to 9 are distributed across four disk sections:

Environment Variable Setting
DEVPLG /dev/rdsk/c3d0s2 # contains PLG.3(5) and PLG.3(9) EOF
DEVPLG2 /dev/rdsk/c4d0s2 # contains PLG.3(6)
DEVPLG3 /dev/rdsk/c5d0s2 # contains PLG.3(7)
DEVPLG4 /dev/rdsk/c6d0s2 # contains PLG.3(8)

The ADADEV commands are as follows:

adadev: section=/dev/rdsk/... 
adadev: dbid=100
adadev: combine=plg.3(5)
adadev: destination=PLOG.3(5)

Extents 5 to 9 of PLOG 3 are combined into one extent in PLOG 3 with the extent number 5 and the EOF label. The combined PLOG extent is created in the current directory under the name PLOG.3(5).

COPY

COPY = keyword, DESTINATION = string

This function copies a container file (ASSO1, DATA1, etc.) or an Adabas sequential file (RECOUT, DVT, etc.) from its present location to a specified destination (DESTINATION=string).

Valid keywords for the container files are ASSOx, DATAx and WORKx, where x is a number between 1 and the maximum number of extents allowed, as described in Administration, Using Utilities.

Valid keywords for the Adabas sequential files are PLG.n, CLG.n, BCK00n, BCKOUT, RECOUT.n, ERR, MUPLOG, ORDEXP, DTA, and DVT. The `n' extension on the Adabas sequential file keywords designates an extent number.

If a container file is to be copied, you must first set the appropriate environment variable (e.g. ASSO1) to the source location before the copy is attempted.

If an Adabas sequential file is to be copied into the current disk section, as specified by the SECTION parameter (e.g. SECTION=/dev/c5d0s2), the environment variable DEVxyz (where xyz may take the values PLG, CLG, 00n, OUT, ERR, LOG, EXP, DTA, and DVT) must be set to the Adabas sequential file or device file.

The DESTINATION keyword may be specified as either a path name for a raw disk section, a path name of a tape device, a path name of a non-existent file in the file system, a named pipe or a period `.', which indicates that the file will be copied into the current disk section.

In some cases, the DBID must be specified in order to uniquely identify the file before the COPY function can be executed: please refer to the ALLOCATE function for a list of those files that require the DBID.

Examples:

adadev: section=/dev/rlv02
adadev: dbid=23
adadev: copy=WORK1, destination=/FS/fs0395/SAG/ada/db023/WORK1.023

WORK1 is copied from a raw device to a file system.

The environment variable WORK1 has the value /FS/fs0395/SAG/ada/db023/WORK1.023.

adadev: section=/dev/rlv02
adadev: dbid=023
adadev: copy=WORK1, destination=.

WORK1 is copied from a file system to the currently-selected raw device.

DBID

DBID = number

This parameter specifies the database of an ASSO, DATA or WORK container file, or of a PLG, CLG, BCK, BCKOUT or RECOUT Adabas sequential file.

DEALLOCATE

DEALLOCATE = { * | keyword }

In accordance with the keyword specified, this function deallocates space from an Adabas container file or Adabas sequential file, or from all of the extents of a given database (DEALLOCATE=*). The keyword can take the values ASSOx, DATAx, WORKx, TEMPx , SORTx, NUCTMPx and NUCSRTx (where x is a number between 1 and the maximum number of extents allowed, as described in Administration, Using Utilities), PLG, PLG.n, PLG*, CLG, CLG.n, CLG*, BCK, BCK00n, BCK*, BCKOUT, RECOUT, RECOUT.n, ERR, MUPLOG, MUPTMP, ORDEXP, DTA or DVT. The Adabas sequential file keywords can also be followed by an extent label (m) or (*). In some cases, the DBID parameter must be set (see ALLOCATE for further information).

The DBA can use this function to deallocate space from container files, e.g. when a database is no longer required or e.g. when a PLOG extent is saved to tape. The deallocated space is managed as free space and can be allocated to other containers.

FREE_SPACE

FREE_SPACE

This function displays the areas of free space on the current disk section. It is a subset of the LAYOUT function. In order to make it easier to allocate space in units of the default block sizes, this function also lists the size of the free areas in units of 2KB and 4KB.

INITIALIZE

INITIALIZE

Some sectors at the beginning of each disk section are used to manage the allocated and free space areas. This function initializes this management part. Each disk section to be used by Adabas must be initialized beforehand. When a disk section is accessed for Adabas purposes, the first step is for the management part to be verified. A disk section can only be initialized if this verification fails.

LAYOUT

LAYOUT

This function provides a summary of the disk section usage. It lists the container and Adabas sequential areas as well as the free space areas. It also displays the status of a container area (allocated or created). Adabas sequential files can also have the status "during creation". This means that the Adabas sequential file is growing: some of the allocated space has been used up, but some of it is still free.

Following a power failure, TEMP and SORT containers may be locked for read or write (status: rlocked or wlocked). Please refer to the UNLOCK function in this section for further information about unlocking container files.

[NO]MOUNTCHECK

[NO]MOUNTCHECK

If MOUNTCHECK is used, ADADEV checks if a file system is mounted on the disk specified in the ADADEV SECTION parameter. If a file system is mounted, ADADEV terminates. This check can be skipped if NOMOUNTCHECK is specified before the SECTION parameter is used.

The default is MOUNTCHECK.

MOVE

MOVE = keyword, DESTINATION = string

MOVE is essentially the same as COPY, however, with the difference that the source file is removed (see COPY for further information).

NEW_DBID

NEW_DBID = (container-name, new-dbid)

This function changes the DBID of Adabas files within raw sections (for example, when the number of a database has been changed and the PLOGs are to be applied to the database with the new number).

The following can be specified for container-name:

The following cannot be specified for container-name:

Example

The following example shows how to change the DBID from 1 to 2:

adadev section=xxx dbid=1 new_dbid=(asso1,2)
adadev section=xxx dbid=1 new_dbid=(plg.175,2)
adadev section=xxx dbid=1 new_dbid=(plg\*,2)

REALLOCATE

REALLOCATE = { * | keyword }

This function deallocates space and directly allocates it in a single step. The keyword can take the same values as for the DEALLOCATE function. Adabas sequential file areas that are <=50 KB are always deallocated.

This function can be used as a short cut when deallocating a container file and then allocating it again at the same location. It is particularly useful if ADAFRM aborts while creating a database, with some container files already created and preallocated at given start sectors.

There is a flag for each container in a disk section, which indicates whether the container or Adabas sequential file has actually been created or whether the space has only been allocated for it. For security reasons, an existing container or Adabas sequential file cannot be overwritten just by creating it again: it must be deallocated or reallocated first.

RESET

RESET

The management part of the current disk section is set to binary zero if the section is initialized. This function is used if a disk section which has the same start sector as an overlapping, initialized disk section is to be initialized.

RESIZE

RESIZE

If a new, overlapping disk section is used with the same start sector as the current disk section, this function updates the size of the section to the size of the new section. The new section can be larger or smaller than the current section. If it is larger, the free space at the end of the section is increased. If it is smaller, existing free space at the end of the section is decreased.

SECTION

SECTION = string

This parameter selects the disk section to be used. The (path) name of the device file that represents the raw I/O interface of the disk section must be specified.

UNLOCK

UNLOCK = keyword

This parameter is used to unlock a container of an abnormally terminated utility (for example kill -9). The keyword can take the values TEMP1, SORT1 or SORT2.

Following a power failure, locked container files must be unlocked using the UNLOCK function in order to use them further. If an Adabas sequential file consists of more than one physical extent, the last extent is marked with EOF in the status field.

Top of page