Detecting objects that needs defragmentation due MAXEXTENT
To detect objects requiring defragmentation because of an overflow due to predefined MAXEXTENT, simply run the following command:
SELECT SUBSTR(owner||'.'||segment_name,1,50) OBJECT, EXTENTS, MAX_EXTENTS
FROM DBA_SEGMENTS
WHERE MAX_EXTENTS - EXTENTS < accepted_range
ORDER BY EXTENTS;
Note that the variable accepted_range represents the overflow we wish to detect (it may take a value of 4, 5 for example)