segunda-feira, 25 de novembro de 2013

7_Total_MB_Objeto_Owner.sql


7_Total_MB_Objeto_Owner.sql

UNDEFINE Owner
COLUMN "Mbytes Tables" Format 999,999.99
COLUMN "Mbytes Indexes" Format 999,999.99
COLUMN "Mbytes SUM" Format 999,999.99
select a.owner "Owner", a.Tables "Mbytes Tables", b.Indexes "Mbytes Indexes", a.Tables+b.Indexes "Mbytes SUM"
from   
(select owner, sum(a.bytes)/(1024*1024) Tables
from   dba_segments a
where  segment_type = 'TABLE'
  and  owner=upper('&&Owner')
group  by owner) a,
(select owner, sum(b.bytes)/(1024*1024) Indexes
from   dba_segments b
where  segment_type='INDEX'
  and  owner=upper('&&Owner')
group  by owner) b
/
UNDEFINE POWNER

Nenhum comentário:

Postar um comentário