/
ses.sql
32 lines (30 loc) · 1001 Bytes
/
ses.sql
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
-- Copyright 2018 Tanel Poder. All rights reserved. More info at http://tanelpoder.com
-- Licensed under the Apache License, Version 2.0. See LICENSE.txt for terms & conditions.
--------------------------------------------------------------------------------
--
-- File name: ses.sql (SEssion Statistics)
-- Purpose: Display Session statistics for given sessions, filter by
-- statistic name
--
-- Author: Tanel Poder
-- Copyright: (c) http://www.tanelpoder.com
--
-- Usage: @ses <sid> <statname>
-- @ses 10 %
-- @ses 10 parse
-- @ses 10,11,12 redo
-- @ses "select sid from v$session where username = 'APPS'" parse
--
--------------------------------------------------------------------------------
select
ses.sid,
sn.name,
ses.value
from
v$sesstat ses,
v$statname sn
where
sn.statistic# = ses.statistic#
and ses.sid in (&1)
and lower(sn.name) like lower('%&2%')
/