HP 3000 Manuals

Set Part [ TurboIMAGE/XL Database Management System Reference Manual ] MPE/iX 5.0 Documentation


TurboIMAGE/XL Database Management System Reference Manual

Set Part 

The set part of the schema defines data sets.  It indicates which data
items listed in the item part belong to which sets and links the master
data sets to the detail data sets by specifying key and search items.  In
addition, it defines security at the set level and at the item level
within each data set.

Master Data Sets 

The set part syntax and parameters for master data sets are provided
below.

Syntax 

{NAME:} set name, {M[ANUAL]   } [(read class list/write class list)]
{N:   }           {A[UTOMATIC]}

[,device class];

{ENTRY:} item name [(path count)],
{E:    }
                    :
               item name;
[REV BEG]

{CAPACITY:}maximum capacity [(blocking factor)];
{C:       }
[REV END] 

Parameters 

set name         is the data set name.  It must be a valid TurboIMAGE/XL
                 data name as described earlier in "Data Sets" in chapter
                 2 and in the discussion of the DBUTIL >>CREATE command
                 in chapter 8.  A maximum of 199 data sets, including
                 both masters and details, is allowed.

MANUAL (or M)    denotes a manual master data set.  Each entry within a
                 manual master must be created manually and can contain
                 one or more data items.

AUTOMATIC (or    denotes an automatic master data set.  Each data entry
A)               within an automatic master is created automatically by
                 TurboIMAGE/XL and contains only one data item.

read class list  is a group of user class numbers between 0 and 63,
                 inclusive, separated by commas.  User class numbers are
                 described in chapter 2.

write class      is a group of user class numbers between 0 and 63,
list             inclusive, separated by commas.  User class numbers are
                 described in chapter 2.

device class     is the class name of the MPE/iX device on which the data
                 set resides.  The device must be a member of the volume
                 set on which the database resides.

item name        is the name of a data item defined in the item part.

path count       is an integer between 0 and 16, inclusive, which is used
                 with the key item only.  It indicates the number of
                 paths that will be established to various detail data
                 sets.  Refer to chapter 2 for more information about
                 paths.  A path count must be specified for one, and only
                 one, item in the master set.  A zero path count can be
                 used with a manual master data item to indicate the key
                 item.  A manual master defined in this way is not linked
                 to any detail data set.  An automatic master has one
                 item that must have a path count greater than zero.[REV
                 BEG]

maximum          is the maximum number of entries the data set can
capacity         contain:  that is, the data set's capacity.  It must be
                 less than 231 -1 (2,147,483,647) and is limited by the
                 maximum size of an MPE/iX file.[REV END]

blocking factor  is the number of data set records in one block.  If a
                 value is not specified, it is calculated by DBSCHEMA.

Example 

     NAME:      SUP-MASTER,MANUAL(13/12,18),DISC1;
     ENTRY:     SUPPLIER(1),
                STREET-ADD,
                CITY,
                STATE,
                ZIP;
     CAPACITY:  201;

Description 

The example above shows the data set SUP-MASTER which will reside on
Disc1.  Assigning the device class where a data set will reside can
provide greater performance for the TurboIMAGE/XL database and can aid in
better use of system resources.  An understanding of how to spread the
data sets over multiple disk devices can be obtained from your system
manager.  Your system manager will be able to give you a listing of
logical devices and their corresponding device class names (each logical
device can have up to eight names).

To retrieve information on where each data set resides after specifying
device classes in the schema, you can use the MPE/iX command LISTF,3
(after the database is created).  This command lists the device type,
logical device number, and the device class name for each data set in the
database.  The DBUTIL >>SHOW command can also be used to display the
devices on which data sets reside.

Detail Data Sets 

The set part syntax and parameters for detail data sets are provided
below.[REV BEG] The maximum capacity, the initial capacity, and the
incremental amount are new parameters for the detail data set CAPACITY
definition.  These parameters allow a detail data set to be expanded
dynamically (up to a new maximum capacity specified in the root file)
during DBPUT when the detail data set space is exhausted.[REV END]

Syntax 

{NAME:}set name, D[ETAIL] [(read class list/write class list)]
{N:   }

[,device class];

{ENTRY:}item name [([!] master set name [(sort item name)])],
{E:    }
                    :
              item name [( master set name [(sort item name)])];
[REV BEG]

{CAPACITY:} maximum capacity 
{C:       }

[(blocking factor)][,initial capacity [, increment]];
[REV END]

Parameters 

set name         is the data set name.  It must be a valid TurboIMAGE/XL
                 data name as defined in "Data Sets" in chapter 2 and in
                 the discussion of the DBUTIL >>CREATE command in chapter
                 8.  A maximum of 199 data sets, including both masters
                 and details, is allowed.

DETAIL (or D)    denotes a detail data set.

read class list  is a group of user class numbers between 0 and 63,
                 inclusive, separated by commas.  User class numbers are
                 described in chapter 2.

write class      is a group of user class numbers between 0 and 63,
list             inclusive, separated by commas.  User class numbers are
                 described in chapter 2.

device class     is the class name of the MPE/iX device on which the data
                 set resides.  The device must be a member of the volume
                 set on which the database resides.

item name        is the name of a data item defined in the item part.
                 Each item defined as a search item must be a simple
                 item.  Up to 16 items can be search items.  (Refer to
                 master set name for more information about search
                 items.)

!  (exclamation  denotes a primary path.  Only one path in each detail
point)           data set can be designated as a primary path.  If no
                 path is designated as primary, the first unsorted path
                 is the primary path by default.  If all of the paths are
                 sorted, the default primary path is the first sorted
                 path.

