zOs/SQL/PDBGENVV

set current path oa1p;
select *
    from Rz2MM.TACCT_general g
    where plan_name = 'VV6200'
         and timestamp >  current timestamp - 121 day
         and class2_elapsed > 1000
    order by class2_elapsed   desc
 -- order by timestamp desc
    with ur
;;;
select *
    from RZ2MM.TACCT_general g
    where plan_name = 'VV6010'
         and timestamp >  current timestamp -  5 day
    order by timestamp desc
    with ur
;;;,
select date(trunc_timestamp(timestamp, 'WW')),
     int(sum(occurrences)) occ,
     int(sum(commit)) com,
     int(sum(rollback)) roll,
     count(*)     cnt,
     fosFmte7(sum(class1_elapsed)/sum(max(occurrences, commit)))c1Ela,
     fosFmte7(sum(class2_elapsed)/sum(max(occurrences, commit)))c2Ela,
     fosFmte7(sum(class1_cpu_Total)/sum(max(occurrences, commit)))c1Cpu,
     fosFmte7(sum(class2_cpu_total)/sum(max(occurrences, commit)))c2Cpu,
       min(class1_elapsed /   (max(occurrences, commit)))  c1ElaMi,
       max(class1_elapsed /   (max(occurrences, commit)))  c1ElaMa,
       fosFmte7(real(sum(select ))/sum(max(occurrences, commit)))select,
       fosFmte7(real(sum(open ))/sum(max(occurrences, commit)))open ,
       fosFmte7(real(sum(fetch ))/sum(max(occurrences, commit)))fetch ,
       fosFmte7(real(sum(insert ))/sum(max(occurrences, commit)))insert,
       fosFmte7(real(sum(update ))/sum(max(occurrences, commit)))update,
       fosFmte7(real(sum(delete ))/sum(max(occurrences, commit)))delete,
       min(timestamp), max(timestamp)
    from Rz2DD.TACCT_GENERAL g
    where plan_name = 'VV5720'
         and timestamp >  current timestamp - 1 year
    group by trunc_timestamp(timestamp, 'WW')
 -- group by floor(3*log10(
 --       max(1e-9, class1_elapsed/max(occurrences, commit))))
    order by min(timestamp) desc
;x;
select class1_elapsed/max(1, commit) "c1Ela/co", g.*
    from RZ2xx.TACCT_GENERAL g
    where plan_name = 'VV5720'
       and
            class1_elapsed/max(1, commit) > 60
    order by 1 desc
;;;
    smallInt(1000* class2_cpu_total     /class2_elapsed) cpu,
    smallInt(1000* class3_global_cont  /class2_elapsed) "gloCon",
    smallInt(1000* class3_DB_IO        /class2_elapsed) "db io",
    smallInt(1000* class3_LOG_WRT_IO   /class2_elapsed) "logIO",
    smallInt(1000* (class2_cpu_total
                 + class3_global_cont
                 + class3_DB_IO
                 + class3_LOG_WRT_IO ) /class2_elapsed) "sum",
select *
select class2_elapsed,
    smallInt(1000* class2_cpu_total     /class2_elapsed) cpu,
    smallInt(1000* class3_global_cont  /class2_elapsed) "gloCon",
    smallInt(1000* class3_DB_IO        /class2_elapsed) "db io",
    smallInt(1000* class3_LOG_WRT_IO   /class2_elapsed) "logIO",
    smallInt(1000* (class2_cpu_total
                 + class3_global_cont
                 + class3_DB_IO
                 + class3_LOG_WRT_IO ) /class2_elapsed) "sum",
        g.*
    from RZ2XX.TACCT_GENERAL g
    where timestamp > trunc_timestamp(current timestamp - 1 DAY, 'DD')
   --     and connect_id like 'MFT5614P%'
          and connect_id like 'TNT780%'
          and plan_name in ('TN7080')
   --     and insert >= 1
    ORDER BY timestamp      desc
  --ORDER BY CLASS1_ELAPSED desc
    with ur
;
X
select insert, class2_elapsed / insert , class2_su_cpu / insert,
        g.*
    from RZ2XX.TACCT_GENERAL g
    where timestamp > current timestamp - 9 DAY
          and plan_name = 'RB5000'
          and insert >= 1
    ORDER BY Timestamp asc
;
X
select class2_elapsed / insert , class2_su_cpu / insert,
        g.*
    from RZ2XX.TACCT_GENERAL g
--  where timestamp > current timestamp - 1 month
    where timestamp IN ('2010-02-02-01.05.50.881483'
                       ,'2010-01-30-06.38.00.929757')
          and plan_name = 'BE5020'
          and  insert > 500000 -- class2_elapsed >= 1000
    order by 1 desc, class2_elapsed desc
;
select -- class2_elapsed / insert , class2_su_cpu / insert,
        g.*
    from RZ2XX.TACCT_GENERAL g
    where timestamp > current timestamp - 5 DAY
          and plan_name = 'RB5000'
    ORDER BY Timestamp asc
;
X
select min(timestamp), max(timestamp)
    from RZ2XX.TACCT_GENERAL g
    with ur
;