Creating full-function databases
When defining a new database, use the CREATE DATABASE statement. The default database description generated is with an IMS PHIDAM OSAM access type, however this can be overridden with the ACCESS keyword. Depending on the type of database you are creating, you may be required to also define at least one table space and at least one table. This can be accomplished by using a CREATE TABLESPACE statement and CREATE TABLE statement.
The following rules apply depending on the database access type you are defining.
For HSAM and SHSAM:
- At least one table with a maximum of 255 tables for the database.
- 0-255 columns for each table, and a maximum of 10,000 for the database.
- You cannot specify use of hierarchic, physical child, or physical twin pointers between tables in the database.
- You cannot specify use of logical or index relationships between tables.
- Optionally, you can define a simple HSAM (SHSAM) database that can contain only one fixed-length table. In this case, no prefixes are built in occurrences of the table.
For HISAM and SHISAM:
- At least one table with a maximum of 255 tables for the database.
- 0-255 columns for each table, and a maximum of 10,000 for the database, one of which must be a primary key in the root table.
- You cannot specify the use of hierarchic or physical child or physical twin pointers between segments in a HISAM database.
- Optionally, you can define a simple HISAM (SHISAM) database that can contain only one fixed-length table. In this case, no prefixes are built in occurrences of the table. The logical record length specified for a SHISAM database must be equal to or greater than the table length specified.
- Optional edit proc identifying an edit or compression exit routine to enable user-supplied routines to manipulate each occurrence of a table to or from auxiliary storage.
- Optional logical relationships using symbolic pointer options when a table in a HISAM database points to another table in a HISAM database, and direct or symbolic pointer options when a table in a HISAM database points to a table in an HDAM or HIDAM database.
- Optional maximum of 32 secondary index relationships per table and a maximum of 1000 for the database.
- Optional Data Capture exit routine to enable DB2® for z/OS® users access to updated IMS data. This exit routine can be used in SHISAM also.
For HDAM and HIDAM:
- At least one table with a maximum of 255 tables for the database.
- Use of hierarchic, physical child, or physical twin pointers between tables in the database.
- 0-255 columns for each table, and a maximum of 10,000 for the database.
- Optional edit proc identifying an edit or compression exit routine to enable user-supplied routines to manipulate each occurrence of a table on their way to or from auxiliary storage.
- Optional logical relationships between tables using direct address or symbolic pointer options.
- Optional maximum of 32 secondary index relationships per table and a maximum of 1000 for the database.
- Optional Data Capture exit routine, to enable DB2 for z/OS users access to updated IMS data.
- Optional data set group definitions based on the size of the database partitions and usage of the tables by applications.
For INDEX and PSINDEX, the primary HIDAM index is composed of one index table that indexes
occurrences of the HIDAM root table. PHIDAM does not have a DBD for the primary index. An index
table contains:
- The sequence field key of the root segment occurrence it indexes.
- In its prefix, a direct address pointer to the root segment occurrence.
A primary HIDAM index must specify:
- One table.
- The index relationship required between the primary HIDAM index database and the root table of a HIDAM database.
- One column within the table as the primary key.
- You cannot specify any additional columns as you might for a secondary index.
Secondary index DBD defines a secondary index database made up of 1 to 16 index pointer tables. These are used to index target tables in HISAM, SHISAM, HDAM, PHDAM, HIDAM, or PHIDAM databases.
A full-function secondary index must specify:
- One table.
- One column for each table.
A logical DBD generation creates a logical database made up of logical tables. A logical table is
defined in a logical database that represents a table or the concatenation of two tables defined in
a physical database or databases.
- From 1 to 255 tables. Each defines the name of a logical table, and the name of the table or tables in physical databases that are to be processed when a call is issued to process the logical table.
- The logical relationships used to create a logical database must be defined in a physical database or databases.
- All columns required for tables in a logical database must have been defined in physical databases.