master set name  is the name of a previously defined master data set.
                 When a master set name follows an item name, the data
                 item is a search item linking the detail set to the
                 named master.  Up to 16 search items can be defined for
                 a detail data set.  If no data items have a master name
                 following them, the detail is not related to any master.
                 In this case, the combined length of all data items in
                 the data set must equal or exceed two halfwords.

sort item name   is the name of a detail data item of type U, K, or X
                 which is a part of the data set being defined.  A sort
                 item defines a sorted path.  Each entry added to a chain
                 of a sorted path will be linked logically in ascending
                 order of the sort item values.  If sort item is omitted,
                 the path order is chronological; that is, new entries
                 are linked to the end of chains.  For performance
                 reasons, sorted chains should be kept short.  (Refer to
                 "Sort Items" in chapter 2.)[REV BEG]

maximum          is the maximum number of entries allowed in a data set
capacity         (data capacity).  It must be less than 231 -1
                 (2,147,483,647) and is limited by the maximum size of an
                 MPE/iX file (4 GB). This number can differ from the
                 number of entries specified in the schema itself because
                 the capacity of each detail is adjusted to represent an
                 even multiple of the blocking factor.  Selecting a very
                 large maximum capacity minimizes the chances that the
                 set will run out of space.

blocking factor  is the number of data set records in one block.  If a
                 value is not specified, it is calculated by DBSCHEMA.

initial          is the initial capacity for the data set, that is, the
capacity         number of entries for which space will be initialized
                 when the data set is created.  This number must be
                 between 1 and 231 -1 inclusive but must be less than or
                 equal to the maximum capacity.  This parameter should be
                 used to closely approximate the current volume of data.
                 The initial capacity is adjusted to represent an even
                 multiple of the blocking factor.  Initial capacity is an
                 optional parameter.  If initial capacity is not
                 specified, or if initial capacity is equal to the
                 maximum capacity, then dynamic capacity expansion is not
                 implemented for the data set, and maximum capacity is
                 used for the data set file creation.

increment        is either the number of entries or the percentage of the
                 initial capacity by which the data set will be expanded
                 each time its initialized space is exhausted.  If a
                 percentage is used, the percent sign (%) must follow the
                 incremental amount.  This increment parameter can only
                 be used if the initial capacity parameter is also
                 specified.  This number must be 1 to 32767 inclusive for
                 percent, or 1 to 231 -1 (2,147,483,647) inclusive for
                 number of entries.  The number of entries defined, or
                 the entries calculated from the percent, cannot exceed
                 the maximum entry count minus the initial allocation.
                 The increment is adjusted to represent an even multiple
                 of the blocking factor.  The increment is an optional
                 parameter.  If the increment is not specified for the
                 data set, or is zero, but the initial capacity is
                 greater than zero, then the increment for each expansion
                 is defaulted to ten percent (10%) of the initial
                 capacity allocated for the data set.  If the initial
                 capacity is equal to the maximum capacity, or the
                 initial capacity is zero, then this indicates the data
                 set cannot be expanded and increment is ignored.
[REV END] 

Example 

     NAME:     SALES,DETAIL(11/14,18),DISC1;
     ENTRY:    ACCOUNT(CUSTOMER(PURCH-DATE)),
               STOCK#(!PRODUCT),
               QUANTITY,
               PRICE,
               TAX,
               TOTAL,
               PURCH-DATE (DATE-MASTER),
               DELIV-DATE (DATE-MASTER);
     CAPACITY: 1008,504,112;

Description[REV BEG]

The example above shows the detail data set SALES which will reside on
Disc1.  The maximum capacity is 1008, the initial capacity is 504, and
the increment is 112.

Another example is a detail data set defined as follows:

     CAPACITY: 500000(10),10000,25%;

The maximum capacity is set at 500000 with a blocking factor of 10.  It
has an initial capacity of 10000, but will be automatically expanded by
2500 when the initialized space is exhausted.  Since the incremental
amount is defined as a percent, the percent is calculated as a constant
number based on the initial (or original) capacity (25% of 10000 is
2500.)

To allow dynamic expansion for a detail data set, specify the maximum
capacity and the initial capacity when defining the data set.  If dynamic
expansion is not needed for the data set, the maximum capacity is the
only required parameter.

Verify that there is enough disk space for a data set to be expanded.
Performance may be impacted by the number of entries incremented when a
detail data set is dynamically expanded.  The number of disk extents used
for the data set file may also impact the performance of TurboIMAGE/XL.


NOTE For existing databases, use DBChange Plus or a third party utility to specify the expansion parameters. For more information, refer to the MPE/iX Release 5.0 Communicator.
[REV END] Master Key and Detail Search Items The master key items and detail search items (also called critical items) that define a path between two data sets must have identical type designators and simple sub-item lengths when they are defined in the item part. The sub-item lengths must be simple because the key and search items cannot be compound items. Because the same data item name can appear in more than one data set, you can use the same data item name and definition for both the master key items and detail search items. For example, the data item ACCOUNT is used as the key item in the CUSTOMER master and as the search item in the SALES detail data sets. If you want to make a distinction between the search items, they can be defined separately. An example of this technique is found in the ORDERS database. The key item DATE links the DATE-MASTER data set to the SALES data set through two paths and two search items, PURCH-DATE and DELIV-DATE. These three data items look like this in the item part: DATE, X6; DELIV-DATE, X6 (/14); PURCH-DATE, X6 (11/14); Each data item has type designator X and sub-item length 6. However, the item names, read class lists, and write class lists differ. Figure 3-5 at the end of this chapter contains the listing printed by the Schema Processor when the ORDERS database schema is processed. Refer to this figure for examples of the schema parts. Data Set Identifiers Similar to data items, data sets can be referenced by name or number. The data set number is determined by the set's position in the set part of the schema. It is more flexible to use data set names in order to maintain program file independence.


MPE/iX 5.0 Documentation