HPlogo Getting Started with HP IMAGE/SQL: HP 3000 MPE/ iX Computer Systems > Chapter 5 IMAGE/SQL Tasks

Configuring a DBEnvironment

» 

Technical documentation

Complete book in PDF
» Feedback

 » Table of Contents

 » Glossary

 » Index

This task describes how to configure a DBEnvironment so that you can access your TurboIMAGE/XL database(s) with IMAGE/SQL (see Task Reference).

Getting Ready

  • When all of the TurboIMAGE/XL databases to be attached to the DBEnvironment are created by the same user in one group and account, it is convenient to configure the DBEnvironment in this group and account.

    If this is not the case, several other issues should be considered. The following considerations apply if the TurboIMAGE/XL database to be attached exists in a different group and/or account than the DBEnvironment: Performing the Task

    • IMAGE/SQL supports standard MPE/iX security rules. Make sure correct user, group, and account capabilities are in place when you plan to access a TurboIMAGE/XL database from a DBEnvironment in a different account than the database.

    • Make sure maintenance words exist for both database management systems, because IMAGE/SQL utility administrators often need to specify DBEnvironment and TurboIMAGE/XL maintenance words if they are not the creator.

    • Be sure to grant DBA authority to everyone who will be performing IMAGE/SQL utility tasks (see Task Reference), because IMAGE/SQL utility administrators need DBA authority to perform most IMAGE/SQL utility tasks.

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

  • When a DBEnvironment is configured, two files are created: DBEFILE0 and DBELOG1. IMAGE/SQL requires that these files be larger than their defaults. Make sure these files are large enough to accommodate IMAGE/SQL. In the example below, a file size of 500 pages is used for each of these files, but you may need to adjust these sizes, depending on the size and number of TurboIMAGE/XL databases you plan to attach (see Task Reference).

Log on in the same group and account as the TurboIMAGE/XL database(s) and run ISQL. At the ISQL prompt, enter the START DBE NEW command. For example, to configure a DBEnvironment named MusicDBE, enter the following:

   isql=> START DBE 'MUSICDBE' MULTI NEW

   > MAXIMUM TIMEOUT = 10 SECONDS

   > DEFAULT TIMEOUT = 5 SECONDS

   > DBEFILE0 DBEFILE DBEFILE0     ⇐DBEFile0Definition

   > WITH PAGES = 500,         ⇐   .         .       

   > NAME = 'MusicF0',         ⇐   .         .     

   > LOG DBEFILE DBELOG1        ⇐DBELog0Definition

   > WITH PAGES = 500,         ⇐   .         .    

   > NAME = 'MusicLog';        ⇐   .         .    

   isql=> EXIT;

   :

If you forget the semicolon, ISQL prompts you. At this prompt, enter a semicolon and ISQL will execute the command. The MULTI parameter is necessary if you plan on a multiuser IMAGE/SQL environment.

To avoid deadlock situations when there are more than two connections, you should either set the MAXIMUM TIMEOUT and DEFAULT TIMEOUT options with the START DBE NEW statement or change them with the SQLUtil ALTDBE command.

To set a maintenance word for the newly configured DBEnvironment, use the SETDBEMAINT command of SQLUtil. This utility prompts you for necessary information, as in the following example.





   :RUN SQLUTIL.PUB.SYS



       THU, APR  8, 1993, 10:26 AM

   HP36216-02A.F0.52                DBE Utility/3000             ALLBASE/SQL

   (C)COPYRIGHT HEWLETT-PACKARD CO. 1982,1983,1984,1985,1986,1987,1988,

   1989,1990,1991,1992,1993. ALL RIGHTS RESERVED.



   >>SETDBEMAINT

   Environment Name: MUSICDBE

   Current Maintenance Word:

   New Maintenance Word:  usr

   Retype New Maintenance Word:  usr



   Maintenance word changed.

   >>EXIT

Listing the Newly Created Files

When you display the files in your current group, note that there are three newly created files: MUSICDBE, DBEFILE0, and DBELOG1.

The first file is the DBECon file or DBEnvironment configuration file. This has the same name you assigned to the DBEnvironment in the START DBE command. The DBECon file contains startup parameters for the DBEnvironment.

