Database Administration (MOSC)

MOSC Banner

Need query to find out tables whose next extent is bigger than largest free extent in the tablespace

edited Jul 1, 2014 8:54AM in Database Administration (MOSC) 11 commentsAnswered ✓

Hello,

We have Oracle Apps 11i instance. This is a potential threat. We have table space monitoring scripts in-place. But sometimes they are useless if the tables are fragmented.

I have a script to find out these tables but in out instance it is taking 30 mins to execute. The instance is 3.1 TB in size.

Here is the SQL:

select a.owner owner,

       a.segment_name segment_name,

       b.tablespace_name tablespace_name,

       decode(ext.extents,

              1,

              b.next_extent,

              a.bytes * (1 + b.pct_increase / 100)) next_ext,

       freesp.largest largest

  from dba_extents a,

       dba_segments b,

       (select owner,

               segment_name,

               max(extent_id) extent_id,

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center