前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >Oracle监控异常的表设计

Oracle监控异常的表设计

原创
作者头像
用户1685462
修改2021-09-06 11:03:38
4430
修改2021-09-06 11:03:38
举报
文章被收录于专栏:网站教程
监控失效分区索引
代码语言:javascript
复制
--普通索引
select t.owner,t.index_name,t.table_name,t.blevel,t.num_rows,t.leaf_blocks,t.distinct_keys
from dba_indexes t where t.status='INVALID';
--分区索引
select t2.owner,t1.blevel,t.leaf_blocks,t1.index_name,t2.table_name,t1.partition_name,t1.status
from dba_ind_partitions t1,dba_indexes t2
where t1.index_name=t2.index_name and t1.owner=t2.owner
and t1.status='UNUSABLE';
查找未建分区的大表
查找未建分区的大表
代码语言:javascript
复制
select owner,segment_name,segment_type,sum(bytes/1024/1024/1024) GB from dba_segments
where segment_type='TABLE' 
group by segment_name,segment_type having sum(bytes/1024/1024/1024) >=10
order by GB desc;

检查分区数过多的表

代码语言:javascript
复制
--分区超过100个的
select owner,table_name,partitioning_type,subpartitioning_type from dba_part_tables
where partition_count>=100;

检查分区表大小严重不均衡的
代码语言:javascript
复制
select owner,table_name,num_rows from dba_tab_partitions 
where table_name='RANGE_PART_TAB' order by num_rows desc;

检查哪些全局临时表被收集统计信息
代码语言:javascript
复制
select owner,table_name,last_analyzed,num_rows,blocks from dba_tables
where temporary='Y' and last_analyzed is not null;

检查表中有没有过时的类型字段
代码语言:javascript
复制
select owner,table_name,column_name,data_type 
from dba_tab_columns
where data_type in('LONG','CHAR');

原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。

如有侵权,请联系 cloudcommunity@tencent.com 删除。

原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。

如有侵权,请联系 cloudcommunity@tencent.com 删除。

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 监控失效分区索引
  • 查找未建分区的大表
  • 检查分区表大小严重不均衡的
  • 检查哪些全局临时表被收集统计信息
  • 检查表中有没有过时的类型字段
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档