SQL Language (MOSC)

MOSC Banner

Analytic Function, Windowing

edited Dec 18, 2011 9:29PM in SQL Language (MOSC) 3 commentsAnswered ✓
I want to produce a report (without using Union All) showing ranked tablespace growth by quarter, and then a sliding window showing ranked tablespace growth across the last 4 quarters.

This is the closest I have come to producing a query:

Select s.tablespace_name, Min (o.created), Max (o.created),
To_Char(o.created,'YYYY-Q') Quarter, Sum (bytes),
Rank () Over (Partition By To_Char(o.created,'YYYY-Q') Order By Sum (s.bytes) Desc Rows 3 Preceding) Fastest_Growing
From dba_extents s, dba_objects o
Where s.owner = o.owner And s.segment_name = o.object_name
And o.created > '31-Jul-2011'

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