Please see my other blog for Oracle EBusiness Suite Posts - EBMentors

Search This Blog

Note: All the posts are based on practical approach avoiding lengthy theory. All have been tested on some development servers. Please don’t test any post on production servers until you are sure.

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: