1 col SQL_FULLTEXT for a50
2 col 平均执行时间 for a10
3 col 总执行时间 for a10
4 col SQL_ID for a15
5 COL OSUSER FOR A10
6 col USERNAME for a10
7 select
8 to_char(sa.last_active_time,'hh24:mi:ss') time,
9 se.osuser,
10 se.username,
11 se.sql_id,
12 sa.sql_fulltext,
13 sa.executions "执行次数",
14 round(sa.ELAPSED_TIME / 1000000, 2) || 's' "总执行时间",
15 round(sa.ELAPSED_TIME / 1000000 / sa.executions, 2) || 's' "平均执行时间"
16 from (select s.osuser, s.username, s.sql_id
17 from v$session s
18 where s.username in ('SCOTT') -- 用户名
19 and s.sql_id is not null
20 group by s.osuser, s.username, s.sql_id) se
文档被以下合辑收录
评论