DBEFILE0 is a file containing the data for the SYSTEM DBEFileSet, which contains the system catalog. (You'll examine the system catalog later.)

DBELOG1 is the log file, which records operations that modify the database.

Once you have configured the DBEnvironment, set the timeout time, and set a maintenance word for it, you are ready to attach TurboIMAGE/XL databases to it, as shown in the next task.

Task Reference

  • No information is given here about considerations that may be necessary when configuring a DBEnvironment that contains native ALLBASE/SQL databases. Consult the ALLBASE/SQL Database Administration Guide for more guidance in this area.

  • The following summaries of IMAGE/SQL commands will get you started. Refer to the ALLBASE/SQL Reference Manual for more information.

    • The ALLBASE/SQL START DBE NEW statement has the following syntax:

      START DBE 'DBEnvironmentName' [MULTI] NEW [ DUAL LOG BUFFER =(DataBuffPages,LogBuffPages) LANG = LanguageName TRANSACTION = MaxTransactions DBEFile0Definition DBELogDefinition ] |,...|

      Refer to the Performing the Task example for details of the syntax for DBEFile0Definition and DBELogDefinition.

    • Use SQLUtil to set a DBEnvironment maintenance word. To access SQLUtil, issue the following command:

         :RUN SQLUTIL.PUB.SYS
      

      The SQLUtil SETDBEMAINT command is used to set a maintenance word. The syntax for this command is as follows:

         >> SETDBEMAINT
      
      
      
         DBEnvironment Name:  DBEnvironmentName
      
         Current Maintenance Word:  OldMaintenanceWord
      
         New Maintenance Word:  NewMaintenanceWord
      
         Retype New Maintenance Word:  NewMaintenanceWord
      
         >>EXIT
      

    When no current maintenance word exists, enter a carriage return at the "Current Maintenance Word:" prompt.

Attaching a TurboIMAGE/XL Database

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 from 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, and 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/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 both database management systems.

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

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

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

    
    
       :RUN IMAGESQL.PUB.SYS
    
    
    
       HP36385B X.F0.12               IMAGE/SQL Utility   THU, APR  8, 1993, 10:30 AM
    
       (C) COPYRIGHT HEWLETT-PACKARD COMPANY 1993
    
    
    
       >>DISPLAY OPTIONS
    
       Current base    :
    
       Current SQLDBE  :
    
       Echo            : ON
    
       Command Logging : ON
    
       Log File        : ATCLOG.PUB.TURBONM
    

  • Because there is no current database or DBEnvironment, issue the SET command as follows:

       >>SET SQLDBE MUSICDBE.PUB.TURBONM
    
       >>SET TURBODB MUSIC.PUB.TURBONM
    
       >>
    

  • Another DISPLAY OPTIONS command confirms that there is now a current database and DBEnvironment:

       >>DISPLAY OPTIONS
    
       Current base    : MUSIC.PUB.TURBONM
    
       Current SQLDBE  : MUSICDBE.PUB.TURBONM
    
       Echo            : ON
    
       Command Logging : ON
    
       Log File        : ATCLOG.PUB.TURBONM
    

Performing the Task

Once you are sure the appropriate SET command have been specified and that the correct MPE/iX security is in place, issue the IMAGE/SQL utility 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 MUSIC database is now a logical part of the MusicDBE DBEnvironment. Although the data remains in the TurboIMAGE/XL database, it can now be selected from mapped tables just as it would be selected 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 the HP IMAGE/SQL Administration Guide 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. (The NOT NULL option is used because null values are not defined in TurboIMAGE/XL.)

    • Produces default mapping information which maps TurboIMAGE/XL data sets to 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 SQL names. Therefore, whenever 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 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 IMAGE/SQL utility's ADD USER command.

  • Once the database is attached, the DBC must add any additional IMAGE/SQL users.

  • It is desirable to update data types and split mapped columns before IMAGE/SQL users access the attached database. For details, refer to the HP IMAGE/SQL Administration Guide. This is because whenever a mapped column is split or updated, any user-created views containing these mapped columns are dropped.

Feedback to webmaster