Average Usage Over The Past 12 Months

Get the average growth over the past 12 months. Ensure you change the TARGET_GUID. SELECT (max(round(avg(a_size.size_gb),2)) – min(round(avg(a_size.size_gb),2)))/12 FROM (SELECT m.rollup_timestamp AS month_timestamp, sum(m.average/1024) AS size_gb FROM mgmt$metric_daily m, mgmt$target_type t WHERE t.target_guid=HEXTORAW(‘A06F734DEB35E1CFE38C9AB4729508E2′) AND (t.target_type=’rac_database’ OR (t.target_type=’oracle_database’ AND t.TYPE_QUALIFIER3 != ‘RACINST’)) AND m.target_guid=t.target_guid AND m.metric_guid=t.metric_guid AND t.metric_name=’tbspAllocation’ AND (t.metric_column=’spaceAllocated’) AND m.rollup_timestamp >= sysdate-365 AND m.rollup_timestamp … Read more

Tablespace Growth

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 FROM dba_hist_tbspc_space_usage tsu, dba_hist_tablespace_stat … Read more