quinta-feira, 28 de novembro de 2013

Objetos fragmentados canditatos a reconstrucao


COL C1 FORMAT A14
 COL C2 FORMAT 999,999,999
 BREACK ON OWNER ON TABLESPACE_NAME
 SELECT OWNER, TABLESPACE_NAME, SEGMENT_NAME||
         decode(SEGMENT_TYPE,'TABLE','[T]', 'INDEX', '[I]',
                           'ROLLBACK','[R]', '[O]') segment_name
       , sum(BYTES) C2,
          decode(count(*),1,to_char(count(*)),
                   2,to_char(count(*)),
                   3,to_char(count(*)),
                   4,to_char(count(*)),
                   5,to_char(count(*)),
                   to_char(count(*))||' < Re-Construir') C1
  FROM DBA_EXTENTS
  WHERE OWNER NOT IN ('SYS','SYSTEM','OWNER1')
  GROUP BY OWNER, TABLESPACE_NAME, SEGMENT_NAME||
         decode(SEGMENT_TYPE,'TABLE','[T]', 'INDEX', '[I]',
             'ROLLBACK','[R]', '[O]')
  HAVING count(*) > 5;

Nenhum comentário:

Postar um comentário