|
|
Getting Started with HP IMAGE/SQL: HP 3000 MPE/ iX Computer Systems > Chapter 6 Practicing with IMAGE/SQL Using MusicDBEExamining The Database |
|
In this section, you will examine the objects that were created within MusicDBE -- tables, views, and authority structures. Information about all these objects is in the system catalog, which is automatically created by IMAGE/SQL when the DBEnvironment is created and configured. Run ISQL, then connect to MusicDBE using this CONNECT command:
Now examine the system catalog by creating queries on the system views. Use the following query exactly as shown to look at all the tables and views created by the attach function. Type the query exactly as shown because the owner name is case-sensitive.
The result table is shown below. Figure 6-2 Information on Tables and Views
Each table is listed in the NAME column. The OWNER column specifies the database to which the table belongs. If you are not the table owner (that is, if it is part of the TurboIMAGE/XL database), you must prefix the table name with its owner name whenever you refer to it. In this example, a reference to the ALBUMS table would be MUSIC.ALBUMS. The DBEFILESET column contains the name of the DBEFileSet an entry has been associated with. IMAGE/SQL tables are always associated with the SYSTEM DBEFileSet. The TYPE column indicates whether the entry is a table or a view. Entries with type 0 are tables and entries with type 1 are views. You can see individual table descriptions by using the INFO command, which returns the column definition of a table. Use the following command for the Albums table:
The output from this ISQL command is shown below: Figure 6-3 Column Definitions of a Table
The Column Name column lists the names of all the columns in the table. The Data Type column shows the SQL data type for each column and its size (in parentheses). The third column, Nulls Allowed, indicates whether or not null values are permitted in this column. IMAGE/SQL tables do not allow null values, so this column will always contain NO. The Language column indicates which language is applicable for the column if it is a character type. This corresponds with the Language value in the MUSIC root file. An authority structure consists of many elements. Some of these elements are shown below:
Use the following query to examine each authorization group in MusicDBE and their members:
The query result is shown below: Figure 6-4 Groups in the System Catalog
Figure 6-4 “Groups in the System Catalog” shows two UserID values, MUSIC_0 and MUSIC_64, that correspond with TurboIMAGE/XL password levels of 0 and 64. Level 0 is assigned to items and sets that do not have levels assigned to them. Users accessing the database without a password are given this level. Level 64 is the creator level. Notice that the OWNER for both is MGR@ACCOUNT, the database creator. Passwords in TurboIMAGE/XL are case-sensitive. Also, you need to allow these users mode 1 access to TurboIMAGE/XL to permit database updates. The information above is set up by the ATTACH command. There are, however, three levels of security defined in the TurboIMAGE/XL database: MGR, DIR, and ANNCR. To use these levels, you must add additional users with the IMAGE/SQL utility as shown below:
You can view these changes and additions with the DISPLAY USERS command:
Figure 6-5 Changes to Levels of Security
Re-invoke ISQL and enter the following command to look at the UserID information:
Figure 6-6 UserID Information
New UserID values now exist for DIR and ANNCR. However, no UserID exists for MGR because MGR is the OWNER of these GroupIDs and UserIDs. Now that all these UserIDs are established, you can access the database using any of these MPE user logins. |
|