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
40 lines (39 loc) · 903 Bytes

File metadata and controls

40 lines (39 loc) · 903 Bytes
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
@plusenv
column event format a25 trunc
column program format a10
column module format a20 trunc
column object_name format a30
column ms format 999
column sql_text format a60
column lock_type format a4
column pct format 99.9
WITH ash_query AS (
SELECT event
,program
,h.module
,h.action
,object_name
,SUM(time_waited)/1000 ms
,COUNT( * ) waits
,sql_text
,RANK() OVER (ORDER BY SUM(time_waited) DESC) AS time_rank
,ROUND(SUM(time_waited) * 100 / SUM(SUM(time_waited)) OVER (), 2) pct
FROM v$active_session_history h
,dba_objects o
,v$sql s
WHERE h.event LIKE '%latch%'
or h.event like '%mutex%'
and h.current_obj# = o.object_id
and h.sql_id = s.sql_id
GROUP BY event
,program
,h.module
,h.action
,object_name
,sql_text
)
SELECT event,module, object_name, ms,pct,
sql_text
FROM ash_query
WHERE time_rank <= 10
ORDER BY time_rank;
Morty Proxy This is a proxified and sanitized view of the page, visit original site.