-
Notifications
You must be signed in to change notification settings - Fork 0
/
oracle_sessions.sql
37 lines (31 loc) · 1.13 KB
/
oracle_sessions.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
33
34
35
36
37
-- =============================================================================
-- Oracle Session Handling
-- =============================================================================
-- -----------------------------------------------------------------------------
-- total cursors open, by session
select s.sid,
s.serial#,
s.username,
s.osuser,
s.machine,
s.terminal,
s.program,
a.value as cursors
from v$session s
inner join v$sesstat a on a.sid = s.sid
inner join v$statname b on b.statistic# = a.statistic#
where b.name = 'opened cursors current'
order by cursors desc
-- -----------------------------------------------------------------------------
-- Oracle Parameters
select *
from v$parameter
order by name
-- -----------------------------------------------------------------------------
-- Oracle Session History
select u.name,
s.*
from sys.wrh$_active_session_history s
inner join sys.user$ u on u.user# = s.user_id
where sample_time > trunc(sysdate)-1
order by sample_time