加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

Oracle_071_lesson_p12

发布时间:2020-12-12 13:26:47 所属栏目:百科 来源:网络整理
导读:数据字典Data Dictionary 管理业务数据 、表、视图、索引 数据字典: 1、基表 base tables 2、用户视图 user accessible views 类型分类:(视图前缀 view prefix) 1、USER 2、ALL 3、DBA 4、V$ 动态视图 desc dictionary 含有字段 table_name,comments 注
数据字典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_COMMENTSUSER_COL_COMMENTSALL_TAB_COMMNENTSUSER_TAB_COMMENTS

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读