记住下面几个例子就好了,执行之前要连上一个db
db2 grant dbadm on database to user db2admin
db2 grant insert on table sales to group grp1
db2 revoke dbadm on database from user db2admin
| Column Name | Data Type | Description |
|---|---|---|
| TABSCHEMA | VARCHAR(128) | Stores the schema name on which the database object is defined |
| TABNAME | VARCHAR(128) | Stores the name of the database object, such as table, view, nickname, or an alias |
| TYPE | CHAR(1) | Identifies the database object as a table, view, alias, or a nickname (The type value 'T' means table; 'V' means view; 'N' means nickname; and 'A' means alias.) |
| COLCOUNT | SMALLINT | Number of columns in the table or view |
| KEYCOLUMNS | SMALLINT | Number of columns that constitute the primary key |
| KEYINDEXID | SMALLINT | Index ID for the primary key |
| KEYUNIQUE | SMALLINT | Number of unique constraints in the table or view |
| Column Name | Data Type | Description |
|---|---|---|
| VIEWSCHEMA | VARCHAR(128) | Schema name for the view |
| VIEWNAME | VARCHAR(128) | Name of the view |
| DEFINER | VARCHAR(128) | User who created the view |
| VIEWCHECK | CHAR(1) | Type of view checking defined for this view: |
| READONLY | CHAR(1) | Defines whether the view is read only or not: |
| VALID | CHAR(1) | Determines the validity of the view: |
| TEXT | CLOB(64K) | DDL text for view |
| Column Name | Data Type | Description |
|---|---|---|
| INDSCHEMA | VARCHAR(128) | Name of the schema on which the index is defined |
| INDNAME | VARCHAR(18) | Index name |
| DEFINER | VARCHAR(128) | User who created the index |
| TABSCHEMA | VARCHAR(128) | Stores the schema name of the table on which the index is defined |
| TABNAME | VARCHAR(128) | Stores the name of the table for which index is defined |
| COLNAMES | VARCHAR(640) | List of columns in the index |
| UNIQUERULE | CHAR(1) | Determines whether the index is unique or not: |
| INDEXTYPE | CHAR(4) |
| Column Name | Data Type | Description |
|---|---|---|
| TRIGSCHEMA | VARCHAR(128) | Name of the schema on which the trigger is defined |
| TRIGNAME | VARCHAR(18) | Trigger name |
| DEFINER | VARCHAR(128) | User who created the index |
| TABSCHEMA | VARCHAR(128) | Stores the schema name of the table for which the trigger is defined |
| TABNAME | VARCHAR(128) | Name of table for which the trigger is defined |
| TRIGTIME | CHAR(1) | |
| TRIGEVENET | CHAR(1) | Event for which the trigger is defined: |
| GRANULARITY | CHAR(1) | Determines whether the trigger is executed per statement or per row: |
| TEXT | CLOB(64K) | Full text of the trigger statement |
ALTER TABLEVOLATILE CARDINALITY
COM.ibm.db2.jdbc.app.DB2Driver,物理表示是 db2java.zip 文件DB2Driver, 物理表示是 db2jcc.jar 文件, 对于不同的系统还需要个license的jar