Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Latest commit

 

History

History
History
47 lines (40 loc) · 1.51 KB

File metadata and controls

47 lines (40 loc) · 1.51 KB
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
-- ashmasters - https://github.com/khailey/ashmasters
-- Kyle Hailey
Def v_secs=3600 -- bucket size
Def v_bars=5 -- size of one AAS in characters
Def v_graph=80
col graph format a80
select
to_char(to_date(
trunc((id*&v_secs)/ (24*60*60)) || ' ' || -- Julian days
mod((id*&v_secs), 24*60*60) -- seconds in the day
, 'J SSSSS' ), 'MON DD YYYY HH24:MI:SS') start_time,
substr(
substr(
rpad('+',round((cpu*&v_bars)/&v_secs),'+') ||
rpad('-',round((waits*&v_bars)/&v_secs),'-') ||
rpad(' ',p.value * &v_bars,' ')
,0,(p.value * &v_bars)) ||
p.value ||
substr(
rpad('+',round((cpu*&v_bars)/&v_secs),'+') ||
rpad('-',round((waits*&v_bars)/&v_secs),'-') ||
rpad(' ',p.value * &v_bars,' '),
(p.value * &v_bars))
,0,&v_graph)
graph
from (
select
trunc((to_char(sample_time,'J')*(24*60*60)+to_char(sample_time,'SSSSS'))/&v_secs) id
, sum(decode(session_state,'ON CPU',1,0)) cpu
, sum(decode(session_state,'WAITING',1,0)) waits
from
-- v$active_session_history ash
dba_hist_active_sess_history
group by
trunc((to_char(sample_time,'J')*(24*60*60)+to_char(sample_time,'SSSSS'))/&v_secs)
) aveact,
v$parameter p
where p.name='cpu_count'
order by id
/
Morty Proxy This is a proxified and sanitized view of the page, visit original site.