Derby-10.11學習筆記(三)Derby系統表及存儲過程

魯春利的工做筆記,誰說程序員不能有文藝範?程序員



SQL標準裏面是有schema的概念的,只是不一樣的數據庫在具體實現的時候出現了差異。在Derby、SQLServer是支持schema的,而Oracle中schema應該對應其實例(orcl),而MySQL中schema應該對應的是其database。
經過create schema lucl;在Derby中建立一個schema,經過DBeaver工具查看:sql

wKiom1ZhXAaAGl6pAAESQJEv9t4129.jpg


Derby的系統表位於SYS schema中,但SYS卻不是系統默認的schema,所以查詢表時須要指定SYS前綴,SYS.TABLE_NAME。Derby的系統表只能查詢,沒法經過命令修改。數據庫

ij> show tables in sys;
TABLE_SCHEM         |TABLE_NAME                    |REMARKS
------------------------------------------------------------------------
SYS                 |SYSALIASES                    |
SYS                 |SYSCHECKS                     |
SYS                 |SYSCOLPERMS                   |
SYS                 |SYSCOLUMNS                    |
SYS                 |SYSCONGLOMERATES              |
SYS                 |SYSCONSTRAINTS                |
SYS                 |SYSDEPENDS                    |
SYS                 |SYSFILES                      |
SYS                 |SYSFOREIGNKEYS                |
SYS                 |SYSKEYS                       |
SYS                 |SYSPERMS                      |
SYS                 |SYSROLES                      |
SYS                 |SYSROUTINEPERMS               |
SYS                 |SYSSCHEMAS                    |
SYS                 |SYSSEQUENCES                  |
SYS                 |SYSSTATEMENTS                 |
SYS                 |SYSSTATISTICS                 |
SYS                 |SYSTABLEPERMS                 |
SYS                 |SYSTABLES                     |
SYS                 |SYSTRIGGERS                   |
SYS                 |SYSUSERS                      |
SYS                 |SYSVIEWS                      |

已選擇 22 行
ij>

The SYSALIASES table describes the procedures, functions, user-defined types, and user-defined aggregates in the database.

The SYSCHECKS table describes the check constraints within the current database.

The SYSCOLPERMS table stores the column permissions that have been granted but not revoked.bash


The SYSCOLUMNS table describes the columns within all tables in the current database.

The SYSCONGLOMERATES table describes the conglomerates(總體狀況) within the current
database. A conglomerate is a unit of storage and is either a table or an index.

The SYSCONSTRAINTS table describes the information common to all types of constraints within the current database (currently, this includes primary key, unique, foreign key, and check constraints).ide


The SYSDEPENDS table stores the dependency relationships between persistent objects in the database.函數


The SYSFILES table describes jar files stored in the database.

The SYSFOREIGNKEYS table describes the information specific to foreign key constraints in the current database.

The SYSKEYS table describes the specific information for primary key and unique constraints within the current database.

The SYSPERMS table describes the USAGE permissions for sequence generators, user-defined types, and user-defined aggregates.

The SYSROLES table stores the roles in the database.

The SYSROUTINEPERMS table stores the permissions that have been granted to routines.

The SYSSCHEMAS table describes the schemas within the current database.

The SYSSEQUENCES table describes the sequence generators in the database.

The SYSSTATEMENTS table describes the prepared statements in the database.

The SYSSTATISTICS table describes the statistics within the current database.

The SYSTABLEPERMS table stores the table permissions that have been granted but not revoked.

The SYSTABLES table describes the tables and views within the current database.

The SYSTRIGGERS table describes the database's triggers.

The SYSUSERS table stores user credentials(用戶憑證) when NATIVE authentication is enabled.

The SYSVIEWS table describes the view definitions within the current database.工具


Derby默認提供的存儲過程以下this

SYSCS_SET_DATABASE_PROPERTY
SYSCS_COMPRESS_TABLE
SYSCS_CHECKPOINT_DATABASE
SYSCS_FREEZE_DATABASE
SYSCS_UNFREEZE_DATABASE
SYSCS_BACKUP_DATABASE
SYSCS_BACKUP_DATABASE_AND_ENABLE_LOG_ARCHIVE_MODE
SYSCS_DISABLE_LOG_ARCHIVE_MODE
SYSCS_SET_RUNTIMESTATISTICS
SYSCS_SET_STATISTICS_TIMING
SYSCS_EXPORT_TABLE
SYSCS_EXPORT_QUERY
SYSCS_IMPORT_TABLE
SYSCS_IMPORT_DATA
SYSCS_BULK_INSERT
SYSCS_INPLACE_COMPRESS_TABLE
SYSCS_BACKUP_DATABASE_NOWAIT
SYSCS_BACKUP_DATABASE_AND_ENABLE_LOG_ARCHIVE_MODE_NOWAIT
SYSCS_EXPORT_TABLE_LOBS_TO_EXTFILE
SYSCS_EXPORT_QUERY_LOBS_TO_EXTFILE
SYSCS_IMPORT_TABLE_LOBS_FROM_EXTFILE
SYSCS_IMPORT_DATA_LOBS_FROM_EXTFILE
SYSCS_RELOAD_SECURITY_POLICY
SYSCS_SET_USER_ACCESS
SYSCS_EMPTY_STATEMENT_CACHE
SYSCS_UPDATE_STATISTICS
SYSCS_SET_XPLAIN_MODE
SYSCS_SET_XPLAIN_SCHEMA
SYSCS_CREATE_USER
SYSCS_RESET_PASSWORD
SYSCS_MODIFY_PASSWORD
SYSCS_DROP_USER
SYSCS_DROP_STATISTICS
SYSCS_INVALIDATE_STORED_STATEMENTS
SYSCS_REGISTER_TOOL


內置的系統函數spa

SYSCS_GET_DATABASE_PROPERTY
SYSCS_CHECK_TABLE
SYSCS_GET_RUNTIMESTATISTICS
SYSCS_GET_USER_ACCESS
SYSCS_GET_XPLAIN_MODE
SYSCS_GET_XPLAIN_SCHEMA
SYSCS_PEEK_AT_SEQUENCE
SYSCS_PEEK_AT_IDENTITY
相關文章
相關標籤/搜索