HPlogo Getting Started with HP IMAGE/SQL: HP 3000 MPE/ iX Computer Systems > Chapter 3 Moving from TurboIMAGE/XL to IMAGE/SQL

Creating Databases

» 

Technical documentation

Complete book in PDF
» Feedback

 » Table of Contents

 » Glossary

 » Index

In TurboIMAGE/XL, you create a database using the following steps:

  1. Create a schema. A common way of doing this is to enter the schema into a text file created with an editor.

  2. Run DBSCHEMA to generate a root file from the schema.

  3. Run DBUTIL to create data sets based on the root file.

  4. Create a DBEnvironment.

With TurboIMAGE/XL, a schema is required to define a database. The schema contains definitions of all the data items in your database and describes all the data sets in the database. It also specifies the desired security for the database by defining passwords for specific users. The schema can also be used to create the same database structure in different groups and accounts or on different systems.

To access a TurboIMAGE/XL database with IMAGE/SQL, you need a DBEnvironment. You create a DBEnvironment with a SQL START DBE NEW statement. The statement can be issued interactively (through ISQL) or through an application program. The START DBE NEW statement is as follows:

   START DBE 'DBEnvironmentName' NEW

The START DBE NEW statement creates a file known as a DBECon file, which is similar to the root file in TurboIMAGE/XL. The DBECon file contains information about startup parameters for the DBEnvironment and its logs. START DBE NEW also creates a structure within the DBEnvironment known as a system catalog, which is a set of information about all the databases in the DBEnvironment.

If you use the START DBE statement and the DBEnvironment does not exist, the system will ask if you want one automatically created. See Chapter 5, "IMAGE/SQL Tasks," for more details and an example.

After the database and DBEnvironment have been created, you must attach the TurboIMAGE/XL database to the DBEnvironment.

Root File versus DBECon File and System Catalog

With TurboIMAGE/XL, the root file, which is generated by DBSCHEMA from the schema, contains security information and definitions of all the data sets in the database. The user executing DBSCHEMA becomes the database creator.

The DBECon file in ALLBASE/SQL is created when you issue the START DBE NEW statement in ISQL. The DBECon file, which has the same name as the DBEnvironment, contains the name of the DBECreator and the names of the logs associated with the DBEnvironment. The DBECon file also contains startup parameters, such as SINGLE or MULTI user mode, but does not contain the names of tables or other database objects; these are stored in the system catalog.

The system catalog contains structural information about database objects and tables, much the way the root file does for standard TurboIMAGE/XL. This catalog serves as an internal schema for accessing data.

When a TurboIMAGE/XL database is attached to a DBEnvironment, data set and item definitions are copied into the system catalog. This provides a mapping to the TurboIMAGE/XL data from the DBEnvironment. The data is not copied; it remains in the TurboIMAGE/XL database.

Naming Conventions

TurboIMAGE/XL data sets and items may contain some characters that are not allowed in IMAGE/SQL. For example, the hyphen is not allowed in IMAGE/SQL names. Therefore, hyphens must be represented in another way in IMAGE/SQL, such as with an underscore ( _ ). Specifically, the characters not allowed in IMAGE/SQL names are: + - * / ? ' % &. For more details, refer to the HP IMAGE/SQL Administration Guide.

Feedback to webmaster