您当前的位置: 首页 >  oracle

顺其自然~

暂无认证

  • 2浏览

    0关注

    1317博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文

Oracle表空间常用操作

顺其自然~ 发布时间:2019-06-05 10:42:41 ,浏览量:2

1、查询表空间使用情况

select
  a.a1 表空间名称,
  c.c2 类型,
  c.c3 区管理,
  b.b2/1024/1024 表空间大小M,
  (b.b2-a.a2)/1024/1024 已使用M,
    (a.a2)/1024/1024 未使用M,
  substr((b.b2-a.a2)/b.b2*100,1,5) 利用率
  from
  (select tablespace_name a1, sum(nvl(bytes,0)) a2 from dba_free_space group by
tablespace_name) a,
  (select tablespace_name b1,sum(bytes) b2 from dba_data_files group by tablespace_name)
b,
  (select tablespace_name c1,contents c2,extent_management c3 from dba_tablespaces) c
  where a.a1=b.b1 and c.c1=b.b1;

2、查询所有用户表使用大小的前三十名

select * from (select segment_name,bytes from dba_segments where owner = USER order by bytes desc ) where rownum             
关注
打赏
1662339380
查看更多评论
0.0406s