-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathsql_detail.sql
More file actions
22 lines (21 loc) · 786 Bytes
/
sql_detail.sql
File metadata and controls
22 lines (21 loc) · 786 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
set lines 300
spool sql_detail.txt append
col c format 99
set colsep ','
select /* sql_id_exec */
to_char(sysdate,'MM/DD/YY HH24:MI:SS') tm,
executions exec,
buffer_gets lios,
round(cpu_time/1000000,2) cpusecs,
round(elapsed_time/1000000,2) elapsecs,
round((elapsed_time-cpu_time)/1000000,2) cpu_wait_secs,
round((cpu_time/1000000)/executions,2) cpu_exec,
round((elapsed_time/1000000)/executions,2) elap_exec,
round(((elapsed_time-cpu_time)/1000000)/executions,2) cpu_wait_exec,
round(buffer_gets/executions,2) lios_exec,
round(buffer_gets/(elapsed_time/1000000),2) lios_elap,
round((round((elapsed_time/1000000)/executions,2) * 1000000) / round(buffer_gets/(elapsed_time/1000000),2),2) us_lio,
child_number c
from v$sql
where sql_id in ('9fx889bgz15h3','68vu5q46nu22s');
spool off