Database Administration (MOSC)

MOSC Banner

use of dba_hist views

edited Dec 13, 2011 9:28AM in Database Administration (MOSC) 2 comments
I have the following query and hope to get the database growth through dba_hist views. But I am getting some errors. Not sure how to modify that.

select b.tsname tablespace_name, max(b.used_size_mb) cur_used_size_mb, round(AVG(inc_used_size_mb),2)avg_increas_mb
from (
select a.days, a.tsname, used_size_mb, used_size_mb - LAG(used_size_mb,1) OVER ( PARTITION BY a.tsname ORDER BY a.tsname, a.days) inc_used_size_mb
from (
select TO_CHAR(sp.begin_interval_time, 'MM_DD_YYYY') days, ts.tsname,
max(round((tsu.tablespace_usedsize*dt.block_size)/(1024*1024),2)) used_size_mb

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