FairCom DB SQL maintains a set of system tables for storing information about table spaces, tables, columns, indexes, constraints, and privileges.
FairCom DB SQL data definition statements and GRANT and REVOKE statements update system catalog tables. Users have read access to the system catalog tables. The database administrator has update access to the tables, but should avoid modifying them directly.
There are two types of tables in the system catalog: base tables and extended tables. Base tables store the information on the table spaces, tables, columns, and indexes that make up the database. There are four system tables:
- systables
- systblspaces
- syscolumns
- sysindexes
The rest of the system catalog tables are extended tables. They contain detailed information on database objects and statistical information.
The owner of the system tables is admin. If you connect to a FairCom DB SQL environment with a User ID other than admin, you need to qualify references to the tables in FairCom DB SQL queries. For example:
SELECT * FROM ADMIN.SYSTABLES
The following table shows details of the columns in each system table. Here is the FairCom DB SQL query that generated the data for this table. You can modify it to generate a similar list that includes user-created tables by omitting the line: and st.tbltype = ‘S’.
select sc.tbl 'Table', sc.col 'Column',
sc.coltype 'Data Type', sc.width 'Size'
from admin.syscolumns sc, admin.systables st
where sc.tbl = st.tbl
and st.tbltype = 'S'
order by sc.tbl, sc.id
System Catalog Tables Definitions
The following table lists all the tables in the system catalog. It gives a brief description of their purpose and lists the column definitions for every table.
System Catalog Table Definitions
Table |
Purpose |
Column |
Data Type |
Size |
|---|---|---|---|---|
sys_chk_constrs |
Contains the CHECK clause for each check constraint specified on a user table. |
chkclause |
varchar |
8192 |
sys_chkcol_usage |
Contains one entry for each column on which the check constraint is specified |
cnstrname |
varchar |
64 |
sys_keycol_usage |
Contains one entry for each column on which primary or foreign key is specified |
cnstrname |
varchar |
64 |
sys_ref_constrs |
Contains one entry for each referential constraint specified on a user table |
cnstrname |
varchar |
64 |
sys_tbl_constrs |
Contains one entry for each table constraint. |
cnstrname |
varchar |
64 |
sysattachtbls |
Contains one entry for each table link. |
db_link |
varchar |
64 |
sysbigintstat |
Contains one row for each bigint column. Used by the optimizer, each row contains a sampling of values in the column. |
colid val10 |
integer |
4 |
syscalctable |
Contains exactly one row with a single column with a value of 100. |
fld |
integer |
4 |
syscharstat |
Contains one row for each char column. Used by the optimizer, each row contains a sampling of values in the column. |
colid |
integer |
4 |
syscolauth |
Contains the update privileges held by users on individual columns of tables in the database. |
col |
varchar |
64 |
syscolstat |
Provides mapping information between syscolumns and sys*stat tables. |
colid |
integer |
4 |
syscolumns |
Contains one row for each column of every table in the database. |
charset |
varchar |
64 |
sysdatatypes |
Contains information on each data type supported by the database. |
autoincr |
smallint |
2 |
sysdatestat |
Contains one row for each date column. Used by the optimizer, each row contains a sampling of values in the column. |
colid |
integer |
4 |
sysdblinks |
Contains one entry for each data source link. |
host |
varchar |
128 |
sysdbauth |
Contains the database-wide privileges held by users. |
dba_acc |
varchar |
1 |
sysfloatstat |
Contains one row for each float column. Used by the optimizer, each row contains a sampling of values in the column. |
colid |
integer |
4 |
sysgroupauth |
Contains privileges held by user groups |
grantor |
[n]varchar |
64 |
sysgroups |
Contains list of user groups |
groupname |
[n]varchar |
64 |
sysgroupusers |
Contains list of users in each group |
username |
[n]varchar |
64 |
sysidentity |
Contains one row for each identity field in the database. Used for SQL IDENTITY support. |
owner |
varchar |
64 |
sysidxstat |
Contains statistics for each index in the database. |
idxid |
integer |
4 |
sysindexes |
Contains one row for each component of an index in the database. For an index with n components, there will be n rows in this table. |
colname |
varchar |
64 |
sysintstat |
Contains one row for each integer column. Used by the optimizer, each row contains a sampling of values in the column. |
colid |
integer |
4 |
sysmoneystat |
Contains one row for each money column. Used by the optimizer, each row contains a sampling of values in the column. |
colid |
integer |
4 |
sysncharstat |
Contains one row for each national char() column. Used by the optimizer, each row contains a sampling of values in the column. |
colid |
integer |
4 |
sysnumstat |
Contains one row for each numeric column. Used by the optimizer, each row contains a sampling of values in the column. |
colid |
integer |
4 |
sysnvarcharstat |
Contains one row for each national varchar column. Used by the optimizer, each row contains a sampling of values in the column. |
colid |
integer |
4 |
sysprocbin |
Contains one or more rows for each stored procedure and trigger in the database, which contain the compiled Java bytecode for their procedure or trigger. |
id |
integer |
4 |
sysproccolumns |
Contains one row for each column of a stored procedure’s result set. |
argtype |
varchar |
64 |
sysprocedures |
Contains one row for each stored procedure in the database. |
creator |
varchar |
64 |
sysproctext |
Contains one or more rows for each stored procedure and trigger in the database, which contain the Java source code for their procedure or trigger. |
id |
integer |
4 |
sysrealstat |
Contains one row for each real column. Used by the optimizer, each row contains a sampling of values in the column. |
colid |
integer |
4 |
syssmintstat |
Contains one row for each smallint column. Used by the optimizer, each row contains a sampling of values in the column. |
colid |
integer |
4 |
syssynonyms |
Contains one entry for each synonym in the database. |
ispublic |
smallint |
2 |
systabauth |
Contains privileges held by users for tables, views, and procedures. |
alt |
varchar |
1 |
systables |
Contains one row for each table in the database. |
creator |
varchar |
64 |
systblspaces |
No longer used. |
id |
integer |
4 |
systblstat |
Contains table statistics for each user table. |
card |
integer |
4 |
systimestat |
Contains one row for each time column. Used by the optimizer, each row contains a sampling of values in the column. |
colid |
integer |
4 |
systinyintstat |
Contains one row for each tinyint column. Used by the optimizer, each row contains a sampling of values in the column. |
colid |
integer |
4 |
systrigcols |
Contains one row for each column specified in each UPDATE trigger in the database. |
colid |
integer |
4 |
systrigger |
Contains one row for each trigger in the database. |
owner |
varchar |
64 |
systsstat |
Contains one row for each timestamp column. Used by the optimizer, each row contains a sampling of values in the column. |
colid |
integer |
4 |
sysvarcharstat |
Contains one row for each varchar column. Used by the optimizer, each row contains a sampling of values in the column. |
colid |
integer |
4 |
sysviews |
Contains information on each view in the database. |
creator |
varchar |
64 |