Attaching a TurboIMAGE/XL Database: Task 2 [ HP IMAGE/SQL Administration Guide ] MPE/iX 5.0 Documentation
HP IMAGE/SQL Administration Guide
Attaching a TurboIMAGE/XL Database: Task 2
This task describes how to attach a TurboIMAGE/XL database.
NOTE If you are attaching a database with the same name but in a
different group and/or account as a database already attached to
the DBEnvironment, you must specify an alternative owner name at
attach time (see Task Reference). This is because in a mapped
table, by default, the owner name is the database name. Duplicate
table names are not allowed within the same database. In any case,
you cannot attach the same TurboIMAGE/XL database twice to the same
DBEnvironment.
Getting Ready
* It is convenient to have the TurboIMAGE/XL database and the
DBEnvironment in the same group and account.
If this is not the case, there are several issues to consider.
The following considerations apply if the TurboIMAGE/XL
database(s) to be attached exist(s) in a different group and/or
account than the DBEnvironment:
* IMAGE/SQL supports standard MPE XL security rules. Correct
user, group, and account capabilities must be in place to
use IMAGE/SQL to access a TurboIMAGE/XL database from a
DBEnvironment in a different account than the database.
* IMAGE/SQL utility administrators often need to specify
DBEnvironment and TurboIMAGE/XL maintenance words as a part
of the SET command if they are not the creator. Because of
this, it is recommended that maintenance words exist
for[REV BEG] the DBEnvironment and all TurboIMAGE/XL
databases.[REV END]
* IMAGE/SQL utility administrators need DBA authority to
perform most IMAGE/SQL utility tasks. Be sure to grant DBA
authority to everyone who will be performing IMAGE/SQL
utility tasks (see Task Reference).
* The TurboIMAGE/XL database and the DBEnvironment must have the
same native language support (NLS) defined for them.
* The ATTACH command requires that the appropriate SET SQLDBE and
SET TURBODB commands have been issued. To check the status of
these commands, use the DISPLAY OPTIONS command:
_________________________________________
| |
| >> DISPLAY OPTIONS |
| Current Turbodb : |
| Current SQLDBE : |
| Echo : ON |
| Command Logging : ON |
| Log File : ATCLOG.SERED.ATC|
_________________________________________
* If necessary, issue the SET commands. For example:
______________________________________
| |
| >>SET SQLDBE PARTSDBE.SERED.ATC|
| >>SET TURBODB SALES.SERED.ATC |
| >> |
______________________________________
[REV BEG]
If the DBEnvironment does not exist, IMAGE/SQL displays this message:
DBE does not exist, do you want to create one? [Y/N] :
If you reply 'Y', a DBEnvironment and DBE files are automatically created
for you. The files created are:
-------------------------------------------------------------------------------------------
| |
| File Created File Name |
| |
-------------------------------------------------------------------------------------------
| |
| DBE CON file DBEnvironment-name |
| |
| DBE FILE DBEnvironment-nameFL |
| |
| LOG FILE DBEnvironment-nameLG |
| |
| ATCINFO file DBEnvironment-nameCR |
| |
-------------------------------------------------------------------------------------------
For example, if you issue the command
SET SQLDBE MYDBE
and the DBEnvironment MYDBE does not exist, these files are created:
MYDBE, MYDBEFL, MYDBELG, and MYDBECR.
The default size of DBE FILE and LOG FILE is 1000 pages.[REV END]
Performing the Task
Once you are sure the appropriate SET commands have been specified and
that the correct MPE XL security is in place, issue the ATTACH command.
_________________________________________________________________
| |
| >> ATTACH |
| Split 1 compound source fields (ATCWARN 32063). |
| Mapped 15 source table/source field names (ATCWARN 32062).|
| Mapped 1 incompatible source types (ATCWARN 32061). |
| >> |
_________________________________________________________________
Messages issued at attach time inform you if any mapping has been done
(see Task Reference). The SALES database is now a logical part of the
PartsDBE DBEnvironment. Although the data remains in the TurboIMAGE/XL
database, it can now be accessed from mapped tables just as it would be
accessed from ALLBASE/SQL tables.
Task Reference
* By default, the IMAGE/SQL utility uses the TurboIMAGE/XL database
name as the owner name.
You must specify an alternative owner name if you are attaching a
TurboIMAGE/XL database with the same name as one already attached.
To do this, use the WITH OWNER= parameter of the ATTACH command.
* To specify a maintenance word, use the MAINT= parameter of the SET
TURBODB or SET SQLDBE command. Refer to Chapter 4, "IMAGE/SQL
Command Syntax," for details about these commands and their
parameters.
* Use the DISPLAY MAP command to see detailed database mapping
information.
* When a TurboIMAGE/XL database is attached to a DBEnvironment,
IMAGE/SQL performs the following tasks:
* Makes a table entry in the system catalog of the
DBEnvironment for each corresponding source data set.
* Creates a column definition for each field in the source
data set.[REV BEG] IMAGE/SQL columns are defined as NOT
NULL with default values.
Default values are based on IMAGE/SQL item types, as listed
in Table 2-5 .
Table 2-5. IMAGE/SQL Default Data Types
----------------------------------------------------------
| | | |
| Group | IMAGE/SQL | Default Type |
| | Data Type | |
| | | |
----------------------------------------------------------
| | | |
| Alphanumeric | CHAR | Blanks |
| | | |
----------------------------------------------------------
| | | |
| Date/Time | DATE | CURRENT_DATE |
| | | |
----------------------------------------------------------
| | | |
| | DATETIME | CURRENT_DATETIME |
| | | |
----------------------------------------------------------
| | | |
| | INTERVAL | 0 00:00:00.000 |
| | | |
----------------------------------------------------------
| | | |
| | TIME | CURRENT_TIME |
| | | |
----------------------------------------------------------
| | | |
| Numeric | FLOAT | 0.0 |
| | | |
----------------------------------------------------------
| | | |
| | DECIMAL | 0 |
| | | |
----------------------------------------------------------
| | | |
| | INTEGER | 0 |
| | | |
----------------------------------------------------------
| | | |
| | SMALLINT | 0 |
| | | |
----------------------------------------------------------
If all columns in a table are not specified, the missing
columns will be defined using the default values.[REV END]
* Produces default mapping information that maps
TurboIMAGE/XL data sets to ALLBASE/SQL tables and stores
this information in the ATCINFO file. Specifically,
mapping is done in the following areas:
* Data item and data set names:
Some characters allowed in TurboIMAGE/XL
names (specifically, + - * / ? ' %
& ) are not valid in ALLBASE/SQL names.
Therefore, whenever the IMAGE/SQL utility
encounters such a character in a
TurboIMAGE/XL name, it converts it to an
underscore (_).
* Data types:
TurboIMAGE/XL data types are mapped to
ALLBASE/SQL data types. When inexact or
imprecise mapping is necessary, an I appears
in the NOTES section of the DISPLAY MAP
display. When a compound field is split into
separate mapped columns, an S appears in the
NOTES section of the display.
* User security:
Initially, only the TurboIMAGE/XL database
creator (DBC) is defined as a user in the
DBEnvironment. For other users to access the
attached database, the DBC must add users
with the IMAGE/SQL utility's ADD USER
command. Refer to Task 3, "Adding IMAGE/SQL
Users," for more information.
* Once the database is attached, the DBC must add any additional
IMAGE/SQL users.
* It is desirable to update data types (Task 4) and split mapped
columns (Task 5) before IMAGE/SQL users access the attached
database. This is because whenever a mapped column is split
or[REV BEG] the data type of a mapped column is[REV END] updated,
any user-created views containing these mapped columns are
dropped.
[REV BEG]
* If the DBEnvironment does not exist, IMAGE/SQL automatically
creates a DBEnvironment and DBE files. The default ATCINFO file
name is the DBEnvironment name appended by `CR'.[REV END]
MPE/iX 5.0 Documentation