Pages

Tuesday, March 15, 2011

DB Segments Used (Type wise)

Create Or Replace Force View Sys.Av_db_used_space_seg_type ("Total Used",
                                                            "Data part",
                                                            "Index part",
                                                            "LOB part",
                                                            "RBS part",
                                                            "TEMP part"
                                                           )
As
   Select Sum (Bytes) / 1024 / 1024 "Total Used",
          Sum (Decode (Substr (Segment_type, 1, 5),
                       'TABLE', Bytes / 1024 / 1024,
                       0
                      )
              ) "Data part",
          Sum (Decode (Substr (Segment_type, 1, 5),
                       'INDEX', Bytes / 1024 / 1024,
                       0
                      )
              ) "Index part",
          Sum (Decode (Substr (Segment_type, 1, 3),
                       'LOB', Bytes / 1024 / 1024,
                       0
                      )
              ) "LOB part",
          Sum (Decode (Segment_type, 'ROLLBACK', Bytes / 1024 / 1024, 0)
              ) "RBS part",
          Sum (Decode (Segment_type, 'TEMPORARY', Bytes / 1024 / 1024, 0)
              ) "TEMP part"
     From Sys.Dba_segments;

No comments:

Post a Comment