-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathavg_active_session.xml
112 lines (74 loc) · 3.3 KB
/
avg_active_session.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
<?xml version="1.0" encoding="UTF-8" ?>
<displays>
<display id="01f2d591-0157-1000-8002-ac190501e72c" type="" style="Table" enable="true">
<name><![CDATA[Average Active Session]]></name>
<description><![CDATA[]]></description>
<tooltip><![CDATA[]]></tooltip>
<drillclass><![CDATA[]]></drillclass>
<CustomValues>
<TYPE><![CDATA[horizontal]]></TYPE>
</CustomValues>
<query>
<sql><![CDATA[with aas as (
select snap_id, value, dbid, instance_number, rownum my_rownum
from (
select snap_id
, round(db_time / elapsed_time,1) value
, dbid
, instance_number
from (
select distinct h.snap_id
, h.instance_number
, h.dbid
, count(*) over (partition by h.snap_id, h.instance_number) * 10 db_time
, (extract( day from (s.end_interval_time - s.begin_interval_time) )*24*60*60)+
(extract( hour from (s.end_interval_time - s.begin_interval_time) )*60*60)+
(extract( minute from (s.end_interval_time - s.begin_interval_time) )*60)+
(extract( second from (s.end_interval_time - s.begin_interval_time)))
elapsed_time
from dba_hist_active_sess_history h
join dba_hist_snapshot s on s.snap_id = h.snap_id
and s.instance_number = h.instance_number
where (
wait_class is null -- on CPU
or wait_class != 'Idle' -- ignore idle events
)
)
order by 2 desc
)
),
top10aas as (
select
sn.begin_interval_time begin_time
, aas.instance_number
, aas.snap_id
, aas.value
, aas.dbid
from aas
join dba_hist_snapshot sn on sn.snap_id = aas.snap_id
and sn.instance_number = aas.instance_number
where my_rownum <= 10
order by value desc
)
select * from top10aas]]></sql>
</query>
<pdf version="VERSION_1_7" compression="CONTENT">
<docproperty title="" author="" subject="" keywords="" />
<cell toppadding="2" bottompadding="2" leftpadding="2" rightpadding="2" horizontalalign="LEFT" verticalalign="TOP" wrap="true" />
<column>
<heading font="Times New Roman" size="10" style="NORMAL" color="-16777216" rowshading="-1" labeling="FIRST_PAGE" />
<footing font="Times New Roman" size="10" style="NORMAL" color="-16777216" rowshading="-1" labeling="NONE" />
<blob blob="NONE" zip="false" />
</column>
<table font="Times New Roman" size="10" style="NORMAL" color="-16777216" userowshading="false" oddrowshading="-1" evenrowshading="-1" showborders="true" spacingbefore="12" spacingafter="12" horizontalalign="LEFT" />
<header enable="false" generatedate="false">
<data>
null </data>
</header>
<footer enable="false" generatedate="false">
<data value="null" />
</footer>
<pagesetup papersize="LETTER" orientation="1" measurement="in" margintop="1.0" marginbottom="1.0" marginleft="1.0" marginright="1.0" />
</pdf>
</display>
</displays>