2 Replies Latest reply on May 11, 2019 11:50 AM by meravke

    User Defined Report - How to create Overtime stacked bar?

    meravke

      Is it possible to create a User Define Report that will be an overtime stacked bar?

      For example, I would like to be able to create an overtime stacked bar for this query - this query is showing for a specific SQL_ID, per hour  (overtime), the total resource consumption per Wait Class.

      I would like to be able to see a stacked bar per hour, and each stacked bar is a stack of all wait classes for the given hour.

       

      select trunc(sample_time,'HH24'),

              sum(decode(wait_class,NULL,1,0)) CPU ,

              sum(decode(wait_class,'User I/O',1,0)) USER_IO ,

              sum(decode(wait_class,'System I/O',1,0)) System_IO,

              sum(decode(wait_class,'Commit',1,0)) COMMIT,

              sum(decode(wait_class,'Network',1,0)) Network,

              sum(decode(wait_class,'Concurrency',1,0)) Concurrency,

              sum(decode(wait_class,'Application',1,0)) Application,

              sum(decode(wait_class,'Configuration',1,0)) Configuration,

              sum(decode(wait_class,'Administrative',1,0)) Administrative,

              sum(decode(wait_class,'Other',1,0)) Other,       

              sum(decode(wait_class,'Idle',1,0)) Idle

      from v$active_session_history a

      where sql_id=:SQL_ID

      group by trunc(sample_time,'HH24')

      order by trunc(sample_time,'HH24')