oracle dba_segments 查询不出结果

前两天刚装了个11.2.0.4 AIX环境,建了一堆表空间,导入了2T数据。
结果执行下面命令的时候,死活不出结果。
select segment_type,sum(bytes)/1024/1024/1024 from dba_segments where owner ='USER1' group by segment_type;

cancel的时候报错
异常退出DBMS_SPACE_ADMIN

非常奇怪,为什么一个查询操作会用到这个包呢?

百度上搜了一下,发现eagle大师的文章提到了一点
http://www.dbafan.com/blog/?p=146
解决方法是运行procedure: TABLESPACE_FIX_SEGMENT_EXTBLKS

DBMS_SPACE_ADMIN.TABLESPACE_FIX_SEGMENT_EXTBLKS(‘tablespace_name’);

Issuing DBMS_SPACE_ADMIN.TABLESPACE_FIX_SEGMENT_EXTBLKS fixes the DBA_SEGMENTS values. The tablespace
must be kept online and read/write when this procedure is called. Runing this procedure requires COMPATIBLE parameter to be set to 10.0.0.0 or greater.

The procedure fixes extents, blocks and bytes in the segment headers to synchronize seg$ and
segment header entries.
It holds the allocation enqueue for the tablespace till the command is completed and this may delay some sort of operations in this tablespace (new extent allocation, deallocate extent, etc.). So it needs to be run during an idle period.


我猜想可能也是我这边的表空间有问题,于是对所有的业务表空间执行了一下DBMS_SPACE_ADMIN.TABLESPACE_FIX_SEGMENT_EXTBLKS

之后再查询就非常快的出结果了。

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值