Hitachi

Hitachi Advanced Database Setup and Operation Guide


B.1 Dictionary table overview

Dictionary tables store table and index definition information as well as DB area information.

HADB provides two types of dictionary tables, base tables and viewed tables.

The following figure shows the relationship between a dictionary table (base table) and a dictionary table.

Figure B‒1: Relationship between a dictionary table (base table) and a dictionary table

[Figure]

Explanation:

Definition information for tables and indexes as well as DB area information is stored in dictionary tables (base tables). A viewed table that is created from a dictionary table (base table) for search purposes becomes a dictionary table.

HADB users can search dictionary tables, but not dictionary tables (base tables).

An HADB user can check definition information of tables and indexes and DB area information by using the SELECT statement to search dictionary tables. When you search dictionary tables, specify MASTER as the schema name.

Organization of this subsection

(1) List of dictionary tables

The following table lists the dictionary tables.

Table B‒1: List of dictionary tables

No.

Dictionary table name

Information stored

Table ID of the dictionary table (base table) that corresponds to the dictionary table

Number of subqueries included in the view definition#

Existence of external reference

1

SQL_TABLES

Stores table definition information of base tables, viewed tables, dictionary tables (base tables), system tables (base tables), dictionary tables, and system tables. Each row stores information for one table.

0x00020001

1

Y

2

SQL_COLUMNS

Stores column definition information of base tables, viewed tables, dictionary tables (base tables), system tables (base tables), dictionary tables, and system tables. Each row stores information for one column.

0x00020002

1

Y

3

SQL_DIV_TABLE

Stores information in locations such as DB areas that store base tables, dictionary tables (base tables), and system tables (base tables). Each row stores information for one table.

0x00020004

1

Y

4

SQL_INDEXES

Stores index definition information for base tables. This table also stores B-tree index definition information for dictionary tables (base tables) and system tables (base tables). Each row stores information for one index.

0x00020003

1

Y

5

SQL_DIV_INDEX

Stores information about DB areas that store indexes of base tables. This table also stores information about DB areas that store B-tree indexes for dictionary tables (base tables) and system tables (base tables). Each row stores information for one index.

0x00020005

1

Y

6

SQL_DBAREAS

Stores DB area definition information. Each row stores information for one DB area.

0x00020006

0

N

7

SQL_SCHEMATA

Stores schema-related definition information. Each row stores information for one schema.

0x00020007

1

Y

8

SQL_VIEWS

Stores viewed table definition information. Each row stores information for one viewed table.

0x00020008

1

Y

9

SQL_VIEW_TABLE_USAGE

Stores the definition information of the underlying tables of a viewed table. Each row stores information for one underlying table.

0x00020009

1

Y

10

SQL_VIEW_OBJECT

Stores information that is used by the system.

There is no dictionary table. There is only a dictionary table (base table).

0x0002000A

--

--

11

SQL_DEFINE_SOURCE

Stores SQL statement information. Each row stores information for one SQL text.

0x0002000B

2

Y

12

SQL_DEFINE_ENVIRONMENT

Stores the environment information that was in effect during view definition or when changing the view definition. Each row stores the environment information of one viewed table.

0x0002000C

2

Y

13

SQL_USERS

Stores HADB user information. Each row stores information on one HADB user.

0x0002000D

1

N

14

SQL_TABLE_CONSTRAINTS

Stores constraint information related to base tables. Each row stores information on one constraint.

0x0002000E

1

Y

15

SQL_INDEX_COLINF

Stores information related to indexed columns. Each row stores information on one indexed column.

0x0002000F

1

Y

16

SQL_KEY_COLUMN_USAGE

Stores information related to columns comprising the primary key and foreign keys. Each row stores information on one column comprising the primary key and foreign keys.

0x00020010

1

Y

17

SQL_REFERENTIAL_CONSTRAINTS

Stores information related to referential constraints. Each row stores information on one referential constraint.

0x00020011

1

Y

18

SQL_TABLE_PRIVILEGES

Stores information related to access privileges for tables. Each row stores one table's worth of information on one authorization identifier granted by a privilege grantor.

0x00020012

1

Y

19

SQL_AUDITS

Stores information related to audit target definitions defined by the CREATE AUDIT statement. Each row stores information for one audit target definition.

0x00020013

0

N

Legend:

Y: The dictionary table's viewed table includes a subquery that performs an external reference. Therefore, you cannot specify the corresponding dictionary table in a multiset value expression subquery.

N: The dictionary table's viewed table does not include a subquery that performs an external reference.

