本节主要内容:
oracle修改表结构与数据字典表。
修改表结构,使用如下的二个命令:
alter
drop
一, alter
1, 字段
2, 约束
二, drop
三, 数据字典表
0, dict 数据字典表 的 表
TABLE_NAME 数据字典表名
COMMENTS 描述
1, user_tables
当前用户下所有表的描述
SQL> desc user_tables;
SQL> select * from dict where table_name = 'USER_TABLES';
SQL> select table_name from user_tables;
2, user_views
Description of the user's own views
SQL> desc user_views;
SQL> select * from dict where table_name = 'USER_VIEWS';
SQL> select view_name from user_views;
3, user_constraints
Constraint definitions on user's own tables
SQL> desc user_constraints
SQL> select * from dict where table_name = 'USER_CONSTRAINTS';
cat tab
SQL> desc cat
Name Null? Type
----------- --------- -----------
TABLE_NAME NOT NULL VARCHAR2(30)
TABLE_TYPE VARCHAR2(11)
SQL> desc tab
Name Null? Type
----------- --------- -----------
TNAME NOT NULL VARCHAR2(30)
TABTYPE VARCHAR2(7)
CLUSTERID NUMBER
SQL> select * from dict where table_name='CAT';
TABLE_NAME COMMENTS
---------- -----------------------------------
CAT Synonym for USER_CATALOG
SQL> select * from dict where table_name='USER_CATALOG';
TABLE_NAME COMMENTS
-------------------- -------------------------
USER_CATALOG Tables, Views, Synonyms and Sequences owned by the user