数据字典Data Dictionary

管理业务数据 、表、视图、索引 数据字典: 1、基表 base tables 2、用户视图 user accessible views

类型分类:(视图前缀 view prefix) 1、USER 2、ALL 3、DBA 4、V$ 动态视图

desc dictionary

含有字段 table_name, comments 注释 select * from dictionary where table_name='USER_OBJECTS';

column 列名 format a30 ; 修改显示的格式

select * from dictionary where table_name like '%COL%' and table_name like '%TAB%';

select * from dictionary where table_name like '%MEM%';

desc user_objects 用户对象

select object_name,object_type,status,created from user_objects order by object_type;

案例:对象ID 达到10亿出现过崩溃的情况;

ALL_OBJECTS

desc user_tables

select table_name,tablespace_name from user_tables;

'%PART%' 分区 PCT_FREE :块的剩余 PCT_USED:块的使用率 DEGREE :并行是否开启

desc user_tab_columns 表字段

select table_name,column_name from user_table_columns where column_name='DEPARTMENT_ID'; 查DEPARTMENT_ID在哪些表里有

desc user_constraints 用户约束

select constraint_name,constraint_type,search_condition,r_constraint_name,delete_rule,status from user_constraints where table_name='EMPLOYEES';

desc user_cons_columns

select constraint_name,column_name from user_cons_columns where table_name='EMPLOYEES';

comment 对表加注释

表加注释: comment on table emp is 'emp information'; 列加注释:comment on column emp.employee_id is ' emp........';

注释: 4个表里查 ALL_COL_COMMENTS USER_COL_COMMENTS ALL_TAB_COMMNENTS USER_TAB_COMMENTS