HPlogo ALLBASE/SQL Database Administration Guide: HP 3000 MPE/iX Computer Systems > Chapter 8  System Catalog

Views owned by SYSTEM and CATALOG

» 

Technical documentation

Complete book in PDF
» Feedback

 » Table of Contents

 » Index

Three distinct groups of system catalog views are created by ALLBASE/SQL:

  • Views owned by special user SYSTEM

  • Views owned by special user CATALOG

  • Pseudotables owned by special user SYSTEM

The SYSTEM views contain information about database objects owned by all users, and access is restricted to users with DBA authority or SELECT authority on the SYSTEM views. The DBA can grant SELECT on these views to other users. SYSTEM views are used to perform administration tasks such as monitoring system usage to improve performance and monitoring physical storage to determine when to add DBEFiles.

The CATALOG views contain information about database objects owned by a particular user. These views permit users without DBA authority or SELECT authority on the SYSTEM views to examine system catalog information for objects to which they have access.

In addition to system and catalog views, ALLBASE/SQL generates a set of pseudotables. These contain statistical data, including counts and other runtime information about system usage. Pseudotables are generated by SQLCore each time they are accessed. They reside in shared memory, and, although formatted to appear like tables, they are not physically stored in the system catalog. Pseudotables are owned by SYSTEM, and are accessible only to users with DBA authority.

Summary of System Catalog Views by Function

Table 8-1 “System Catalog Views by Function” shows the system catalog views arranged according to their function.

Table 8-1 System Catalog Views by Function

FunctionName of ViewDescription
User AuthoritySYSTEM.COLAUTH, CATALOG.COLAUTHUPDATE authority on specific columns in a table
 SYSTEM.GROUP, CATALOG.GROUPAuthorization groups
 SYSTEM.MODAUTH, CATALOG.MODAUTHRUN authority on programs
 SYSTEM.PROCAUTH, CATALOG.PROCAUTHEXECUTE authority on procedures
 SYSTEM.SPACEAUTH, CATALOG.SPACEAUTHTABLESPACE and SECTIONSPACE authority for a DBEFileSet
 SYSTEM.SPECAUTH, CATALOG.SPECAUTHSPECIAL authorities
 SYSTEM.INSTALLAUTH, CATALOG.INSTALLAUTHINSTALL authority
 SYSTEM.TABAUTH, CATALOG.TABAUTHAuthorities for operations on tables and views
Object DefinitionsSYSTEM.CHECKDEF, CATALOG.CHECKDEFCheck constraint definitions
 SYSTEM.COLDEFAULT, CATALOG.COLDEFAULTDefaults for each column
 SYSTEM.COLUMN, CATALOG.COLUMNColumns in tables and views
 SYSTEM.CONSTRAINT, CATALOG.CONSTRAINT Constraints defined on tables and views
 SYSTEM.CONSTRAINTCOL, CATALOG.CONSTRAINTCOLColumns with a unique, referential,, check constraint
 SYSTEM.CONSTRAINTINDEX, CATALOG.CONSTRAINTINDEX Indexes in constraints
 SYSTEM.HASH, CATALOG.HASHHash structures
 SYSTEM.INDEX, CATALOG.INDEXIndexes on tables
 SYSTEM.PARAMDEFAULT, CATALOG.PARAMDEFAULT Defaults for parameters in procedures
 SYSTEM.PARAMETER, CATALOG.PARAMETERParameters in procedures
 SYSTEM.PROCEDURE, CATALOG.PROCEDUREProcedures
 SYSTEM.PROCEDUREDEF, CATALOG.PROCEDUREDEFProcedure definitions
 SYSTEM.PROCRESULT, CATALOG.PROCRESULTProcedure results
 SYSTEM.RULE , CATALOG.RULERules
 SYSTEM.RULECOLUMN , CATALOG.RULECOLUMNColumns listed for a rule triggered by the UPDATE statement type
 SYSTEM.RULEDEF, CATALOG.RULEDEFRule definitions
 SYSTEM.SECTION, CATALOG.SECTIONSections and views
 SYSTEM.TABLE, CATALOG.TABLETables and views
 SYSTEM.VIEWDEF, CATALOG.VIEWDEFView definitions
 SYSTEM.PARTITIONPartition information
 SYSTEM.IMAGEKEY, CATALOG.IMAGEKEYMaster and detail dataset keys associated with TurboIMAGE databases attached to DBE
 SYSTEM.TPINDEX, CATALOG.TPINDEXThird-party indexes used in TurboIMAGE database attached to DBE
Storage Management SYSTEM.DBEFILEDBEFiles
 SYSTEM.DBEFILESETDBEFileSets
 SYSTEM.SPACEDEFAULTDefault TABLESPACE and SECTIONSPACE DBEFileSets
 SYSTEM.TEMPSPACETempSpace names
