HPlogo IMAGE/SQL Administration Guide: HP 3000 MPE/iX Computer Systems > Chapter 2 Using the IMAGE/SQL Utility

Task 2: Attaching a TurboIMAGE/XL Database

» 

Technical documentation

Complete book in PDF
» Feedback

 » Table of Contents

 » Glossary

 » Index

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. 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

  • Exit from SQLUtil after you finish Task 1, then run the IMAGE/SQL utility, IMAGESQL.

  • 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/iX 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 the DBEnvironment and all TurboIMAGE/XL databases.

    • 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.

  • The TurboIMAGE/XL database and the DBEnvironment must have the same native language support (NLS) defined for them.

  • Be sure that all processes accessing the DBEnvironment are shutdown before using the ATTACH command. The first ATTACH command using the IMAGE/SQL utility requires exclusive access to the DBEnvironment.

  • The ATTACH command also requires that the appropriate SET SQLDBE and SET TURBODB commands have been issued. To check the status of these commands, run the IMAGE/SQL utility and use the DISPLAY OPTIONS command:

       :RUN IMAGESQL.PUB.SYS
    
       >>DISPLAY OPTIONS
    
       Current base      :
    
       Current SQLDBE    :
    
       Echo              : ON
    
       Command Logging   : ON
    
       Current Log File  : ATCLOG.SERED.ATC
    
  • If necessary, issue the SET commands in IMAGE/SQL utility. For example:

       >>SET SQLDBE PARTSDBE.SERED.ATC
    
       >>SET TURBODB SALES.SERED.ATC
    
       >>
    

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 DBEFiles are automatically created for you. The files created are:

File CreatedFile Name
DBEConFileDBEnvironmentName
DBEFileDBEnvironmentNameFL
LOG fileDBEnvironmentNameLG
ATCINFO fileDBEnvironmentNameCR

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 size of MYDBEFL is 5000 pages, and that of MYDBELG is 10000 pages.

Performing the Task

When you are sure the appropriate SET commands have been specified and that the correct MPE/iX security is in place, issue the ATTACH command.

   :RUN IMAGESQL.PUB.SYS

   >>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. 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 Utility Commands," 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. IMAGE/SQL columns are defined as NOT NULL with default values.

      Default values are based on IMAGE/SQL data types, as listed in Table 2-5 “IMAGE/SQL Default Data Types”.

      Table 2-5 IMAGE/SQL Default Data Types

      GroupIMAGE/SQL Data TypeDefault Type
      AlphanumericCHARBlanks
      Date/TimeDATECURRENT_DATE
       DATETIMECURRENT_DATETIME
       INTERVAL0 00:00:00.000
       TIMECURRENT_TIME
      NumericFLOAT0.0
       DECIMAL0
       INTEGER0
       SMALLINT0

       

      If all columns in a table are not specified, the missing columns will be defined using the default values.

    • Produces default mapping information that maps TurboIMAGE/XL data sets to ALLBASE/SQL tables and stores this information in the ATCINFO file (DBEnvironmentNameCR). 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 the data type of a mapped column is updated, any user-created views containing these mapped columns are dropped.

  • If the DBEnvironment does not exist, IMAGE/SQL automatically creates a DBEnvironment and DBEFiles. The default ATCINFO file name is the DBEnvironment name (up to 6 characters) appended by `CR'.

  • If you have a data set containing a compound item such that when it is mapped into an SQL name with suffix (-n, where n is an element number), and this mapped name happens to be the same as one of the existing mapped names within the same table, ATTACH will fail due to duplicate names. If this is the case, use a utility such as Adager or DBChange Plus to change the item name, then use the ATTACH command.

Feedback to webmaster