ITPub博客

首页 > Linux操作系统 > Linux操作系统 > Identify Tables That Need Space

Identify Tables That Need Space

原创 Linux操作系统 作者:xhailiang 时间:2007-05-21 00:00:00 0 删除 编辑
This tip lets you identify tables that need more than a specified amount of space. This example uses a size of 1GB.

SELECT segment_type, SUBSTR (segment_name, 1, 30),
SUBSTR (tablespace_name, 1, 30),
SUM (TRUNC (BYTES / (1024 * 1024 * 1024), 2)) "size in GB"
FROM dba_segments
WHERE segment_type IN ('TABLE', 'TABLE PARTITION', 'TABLE SUBPARTITION')
AND owner IN ('BO_USER', 'DWH_OWNER', 'OWBTARGET', 'SM_OWNER')
HAVING SUM (TRUNC (BYTES / (1024 * 1024 * 1024), 2)) > 1
GROUP BY segment_type,
SUBSTR (segment_name, 1, 30),
SUBSTR (tablespace_name, 1, 30)

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/308563/viewspace-171984/,如需转载,请注明出处,否则将追究法律责任。

下一篇: checkpoint_1
请登录后发表评论 登录
全部评论

注册时间:2008-02-17

  • 博文量
    270
  • 访问量
    414366