Dictionaries, Data Sections and Indexes

This section discusses the purpose and contents of the four levels in the database hierarchy.

SYSTEM Dictionary

The dictionary-only file called SYSTEM is the highest level file on the database holding all the information necessary to enable users to logon and access accounts on the database. In particular, it contains items which define the accounts that can be logged to. It also contains a LOGON item which provides the 'Logon please' message. During normal use of a database, a user is not aware of the SYSTEM dictionary. Access to SYSTEM is only available from the SYSMAN account.

Three types of definition item are held in the SYSTEM dictionary. They are:

Creating an Account

A new account is created by executing theCREATE-ACCOUNT command. This prompts for the type of account required and creates the appropriate account definition item (D, Q, or R-pointer) in SYSTEM. It also prompts for other information such as security restrictions, modulo for the MD, and so on. This information is entered into attributes in the account definition item.

Logon Processing

The LOGON item in the SYSTEM dictionary contains the database name and a 'Logon please:' prompt. This is displayed as a prompt for the user to logon to the database. Refer to LOGON Processor.

Master Dictionaries

Master dictionaries (MDs) form the next level below the SYSTEM dictionary. Each account has one MD only which defines the files that are defined from that in the account and the commands, including, TCL commands, English commands, cataloged DataBasic programs and Procs which can be executed by account users. When you log on to a particular account the logon program is under the control of the MD for that account.

When a new account is created, Reality creates an MD and copies a standard set of definition items from a system file called NEWAC. The following types of definition item can be created in a master dictionary (MD):

File Dictionaries

Just as an MD points to and defines all file dictionaries in an account, so each file dictionary points to one or more data sections and defines the format of the data in each. It also specifies any indexes associated with the file. To do this, a file dictionary may contain:

Data Sections

Data sections are the lowest level files of a database and contain the user data arranged in item format. One or more data sections may be associated with a file dictionary, or even no data sections. A file dictionary without data sections is referred to as a single-level dictionary. A data section is always accessed by way of its file dictionary, in which Reality looks for the data level descriptor to locate the data section.

Data sections can be shared between accounts using Q-pointers (file synonym definition items) in the MD and access to them can be restricted by update and retrieval lock codes. Q-pointers have already been discussed briefly in this section and are described in more detail in File and Item Structures. A user's capability to view or write data into a file is restricted by the update and retrieval lock codes of the target account or file definition item.

Index Sections

Index sections are closely coupled to the data sections that they are created for. An index section contains an entry for each item in its associated data section which matches the selection criteria in the index definition item. The D-pointer for the data section also defines the index section. Index entries are ordered according to their sort key value derived from the sort criteria in the index definition item. The construction and maintenance of an index section is transparent to the user. It is created using the CREATE-INDEX command with the index name (index definition item-id) as a parameter. Refer to File and File Index Management for a description of indexing.