Access Methods
OpenFrame/HiDB consists of several components including segment instances and database records. It supports various access methods, such as HSAM, HDAM, or DEDB, to organize the data segments and records. Your choice of the method determines the functions used by applications, and the sequence of data access, and application’s data processing performance.
This chapter describes the database access methods supported by the OpenFrame/HiDB system.
1. HSAM (SHSAM)
A hierarchical sequential access method (HSAM) database sequentially accesses data. All database records and segment instances are stored physically adjacent.
An HSAM database can be stored both in a tape device or disk device, and uses basic sequential access method (BSAM) or queued sequential access method (QSAM) as data set access method.
The HSAM data set is loaded sequentially with root segments in ascending key sequence and dependent segments in hierarchical sequence. A root segment key does not need to be defined in the HSAM database. However, you need to submit the segments into the database load program in the order in which they need to be loaded.
To update an HSAM database, you need to rewrite the entire database. You cannot delete (DELETE) or change (REPL) a segment, and you can use the insert (ISRT) call only for loading a database.
The following functions are not supported for HSAM database.
-
Multiple data set groups
-
Logical relationship
-
Secondary indexing
-
Variable-length segments
There are many restrictions when you use an HSAM database as it is a very simple database. An HSAM database is useful for applications that require only sequential processing. For example, it can be used to store auditing data and statistical reports, or to back up deleted data of the main database.
A Simple HSAM (SHSAM) database is a functional subset of an HSAM database. It can be used like an HSAM database, but an SHSAM database has only one root segment type. Unlike HSAM, SHSAM database segments do not have prefix information such as segment code or delete byte.
2. HISAM (SHISAM)
Like an HSAM database, a hierarchical indexed sequential access method (HISAM) database stores segment instances in each database record in physically adjacent sequential order. However, it has an index that enables you to directly access database records.
When defining an HISAM database, a sequential field with a unique value must be defined in the root segment. This sequential field is used to construct an index to root segments.
An HISAM database can only be stored on a disk device, and its data set access method is VSAM. Unlike HSAM database, all DL/I calls can be issued on an HISAM database. The following options are also used for HISAM databases.
-
Logical relationship
-
Secondary Indexing
-
Variable-length segments
-
Field-level sensitivity
HISAM is the most suitable database for application programs that require direct access to the database records and sequential processing of segments in database records.
A Simple HISAM (SHISAM) database is a functional subset of the HISAM database. It can be used like an HISAM database, but the SHISAM database has only one root segment type. Unlike HISAM, the segments of the SHISAM database does not contain prefix information, such as segment code or delete byte, and only contains VSAM KSDS.
It is desirable to use HISAM database for applications with the following characteristics:
-
Most of the database records have the same size.
-
Root segments have few dependent segments.
-
Root segments are not frequently added after data loading.
-
Record deletion occurs sparingly.
3. HDAM/HIDAM
A hierarchical direct access method (HDAM) database and a hierarchical indexed direct access method (HIDAM) database have similar functions and thus both are called an HD database. An HD database is distinguished from a sequentially organized database in the following two ways:
-
Uses direct-address pointers
The segments of the database use pointers to manage hierarchical relationships. Each segment has a number of address pointers in its prefix.
Once a segment instance is written to storage, its position is fixed but its pointers are updated to reflect any changes.
-
Reuses storage space
If a particular database record is deleted, the space of the deleted record can be reused for inserting other database records.
An HD database can only be stored on a disk device, and its data set access method is VSAM ESDS.
An HDAM database and HIDAM database use similar storage management method. The biggest difference between the two databases is the access method to root segments. While HDAM uses the module named Randomizer, HIDAM searches indexes to find the position of the root segment. The benefits of using HDAM are that it does not require I/O operations for index search.
All DL/I calls can be issued on an HD database. The following options are also used for HD databases.
-
Multiple data set groups
-
Logical relationship
-
Secondary indexing
-
Variable-length segments
-
Field-level sensitivity
HDAM is suitable for use when you need direct access to the database. The Randomizer module used in an HDAM database provides the fastest way to access the root segment.
HIDAM is suitable for use when you need both direct and sequential access to the database. Although access to the root segment is not as fast as in an HDAM database, database records can be sequentially processed as the index manages the addresses of root segments in their key sequence.
4. DEDB
A data entry database (DEDB) is a hierarchical database that supports up to 127 segment types. One of the segments must be the root segment. The remaining 126 segments can be specified as one sequential dependent segment and 125 direct dependent segments.
A DEDB can have up to 15 hierarchical levels. Sequential dependent segments are stored in an area in the order which they are added, regardless of the root segment that they belong to. The remaining direct dependent segments are sequentially stored as in HD database for faster access. Mainframe DEDB was originally developed to provide an efficient, high-availability storage for large-scale data.
The following describes three characteristics of DEDB.
-
Area format
DEDB uses multiple data sets called area. A single DEDB record is not stored across multiple areas. That is, a root segment and all its dependent segments are stored in the same area. One DEDB can have up to 240 areas. HiDB also supports the area format.
-
Area data set replication (not supported)
In DEDBs, a data set can be replicated up to seven times to ensure high availability of the data. HiDB does not support this function.
-
Record deactivation (not supported)
When an error occurs while updating DEDB, only the relevant blocks are inaccessible to other applications so that the problematic area is available to other users without having to stop the area or the database. HiDB does not support this function.
The followings are access methods available for each database type.
Database Type | Data Set Access Method |
---|---|
HSAM |
BSAM, QSAM |
HISAM(SHISAM) |
VSAM KSDS (VSAM ESDS) |
HDAM/HIDAM |
VSAM ESDS |
DEDB |
VSAM ESDS |