What Is a DBEnvironment? [ Getting Started with HP IMAGE/SQL ] MPE/iX 5.0 Documentation
Getting Started with HP IMAGE/SQL
What Is a DBEnvironment?
In IMAGE/SQL, you create one or more databases in a structure called a
DBEnvironment. The structure of a DBEnvironment is shown in Figure 2-2.
Figure 2-2. Structure of a DBEnvironment
The following objects are the most important parts of the DBEnvironment:
* The DBECon file
* DBEFiles
* DBEFileSets
* Databases
* Tables
* Authorities
* System catalog
* Log files
Objects are structures created and stored in an IMAGE/SQL DBEnvironment.
IMAGE/SQL connects the DBEnvironment objects with the TurboIMAGE/XL
database structures. This is discussed in greater detail in Chapter 5,
"IMAGE/SQL Tasks."
To better understand the DBEnvironment and its objects, imagine that it
is like a library that stores books, periodicals, or other information.
Like a library, the DBEnvironment is a physical location for information,
so you need to set aside physical space for it. Also like a library, the
DBEnvironment uses a logical method for storing and retrieving
information.
The DBECon file
When you create a DBEnvironment, IMAGE/SQL creates a physical file known
as the DBEnvironment Configuration File or DBECon file. This file
contains basic information that is used every time the DBEnvironment is
opened. The DBECon file has the same name as the DBEnvironment itself.
If the DBEnvironment is like a library, the DBECon file is like a
building directory that points to the other DBEnvironment components.
DBEFiles
You must allocate some physical storage space by creating
DBEFiles--operating system files that hold DBEnvironment data. Like the
individual bookcases in a library, they have a specific capacity.
DBEFiles have both physical names (operating system names) and logical
names by which the files are known internally to the IMAGE/SQL system
catalog, to be explained shortly.
DBEFileSets
DBEFiles are grouped together in logical groupings known as DBEFileSets.
These are something like the different subject categories in a library.
You create a DBEFileSet with a logical name (this corresponds to the
subject category name). Then you add DBEFiles to the DBEFileSet as
needed, as you would add bookcases to the category to add more space.
For example, a section may be labeled "Computer Periodicals" and hold
many bookcases with different magazines in them. DBEFileSets do not have
a specific capacity; you can always add more DBEFiles to create more
space in them.
Databases
The data in a DBEnvironment is stored in databases, which are groups of
tables having the same owner. The database in a DBEnvironment is like
division ownership of certain books or periodicals in a library. In a
university, some of the periodicals may belong to a computer science
library, others may belong to a medical library, though these may be
housed inside the same building and use the same card catalog. In such a
subdivision of the library, certain books and periodicals could only be
checked out by people belonging to the appropriate division or having
special permission.
When you create an object in the DBEnvironment, you are its owner by
default, and therefore it belongs to your database.
Tables
The most important objects you create are tables. A table is like a
periodical stored in a library, and the rows in the table are like
individual articles in the periodical.
Tables have only logical names; a table name is like the title of the
periodical. When you create a table, you only need to define its name
and characteristics and associate it with a DBEFileSet. This is like
adding a new periodical to a subject category in the library.
System Catalog
To enable readers to find issues of ComputerWorld, the librarian puts an
entry in a card catalog that shows where the issues are stored. In the
DBEnvironment, SQLCore inserts an entry in the system catalog for each
database object you create. The system catalog is created at the time
you create a DBEnvironment.
The system catalog is physically located in a DBEFile known as DBEFILE0.
This file contains extra space for the additional entries that are made
by SQLCore each time you create a new object. Like a good librarian,
IMAGE/SQL keeps the system catalog up-to-date for you, without your being
aware of it.
The system catalog is a set of tables for internal use by SQLCore. These
tables are associated with a DBEFileSet known as SYSTEM. SQLCore uses the
system catalog to look up database objects much as you would use the card
catalog in a library to look up the bookcase and shelf number for a book
or periodical.
Log Files
IMAGE/SQL provides logging of all transactions that take place in the
DBEnvironment. Like the library's record of items checked out and
returned, the log file is a record of the rows in database tables that
are added, deleted, or changed. The log makes it possible to keep data
consistent when multiple users are accessing the system, and it makes
recovery possible in the event of a system failure. Information about
the system log is stored in the DBECon file.
Because logging is essentially automatic, it will not be discussed any
further in this manual. For more information, refer to the chapter
"Backup and Recovery" in the ALLBASE/SQL Database Administration Guide.
MPE/iX 5.0 Documentation