--: Not applicable.

#

If you specified the corresponding dictionary table in a SQL statement subquery, the number that must be added as the number of nests in that subquery is displayed.

Note
  • A dictionary table also stores the table definition information and index definition information of the dictionary table.

  • The data types of the dictionary tables follow HADB's SQL specification.

(2) Times at which a dictionary table is created

A dictionary table is automatically created at the following times:

(3) Scope of information in dictionary tables that can be referenced by HADB users

The scope of information in dictionary tables that can be referenced by HADB users varies according to the privileges they have. The following table shows the dictionary table information that an HADB user can reference.

Note that even for viewed tables specified as an underlying table of the dictionary table, the information a user can reference varies according to the users' privileges. Therefore, even when searching the same viewed table, the HADB user who defined the viewed table and users granted access privileges for that viewed table might not be able to view the same information.

Table B‒2: Dictionary table information that an HADB user can reference

Dictionary table name

Information being referenced

Privilege of HADB user who references dictionary table

DBA privilege

Audit admin privilege

Access privilege

CONNECT privilege

SQL_TABLES

Their own

Y

Y

Y

Y

Other user

Y

Y

C#1

N

MASTER

Y

Y

Y

Y

SQL_COLUMNS

Their own

Y

Y

Y

Y

Other user

Y

N

C#1

N

MASTER

Y

Y

Y

Y

SQL_DIV_TABLE

Their own

Y

Y

Y

Y

Other user

Y

N

C#1

N

MASTER

--

--

--

--

SQL_INDEXES

Their own

Y

Y

Y

Y

Other user

Y

Y

C#1

N

MASTER

Y

Y

Y

Y

SQL_DIV_INDEX

Their own

Y

Y

Y

Y

Other user

Y

N

C#1

N

MASTER

--

--

--

--

SQL_DBAREAS

--

Y

Y

Y

Y

SQL_SCHEMATA

Their own

Y

Y

Y

Y

Other user

Y

Y

C#1

N

MASTER

Y

Y

Y

Y

SQL_VIEWS

Their own

Y

Y

Y

Y

Other user

Y

N

C#1, #3

N

MASTER

Y

Y

Y

Y

SQL_VIEW_TABLE_USAGE

Their own

Y

Y

Y

Y

Other user

Y

Y

C#1, #3

N

MASTER

Y

Y

Y

Y

SQL_DEFINE_SOURCE

Their own

Y

Y

Y

Y

Other user

Y

N

C#1, #3

N

MASTER

--

--

--

--

SQL_DEFINE_ENVIRONMENT

Their own

Y

Y

Y

Y

Other user

Y

N

C#1, #3

N

MASTER

Y

Y

Y

Y

SQL_USERS

Their own

Y

Y

--

Y

Other user

Y

Y

--

N

MASTER

--

--

--

--

SQL_TABLE_CONSTRAINTS

Their own

Y

Y

Y

Y

Other user

Y

N

C#1

N

MASTER

--

--

--

--

SQL_INDEX_COLINF

Their own

Y

Y

Y

Y

Other user

Y

N

C#1

N

MASTER

--

--

--

--

SQL_KEY_COLUMN_USAGE

Their own

Y

Y

Y

Y

Other user

Y

N

C#1

N

MASTER

--

--

--

--

SQL_REFERENTIAL_CONSTRAINTS

Their own

Y

Y

Y

Y

Other user

Y

N

C#1

N

MASTER

--

--

--

--

SQL_TABLE_PRIVILEGES

Their own

C#2

C#2

C#2

C#2

Other user

C#2

N

C#1, #2

N

MASTER

--

--

--

--

SQL_AUDITS

Their own

N

Y

N

N

Other user

N

Y

N

N

MASTER

N

Y

N

N

Legend:

Their own: Information related to a schema or schema object for which the HADB user is the owner (his or her own HADB user information in the case of SQL_USERS).

Other user: Information related to a schema or schema object that another HADB user owns (the HADB user information of other HADB users in the case of SQL_USERS).

MASTER: Information related to dictionary tables and system tables.

Y: Can be referenced.

C: Can be referenced but conditions apply.

N: Cannot be referenced.

--: Not applicable.

#1

Users can reference information related to schema objects for which they have the access privilege, and the schema of those schema objects.

#2

When the target schema object is a viewed table that has been invalidated, users cannot retrieve information from SQL_TABLE_PRIVILEGES about access privileges for the invalidated viewed table.

#3

When the target schema object is a viewed table that has been invalidated, users cannot reference definition information related to the invalidated viewed table.