- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsql_monitor.sql
More file actions
Latest commit
30 lines (28 loc) · 745 Bytes
/
Copy pathsql_monitor.sql
File metadata and controls
30 lines (28 loc) · 745 Bytes
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
----------------------------------------------------------------------------------------
--
-- File name: sql_monitor.sql
--
-- Purpose: shows statements execution errors based on sql_monitor view
--
-- Author: jpsaraiva
--
-- Version: 2017/10/27
--
-- Example: @sql_monitor.sql
--
-- Notes: Developed and tested on 11.2.0.4.
--
---------------------------------------------------------------------------------------
--
set pagesize 100 lines 120 pages 1000 heading on feed off null'' ver off
select
sql_exec_start,
last_refresh_time,
status,
error_message,
round(elapsed_time/1000000,0) elapsed_time,
username,
sql_id,
sql_text
from gv$sql_monitor where status like'%ERR%'
order by last_refresh_time desc;