How IMAGE/SQL Works [ IMAGE/SQL Administration Guide ] MPE/iX 5.0 Documentation
IMAGE/SQL Administration Guide
How IMAGE/SQL Works
IMAGE/SQL users can select data in mapped tables in the same way that
data in ALLBASE/SQL tables is selected.
To understand how this is accomplished, you need to know:
* What files are used by IMAGE/SQL
* How IMAGE/SQL files are used
* What takes place during the attach/detach process
* How IMAGE/SQL maps TurboIMAGE/XL security
* How IMAGE/SQL maps TurboIMAGE/XL data types
* What takes place at run time
IMAGE/SQL Files
[REV BEG]
IMAGE/SQL creates two files: the ATCINFO file with a default name of
DBEnvironmentNameCR in the same group and account as the DBEnvironment
and DBNameTC in the same group and account as the TurboIMAGE/XL database.
This is shown in Figure 3-1 .[REV END]
Figure 3-1. Files Created by IMAGE/SQL
These files contain information about the relationships between all
attached TurboIMAGE/XL databases and their DBEnvironments. Specifically:
ATCINFO is a permanent privileged file in the same group and
account as the DBEnvironment. It contains mapping
information about each TurboIMAGE/XL database attached to
the DBEnvironment. One ATCINFO file exists for each
DBEnvironment.
[REV BEG]
It is named DBEnvironmentNameCR where DBName is up to six
characters of the DBEnvironmentName unless a file equation
has been set before the attach. Its name is placed in the
DBECon file of the DBEnvironment so that it can be located
whenever IMAGE/SQL needs to use or update the information
in this file.[REV END]
DBNameTC is a permanent privileged file in the same group and
account as the TurboIMAGE/XL database. It contains the
fully qualified names of the DBEnvironments to which the
TurboIMAGE/XL database is attached. This information is
used to let external utilities such as DBUTIL know that the
database is attached to one or more DBEnvironments.
What Takes Place During an Attach?
An attach is the process that establishes the connection between the
TurboIMAGE/XL database and the DBEnvironment. Figure 3-2 shows a
TurboIMAGE/XL database and DBEnvironment before the TurboIMAGE/XL
database is attached.
Figure 3-2. A TurboIMAGE/XL Database and a DBEnvironment Before the Attach
When the TurboIMAGE/XL database is attached to the DBEnvironment, several
events take place:
[REV BEG]
1. The ATCINFO (DBEnvironmentNameCR) and DBNameTC files are
created.[REV END]
2. Definitions of the TurboIMAGE/XL mapped tables are placed in the
system catalog of the DBEnvironment. These entries in the system
catalog identify the tables as mapped tables. The naming
convention for SQL tables is OwnerName.TableName. By
default, in mapped tables, IMAGE/SQL specifies the database
name as the owner name and the data set name as the table
name. Thus, the naming convention for mapped tables is
MappedDatabaseName.MappedDataSetName. (At attach time, you must
substitute a different owner name if an already attached database
has the same name.)[REV BEG]
3. The TurboIMAGE/XL database creator (DBC) is defined in the ATCINFO
file as an IMAGE/SQL user. For security reasons, all other
IMAGE/SQL users must be explicitly added by the DBC.[REV END]
Figure 3-3 shows an attached database.
Figure 3-3. An Attached TurboIMAGE/XL Database
What Takes Place During a Detach?
When a database is detached, you can no longer use SQL to access
TurboIMAGE/XL data. All views based on mapped tables are dropped. This
includes views created by users, as well as IMAGE/SQL-created views.
Mapped table definitions are removed from the system catalog and all
mapping information about the detached TurboIMAGE/XL database is removed
from the ATCINFO file.
If you are detaching the only TurboIMAGE/XL database attached to the
DBEnvironment, the ATCINFO file is deleted and its name is removed from
the DBECon file. If you are detaching the TurboIMAGE/XL database from
the only DBEnvironment it is attached to, the DBNameTC file is deleted.
Detach if you plan to restructure the database or if you want to remove
all mapping information about the database from the ATCINFO file.
When the database is detached, all customized mapping information
(alternative data types and added IMAGE/SQL users) is lost and must be
remapped when the database is reattached. IMAGE/SQL utility command
files are useful for this purpose[REV BEG] (refer to Tasks 13 and 14 in
Chapter 2).[REV END] To protect database security, be sure command files
that contain passwords and other sensitive information are carefully
controlled. (A message notifies you when IMAGE/SQL commands containing
maintenance words or passwords have been logged.)
MPE/iX 5.0 Documentation