Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Database growth query

741780Jul 7 2011 — edited Jul 7 2011
Hi All,

DB 8ii
OS HPUX

I have a requirement, where I need to check, percentage of increse in database over last one year. Although, I have a following quety, which does the same, but not able to figure out on how can I re-write to address my issue, if I need one more coulum, which will show % of increment. Also, is there any possibility of changing the order of result set. like 2010 jul must appear before 2010 aug. thank you very much.
select to_char(creation_time, 'RRRR Month') "Month",
       sum(bytes)/1024/1024 "Growth in Meg"
  from sys.v_$datafile
 where creation_time > SYSDATE-365
 group by to_char(creation_time, 'RRRR Month') 

MONTH                            GROWTH IN MEG
-------------------------------- -------------
2010 AUGUST                               6000
2010 JULY                                 2448
2010 NOVEMBER                             8000
2010 OCTOBER                              6000
2011 APRIL                              223000
2011 JANUARY                             13100
2011 JUNE                               128000
2011 MARCH                              148500
2011 MAY                                112000
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 4 2011
Added on Jul 7 2011
12 comments
674 views