System Usage and Statistics (pseudotables)SYSTEM.ACCOUNTI/O resource currently in use
 SYSTEM.CALLCurrent DBCore calls
 SYSTEM.COUNTERInternal system counters
 SYSTEM.TRANSACTIONCurrent transactions
 SYSTEM.USERUsers currently accessing the DBEnvironment

 

Using the System Catalog

ALLBASE/SQL creates and initializes the system catalog during DBEnvironment configuration. Thereafter, you query the system views and pseudotables to obtain required information. All view names must be fully qualified when querying the system catalog.

As a DBA, you have limited capabilities to access and alter the base system tables owned by HPRDBSS and STOREDSECT. For example, you cannot read or write directly to these tables. You cannot issue any of the following statements on the system catalog base tables:

   ALTER TABLE (except SetTypeSpecification)

   CREATE INDEX

   DELETE

   DROP INDEX

   DROP TABLE

   GRANT

   INSERT

   LOCK TABLE

   REVOKE

   TRANSFER OWNERSHIP

   UPDATE


However, you can issue some statements on the base system tables, which you can use to tune the DBEnvironment for concurrency and performance. For example, you can

  • Use ALTER TABLE to change the base system table locking. For example, the DBA may decide to change the HPRDBSS.SECTION table from PUBLIC to PUBLICROW to help resolve concurrency problems associated with section validation.

  • Use UPDATE STATISTICS on the base system tables to provide up-to-date statistics for the optimizer in optimizing queries on the system catalog views.

Through the SYSTEM.TABLE view, you can see that the HPRDBSS and STOREDSECT tables exist. However, you cannot see any other information, such as columns and indexes, about the HPRDBSS and STOREDSECT tables. The definitions of the system catalog views and pseudotables are complete in the system catalog.

System Catalog Views

System views are like all other views in that statements normally not allowed on views cannot be executed on the system views. In addition, the following statements, normally allowed on views, are not allowed on system views:

   DELETE

   DROP VIEW

   GRANT (except SELECT)

   INSERT

   REVOKE (except SELECT)

   TRANSFER OWNERSHIP

   UPDATE


You can access the system views with SELECT statements like the following:

   isql=> SELECT * FROM System.DBEFile;

   isql=> SELECT * FROM System.Table

   > WHERE Owner='SYSTEM';

   isql=> SELECT IndexName, TableName FROM System.Index

   > WHERE Cluster=1;


Because the owner of the system views is SYSTEM, you must fully qualify the names of all system views.

Partition values are stored in the system catalog. You can verify the attributes of table partitions by examining the SYSTEM.TABLE and the SYSTEM.PARTITION views.

Using UPDATE STATISTICS on System Views

The UPDATE STATISTICS statement, which is not normally allowed on a view, is accepted on system views. A user with DBA authority can perform an UPDATE STATISTICS on a system view. ALLBASE/SQL makes an exception for the system views so that the DBA may monitor the system catalog for storage use and performance tuning. The following system views are updated by the UPDATE STATISTICS statement:

   SYSTEM.COLUMN          SYSTEM.CONSTRAINTINDEX   SYSTEM.DBEFILE

   SYSTEM.DBEFILESET      SYSTEM.HASH              SYSTEM.INDEX

   SYSTEM.TABLE


You cannot use UPDATE STATISTICS on CATALOG views, and UPDATE STATISTICS does not update the following pseudotables:

   SYSTEM.ACCOUNT         SYSTEM.CALL              SYSTEM.COUNTER

   SYSTEM.TRANSACTION     SYSTEM.USER


Initially, only users with DBA authority have SELECT authority on views owned by SYSTEM. SELECT authority can be granted to non-DBA users. Views can be created on system views to grant partial access to non-DBA users. If you do not want to restrict access to system views, you can grant SELECT authority to the special DBEUserID PUBLIC. However, you also have the option of keeping the contents of the DBEnvironment confidential.

Locking of the System Catalog

Many ALLBASE/SQL statements have the effect of obtaining locks on parts of the system catalog. In particular, UPDATE STATISTICS acquires many locks that can affect concurrency. This overhead can affect performance considerably. Refer to the appendix, "Locks Held on the System Catalog by SQL Statements," for a complete list of locks obtained on the system catalog by ALLBASE/SQL statements.

The rest of this chapter contains the column definition for each system view, plus a brief description of the purpose of the view, and a sample SELECT. The examples contain the DBEUserIDs, tables, indexes, views, groups, and other objects from the sample DBEnvironment. The columns of each view are listed in the order in which they are created.

Feedback to webmaster