Physical Database Structures

Now that you have created your design, calculate the amount of space that is required by your database. Then implement the database design using SQL or non-SQL data definition statements.
idms
Now that you have created your design, calculate the amount of space that is required by your database. Then implement the database design using SQL or non-SQL data definition statements.
No matter how you define the database, certain physical database structures are used by CA IDMS/DB to implement your design, such as areas, pages, segments, DMCLs, and database keys.
2
2
Areas and Pages
CA IDMS/DB subdivides the physical database into separate
areas
, each consisting of a set of contiguously numbered
pages
.
Areas are stored in operating system files. Each page corresponds to one or more direct-access blocks. CA IDMS/DB usually transfers an entire page of data in a single input/output operation.
While some database pages are reserved for space management, most pages are used to hold user data in the form of
entity occurrences
. An entity occurrence corresponds to either:
  • A single row of an SQL-defined table
  • An instance of a record that is defined by a non-SQL schema
A page can contain as many entity occurrences as space availability permits.
Segments
A segment defines the areas and files that contain the data in the database. A segment represents a physical database that is usually defined by a single schema. To be accessed by the database at runtime, the segment must be included in the definition of a
DMCL
.
DMCL
A DMCL is a collection of segment definitions that can be accessed in a single execution of CA IDMS/DB. The DMCL also specifies buffer characteristics. The DMCL describes the buffer and files for journaling database activity. The DMCL also identifies a database name table that the database uses at runtime to map a logical (or schema) definition of the database to specific segments.
A DMCL exists as a load module in a load (core-image) library. At runtime, it is used to determine where data that is required by an application is physically stored.
For more information on segments and the DMCL, see the Administrating CA IDMS Database.
Database Keys
CA IDMS/DB assigns a
database key
(db-key) to each record occurrence when it is entered into the database. The database key is the concatenation of the number of the page on which a record occurrence is stored and a line number. A line number is an index to an 8-byte structure called a line index. The line index is used to locate the record occurrence within the page. The database key uniquely identifies the record with which it is associated and never changes as long as the record remains in the database.
Structure of the Physical Database
The following diagram shows how areas, pages, and entity occurrences appear in the database.
The EMPDATA database area contains four pages and five entity occurrences. Each of the entity occurrences is uniquely identified by a database key. For example, the database key for the Mary Bliss occurrence is 1001:1.
The diagram shows how areas, pages, and entity occurrences appear in the database.