hagendaz

场景:在做数据库巡检时,检查大表是必不可少的操作,可以查看各表占用表空间的大小

代码:

1 select t.owner,t.segment_name,t.tablespace_name,bytes/1024/1024/1024 as sizes,q.num_rows,t.segment_type
2   from dba_segments t
3   left join dba_tables q
4     on t.segment_name=q.table_name
5    and t.owner=q.owner
6  where t.segment_type=\'TABLE\'
7    and t.tablespace_name=\'TS_AAA\'  --需要查看的表空间
8  order by 4 desc

 

分类:

技术点:

相关文章:

  • 2021-11-29
  • 2021-12-22
  • 2021-12-07
  • 2021-07-11
猜你喜欢
  • 2022-12-23
  • 2021-12-23
  • 2021-05-27
  • 2022-01-18
  • 2022-12-23
  • 2021-12-04
相关资源
相似解决方案