- 9
- 0
- 约3.57千字
- 约 7页
- 2017-12-22 发布于河南
- 举报
查询表大小创建时间
查询表大小创建时间
select t.table_name,t.tablespace_name,t.num_rows,t.last_analyzed ,m.partition_name,m.sizeM,ob.created
from user_tables t, user_objects ob,
(select segment_name,partition_name,tablespace_name, sum(bytes)/(1024*1024) as sizeM
from user_segments t
where segment_type=upper(table)
group by tablespace_name,segment_name,partition_name
) m
where t.table_name=m.segment_name
and ob.object_type=upper(table)
and ob.object_name=t.table_name;
1、表:
user_segments user_objects ob user_tables
查看表大小和创建时间
select t.table_name,t.tablespace_name,t.num_rows,t.last_analyzed ,m.partition_name,m.sizeM,ob.created
from user_tables t, user_objects ob,
(select segment_name,partition_name,tablespace_name, sum(bytes)/(1024*1024) as sizeM
from user_segments t
where segment_type=upper(table)
group by tablespace_name,segment_name,partition_name
) m
where t.table_name=m.segment_name
and ob.object_type=upper(table)
and ob.object_name=t.table_name;
2、索引:
查看索引个数和类别
select index_name,index_type,table_name
from user_indexes order by table_name;
查看索引被索引的字段
select * from user_ind_columns where index_name=upper(index_name);
查看索引或表的大小
select sum(bytes)/(1024*1024) as size(M) from user_segments
where segment_name=upper(index_name);
3、查看序列号,last_number是当前值
select * from user_sequences
4、视图
select view_name from user_views;
5、同义词
查看同义词的名称
select * from user_synonyms;
6、约束条件
查看某表的约束条件
select constraint_name, constraint_type,search_condition, r_constraint_name
from user_constraints where table_name = upper(table_name);
select c.constraint_name,c.constraint_type,cc.column_name
from user_constraints c,user_cons_columns cc
where c.owner = upper(table_owner) and c.table_name = upper(table_name)
and c.owner = cc.owner and c.constraint_name = cc.constraint_name
order by cc.position;
7、存储函数和过程
查看函数和过程的状态
select object_name,status from user_objects where object_type=FUNCTION;
sel
您可能关注的文档
最近下载
- 个人简历表格填写2021简历模板.docx VIP
- 针灸推拿学习题库(附答案).docx VIP
- 毕业设计(论文)-五边形凸台零件铣削加工.doc VIP
- 2026届山东省淄博市高三上学期期末考试(摸底质量检测)历史试题(含答案).docx VIP
- 常见词组固定搭配.pdf VIP
- 2023年山东泰安中考地理试题及答案.pdf VIP
- 胎动管理专家共识最新2025.pptx
- (小学综合实践课标复习题全.doc VIP
- 0—3岁婴幼儿心理发展与教育 第四章 0-3岁婴幼儿心理发展与教育 课件PPT.pptx VIP
- 0—3岁婴幼儿心理发展与教育 第三章 0-3岁婴幼儿心理发展与教育 课件PPT.pptx VIP
原创力文档

文档评论(0)