Ims Db 简明教程

IMS DB - Structure

Hierarchical Structure

IMS 数据库是容纳物理文件的数据集合。在分层数据库中,最顶层包含有关实体的一般信息。随着我们在层次结构中从顶层往下移动,我们会获得更多有关实体的信息。

An IMS database is a collection of data accommodating physical files. In a hierarchical database, the topmost level contains the general information about the entity. As we proceed from the top level to the bottom levels in the hierarchy, we get more and more information about the entity.

层次结构中的每一层都包含段。在标准文件中,难以实现层次结构,但 DL/I 支持层次结构。下图描绘了 IMS DB 的结构。

Each level in the hierarchy contains segments. In standard files, it is difficult to implement hierarchies but DL/I supports hierarchies. The following figure depicts the structure of IMS DB.

hierarchies

Segment

重点注意事项:

Points to note −

  1. A segment is created by grouping of similar data together.

  2. It is the smallest unit of information that DL/I transfers to and from an application program during any input-output operation.

  3. A segment can have one or more data fields grouped together.

在以下示例中,段 Student 有四个数据字段。

In the following example, the segment Student has four data fields.

Student

Roll Number

Name

Course

Mobile NUmber

Field

注意事项:

Points to note−

  1. A field is a single piece of data in a segment. For example, Roll Number, Name, Course, and Mobile Number are single fields in the Student segment.

  2. A segment consists of related fields to collect the information of an entity.

  3. Fields can be used as a key for ordering the segments.

  4. Fields can be used as a qualifier for searching information about a particular segment.

Segment Type

重点注意事项:

Points to note −

  1. Segment Type is a category of data in a segment.

  2. A DL/I database can have 255 different segment types and 15 levels of hierarchy.

  3. In the following figure, there are three segments namely, Library, Books Information, and Student Information.

std info

Segment Occurrence

重点注意事项:

Points to note −

  1. A segment occurrence is an individual segment of a particular type containing user data. In the above example, Books Information is one segment type and there can any number of occurrences of it, as it can store the information about any number of books.

  2. Within the IMS Database, there is only one occurrence of each segment type, but there can be an unlimited number of occurrences of each segment type.