Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 29ac8e5

Browse files
committed
v170821
1 parent a0d8086 commit 29ac8e5

21 files changed

Lines changed: 2716 additions & 56 deletions

sql/aas_last24h.sql

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
SET TERM OFF
2+
COL db_name NEW_V db_name
3+
SELECT name db_name FROM v$database;
4+
SET PAGES 0 TIMING OFF FEED OFF
5+
SPO aas_&&db_name._last24h.html
6+
PRO <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
7+
PRO <html xmlns="http://www.w3.org/1999/xhtml">
8+
PRO <head>
9+
PRO <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
10+
PRO <title>AAS per Wait Class for Cluster</title>
11+
PRO
12+
PRO <style type="text/css">
13+
PRO body {font:10pt Arial,Helvetica,Geneva,sans-serif; color:black; background:white;}
14+
PRO h1 {font-size:16pt; font-weight:bold; color:#336699; border-bottom:1px solid #336699; margin-top:0pt; margin-bottom:0pt; padding:0px 0px 0px 0px;}
15+
PRO h2 {font-size:14pt; font-weight:bold; color:#336699; margin-top:4pt; margin-bottom:0pt;}
16+
PRO h3 {font-size:12pt; font-weight:bold; color:#336699; margin-top:4pt; margin-bottom:0pt;}
17+
PRO pre {font:8pt monospace,Monaco,"Courier New",Courier;}
18+
PRO a {color:#663300;}
19+
PRO table {font-size:8pt; border-collapse:collapse; empty-cells:show; white-space:nowrap; border:1px solid #336699;}
20+
PRO li {font-size:8pt; color:black; padding-left:4px; padding-right:4px; padding-bottom:2px;}
21+
PRO th {font-weight:bold; color:white; background:#0066CC; padding-left:4px; padding-right:4px; padding-bottom:2px;}
22+
PRO tr {color:black; background:white;}
23+
PRO tr:hover {color:white; background:#0066CC;}
24+
PRO tr.main {color:black; background:white;}
25+
PRO tr.main:hover {color:black; background:white;}
26+
PRO td {vertical-align:top; border:1px solid #336699;}
27+
PRO td.c {text-align:center;}
28+
PRO font.n {font-size:8pt; font-style:italic; color:#336699;}
29+
PRO font.f {font-size:8pt; color:#999999; border-top:1px solid #336699; margin-top:30pt;}
30+
PRO div.google-chart {width:809px; height:500px;}
31+
PRO </style>
32+
PRO <script type="text/javascript" src="https://www.google.com/jsapi"></script>
33+
PRO <script type="text/javascript">
34+
PRO google.load("visualization", "1", {packages:["corechart"]})
35+
PRO google.setOnLoadCallback(drawChart)
36+
PRO function drawChart() {
37+
PRO var data = google.visualization.arrayToDataTable([
38+
PRO ['Date', 'On CPU', 'User I/O', 'System I/O', 'Cluster', 'Commit', 'Concurrency', 'Application', 'Administrative', 'Configuration', 'Network', 'Queueing', 'Scheduler', 'Other']
39+
SELECT /*+ DYNAMIC_SAMPLING(4) FULL(h.ash) FULL(h.evt) FULL(h.sn) USE_HASH(h.sn h.ash h.evt) FULL(h.INT$DBA_HIST_ACT_SESS_HISTORY.sn) FULL(h.INT$DBA_HIST_ACT_SESS_HISTORY.ash) FULL(h.INT$DBA_HIST_ACT_SESS_HISTORY.evt) USE_HASH(h.INT$DBA_HIST_ACT_SESS_HISTORY.sn h.INT$DBA_HIST_ACT_SESS_HISTORY.ash h.INT$DBA_HIST_ACT_SESS_HISTORY.evt) */
40+
', [new Date('||SUBSTR(end_time,1,4)||','||(TO_NUMBER(SUBSTR(end_time,6,2)) - 1)||','||SUBSTR(end_time,9,2)||','||SUBSTR(end_time,12,2)||','||SUBSTR(end_time,15,2)||','||NVL(SUBSTR(end_time,18,2),0)||',0)'||
41+
', '||aas_on_cpu||' ,'||aas_user_io||' ,'||aas_system_io||' ,'||aas_cluster||' ,'||aas_commit||' ,'||aas_concurrency||' ,'||aas_application||' ,'||aas_administrative||' ,'||aas_configuration||' ,'||aas_network||' ,'||aas_queueing||' ,'||aas_scheduler||' ,'||aas_other||']'
42+
FROM (SELECT TO_CHAR(MAX(sample_time), 'YYYY-MM-DD HH24:MI:SS') end_time,
43+
ROUND(SUM(CASE session_state WHEN 'ON CPU' THEN 10 ELSE 0 END) / (GREATEST(CAST(MAX(sample_time) AS DATE) - CAST(LAG(MAX(sample_time)) OVER (ORDER BY snap_id) AS DATE), (1/24/3600)) * 24 * 3600), 3) aas_on_cpu,
44+
ROUND(SUM(CASE wait_class WHEN 'User I/O' THEN 10 ELSE 0 END) / (GREATEST(CAST(MAX(sample_time) AS DATE) - CAST(LAG(MAX(sample_time)) OVER (ORDER BY snap_id) AS DATE), (1/24/3600)) * 24 * 3600), 3) aas_user_io,
45+
ROUND(SUM(CASE wait_class WHEN 'System I/O' THEN 10 ELSE 0 END) / (GREATEST(CAST(MAX(sample_time) AS DATE) - CAST(LAG(MAX(sample_time)) OVER (ORDER BY snap_id) AS DATE), (1/24/3600)) * 24 * 3600), 3) aas_system_io,
46+
ROUND(SUM(CASE wait_class WHEN 'Cluster' THEN 10 ELSE 0 END) / (GREATEST(CAST(MAX(sample_time) AS DATE) - CAST(LAG(MAX(sample_time)) OVER (ORDER BY snap_id) AS DATE), (1/24/3600)) * 24 * 3600), 3) aas_cluster,
47+
ROUND(SUM(CASE wait_class WHEN 'Commit' THEN 10 ELSE 0 END) / (GREATEST(CAST(MAX(sample_time) AS DATE) - CAST(LAG(MAX(sample_time)) OVER (ORDER BY snap_id) AS DATE), (1/24/3600)) * 24 * 3600), 3) aas_commit,
48+
ROUND(SUM(CASE wait_class WHEN 'Concurrency' THEN 10 ELSE 0 END) / (GREATEST(CAST(MAX(sample_time) AS DATE) - CAST(LAG(MAX(sample_time)) OVER (ORDER BY snap_id) AS DATE), (1/24/3600)) * 24 * 3600), 3) aas_concurrency,
49+
ROUND(SUM(CASE wait_class WHEN 'Application' THEN 10 ELSE 0 END) / (GREATEST(CAST(MAX(sample_time) AS DATE) - CAST(LAG(MAX(sample_time)) OVER (ORDER BY snap_id) AS DATE), (1/24/3600)) * 24 * 3600), 3) aas_application,
50+
ROUND(SUM(CASE wait_class WHEN 'Administrative' THEN 10 ELSE 0 END) / (GREATEST(CAST(MAX(sample_time) AS DATE) - CAST(LAG(MAX(sample_time)) OVER (ORDER BY snap_id) AS DATE), (1/24/3600)) * 24 * 3600), 3) aas_administrative,
51+
ROUND(SUM(CASE wait_class WHEN 'Configuration' THEN 10 ELSE 0 END) / (GREATEST(CAST(MAX(sample_time) AS DATE) - CAST(LAG(MAX(sample_time)) OVER (ORDER BY snap_id) AS DATE), (1/24/3600)) * 24 * 3600), 3) aas_configuration,
52+
ROUND(SUM(CASE wait_class WHEN 'Network' THEN 10 ELSE 0 END) / (GREATEST(CAST(MAX(sample_time) AS DATE) - CAST(LAG(MAX(sample_time)) OVER (ORDER BY snap_id) AS DATE), (1/24/3600)) * 24 * 3600), 3) aas_network,
53+
ROUND(SUM(CASE wait_class WHEN 'Queueing' THEN 10 ELSE 0 END) / (GREATEST(CAST(MAX(sample_time) AS DATE) - CAST(LAG(MAX(sample_time)) OVER (ORDER BY snap_id) AS DATE), (1/24/3600)) * 24 * 3600), 3) aas_queueing,
54+
ROUND(SUM(CASE wait_class WHEN 'Scheduler' THEN 10 ELSE 0 END) / (GREATEST(CAST(MAX(sample_time) AS DATE) - CAST(LAG(MAX(sample_time)) OVER (ORDER BY snap_id) AS DATE), (1/24/3600)) * 24 * 3600), 3) aas_scheduler,
55+
ROUND(SUM(CASE wait_class WHEN 'Other' THEN 10 ELSE 0 END) / (GREATEST(CAST(MAX(sample_time) AS DATE) - CAST(LAG(MAX(sample_time)) OVER (ORDER BY snap_id) AS DATE), (1/24/3600)) * 24 * 3600), 3) aas_other
56+
FROM dba_hist_active_sess_history h
57+
WHERE snap_id >= (SELECT MIN(snap_id) FROM dba_hist_snapshot WHERE end_interval_time >= sysdate-1)
58+
AND dbid = (SELECT dbid FROM v$database)
59+
AND instance_number = instance_number
60+
GROUP BY
61+
snap_id
62+
ORDER BY
63+
snap_id)
64+
WHERE aas_on_cpu IS NOT NULL;
65+
PRO ]);
66+
PRO
67+
PRO var options = {isStacked: true,
68+
PRO chartArea:{left:90, top:75, width:'65%', height:'70%'},
69+
PRO backgroundColor: {fill: 'white', stroke: '#336699', strokeWidth: 1},
70+
PRO explorer: {actions: ['dragToZoom', 'rightClickToReset'], maxZoomIn: 0.01},
71+
PRO title: '5a.618. AAS per Wait Class for Cluster',
72+
PRO titleTextStyle: {fontSize: 18, bold: false},
73+
PRO focusTarget: 'category',
74+
PRO legend: {position: 'right', textStyle: {fontSize: 14}},
75+
PRO tooltip: {textStyle: {fontSize: 14}},
76+
PRO hAxis: {title: '12.1.0.2.0 cores:44(avg) threads:88(avg) hosts:2', gridlines: {count: -1}, titleTextStyle: {fontSize: 16, bold: false}},
77+
PRO series: { 0: { color :'#34CF27'}, 1: { color :'#0252D7'}, 2: { color :'#1E96DD'}, 3: { color :'#CEC3B5'}, 4: { color :'#EA6A05'}, 5: { color :'#871C12'}, 6: { color :'#C42A05'}, 7: {color :'#75763E'},
78+
PRO 8: { color :'#594611'}, 9: { color :'#989779'}, 10: { color :'#C6BAA5'}, 11: { color :'#9FFA9D'}, 12: { color :'#F571A0'}, 13: { color :'#000000'}, 14: { color :'#ff0000'}
79+
PRO },
80+
PRO vAxis: {title: 'Average Active Sessions - AAS (stacked)', gridlines: {count: -1}, titleTextStyle: {fontSize: 16, bold: false}}
81+
PRO }
82+
PRO
83+
PRO var chart = new google.visualization.AreaChart(document.getElementById('linechart'))
84+
PRO chart.draw(data, options)
85+
PRO }
86+
PRO </script>
87+
PRO </head>
88+
PRO <body>
89+
PRO <h1> AAS per Wait Class for Cluster <em>(DBA_HIST_ACTIVE_SESS_HISTORY)</em> </h1>
90+
PRO <br />
91+
PRO <br />
92+
PRO <div id="linechart" class="google-chart"></div>
93+
PRO <br />
94+
PRO <font class="n">Notes:<br />1) drag to zoom, and right click to reset<br />2) up to 1 days of awr history were considered</font>
95+
PRO <font class="n"><br />3) </font>
96+
PRO <pre>
97+
98+
PRO </pre>
99+
PRO <br />
100+
PRO <font class="f">edb360 (c) 2017. Version v1715 (2017-07-28). Timestamp: 2017-08-02T00:50:58 </font>
101+
PRO </body>
102+
PRO </html>
103+
SPO OFF
104+
SET TERM ON PAGES 80

sql/aas_last24h_mem_f.sql

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
SET TERM OFF
2+
COL db_name NEW_V db_name
3+
SELECT name db_name FROM v$database;
4+
SET PAGES 0 TIMING OFF FEED OFF
5+
SPO aas_&&db_name._last24h_mem_f.html
6+
PRO <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
7+
PRO <html xmlns="http://www.w3.org/1999/xhtml">
8+
PRO <head>
9+
PRO <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
10+
PRO <title>AAS per Wait Class for Cluster</title>
11+
PRO
12+
PRO <style type="text/css">
13+
PRO body {font:10pt Arial,Helvetica,Geneva,sans-serif; color:black; background:white;}
14+
PRO h1 {font-size:16pt; font-weight:bold; color:#336699; border-bottom:1px solid #336699; margin-top:0pt; margin-bottom:0pt; padding:0px 0px 0px 0px;}
15+
PRO h2 {font-size:14pt; font-weight:bold; color:#336699; margin-top:4pt; margin-bottom:0pt;}
16+
PRO h3 {font-size:12pt; font-weight:bold; color:#336699; margin-top:4pt; margin-bottom:0pt;}
17+
PRO pre {font:8pt monospace,Monaco,"Courier New",Courier;}
18+
PRO a {color:#663300;}
19+
PRO table {font-size:8pt; border-collapse:collapse; empty-cells:show; white-space:nowrap; border:1px solid #336699;}
20+
PRO li {font-size:8pt; color:black; padding-left:4px; padding-right:4px; padding-bottom:2px;}
21+
PRO th {font-weight:bold; color:white; background:#0066CC; padding-left:4px; padding-right:4px; padding-bottom:2px;}
22+
PRO tr {color:black; background:white;}
23+
PRO tr:hover {color:white; background:#0066CC;}
24+
PRO tr.main {color:black; background:white;}
25+
PRO tr.main:hover {color:black; background:white;}
26+
PRO td {vertical-align:top; border:1px solid #336699;}
27+
PRO td.c {text-align:center;}
28+
PRO font.n {font-size:8pt; font-style:italic; color:#336699;}
29+
PRO font.f {font-size:8pt; color:#999999; border-top:1px solid #336699; margin-top:30pt;}
30+
PRO div.google-chart {width:809px; height:500px;}
31+
PRO </style>
32+
PRO <script type="text/javascript" src="https://www.google.com/jsapi"></script>
33+
PRO <script type="text/javascript">
34+
PRO google.load("visualization", "1", {packages:["corechart"]})
35+
PRO google.setOnLoadCallback(drawChart)
36+
PRO function drawChart() {
37+
PRO var data = google.visualization.arrayToDataTable([
38+
PRO ['Date', 'On CPU', 'User I/O', 'System I/O', 'Cluster', 'Commit', 'Concurrency', 'Application', 'Administrative', 'Configuration', 'Network', 'Queueing', 'Scheduler', 'Other']
39+
SELECT /*+ DYNAMIC_SAMPLING(4) FULL(h.ash) FULL(h.evt) FULL(h.sn) USE_HASH(h.sn h.ash h.evt) FULL(h.INT$DBA_HIST_ACT_SESS_HISTORY.sn) FULL(h.INT$DBA_HIST_ACT_SESS_HISTORY.ash) FULL(h.INT$DBA_HIST_ACT_SESS_HISTORY.evt) USE_HASH(h.INT$DBA_HIST_ACT_SESS_HISTORY.sn h.INT$DBA_HIST_ACT_SESS_HISTORY.ash h.INT$DBA_HIST_ACT_SESS_HISTORY.evt) */
40+
', [new Date('||SUBSTR(end_time,1,4)||','||(TO_NUMBER(SUBSTR(end_time,6,2)) - 1)||','||SUBSTR(end_time,9,2)||','||SUBSTR(end_time,12,2)||','||SUBSTR(end_time,15,2)||','||NVL(SUBSTR(end_time,18,2),0)||',0)'||
41+
', '||aas_on_cpu||' ,'||aas_user_io||' ,'||aas_system_io||' ,'||aas_cluster||' ,'||aas_commit||' ,'||aas_concurrency||' ,'||aas_application||' ,'||aas_administrative||' ,'||aas_configuration||' ,'||aas_network||' ,'||aas_queueing||' ,'||aas_scheduler||' ,'||aas_other||']'
42+
FROM (SELECT TO_CHAR(MAX(sample_time), 'YYYY-MM-DD HH24:MI:SS') end_time,
43+
ROUND(SUM(CASE session_state WHEN 'ON CPU' THEN 1 ELSE 0 END) / 60, 3) aas_on_cpu,
44+
ROUND(SUM(CASE wait_class WHEN 'User I/O' THEN 1 ELSE 0 END) / 60, 3) aas_user_io,
45+
ROUND(SUM(CASE wait_class WHEN 'System I/O' THEN 1 ELSE 0 END) / 60, 3) aas_system_io,
46+
ROUND(SUM(CASE wait_class WHEN 'Cluster' THEN 1 ELSE 0 END) / 60, 3) aas_cluster,
47+
ROUND(SUM(CASE wait_class WHEN 'Commit' THEN 1 ELSE 0 END) / 60, 3) aas_commit,
48+
ROUND(SUM(CASE wait_class WHEN 'Concurrency' THEN 1 ELSE 0 END) / 60, 3) aas_concurrency,
49+
ROUND(SUM(CASE wait_class WHEN 'Application' THEN 1 ELSE 0 END) / 60, 3) aas_application,
50+
ROUND(SUM(CASE wait_class WHEN 'Administrative' THEN 1 ELSE 0 END) / 60, 3) aas_administrative,
51+
ROUND(SUM(CASE wait_class WHEN 'Configuration' THEN 1 ELSE 0 END) / 60, 3) aas_configuration,
52+
ROUND(SUM(CASE wait_class WHEN 'Network' THEN 1 ELSE 0 END) / 60, 3) aas_network,
53+
ROUND(SUM(CASE wait_class WHEN 'Queueing' THEN 1 ELSE 0 END) / 60, 3) aas_queueing,
54+
ROUND(SUM(CASE wait_class WHEN 'Scheduler' THEN 1 ELSE 0 END) / 60, 3) aas_scheduler,
55+
ROUND(SUM(CASE wait_class WHEN 'Other' THEN 1 ELSE 0 END) / 60, 3) aas_other
56+
FROM gv$active_session_history h
57+
WHERE sample_time >= SYSDATE-1
58+
AND session_type = 'FOREGROUND'
59+
GROUP BY
60+
trunc(sample_time,'mi')
61+
ORDER BY
62+
1)
63+
WHERE aas_on_cpu IS NOT NULL;
64+
PRO ]);
65+
PRO
66+
PRO var options = {isStacked: true,
67+
PRO chartArea:{left:90, top:75, width:'65%', height:'70%'},
68+
PRO backgroundColor: {fill: 'white', stroke: '#336699', strokeWidth: 1},
69+
PRO explorer: {actions: ['dragToZoom', 'rightClickToReset'], maxZoomIn: 0.01},
70+
PRO title: '5a.618. AAS per Wait Class for Cluster',
71+
PRO titleTextStyle: {fontSize: 18, bold: false},
72+
PRO focusTarget: 'category',
73+
PRO legend: {position: 'right', textStyle: {fontSize: 14}},
74+
PRO tooltip: {textStyle: {fontSize: 14}},
75+
PRO hAxis: {title: '12.1.0.2.0 cores:44(avg) threads:88(avg) hosts:2', gridlines: {count: -1}, titleTextStyle: {fontSize: 16, bold: false}},
76+
PRO series: { 0: { color :'#34CF27'}, 1: { color :'#0252D7'}, 2: { color :'#1E96DD'}, 3: { color :'#CEC3B5'}, 4: { color :'#EA6A05'}, 5: { color :'#871C12'}, 6: { color :'#C42A05'}, 7: {color :'#75763E'},
77+
PRO 8: { color :'#594611'}, 9: { color :'#989779'}, 10: { color :'#C6BAA5'}, 11: { color :'#9FFA9D'}, 12: { color :'#F571A0'}, 13: { color :'#000000'}, 14: { color :'#ff0000'}
78+
PRO },
79+
PRO vAxis: {title: 'Average Active Sessions - AAS (stacked)', gridlines: {count: -1}, titleTextStyle: {fontSize: 16, bold: false}}
80+
PRO }
81+
PRO
82+
PRO var chart = new google.visualization.AreaChart(document.getElementById('linechart'))
83+
PRO chart.draw(data, options)
84+
PRO }
85+
PRO </script>
86+
PRO </head>
87+
PRO <body>
88+
PRO <h1> AAS per Wait Class for Cluster <em>(DBA_HIST_ACTIVE_SESS_HISTORY)</em> </h1>
89+
PRO <br />
90+
PRO <br />
91+
PRO <div id="linechart" class="google-chart"></div>
92+
PRO <br />
93+
PRO <font class="n">Notes:<br />1) drag to zoom, and right click to reset<br />2) up to 1 days of awr history were considered</font>
94+
PRO <font class="n"><br />3) </font>
95+
PRO <pre>
96+
97+
PRO </pre>
98+
PRO <br />
99+
PRO <font class="f">edb360 (c) 2017. Version v1715 (2017-07-28). Timestamp: 2017-08-02T00:50:58 </font>
100+
PRO </body>
101+
PRO </html>
102+
SPO OFF
103+
SET TERM ON PAGES 80

0 commit comments

Comments
 (0)