create or replace view treemap_data_view
as
selectts.nametablespace_name,
0 free_bytes,
ts.blocksize * f.blocksused_bytes,
ts.blocksize * f.blockstotal_bytes
fromsys.file$ f, sys.ts$ ts
where f.spare1 is null
andf.ts# = ts.ts#
union all
selectts.name,
0,
decode(hc.ktfbhccval,0,ts.blocksize * hc.ktfbhcsz,null),
decode(hc.ktfbhccval,0,ts.blocksize * hc.ktfbhcsz,null)
fromsys.ts$ ts, sys.x$ktfbhchc
wherehc.ktfbhctsn = ts.ts#
union all
selectts.name,
f.length * ts.blocksize,
0,
f.length * ts.blocksize
fromsys.ts$ ts, sys.fet$ f
wherets.ts# = f.ts#
andts.bitmapped = 0
union all
selectts.name,
f.ktfbfeblks * ts.blocksize,
0,
f.ktfbfeblks * ts.blocksize
fromsys.ts$ ts, sys.x$ktfbfe f
wherets.ts# = f.ktfbfetsn
andts.bitmapped <> 0 and ts.online$ in (1,4) and ts.contents$ = 0;
grant select on treemap_data_view to public;
|